#include "omc_simulation_settings.h"
#include "HpcOmTaskGraph.h"
#define _OMC_LIT0_data " "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,1,_OMC_LIT0_data);
#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
#define _OMC_LIT1_data "\nSCC "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,5,_OMC_LIT1_data);
#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
#define _OMC_LIT2_data ": {"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,3,_OMC_LIT2_data);
#define _OMC_LIT2 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)
#define _OMC_LIT3_data "}"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT3,1,_OMC_LIT3_data);
#define _OMC_LIT3 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT3)
#define _OMC_LIT4_data "SccToSimEqMapping"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT4,17,_OMC_LIT4_data);
#define _OMC_LIT4 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT4)
#define _OMC_LIT5_data "\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,1,_OMC_LIT5_data);
#define _OMC_LIT5 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)
#define _OMC_LIT6_data "\nSimEq "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,7,_OMC_LIT6_data);
#define _OMC_LIT6 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT6)
#define _OMC_LIT7_data "SimEqToSCCMapping"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT7,17,_OMC_LIT7_data);
#define _OMC_LIT7 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT7)
#define _OMC_LIT8_data "HpcOmTaskGraph.getIndexBySimCodeEq failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT8,41,_OMC_LIT8_data);
#define _OMC_LIT8 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data "/home/per/workspace/OpenModelica/OMCompiler/Compiler/BackEnd/HpcOmTaskGraph.mo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,78,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT10_6,1.770631566e9);
#define _OMC_LIT10_6 MMC_REFREALLIT(_OMC_LIT_STRUCT10_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT10,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT9,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6873)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6873)),MMC_IMMEDIATE(MMC_TAGFIXNUM(74)),_OMC_LIT10_6}};
#define _OMC_LIT10 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT10)
#define _OMC_LIT11_data "getSimCodeEqByIndex failed. Looking for Index "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT11,46,_OMC_LIT11_data);
#define _OMC_LIT11 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT11)
#define _OMC_LIT12_data "getSimCodeEqByIndexAndMapping1 failed. Looking for Index "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT12,57,_OMC_LIT12_data);
#define _OMC_LIT12 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT12)
#define _OMC_LIT13_data "removeDummyStateFromMapping1 failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT13,36,_OMC_LIT13_data);
#define _OMC_LIT13 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT13)
#define _OMC_LIT14_data "Multirate Partition Data\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT14,25,_OMC_LIT14_data);
#define _OMC_LIT14 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT14)
#define _OMC_LIT15_data " partitions:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT15,13,_OMC_LIT15_data);
#define _OMC_LIT15 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT15)
#define _OMC_LIT16_data "activator "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT16,10,_OMC_LIT16_data);
#define _OMC_LIT16 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT16)
#define _OMC_LIT17_data " is state "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT17,10,_OMC_LIT17_data);
#define _OMC_LIT17 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT17)
#define _OMC_LIT18_data "activators: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT18,12,_OMC_LIT18_data);
#define _OMC_LIT18 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT18)
#define _OMC_LIT19_data "				derStateTasks: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT19,19,_OMC_LIT19_data);
#define _OMC_LIT19 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT19)
#define _OMC_LIT20_data "				nodes: 	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT20,12,_OMC_LIT20_data);
#define _OMC_LIT20 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT20)
#define _OMC_LIT21_data "stateAssign "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT21,12,_OMC_LIT21_data);
#define _OMC_LIT21 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT21)
#define _OMC_LIT22_data "tasksPerLevel "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT22,14,_OMC_LIT22_data);
#define _OMC_LIT22 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT22)
#define _OMC_LIT23_data "stateTasks "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT23,11,_OMC_LIT23_data);
#define _OMC_LIT23 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT23)
#define _OMC_LIT24_data "PARTITIONS :\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT24,13,_OMC_LIT24_data);
#define _OMC_LIT24 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT24)
#define _OMC_LIT25_data "HpcOmTaskGraph.getNodeForVarIdx failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT25,39,_OMC_LIT25_data);
#define _OMC_LIT25 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT25)
#define _OMC_LIT26_data "HpcOmTaskGraph.getNodeForVarIdx failed (there is a loop somewhere)"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT26,66,_OMC_LIT26_data);
#define _OMC_LIT26 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT26)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT27_6,1.770631566e9);
#define _OMC_LIT27_6 MMC_REFREALLIT(_OMC_LIT_STRUCT27_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT27,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT9,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6290)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7)),MMC_IMMEDIATE(MMC_TAGFIXNUM(6290)),MMC_IMMEDIATE(MMC_TAGFIXNUM(102)),_OMC_LIT27_6}};
#define _OMC_LIT27 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT27)
#define _OMC_LIT28_data "Check if there is a assert or something that is dependent of arrayEquations"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT28,75,_OMC_LIT28_data);
#define _OMC_LIT28 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT28)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT29,3,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT29 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT29)
#define _OMC_LIT30_data "("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT30,1,_OMC_LIT30_data);
#define _OMC_LIT30 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT30)
#define _OMC_LIT31_data ","
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT31,1,_OMC_LIT31_data);
#define _OMC_LIT31 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT31)
#define _OMC_LIT32_data ")"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT32,1,_OMC_LIT32_data);
#define _OMC_LIT32 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT32)
#define _OMC_LIT33_data ":"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT33,1,_OMC_LIT33_data);
#define _OMC_LIT33 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT33)
#define _OMC_LIT34_data " | "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT34,3,_OMC_LIT34_data);
#define _OMC_LIT34 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT34)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT35,8,0) {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)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT35 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT35)
#define _OMC_LIT36_data "assert"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT36,6,_OMC_LIT36_data);
#define _OMC_LIT36 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT36)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT37,4,3) {&HpcOmTaskGraph_ComponentInfo_COMPONENTINFO__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT37 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT37)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT38,74.0);
#define _OMC_LIT38 MMC_REFREALLIT(_OMC_LIT_STRUCT38)
#define _OMC_LIT39_data ": "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT39,2,_OMC_LIT39_data);
#define _OMC_LIT39 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT39)
#define _OMC_LIT40_data ") "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT40,2,_OMC_LIT40_data);
#define _OMC_LIT40 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT40)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT41,0.0);
#define _OMC_LIT41 MMC_REFREALLIT(_OMC_LIT_STRUCT41)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT42,2,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT41}};
#define _OMC_LIT42 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT42)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT43,-1.0);
#define _OMC_LIT43 MMC_REFREALLIT(_OMC_LIT_STRUCT43)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT44,8,3) {&HpcOmTaskGraph_Communication_COMMUNICATION__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),_OMC_LIT43}};
#define _OMC_LIT44 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT44)
#define _OMC_LIT45_data "getCommunicationByChildIdx failed! - the child idx "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT45,51,_OMC_LIT45_data);
#define _OMC_LIT45 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT45)
#define _OMC_LIT46_data " can not be found in the list of edges\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT46,39,_OMC_LIT46_data);
#define _OMC_LIT46 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT46)
#define _OMC_LIT47_data " , "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT47,3,_OMC_LIT47_data);
#define _OMC_LIT47 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT47)
#define _OMC_LIT48_data "getParallelSetForComp failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT48,30,_OMC_LIT48_data);
#define _OMC_LIT48 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT48)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT49,2,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT49 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT49)
#define _OMC_LIT50_data "getCostsForNode failed! \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT50,25,_OMC_LIT50_data);
#define _OMC_LIT50 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT50)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT51,8,3) {&HpcOmTaskGraph_Communication_COMMUNICATION__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),_OMC_LIT41}};
#define _OMC_LIT51 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data "HpcOmTaskGraph.getCriticalPath_1 failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,40,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT53,2,0) {_OMC_LIT43,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT53 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT53)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT54,2,1) {MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT54 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT54)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT55,2,0) {_OMC_LIT54,_OMC_LIT41}};
#define _OMC_LIT55 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT55)
#define _OMC_LIT56_data "getCriticalPaths failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT56,25,_OMC_LIT56_data);
#define _OMC_LIT56 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT56)
#define _OMC_LIT57_data "_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,1,_OMC_LIT57_data);
#define _OMC_LIT57 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT57)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT58,2,0) {MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT58 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT58)
#define _OMC_LIT59_data "Component duplicate detected: current: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT59,39,_OMC_LIT59_data);
#define _OMC_LIT59 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT59)
#define _OMC_LIT60_data " (eqSystem "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT60,11,_OMC_LIT60_data);
#define _OMC_LIT60 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT60)
#define _OMC_LIT61_data ") last "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT61,7,_OMC_LIT61_data);
#define _OMC_LIT61 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT61)
#define _OMC_LIT62_data ").\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT62,3,_OMC_LIT62_data);
#define _OMC_LIT62 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT62)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT63,2,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT63 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT63)
#define _OMC_LIT64_data "the graph and the system have a difference number of components.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT64,65,_OMC_LIT64_data);
#define _OMC_LIT64 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT64)
#define _OMC_LIT65_data "comp "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT65,5,_OMC_LIT65_data);
#define _OMC_LIT65 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT65)
#define _OMC_LIT66_data " is not equal to "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT66,17,_OMC_LIT66_data);
#define _OMC_LIT66 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT66)
#define _OMC_LIT67_data "comp"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT67,4,_OMC_LIT67_data);
#define _OMC_LIT67 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT67)
#define _OMC_LIT68_data "Different components in graph and system\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT68,41,_OMC_LIT68_data);
#define _OMC_LIT68 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT68)
#define _OMC_LIT69_data "convertSimEqToSccCosts1 failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT69,32,_OMC_LIT69_data);
#define _OMC_LIT69 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT69)
#define _OMC_LIT70_data "There are execution costs with value 0.0!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT70,42,_OMC_LIT70_data);
#define _OMC_LIT70 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT70)
#define _OMC_LIT71_data "calculate costs failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT71,24,_OMC_LIT71_data);
#define _OMC_LIT71 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT71)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT72,2,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),_OMC_LIT43}};
#define _OMC_LIT72 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT72)
#define _OMC_LIT73_data "Warning: The costs have been estimated. Maybe "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT73,46,_OMC_LIT73_data);
#define _OMC_LIT73 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT73)
#define _OMC_LIT74_data "-file is missing.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT74,18,_OMC_LIT74_data);
#define _OMC_LIT74 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT74)
#define _OMC_LIT75_data "findOneChildParents failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT75,27,_OMC_LIT75_data);
#define _OMC_LIT75 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT75)
#define _OMC_LIT76_data "contracted comps "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT76,17,_OMC_LIT76_data);
#define _OMC_LIT76 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT76)
#define _OMC_LIT77_data "updateCompNamesForMerging failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT77,34,_OMC_LIT77_data);
#define _OMC_LIT77 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT77)
#define _OMC_LIT78_data "distributeToClusters failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT78,29,_OMC_LIT78_data);
#define _OMC_LIT78 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT78)
#define _OMC_LIT79_data "numProcs"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT79,8,_OMC_LIT79_data);
#define _OMC_LIT79 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT79)
#define _OMC_LIT80_data "n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT80,1,_OMC_LIT80_data);
#define _OMC_LIT80 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT80)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT81,1,1) {_OMC_LIT80}};
#define _OMC_LIT81 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT81)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT82,1,4) {&Flags_FlagVisibility_EXTERNAL__desc,}};
#define _OMC_LIT82 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT82)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT83,2,5) {&Flags_FlagData_INT__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT83 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT83)
#define _OMC_LIT84_data "Sets the number of processors to use (0=default=auto)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT84,54,_OMC_LIT84_data);
#define _OMC_LIT84 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT84)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT85,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT84}};
#define _OMC_LIT85 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT85)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT86,8,3) {&Flags_ConfigFlag_CONFIG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(24)),_OMC_LIT79,_OMC_LIT81,_OMC_LIT82,_OMC_LIT83,MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT85}};
#define _OMC_LIT86 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT86)
#define _OMC_LIT87_data ". path: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT87,8,_OMC_LIT87_data);
#define _OMC_LIT87 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT87)
#define _OMC_LIT88_data "--------------------------------\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT88,33,_OMC_LIT88_data);
#define _OMC_LIT88 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT88)
#define _OMC_LIT89_data " CRITICAL PATH INFO\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT89,20,_OMC_LIT89_data);
#define _OMC_LIT89 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT89)
#define _OMC_LIT90_data "found "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT90,6,_OMC_LIT90_data);
#define _OMC_LIT90 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT90)
#define _OMC_LIT91_data " critical paths with costs of "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT91,30,_OMC_LIT91_data);
#define _OMC_LIT91 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT91)
#define _OMC_LIT92_data " sec\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT92,5,_OMC_LIT92_data);
#define _OMC_LIT92 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT92)
#define _OMC_LIT93_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT93,0,_OMC_LIT93_data);
#define _OMC_LIT93 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT93)
#define _OMC_LIT94_data "critical path with costs of "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT94,28,_OMC_LIT94_data);
#define _OMC_LIT94 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT94)
#define _OMC_LIT95_data " cycles -- "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT95,11,_OMC_LIT95_data);
#define _OMC_LIT95 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT95)
#define _OMC_LIT96_data " ;; "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT96,4,_OMC_LIT96_data);
#define _OMC_LIT96 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT96)
#define _OMC_LIT97_data "critical path' with costs of "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT97,29,_OMC_LIT97_data);
#define _OMC_LIT97 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT97)
#define _OMC_LIT98_data "---"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT98,3,_OMC_LIT98_data);
#define _OMC_LIT98 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT98)
#define _OMC_LIT99_data "component "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT99,10,_OMC_LIT99_data);
#define _OMC_LIT99 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT99)
#define _OMC_LIT100_data " has component information:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT100,28,_OMC_LIT100_data);
#define _OMC_LIT100 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT100)
#define _OMC_LIT101_data "   Is part of ODE-System:   "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT101,28,_OMC_LIT101_data);
#define _OMC_LIT101 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT101)
#define _OMC_LIT102_data "true"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT102,4,_OMC_LIT102_data);
#define _OMC_LIT102 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data "false"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,5,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
#define _OMC_LIT104_data "   Is part of Event-System: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT104,28,_OMC_LIT104_data);
#define _OMC_LIT104 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT104)
#define _OMC_LIT105_data "   Is removed component:    "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT105,28,_OMC_LIT105_data);
#define _OMC_LIT105 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT105)
#define _OMC_LIT106_data " has the nodeMark : "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT106,20,_OMC_LIT106_data);
#define _OMC_LIT106 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT106)
#define _OMC_LIT107_data "(target node: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT107,14,_OMC_LIT107_data);
#define _OMC_LIT107 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT107)
#define _OMC_LIT108_data " ints: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT108,7,_OMC_LIT108_data);
#define _OMC_LIT108 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT108)
#define _OMC_LIT109_data " floats: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT109,9,_OMC_LIT109_data);
#define _OMC_LIT109 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT109)
#define _OMC_LIT110_data " booleans: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT110,11,_OMC_LIT110_data);
#define _OMC_LIT110 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT110)
#define _OMC_LIT111_data " [requiredTime: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT111,16,_OMC_LIT111_data);
#define _OMC_LIT111 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT111)
#define _OMC_LIT112_data " for "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT112,5,_OMC_LIT112_data);
#define _OMC_LIT112 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT112)
#define _OMC_LIT113_data " variables)"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT113,11,_OMC_LIT113_data);
#define _OMC_LIT113 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT113)
#define _OMC_LIT114_data "edges from node "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT114,16,_OMC_LIT114_data);
#define _OMC_LIT114 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT114)
#define _OMC_LIT115_data ": with the communication costs "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT115,31,_OMC_LIT115_data);
#define _OMC_LIT115 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT115)
#define _OMC_LIT116_data ", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT116,2,_OMC_LIT116_data);
#define _OMC_LIT116 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT116)
#define _OMC_LIT117_data " has execution cost of: ("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT117,25,_OMC_LIT117_data);
#define _OMC_LIT117 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT117)
#define _OMC_LIT118_data ")\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT118,2,_OMC_LIT118_data);
#define _OMC_LIT118 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT118)
#define _OMC_LIT119_data " is described with: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT119,20,_OMC_LIT119_data);
#define _OMC_LIT119 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT119)
#define _OMC_LIT120_data " is named "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT120,10,_OMC_LIT120_data);
#define _OMC_LIT120 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT120)
#define _OMC_LIT121_data " needs the parameters: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT121,23,_OMC_LIT121_data);
#define _OMC_LIT121 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT121)
#define _OMC_LIT122_data "equation "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT122,9,_OMC_LIT122_data);
#define _OMC_LIT122 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT122)
#define _OMC_LIT123_data " (offset: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT123,10,_OMC_LIT123_data);
#define _OMC_LIT123 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT123)
#define _OMC_LIT124_data ") of equation system "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT124,21,_OMC_LIT124_data);
#define _OMC_LIT124 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT124)
#define _OMC_LIT125_data " is computed in component: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT125,27,_OMC_LIT125_data);
#define _OMC_LIT125 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT125)
#define _OMC_LIT126_data "variable "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT126,9,_OMC_LIT126_data);
#define _OMC_LIT126 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT126)
#define _OMC_LIT127_data " is solved in component: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT127,25,_OMC_LIT127_data);
#define _OMC_LIT127 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT127)
#define _OMC_LIT128_data "node "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT128,5,_OMC_LIT128_data);
#define _OMC_LIT128 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT128)
#define _OMC_LIT129_data " solves components: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT129,20,_OMC_LIT129_data);
#define _OMC_LIT129 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT129)
#define _OMC_LIT130_data "TASKGRAPH METADATA\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT130,19,_OMC_LIT130_data);
#define _OMC_LIT130 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT130)
#define _OMC_LIT131_data " nodes include components:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT131,27,_OMC_LIT131_data);
#define _OMC_LIT131 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT131)
#define _OMC_LIT132_data " vars are solved in the nodes \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT132,31,_OMC_LIT132_data);
#define _OMC_LIT132 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT132)
#define _OMC_LIT133_data " equations are computed in the nodes \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT133,38,_OMC_LIT133_data);
#define _OMC_LIT133 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT133)
#define _OMC_LIT134_data " parameters are part of the components \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT134,40,_OMC_LIT134_data);
#define _OMC_LIT134 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT134)
#define _OMC_LIT135_data "the names of the components \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT135,29,_OMC_LIT135_data);
#define _OMC_LIT135 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT135)
#define _OMC_LIT136_data "the description of the node\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT136,28,_OMC_LIT136_data);
#define _OMC_LIT136 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT136)
#define _OMC_LIT137_data "the execution costs of the nodes\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT137,33,_OMC_LIT137_data);
#define _OMC_LIT137 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT137)
#define _OMC_LIT138_data "the communication costs of the nodes\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT138,37,_OMC_LIT138_data);
#define _OMC_LIT138 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT138)
#define _OMC_LIT139_data "the nodeMark of the nodes\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT139,26,_OMC_LIT139_data);
#define _OMC_LIT139 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT139)
#define _OMC_LIT140_data "the component informations are\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT140,31,_OMC_LIT140_data);
#define _OMC_LIT140 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT140)
#define _OMC_LIT141_data "TASKGRAPH\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT141,10,_OMC_LIT141_data);
#define _OMC_LIT141 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT141)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT142,4,3) {&HpcOmTaskGraph_ComponentInfo_COMPONENTINFO__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT142 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT142)
#define _OMC_LIT143_data "000000"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT143,6,_OMC_LIT143_data);
#define _OMC_LIT143 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT143)
#define _OMC_LIT144_data "C0C0C0"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT144,6,_OMC_LIT144_data);
#define _OMC_LIT144 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT144)
#define _OMC_LIT145_data "%.0f"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT145,4,_OMC_LIT145_data);
#define _OMC_LIT145 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT145)
#define _OMC_LIT146_data "Edge"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT146,4,_OMC_LIT146_data);
#define _OMC_LIT146 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT146)
#define _OMC_LIT147_data "Node"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT147,4,_OMC_LIT147_data);
#define _OMC_LIT147 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT147)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT148,1,3) {&GraphML_LineType_LINE__desc,}};
#define _OMC_LIT148 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT148)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT149,1,4) {&GraphML_ArrowType_ARROWNONE__desc,}};
#define _OMC_LIT149 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT149)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT150,1,3) {&GraphML_ArrowType_ARROWSTANDART__desc,}};
#define _OMC_LIT150 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT150)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT151,2,0) {_OMC_LIT149,_OMC_LIT150}};
#define _OMC_LIT151 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT151)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT152,1,5) {&ErrorTypes_MessageType_TRANSLATION__desc,}};
#define _OMC_LIT152 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,1,4) {&ErrorTypes_Severity_ERROR__desc,}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
#define _OMC_LIT154_data "Internal error %s"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT154,17,_OMC_LIT154_data);
#define _OMC_LIT154 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT154)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT155,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT154}};
#define _OMC_LIT155 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT155)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT156,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(63)),_OMC_LIT152,_OMC_LIT153,_OMC_LIT155}};
#define _OMC_LIT156 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT156)
#define _OMC_LIT157_data "function addNodeToGraphML failed."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT157,33,_OMC_LIT157_data);
#define _OMC_LIT157 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT157)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT158,2,1) {_OMC_LIT157,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT158 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT158)
#define _OMC_LIT159_data "{"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT159,1,_OMC_LIT159_data);
#define _OMC_LIT159 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT159)
#define _OMC_LIT160_data "Th "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT160,3,_OMC_LIT160_data);
#define _OMC_LIT160 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT160)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT161,1,3) {&GraphML_FontStyle_FONTPLAIN__desc,}};
#define _OMC_LIT161 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT161)
#define _OMC_LIT162_data "FFFF00"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT162,6,_OMC_LIT162_data);
#define _OMC_LIT162 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT162)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT163,1,1) {_OMC_LIT162}};
#define _OMC_LIT163 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT163)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT164,1,4) {&GraphML_FontStyle_FONTBOLD__desc,}};
#define _OMC_LIT164 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT164)
#define _OMC_LIT165_data "se"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT165,2,_OMC_LIT165_data);
#define _OMC_LIT165 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT165)
#define _OMC_LIT166_data "46BED8"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT166,6,_OMC_LIT166_data);
#define _OMC_LIT166 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT166)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT167,1,1) {_OMC_LIT166}};
#define _OMC_LIT167 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT167)
#define _OMC_LIT168_data "nw"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT168,2,_OMC_LIT168_data);
#define _OMC_LIT168 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT168)
#define _OMC_LIT169_data "CF8CB7"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT169,6,_OMC_LIT169_data);
#define _OMC_LIT169 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT169)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT170,1,1) {_OMC_LIT169}};
#define _OMC_LIT170 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT170)
#define _OMC_LIT171_data "sw"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT171,2,_OMC_LIT171_data);
#define _OMC_LIT171 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT171)
#define _OMC_LIT172_data "FFCC00"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT172,6,_OMC_LIT172_data);
#define _OMC_LIT172 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT172)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT173,1,3) {&GraphML_ShapeType_RECTANGLE__desc,}};
#define _OMC_LIT173 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT173)
#define _OMC_LIT174_data "Name"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT174,4,_OMC_LIT174_data);
#define _OMC_LIT174 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT174)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT175,1,3) {&GraphML_AttributeType_TYPE__STRING__desc,}};
#define _OMC_LIT175 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT175)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT176,1,3) {&GraphML_AttributeTarget_TARGET__NODE__desc,}};
#define _OMC_LIT176 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT176)
#define _OMC_LIT177_data "-1"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT177,2,_OMC_LIT177_data);
#define _OMC_LIT177 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT177)
#define _OMC_LIT178_data "Operations"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT178,10,_OMC_LIT178_data);
#define _OMC_LIT178 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT178)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT179,1,5) {&GraphML_AttributeType_TYPE__INTEGER__desc,}};
#define _OMC_LIT179 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT179)
#define _OMC_LIT180_data "CalcTime"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT180,8,_OMC_LIT180_data);
#define _OMC_LIT180 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT180)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT181,1,6) {&GraphML_AttributeType_TYPE__DOUBLE__desc,}};
#define _OMC_LIT181 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT181)
#define _OMC_LIT182_data "TaskID"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT182,6,_OMC_LIT182_data);
#define _OMC_LIT182 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT182)
#define _OMC_LIT183_data "Components"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT183,10,_OMC_LIT183_data);
#define _OMC_LIT183 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT183)
#define _OMC_LIT184_data "17"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT184,2,_OMC_LIT184_data);
#define _OMC_LIT184 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT184)
#define _OMC_LIT185_data "yCoord"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT185,6,_OMC_LIT185_data);
#define _OMC_LIT185 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT185)
#define _OMC_LIT186_data "SimCodeEqs"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT186,10,_OMC_LIT186_data);
#define _OMC_LIT186 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT186)
#define _OMC_LIT187_data "ThreadId"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT187,8,_OMC_LIT187_data);
#define _OMC_LIT187 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT187)
#define _OMC_LIT188_data "TaskNumber"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT188,10,_OMC_LIT188_data);
#define _OMC_LIT188 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT188)
#define _OMC_LIT189_data "CommCost"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT189,8,_OMC_LIT189_data);
#define _OMC_LIT189 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT189)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT190,1,4) {&GraphML_AttributeTarget_TARGET__EDGE__desc,}};
#define _OMC_LIT190 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT190)
#define _OMC_LIT191_data "CommVars"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT191,8,_OMC_LIT191_data);
#define _OMC_LIT191 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT191)
#define _OMC_LIT192_data "CommVarsInt"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT192,11,_OMC_LIT192_data);
#define _OMC_LIT192 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT192)
#define _OMC_LIT193_data "CommVarsFloat"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT193,13,_OMC_LIT193_data);
#define _OMC_LIT193 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT193)
#define _OMC_LIT194_data "CommVarsBool"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT194,12,_OMC_LIT194_data);
#define _OMC_LIT194 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT194)
#define _OMC_LIT195_data "annotation"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT195,10,_OMC_LIT195_data);
#define _OMC_LIT195 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT195)
#define _OMC_LIT196_data "Annotations"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT196,11,_OMC_LIT196_data);
#define _OMC_LIT196 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT196)
#define _OMC_LIT197_data "CriticalPath"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT197,12,_OMC_LIT197_data);
#define _OMC_LIT197 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT197)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT198,1,5) {&GraphML_AttributeTarget_TARGET__GRAPH__desc,}};
#define _OMC_LIT198 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT198)
#define _OMC_LIT199_data "isPartOfZeroFuncSystem"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT199,22,_OMC_LIT199_data);
#define _OMC_LIT199 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT199)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT200,1,4) {&GraphML_AttributeType_TYPE__BOOLEAN__desc,}};
#define _OMC_LIT200 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT200)
#define _OMC_LIT201_data "IsPartOfOdeSystem"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT201,17,_OMC_LIT201_data);
#define _OMC_LIT201 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT201)
#define _OMC_LIT202_data "IsRemovedComponent"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT202,18,_OMC_LIT202_data);
#define _OMC_LIT202 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT202)
#define _OMC_LIT203_data "TaskGraph"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT203,9,_OMC_LIT203_data);
#define _OMC_LIT203 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT203)
#define _OMC_LIT204_data "uncomment in HpcOmTaskGraph and +showAnnotations"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT204,48,_OMC_LIT204_data);
#define _OMC_LIT204 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT204)
#define _OMC_LIT205_data "TaskGraph_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT205,10,_OMC_LIT205_data);
#define _OMC_LIT205 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT205)
#define _OMC_LIT206_data ".graphml"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT206,8,_OMC_LIT206_data);
#define _OMC_LIT206 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT206)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT207,3,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),_OMC_LIT43}};
#define _OMC_LIT207 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT207)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT208,2,1) {MMC_IMMEDIATE(MMC_TAGFIXNUM(-1)),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT208 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT208)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209,5,3) {&HpcOmTaskGraph_GraphDumpOptions_GRAPHDUMPOPTIONS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT209 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT210,2,0) {MMC_REFSTRUCTLIT(mmc_nil),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT210 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT210)
#define _OMC_LIT211_data "time"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT211,4,_OMC_LIT211_data);
#define _OMC_LIT211 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT211)
#define _OMC_LIT212_data "getComponentsOfZeroCrossing: simEqs: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT212,37,_OMC_LIT212_data);
#define _OMC_LIT212 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT212)
#define _OMC_LIT213_data "getComponentsOfZeroCrossing: components: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT213,41,_OMC_LIT213_data);
#define _OMC_LIT213 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT213)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT214,2,0) {MMC_REFSTRUCTLIT(mmc_nil),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT214 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT214)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT215,2,1) {MMC_IMMEDIATE(MMC_TAGFIXNUM(222)),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT216,2,1) {MMC_IMMEDIATE(MMC_TAGFIXNUM(111)),_OMC_LIT215}};
#define _OMC_LIT216 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT216)
#define _OMC_LIT217_data "removeContinuousEntries1 failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT217,33,_OMC_LIT217_data);
#define _OMC_LIT217 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT217)
#define _OMC_LIT218_data "getAllSuccessors failed!\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT218,25,_OMC_LIT218_data);
#define _OMC_LIT218 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT218)
#define _OMC_LIT219_data "getCompInComps failed! CompIn idx: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT219,35,_OMC_LIT219_data);
#define _OMC_LIT219 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT219)
#define _OMC_LIT220_data " | Component array-size: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT220,25,_OMC_LIT220_data);
#define _OMC_LIT220 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT220)
#define _OMC_LIT221_data "cutTaskGraph failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT221,20,_OMC_LIT221_data);
#define _OMC_LIT221 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT221)
#define _OMC_LIT222_data "getAllStateNodes failed! StateVars-Count: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT222,42,_OMC_LIT222_data);
#define _OMC_LIT222 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT222)
#define _OMC_LIT223_data "check number of vars in relation to number of eqs in otherEqnVarTpl in the torn system\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT223,87,_OMC_LIT223_data);
#define _OMC_LIT223 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT223)
#define _OMC_LIT224_data "getVarEqCompMapping0 - Unsupported component-type:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT224,51,_OMC_LIT224_data);
#define _OMC_LIT224 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT224)
#define _OMC_LIT225_data ";"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT225,1,_OMC_LIT225_data);
#define _OMC_LIT225 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT225)
#define _OMC_LIT226_data "Error in getVarsBySCC! Unsupported component-type \n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT226,51,_OMC_LIT226_data);
#define _OMC_LIT226 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT226)
#define _OMC_LIT227_data "getUnsolvedVarsBySCC2: Warning, unknown varType for variable "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT227,61,_OMC_LIT227_data);
#define _OMC_LIT227 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT227)
#define _OMC_LIT228_data " !\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT228,3,_OMC_LIT228_data);
#define _OMC_LIT228 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT228)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT229,4,0) {MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT229 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT229)
#define _OMC_LIT230_data "getUnsolvedVarsBySCC failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT230,28,_OMC_LIT230_data);
#define _OMC_LIT230 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT230)
#define _OMC_LIT231_data " der("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT231,5,_OMC_LIT231_data);
#define _OMC_LIT231 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT231)
#define _OMC_LIT232_data " FOR "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT232,5,_OMC_LIT232_data);
#define _OMC_LIT232 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT232)
#define _OMC_LIT233_data "Equation System"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT233,15,_OMC_LIT233_data);
#define _OMC_LIT233 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT233)
#define _OMC_LIT234_data "ARRAY:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT234,6,_OMC_LIT234_data);
#define _OMC_LIT234 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT234)
#define _OMC_LIT235_data " FOR THE VARS: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT235,15,_OMC_LIT235_data);
#define _OMC_LIT235 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT235)
#define _OMC_LIT236_data " AND "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT236,5,_OMC_LIT236_data);
#define _OMC_LIT236 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT236)
#define _OMC_LIT237_data "ALGO: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT237,6,_OMC_LIT237_data);
#define _OMC_LIT237 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT237)
#define _OMC_LIT238_data "COMPLEX: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT238,9,_OMC_LIT238_data);
#define _OMC_LIT238 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT238)
#define _OMC_LIT239_data "WHEN:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT239,5,_OMC_LIT239_data);
#define _OMC_LIT239 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT239)
#define _OMC_LIT240_data "IFEQ:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT240,5,_OMC_LIT240_data);
#define _OMC_LIT240 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT240)
#define _OMC_LIT241_data "Torn linear System"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT241,18,_OMC_LIT241_data);
#define _OMC_LIT241 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT241)
#define _OMC_LIT242_data "Torn nonlinear System"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT242,21,_OMC_LIT242_data);
#define _OMC_LIT242 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT242)
#define _OMC_LIT243_data "no singleEquation"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT243,17,_OMC_LIT243_data);
#define _OMC_LIT243 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT243)
#define _OMC_LIT244_data " subsys"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT244,7,_OMC_LIT244_data);
#define _OMC_LIT244 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT244)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT245,3,0) {MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0))}};
#define _OMC_LIT245 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT245)
#define _OMC_LIT246_data "getSystemComponents0 failed\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT246,28,_OMC_LIT246_data);
#define _OMC_LIT246 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT246)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT247,3,0) {MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT247 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT247)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT248,1,4) {&BackendDAE_IndexType_NORMAL__desc,}};
#define _OMC_LIT248 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT248)
#include "util/modelica.h"

#include "HpcOmTaskGraph_includes.h"


/* default, do not make protected functions static */
#if !defined(PROTECTED_FUNCTION_STATIC)
#define PROTECTED_FUNCTION_STATIC
#endif
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_dumpSccSimEqMapping2(threadData_t *threadData, modelica_integer _iIndex, modelica_string _iText);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_dumpSccSimEqMapping2(threadData_t *threadData, modelica_metatype _iIndex, modelica_metatype _iText);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSccSimEqMapping2,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpSccSimEqMapping2,0}};
#define boxvar_HpcOmTaskGraph_dumpSccSimEqMapping2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSccSimEqMapping2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_dumpSccSimEqMapping1(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _iIndexText);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSccSimEqMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpSccSimEqMapping1,0}};
#define boxvar_HpcOmTaskGraph_dumpSccSimEqMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSccSimEqMapping1)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpSccSimEqMapping(threadData_t *threadData, modelica_metatype _iSccMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSccSimEqMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpSccSimEqMapping,0}};
#define boxvar_HpcOmTaskGraph_dumpSccSimEqMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSccSimEqMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_dumpSimEqSCCMapping1(threadData_t *threadData, modelica_integer _iMapping, modelica_metatype _iIndexText);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_dumpSimEqSCCMapping1(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _iIndexText);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSimEqSCCMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpSimEqSCCMapping1,0}};
#define boxvar_HpcOmTaskGraph_dumpSimEqSCCMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSimEqSCCMapping1)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpSimEqSCCMapping(threadData_t *threadData, modelica_metatype _iSccMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSimEqSCCMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpSimEqSCCMapping,0}};
#define boxvar_HpcOmTaskGraph_dumpSimEqSCCMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpSimEqSCCMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqsByTaskList0(threadData_t *threadData, modelica_metatype _iTask, modelica_metatype _iSimEqIdxSimEqMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqsByTaskList0,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimCodeEqsByTaskList0,0}};
#define boxvar_HpcOmTaskGraph_getSimCodeEqsByTaskList0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqsByTaskList0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqsByTaskList(threadData_t *threadData, modelica_metatype _iTaskList, modelica_metatype _iSimEqIdxSimEqMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqsByTaskList,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimCodeEqsByTaskList,0}};
#define boxvar_HpcOmTaskGraph_getSimCodeEqsByTaskList MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqsByTaskList)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getIndexBySimCodeEq(threadData_t *threadData, modelica_metatype _iEq, modelica_integer *out_oIdx2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getIndexBySimCodeEq(threadData_t *threadData, modelica_metatype _iEq, modelica_metatype *out_oIdx2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getIndexBySimCodeEq,2,0) {(void*) boxptr_HpcOmTaskGraph_getIndexBySimCodeEq,0}};
#define boxvar_HpcOmTaskGraph_getIndexBySimCodeEq MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getIndexBySimCodeEq)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1(threadData_t *threadData, modelica_metatype _iSimEqSystem, modelica_integer _iIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1(threadData_t *threadData, modelica_metatype _iSimEqSystem, modelica_metatype _iIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1,0}};
#define boxvar_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping(threadData_t *threadData, modelica_metatype _iSimEqIdxSimEqMapping, modelica_integer _iIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping(threadData_t *threadData, modelica_metatype _iSimEqIdxSimEqMapping, modelica_metatype _iIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping,0}};
#define boxvar_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimEqIdxSimEqMapping1(threadData_t *threadData, modelica_metatype _iEquation, modelica_metatype _iMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqIdxSimEqMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimEqIdxSimEqMapping1,0}};
#define boxvar_HpcOmTaskGraph_getSimEqIdxSimEqMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqIdxSimEqMapping1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimEqIdxSimEqMapping(threadData_t *threadData, modelica_metatype _iAllEquations, modelica_integer _iSimEqSystemHighestIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimEqIdxSimEqMapping(threadData_t *threadData, modelica_metatype _iAllEquations, modelica_metatype _iSimEqSystemHighestIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqIdxSimEqMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimEqIdxSimEqMapping,0}};
#define boxvar_HpcOmTaskGraph_getSimEqIdxSimEqMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqIdxSimEqMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSimeqCompMapping1(threadData_t *threadData, modelica_metatype _iSimEqTuple, modelica_metatype _iMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSimeqCompMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_convertToSimeqCompMapping1,0}};
#define boxvar_HpcOmTaskGraph_convertToSimeqCompMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSimeqCompMapping1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSimeqCompMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_integer _numOfSimEqs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertToSimeqCompMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _numOfSimEqs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSimeqCompMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_convertToSimeqCompMapping,0}};
#define boxvar_HpcOmTaskGraph_convertToSimeqCompMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSimeqCompMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSccSimEqMapping1(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _iSccMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSccSimEqMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_convertToSccSimEqMapping1,0}};
#define boxvar_HpcOmTaskGraph_convertToSccSimEqMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSccSimEqMapping1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSccSimEqMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_integer _numOfSccs);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertToSccSimEqMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _numOfSccs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSccSimEqMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_convertToSccSimEqMapping,0}};
#define boxvar_HpcOmTaskGraph_convertToSccSimEqMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertToSccSimEqMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_removeDummyStateFromMapping1(threadData_t *threadData, modelica_metatype _iTuple, modelica_metatype _iNewList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeDummyStateFromMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_removeDummyStateFromMapping1,0}};
#define boxvar_HpcOmTaskGraph_removeDummyStateFromMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeDummyStateFromMapping1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_removeDummyStateFromMapping(threadData_t *threadData, modelica_metatype _iEquationSccMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeDummyStateFromMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_removeDummyStateFromMapping,0}};
#define boxvar_HpcOmTaskGraph_removeDummyStateFromMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeDummyStateFromMapping)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData_t *threadData, modelica_metatype _iEquationSccMapping, modelica_integer _iHighestIndex);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData_t *threadData, modelica_metatype _iEquationSccMapping, modelica_metatype _iHighestIndex);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_findHighestSccIdxInMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_findHighestSccIdxInMapping,0}};
#define boxvar_HpcOmTaskGraph_findHighestSccIdxInMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_findHighestSccIdxInMapping)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpPartitionData(threadData_t *threadData, modelica_metatype _partData);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpPartitionData,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpPartitionData,0}};
#define boxvar_HpcOmTaskGraph_dumpPartitionData MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpPartitionData)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpStateAssign(threadData_t *threadData, modelica_metatype _stateAssign);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpStateAssign,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpStateAssign,0}};
#define boxvar_HpcOmTaskGraph_dumpStateAssign MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpStateAssign)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_appendToElementUnique(threadData_t *threadData, modelica_integer _inIndex, modelica_metatype _inElements, modelica_metatype _inArray);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_appendToElementUnique(threadData_t *threadData, modelica_metatype _inIndex, modelica_metatype _inElements, modelica_metatype _inArray);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_appendToElementUnique,2,0) {(void*) boxptr_HpcOmTaskGraph_appendToElementUnique,0}};
#define boxvar_HpcOmTaskGraph_appendToElementUnique MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_appendToElementUnique)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__assignTasksToStates(threadData_t *threadData, modelica_metatype _tasksPerLevel, modelica_metatype _stateTasks, modelica_metatype _odeGraphT);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__assignTasksToStates,2,0) {(void*) boxptr_HpcOmTaskGraph_multirate__assignTasksToStates,0}};
#define boxvar_HpcOmTaskGraph_multirate__assignTasksToStates MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__assignTasksToStates)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_hasSameStateAssign(threadData_t *threadData, modelica_integer _task, modelica_metatype _stateTaskAssign, modelica_metatype _refStateAssign);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_hasSameStateAssign(threadData_t *threadData, modelica_metatype _task, modelica_metatype _stateTaskAssign, modelica_metatype _refStateAssign);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_hasSameStateAssign,2,0) {(void*) boxptr_HpcOmTaskGraph_hasSameStateAssign,0}};
#define boxvar_HpcOmTaskGraph_hasSameStateAssign MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_hasSameStateAssign)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_taskIsNotVisited(threadData_t *threadData, modelica_integer _task, modelica_metatype _visitedTasks);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_taskIsNotVisited(threadData_t *threadData, modelica_metatype _task, modelica_metatype _visitedTasks);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_taskIsNotVisited,2,0) {(void*) boxptr_HpcOmTaskGraph_taskIsNotVisited,0}};
#define boxvar_HpcOmTaskGraph_taskIsNotVisited MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_taskIsNotVisited)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__getPartitionPredecessors(threadData_t *threadData, modelica_metatype _leavesIn, modelica_metatype _odeGraphT, modelica_metatype _stateTaskAssign, modelica_metatype _refStateAssign, modelica_metatype _visitedTasks, modelica_metatype *out_otherLeaveNodes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__getPartitionPredecessors,2,0) {(void*) boxptr_HpcOmTaskGraph_multirate__getPartitionPredecessors,0}};
#define boxvar_HpcOmTaskGraph_multirate__getPartitionPredecessors MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__getPartitionPredecessors)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_multirate__dispatchLeaveNodes(threadData_t *threadData, modelica_metatype _tasksIn, modelica_metatype _stateTaskAssign, modelica_metatype _leaveNodesWithNassigns);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__dispatchLeaveNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_multirate__dispatchLeaveNodes,0}};
#define boxvar_HpcOmTaskGraph_multirate__dispatchLeaveNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__dispatchLeaveNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__getPartitions(threadData_t *threadData, modelica_metatype _stateTaskAssign, modelica_metatype _stateTasks, modelica_metatype _odeGraphT);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__getPartitions,2,0) {(void*) boxptr_HpcOmTaskGraph_multirate__getPartitions,0}};
#define boxvar_HpcOmTaskGraph_multirate__getPartitions MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__getPartitions)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimEqsIdxLstForSCCIdxLst(threadData_t *threadData, modelica_metatype _sccIdxs, modelica_metatype _sccSimEqMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqsIdxLstForSCCIdxLst,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimEqsIdxLstForSCCIdxLst,0}};
#define boxvar_HpcOmTaskGraph_getSimEqsIdxLstForSCCIdxLst MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqsIdxLstForSCCIdxLst)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getSimEqIdxForSCCIdx(threadData_t *threadData, modelica_integer _sccIdx, modelica_metatype _sccSimEqMapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimEqIdxForSCCIdx(threadData_t *threadData, modelica_metatype _sccIdx, modelica_metatype _sccSimEqMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqIdxForSCCIdx,2,0) {(void*) boxptr_HpcOmTaskGraph_getSimEqIdxForSCCIdx,0}};
#define boxvar_HpcOmTaskGraph_getSimEqIdxForSCCIdx MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSimEqIdxForSCCIdx)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_varMappingTupleCompEqual(threadData_t *threadData, modelica_metatype _tpl, modelica_integer _compIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_varMappingTupleCompEqual(threadData_t *threadData, modelica_metatype _tpl, modelica_metatype _compIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_varMappingTupleCompEqual,2,0) {(void*) boxptr_HpcOmTaskGraph_varMappingTupleCompEqual,0}};
#define boxvar_HpcOmTaskGraph_varMappingTupleCompEqual MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_varMappingTupleCompEqual)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__orderStateTasksInSimVarStateOrder(threadData_t *threadData, modelica_metatype _stateTasks, modelica_metatype _taskGraphData, modelica_metatype _dae, modelica_metatype _simCode);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__orderStateTasksInSimVarStateOrder,2,0) {(void*) boxptr_HpcOmTaskGraph_multirate__orderStateTasksInSimVarStateOrder,0}};
#define boxvar_HpcOmTaskGraph_multirate__orderStateTasksInSimVarStateOrder MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_multirate__orderStateTasksInSimVarStateOrder)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNodeForVarIdx(threadData_t *threadData, modelica_integer _varIdx, modelica_integer _eqSysIdx, modelica_metatype _varCompMapping, modelica_integer _inTryThisIndex);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNodeForVarIdx(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _eqSysIdx, modelica_metatype _varCompMapping, modelica_metatype _inTryThisIndex);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForVarIdx,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodeForVarIdx,0}};
#define boxvar_HpcOmTaskGraph_getNodeForVarIdx MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForVarIdx)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNodeForCref1(threadData_t *threadData, modelica_metatype _eqSystems, modelica_metatype _cref, modelica_integer _eqSysIdxIn, modelica_integer *out_varIdx, modelica_boolean *out_found);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNodeForCref1(threadData_t *threadData, modelica_metatype _eqSystems, modelica_metatype _cref, modelica_metatype _eqSysIdxIn, modelica_metatype *out_varIdx, modelica_metatype *out_found);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForCref1,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodeForCref1,0}};
#define boxvar_HpcOmTaskGraph_getNodeForCref1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForCref1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeForCref(threadData_t *threadData, modelica_metatype _iCref, modelica_metatype _iDae, modelica_metatype _iVarCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForCref,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodeForCref,0}};
#define boxvar_HpcOmTaskGraph_getNodeForCref MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForCref)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_nodeIsDependent(threadData_t *threadData, modelica_metatype _node);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_nodeIsDependent(threadData_t *threadData, modelica_metatype _node);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_nodeIsDependent,2,0) {(void*) boxptr_HpcOmTaskGraph_nodeIsDependent,0}};
#define boxvar_HpcOmTaskGraph_nodeIsDependent MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_nodeIsDependent)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeForCrefLst(threadData_t *threadData, modelica_metatype _iCrefs, modelica_metatype _iDae, modelica_metatype _iVarCompMap);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForCrefLst,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodeForCrefLst,0}};
#define boxvar_HpcOmTaskGraph_getNodeForCrefLst MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeForCrefLst)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addEdgeToGraph(threadData_t *threadData, modelica_integer _parent, modelica_integer _child, modelica_metatype _graphIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addEdgeToGraph(threadData_t *threadData, modelica_metatype _parent, modelica_metatype _child, modelica_metatype _graphIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addEdgeToGraph,2,0) {(void*) boxptr_HpcOmTaskGraph_addEdgeToGraph,0}};
#define boxvar_HpcOmTaskGraph_addEdgeToGraph MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addEdgeToGraph)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addEdgesToGraph(threadData_t *threadData, modelica_metatype _parents, modelica_integer _child, modelica_metatype _graphIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addEdgesToGraph(threadData_t *threadData, modelica_metatype _parents, modelica_metatype _child, modelica_metatype _graphIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addEdgesToGraph,2,0) {(void*) boxptr_HpcOmTaskGraph_addEdgesToGraph,0}};
#define boxvar_HpcOmTaskGraph_addEdgesToGraph MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addEdgesToGraph)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_isCommunicationChildEqualToIdx(threadData_t *threadData, modelica_metatype _iComm, modelica_integer _iIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_isCommunicationChildEqualToIdx(threadData_t *threadData, modelica_metatype _iComm, modelica_metatype _iIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_isCommunicationChildEqualToIdx,2,0) {(void*) boxptr_HpcOmTaskGraph_isCommunicationChildEqualToIdx,0}};
#define boxvar_HpcOmTaskGraph_isCommunicationChildEqualToIdx MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_isCommunicationChildEqualToIdx)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setCommCosts(threadData_t *threadData, modelica_metatype _parent, modelica_integer _child, modelica_real _reqCycles, modelica_metatype _commCostsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setCommCosts(threadData_t *threadData, modelica_metatype _parent, modelica_metatype _child, modelica_metatype _reqCycles, modelica_metatype _commCostsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setCommCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_setCommCosts,0}};
#define boxvar_HpcOmTaskGraph_setCommCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setCommCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setCommCostsToParent(threadData_t *threadData, modelica_metatype _parents, modelica_integer _child, modelica_real _reqCycles, modelica_metatype _commCostsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setCommCostsToParent(threadData_t *threadData, modelica_metatype _parents, modelica_metatype _child, modelica_metatype _reqCycles, modelica_metatype _commCostsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setCommCostsToParent,2,0) {(void*) boxptr_HpcOmTaskGraph_setCommCostsToParent,0}};
#define boxvar_HpcOmTaskGraph_setCommCostsToParent MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setCommCostsToParent)
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_printNodeVars1(threadData_t *threadData, modelica_metatype _node);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printNodeVars1,2,0) {(void*) boxptr_HpcOmTaskGraph_printNodeVars1,0}};
#define boxvar_HpcOmTaskGraph_printNodeVars1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printNodeVars1)
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_printNodeVars(threadData_t *threadData, modelica_metatype _nodes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printNodeVars,2,0) {(void*) boxptr_HpcOmTaskGraph_printNodeVars,0}};
#define boxvar_HpcOmTaskGraph_printNodeVars MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printNodeVars)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_estimateEquationCosts(threadData_t *threadData, modelica_metatype _eqIn, modelica_metatype _sharedIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_estimateEquationCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_estimateEquationCosts,0}};
#define boxvar_HpcOmTaskGraph_estimateEquationCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_estimateEquationCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setAnnotationsForVar(threadData_t *threadData, modelica_integer _backendVarIdx, modelica_metatype _vars, modelica_metatype _taskGraphInfo, modelica_integer _eqSysOffset, modelica_metatype _annotInfoIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setAnnotationsForVar(threadData_t *threadData, modelica_metatype _backendVarIdx, modelica_metatype _vars, modelica_metatype _taskGraphInfo, modelica_metatype _eqSysOffset, modelica_metatype _annotInfoIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setAnnotationsForVar,2,0) {(void*) boxptr_HpcOmTaskGraph_setAnnotationsForVar,0}};
#define boxvar_HpcOmTaskGraph_setAnnotationsForVar MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setAnnotationsForVar)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setAnnotationsForTasks1(threadData_t *threadData, modelica_metatype _syst, modelica_metatype _taskGraphInfo, modelica_metatype _infoIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setAnnotationsForTasks1,2,0) {(void*) boxptr_HpcOmTaskGraph_setAnnotationsForTasks1,0}};
#define boxvar_HpcOmTaskGraph_setAnnotationsForTasks1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setAnnotationsForTasks1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setAnnotationsForTasks(threadData_t *threadData, modelica_metatype _taskGraphInfo, modelica_metatype _backendDAE, modelica_metatype _annotInfoIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setAnnotationsForTasks,2,0) {(void*) boxptr_HpcOmTaskGraph_setAnnotationsForTasks,0}};
#define boxvar_HpcOmTaskGraph_setAnnotationsForTasks MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setAnnotationsForTasks)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getHighestCommCost(threadData_t *threadData, modelica_metatype _iCommCosts, modelica_metatype _iHighestTuple);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getHighestCommCost,2,0) {(void*) boxptr_HpcOmTaskGraph_getHighestCommCost,0}};
#define boxvar_HpcOmTaskGraph_getHighestCommCost MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getHighestCommCost)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_getCommCostBetweenNodes1(threadData_t *threadData, modelica_metatype _iCommCost, modelica_metatype _iChildComps);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommCostBetweenNodes1(threadData_t *threadData, modelica_metatype _iCommCost, modelica_metatype _iChildComps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostBetweenNodes1,2,0) {(void*) boxptr_HpcOmTaskGraph_getCommCostBetweenNodes1,0}};
#define boxvar_HpcOmTaskGraph_getCommCostBetweenNodes1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostBetweenNodes1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommCostBetweenNodes0(threadData_t *threadData, modelica_integer _iParentComp, modelica_metatype _iChildComps, modelica_metatype _iCommCosts);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommCostBetweenNodes0(threadData_t *threadData, modelica_metatype _iParentComp, modelica_metatype _iChildComps, modelica_metatype _iCommCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostBetweenNodes0,2,0) {(void*) boxptr_HpcOmTaskGraph_getCommCostBetweenNodes0,0}};
#define boxvar_HpcOmTaskGraph_getCommCostBetweenNodes0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostBetweenNodes0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommCostBetweenNodes(threadData_t *threadData, modelica_integer _iParentNodeIdx, modelica_integer _iChildNodeIdx, modelica_metatype _iTaskGraphMeta);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommCostBetweenNodes(threadData_t *threadData, modelica_metatype _iParentNodeIdx, modelica_metatype _iChildNodeIdx, modelica_metatype _iTaskGraphMeta);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostBetweenNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_getCommCostBetweenNodes,0}};
#define boxvar_HpcOmTaskGraph_getCommCostBetweenNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostBetweenNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommunicationByChildIdx(threadData_t *threadData, modelica_metatype _iComms, modelica_integer _iChildIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommunicationByChildIdx(threadData_t *threadData, modelica_metatype _iComms, modelica_metatype _iChildIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommunicationByChildIdx,2,0) {(void*) boxptr_HpcOmTaskGraph_getCommunicationByChildIdx,0}};
#define boxvar_HpcOmTaskGraph_getCommunicationByChildIdx MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommunicationByChildIdx)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommunicationCost(threadData_t *threadData, modelica_integer _childIdx, modelica_integer _parentIdx, modelica_metatype _commCosts);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommunicationCost(threadData_t *threadData, modelica_metatype _childIdx, modelica_metatype _parentIdx, modelica_metatype _commCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommunicationCost,2,0) {(void*) boxptr_HpcOmTaskGraph_getCommunicationCost,0}};
#define boxvar_HpcOmTaskGraph_getCommunicationCost MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommunicationCost)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_transposeCommCosts1(threadData_t *threadData, modelica_metatype _iCost, modelica_integer _iParentCompIdx, modelica_metatype _iCommCosts);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_transposeCommCosts1(threadData_t *threadData, modelica_metatype _iCost, modelica_metatype _iParentCompIdx, modelica_metatype _iCommCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_transposeCommCosts1,2,0) {(void*) boxptr_HpcOmTaskGraph_transposeCommCosts1,0}};
#define boxvar_HpcOmTaskGraph_transposeCommCosts1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_transposeCommCosts1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_transposeCommCosts0(threadData_t *threadData, modelica_metatype _iCosts, modelica_metatype _iCommCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_transposeCommCosts0,2,0) {(void*) boxptr_HpcOmTaskGraph_transposeCommCosts0,0}};
#define boxvar_HpcOmTaskGraph_transposeCommCosts0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_transposeCommCosts0)
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_tupleToStringIntRealInt(threadData_t *threadData, modelica_metatype _inTuple);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_tupleToStringIntRealInt,2,0) {(void*) boxptr_HpcOmTaskGraph_tupleToStringIntRealInt,0}};
#define boxvar_HpcOmTaskGraph_tupleToStringIntRealInt MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_tupleToStringIntRealInt)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setLevelInNodeMark(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _inComps, modelica_metatype _nodeCoords, modelica_metatype _nodeMarkIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setLevelInNodeMark(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _inComps, modelica_metatype _nodeCoords, modelica_metatype _nodeMarkIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setLevelInNodeMark,2,0) {(void*) boxptr_HpcOmTaskGraph_setLevelInNodeMark,0}};
#define boxvar_HpcOmTaskGraph_setLevelInNodeMark MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setLevelInNodeMark)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getParallelSetForComp(threadData_t *threadData, modelica_integer _compIn, modelica_integer _setIdx, modelica_metatype _parallelSets);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getParallelSetForComp(threadData_t *threadData, modelica_metatype _compIn, modelica_metatype _setIdx, modelica_metatype _parallelSets);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getParallelSetForComp,2,0) {(void*) boxptr_HpcOmTaskGraph_getParallelSetForComp,0}};
#define boxvar_HpcOmTaskGraph_getParallelSetForComp MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getParallelSetForComp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getYCoordForNode(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _parallelSets, modelica_metatype _nodeCoordsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getYCoordForNode(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _parallelSets, modelica_metatype _nodeCoordsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getYCoordForNode,2,0) {(void*) boxptr_HpcOmTaskGraph_getYCoordForNode,0}};
#define boxvar_HpcOmTaskGraph_getYCoordForNode MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getYCoordForNode)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeCoords(threadData_t *threadData, modelica_metatype _parallelSets, modelica_metatype _graphIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeCoords,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodeCoords,0}};
#define boxvar_HpcOmTaskGraph_getNodeCoords MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeCoords)
PROTECTED_FUNCTION_STATIC modelica_real omc_HpcOmTaskGraph_getCostsForContractedNodes1(threadData_t *threadData, modelica_integer _node, modelica_metatype _exeCosts, modelica_real _costsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCostsForContractedNodes1(threadData_t *threadData, modelica_metatype _node, modelica_metatype _exeCosts, modelica_metatype _costsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCostsForContractedNodes1,2,0) {(void*) boxptr_HpcOmTaskGraph_getCostsForContractedNodes1,0}};
#define boxvar_HpcOmTaskGraph_getCostsForContractedNodes1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCostsForContractedNodes1)
PROTECTED_FUNCTION_STATIC modelica_real omc_HpcOmTaskGraph_getCostsForNode(threadData_t *threadData, modelica_integer _parentNode, modelica_integer _childNode, modelica_metatype _inComps, modelica_metatype _exeCosts, modelica_metatype _commCosts);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCostsForNode(threadData_t *threadData, modelica_metatype _parentNode, modelica_metatype _childNode, modelica_metatype _inComps, modelica_metatype _exeCosts, modelica_metatype _commCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCostsForNode,2,0) {(void*) boxptr_HpcOmTaskGraph_getCostsForNode,0}};
#define boxvar_HpcOmTaskGraph_getCostsForNode MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCostsForNode)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_gatherParallelSets1(threadData_t *threadData, modelica_integer _idx, modelica_metatype _nodeInfo, modelica_metatype _parallelSetIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_gatherParallelSets1(threadData_t *threadData, modelica_metatype _idx, modelica_metatype _nodeInfo, modelica_metatype _parallelSetIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_gatherParallelSets1,2,0) {(void*) boxptr_HpcOmTaskGraph_gatherParallelSets1,0}};
#define boxvar_HpcOmTaskGraph_gatherParallelSets1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_gatherParallelSets1)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_numberOfLevels(threadData_t *threadData, modelica_metatype _nodeInfoEntry, modelica_integer _numLevelsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_numberOfLevels(threadData_t *threadData, modelica_metatype _nodeInfoEntry, modelica_metatype _numLevelsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_numberOfLevels,2,0) {(void*) boxptr_HpcOmTaskGraph_numberOfLevels,0}};
#define boxvar_HpcOmTaskGraph_numberOfLevels MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_numberOfLevels)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_gatherParallelSets(threadData_t *threadData, modelica_metatype _nodeInfo);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_gatherParallelSets,2,0) {(void*) boxptr_HpcOmTaskGraph_gatherParallelSets,0}};
#define boxvar_HpcOmTaskGraph_gatherParallelSets MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_gatherParallelSets)
PROTECTED_FUNCTION_STATIC modelica_real omc_HpcOmTaskGraph_addUpExeCostsForNode(threadData_t *threadData, modelica_metatype _iNodeComps, modelica_metatype _iExeCosts, modelica_real _iExeCost);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addUpExeCostsForNode(threadData_t *threadData, modelica_metatype _iNodeComps, modelica_metatype _iExeCosts, modelica_metatype _iExeCost);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addUpExeCostsForNode,2,0) {(void*) boxptr_HpcOmTaskGraph_addUpExeCostsForNode,0}};
#define boxvar_HpcOmTaskGraph_addUpExeCostsForNode MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addUpExeCostsForNode)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getCriticalPath2(threadData_t *threadData, modelica_metatype _iCriticalPaths, modelica_integer _iListIdx, modelica_real _iLongestPath, modelica_integer _iLongestPathIndex);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCriticalPath2(threadData_t *threadData, modelica_metatype _iCriticalPaths, modelica_metatype _iListIdx, modelica_metatype _iLongestPath, modelica_metatype _iLongestPathIndex);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCriticalPath2,2,0) {(void*) boxptr_HpcOmTaskGraph_getCriticalPath2,0}};
#define boxvar_HpcOmTaskGraph_getCriticalPath2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCriticalPath2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCriticalPath1(threadData_t *threadData, modelica_integer _iNode, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_boolean _iHandleCommCosts, modelica_metatype _iNodeCriticalPaths);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCriticalPath1(threadData_t *threadData, modelica_metatype _iNode, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_metatype _iHandleCommCosts, modelica_metatype _iNodeCriticalPaths);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCriticalPath1,2,0) {(void*) boxptr_HpcOmTaskGraph_getCriticalPath1,0}};
#define boxvar_HpcOmTaskGraph_getCriticalPath1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCriticalPath1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCriticalPath(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_metatype _iRootNodes, modelica_boolean _iHandleCommCosts, modelica_real *out_oCpCosts);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCriticalPath(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_metatype _iRootNodes, modelica_metatype _iHandleCommCosts, modelica_metatype *out_oCpCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCriticalPath,2,0) {(void*) boxptr_HpcOmTaskGraph_getCriticalPath,0}};
#define boxvar_HpcOmTaskGraph_getCriticalPath MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCriticalPath)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareComponents(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareComponents(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareComponents,2,0) {(void*) boxptr_HpcOmTaskGraph_compareComponents,0}};
#define boxvar_HpcOmTaskGraph_compareComponents MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareComponents)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_componentsEqual(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_componentsEqual(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_componentsEqual,2,0) {(void*) boxptr_HpcOmTaskGraph_componentsEqual,0}};
#define boxvar_HpcOmTaskGraph_componentsEqual MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_componentsEqual)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents2(threadData_t *threadData, modelica_integer _nodeMark, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getGraphComponents2(threadData_t *threadData, modelica_metatype _nodeMark, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents2,2,0) {(void*) boxptr_HpcOmTaskGraph_getGraphComponents2,0}};
#define boxvar_HpcOmTaskGraph_getGraphComponents2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents1(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getGraphComponents1(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents1,2,0) {(void*) boxptr_HpcOmTaskGraph_getGraphComponents1,0}};
#define boxvar_HpcOmTaskGraph_getGraphComponents1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents0(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents0,2,0) {(void*) boxptr_HpcOmTaskGraph_getGraphComponents0,0}};
#define boxvar_HpcOmTaskGraph_getGraphComponents0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents(threadData_t *threadData, modelica_metatype _iTaskGraphMeta, modelica_metatype _iSystComps, modelica_metatype _iCompEqSysMapping, modelica_metatype *out_oCompEqGraphMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents,2,0) {(void*) boxptr_HpcOmTaskGraph_getGraphComponents,0}};
#define boxvar_HpcOmTaskGraph_getGraphComponents MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getGraphComponents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_checkForDuplicates0(threadData_t *threadData, modelica_metatype _currentComp_idx, modelica_metatype _iLastComp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForDuplicates0,2,0) {(void*) boxptr_HpcOmTaskGraph_checkForDuplicates0,0}};
#define boxvar_HpcOmTaskGraph_checkForDuplicates0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForDuplicates0)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkForDuplicates(threadData_t *threadData, modelica_metatype _iComps);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkForDuplicates(threadData_t *threadData, modelica_metatype _iComps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForDuplicates,2,0) {(void*) boxptr_HpcOmTaskGraph_checkForDuplicates,0}};
#define boxvar_HpcOmTaskGraph_checkForDuplicates MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForDuplicates)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_validateComponents(threadData_t *threadData, modelica_metatype _graphComps, modelica_metatype _systComps);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_validateComponents(threadData_t *threadData, modelica_metatype _graphComps, modelica_metatype _systComps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_validateComponents,2,0) {(void*) boxptr_HpcOmTaskGraph_validateComponents,0}};
#define boxvar_HpcOmTaskGraph_validateComponents MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_validateComponents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_validateTaskGraphMeta0(threadData_t *threadData, modelica_metatype _iEqSysMapping, modelica_metatype _iCompsTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_validateTaskGraphMeta0,2,0) {(void*) boxptr_HpcOmTaskGraph_validateTaskGraphMeta0,0}};
#define boxvar_HpcOmTaskGraph_validateTaskGraphMeta0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_validateTaskGraphMeta0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCommCosts0(threadData_t *threadData, modelica_metatype _iComm, modelica_metatype _iReqTimeCom);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCommCosts0,2,0) {(void*) boxptr_HpcOmTaskGraph_createCommCosts0,0}};
#define boxvar_HpcOmTaskGraph_createCommCosts0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCommCosts0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCommCosts(threadData_t *threadData, modelica_metatype _iCosts, modelica_integer _iCurrentIndex, modelica_metatype _iReqTimeCom);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createCommCosts(threadData_t *threadData, modelica_metatype _iCosts, modelica_metatype _iCurrentIndex, modelica_metatype _iReqTimeCom);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCommCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_createCommCosts,0}};
#define boxvar_HpcOmTaskGraph_createCommCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCommCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createExecCost0(threadData_t *threadData, modelica_integer _sccIndex, modelica_metatype _icomps_shared, modelica_metatype _compMapping, modelica_metatype _iRequiredTime, modelica_metatype _iCosts);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createExecCost0(threadData_t *threadData, modelica_metatype _sccIndex, modelica_metatype _icomps_shared, modelica_metatype _compMapping, modelica_metatype _iRequiredTime, modelica_metatype _iCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createExecCost0,2,0) {(void*) boxptr_HpcOmTaskGraph_createExecCost0,0}};
#define boxvar_HpcOmTaskGraph_createExecCost0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createExecCost0)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_createExecCost(threadData_t *threadData, modelica_metatype _iNodeSccs, modelica_metatype _icomps_shared, modelica_metatype _iRequiredTime, modelica_metatype _iExecCosts, modelica_metatype _compMapping, modelica_integer _iNodeIdx);
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_createExecCost(threadData_t *threadData, modelica_metatype _iNodeSccs, modelica_metatype _icomps_shared, modelica_metatype _iRequiredTime, modelica_metatype _iExecCosts, modelica_metatype _compMapping, modelica_metatype _iNodeIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createExecCost,2,0) {(void*) boxptr_HpcOmTaskGraph_createExecCost,0}};
#define boxvar_HpcOmTaskGraph_createExecCost MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createExecCost)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCosts1(threadData_t *threadData, modelica_metatype _iTuple, modelica_metatype _iReqTime);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCosts1,2,0) {(void*) boxptr_HpcOmTaskGraph_createCosts1,0}};
#define boxvar_HpcOmTaskGraph_createCosts1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCosts1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCosts0(threadData_t *threadData, modelica_metatype _iNode, modelica_metatype _iComps_shared, modelica_metatype _iCompMapping, modelica_metatype _reqTimeOp, modelica_metatype _reqTimeCom, modelica_metatype _iTaskGraphMeta);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCosts0,2,0) {(void*) boxptr_HpcOmTaskGraph_createCosts0,0}};
#define boxvar_HpcOmTaskGraph_createCosts0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCosts0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertSimEqToSccCosts2(threadData_t *threadData, modelica_metatype _iReqTime, modelica_real _iSimEqCalcTime, modelica_integer _iSimEqIdx, modelica_metatype _iSimeqCompMapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertSimEqToSccCosts2(threadData_t *threadData, modelica_metatype _iReqTime, modelica_metatype _iSimEqCalcTime, modelica_metatype _iSimEqIdx, modelica_metatype _iSimeqCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertSimEqToSccCosts2,2,0) {(void*) boxptr_HpcOmTaskGraph_convertSimEqToSccCosts2,0}};
#define boxvar_HpcOmTaskGraph_convertSimEqToSccCosts2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertSimEqToSccCosts2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertSimEqToSccCosts1(threadData_t *threadData, modelica_metatype _iReqTimeOpSimCode, modelica_metatype _iSimeqCompMapping, modelica_metatype _iReqTimeOp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertSimEqToSccCosts1,2,0) {(void*) boxptr_HpcOmTaskGraph_convertSimEqToSccCosts1,0}};
#define boxvar_HpcOmTaskGraph_convertSimEqToSccCosts1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertSimEqToSccCosts1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertSimEqToSccCosts(threadData_t *threadData, modelica_metatype _iReqTimeOpSimCode, modelica_metatype _iSimeqCompMapping, modelica_metatype _iReqTimeOp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertSimEqToSccCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_convertSimEqToSccCosts,0}};
#define boxvar_HpcOmTaskGraph_convertSimEqToSccCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertSimEqToSccCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertNodeListToEdgeTuples0(threadData_t *threadData, modelica_metatype _iNodeList, modelica_integer _iNodeIdx, modelica_metatype _iEdgeList);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertNodeListToEdgeTuples0(threadData_t *threadData, modelica_metatype _iNodeList, modelica_metatype _iNodeIdx, modelica_metatype _iEdgeList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertNodeListToEdgeTuples0,2,0) {(void*) boxptr_HpcOmTaskGraph_convertNodeListToEdgeTuples0,0}};
#define boxvar_HpcOmTaskGraph_convertNodeListToEdgeTuples0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_convertNodeListToEdgeTuples0)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkTpl2ForZero(threadData_t *threadData, modelica_integer _comp, modelica_metatype _exeCosts, modelica_boolean _bIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkTpl2ForZero(threadData_t *threadData, modelica_metatype _comp, modelica_metatype _exeCosts, modelica_metatype _bIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkTpl2ForZero,2,0) {(void*) boxptr_HpcOmTaskGraph_checkTpl2ForZero,0}};
#define boxvar_HpcOmTaskGraph_checkTpl2ForZero MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkTpl2ForZero)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkForExecutionCosts1(threadData_t *threadData, modelica_metatype _exeCosts, modelica_metatype _inComps, modelica_integer _nodeIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkForExecutionCosts1(threadData_t *threadData, modelica_metatype _exeCosts, modelica_metatype _inComps, modelica_metatype _nodeIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForExecutionCosts1,2,0) {(void*) boxptr_HpcOmTaskGraph_checkForExecutionCosts1,0}};
#define boxvar_HpcOmTaskGraph_checkForExecutionCosts1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForExecutionCosts1)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkForExecutionCosts(threadData_t *threadData, modelica_metatype _dataIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkForExecutionCosts(threadData_t *threadData, modelica_metatype _dataIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForExecutionCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_checkForExecutionCosts,0}};
#define boxvar_HpcOmTaskGraph_checkForExecutionCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkForExecutionCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommCostsOnly(threadData_t *threadData, modelica_metatype _commCostsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostsOnly,2,0) {(void*) boxptr_HpcOmTaskGraph_getCommCostsOnly,0}};
#define boxvar_HpcOmTaskGraph_getCommCostsOnly MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getCommCostsOnly)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_estimateCosts0(threadData_t *threadData, modelica_integer _systIdx, modelica_metatype _compsLstIn, modelica_metatype _eqSystemsIn, modelica_metatype _sharedIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_estimateCosts0(threadData_t *threadData, modelica_metatype _systIdx, modelica_metatype _compsLstIn, modelica_metatype _eqSystemsIn, modelica_metatype _sharedIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_estimateCosts0,2,0) {(void*) boxptr_HpcOmTaskGraph_estimateCosts0,0}};
#define boxvar_HpcOmTaskGraph_estimateCosts0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_estimateCosts0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_estimateCosts(threadData_t *threadData, modelica_metatype _daeIn, modelica_metatype _taskGraphMetaIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_estimateCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_estimateCosts,0}};
#define boxvar_HpcOmTaskGraph_estimateCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_estimateCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_checkParentNode(threadData_t *threadData, modelica_integer _lstIdx, modelica_metatype _graphIn, modelica_metatype _lstIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkParentNode(threadData_t *threadData, modelica_metatype _lstIdx, modelica_metatype _graphIn, modelica_metatype _lstIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkParentNode,2,0) {(void*) boxptr_HpcOmTaskGraph_checkParentNode,0}};
#define boxvar_HpcOmTaskGraph_checkParentNode MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkParentNode)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getParentNodes(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _graphIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getParentNodes(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _graphIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getParentNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_getParentNodes,0}};
#define boxvar_HpcOmTaskGraph_getParentNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getParentNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_findOneChildParents(threadData_t *threadData, modelica_metatype _allNodes, modelica_metatype _graphIn, modelica_metatype _doNotMerge, modelica_metatype _lstIn, modelica_integer _inPath, modelica_metatype _contrNodes);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_findOneChildParents(threadData_t *threadData, modelica_metatype _allNodes, modelica_metatype _graphIn, modelica_metatype _doNotMerge, modelica_metatype _lstIn, modelica_metatype _inPath, modelica_metatype _contrNodes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_findOneChildParents,2,0) {(void*) boxptr_HpcOmTaskGraph_findOneChildParents,0}};
#define boxvar_HpcOmTaskGraph_findOneChildParents MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_findOneChildParents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateInComps2(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _inCompLstIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateInComps2(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _inCompLstIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInComps2,2,0) {(void*) boxptr_HpcOmTaskGraph_updateInComps2,0}};
#define boxvar_HpcOmTaskGraph_updateInComps2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInComps2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateInComps1(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _mergeInfo, modelica_metatype _primInComps, modelica_metatype _inCompLstIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateInComps1(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _mergeInfo, modelica_metatype _primInComps, modelica_metatype _inCompLstIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInComps1,2,0) {(void*) boxptr_HpcOmTaskGraph_updateInComps1,0}};
#define boxvar_HpcOmTaskGraph_updateInComps1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInComps1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateInCompsForMerging(threadData_t *threadData, modelica_metatype _inCompsIn, modelica_metatype _mergedPaths);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInCompsForMerging,2,0) {(void*) boxptr_HpcOmTaskGraph_updateInCompsForMerging,0}};
#define boxvar_HpcOmTaskGraph_updateInCompsForMerging MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInCompsForMerging)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCompNamesForMerging(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _inComps, modelica_metatype _nodeMark, modelica_metatype _compNamesIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCompNamesForMerging(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _inComps, modelica_metatype _nodeMark, modelica_metatype _compNamesIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCompNamesForMerging,2,0) {(void*) boxptr_HpcOmTaskGraph_updateCompNamesForMerging,0}};
#define boxvar_HpcOmTaskGraph_updateCompNamesForMerging MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCompNamesForMerging)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getMergedSystemData(threadData_t *threadData, modelica_metatype _graphDataIn, modelica_metatype _contractNodes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getMergedSystemData,2,0) {(void*) boxptr_HpcOmTaskGraph_getMergedSystemData,0}};
#define boxvar_HpcOmTaskGraph_getMergedSystemData MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getMergedSystemData)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareListLengthOnTrue(threadData_t *threadData, modelica_integer _inValue, modelica_metatype _inLst);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareListLengthOnTrue(threadData_t *threadData, modelica_metatype _inValue, modelica_metatype _inLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareListLengthOnTrue,2,0) {(void*) boxptr_HpcOmTaskGraph_compareListLengthOnTrue,0}};
#define boxvar_HpcOmTaskGraph_compareListLengthOnTrue MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareListLengthOnTrue)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_contractNodesInGraph2(threadData_t *threadData, modelica_integer _iParentNode, modelica_metatype _iDeletedNodes, modelica_integer _iNewNodeIdx, modelica_metatype _iGraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_contractNodesInGraph2(threadData_t *threadData, modelica_metatype _iParentNode, modelica_metatype _iDeletedNodes, modelica_metatype _iNewNodeIdx, modelica_metatype _iGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_contractNodesInGraph2,2,0) {(void*) boxptr_HpcOmTaskGraph_contractNodesInGraph2,0}};
#define boxvar_HpcOmTaskGraph_contractNodesInGraph2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_contractNodesInGraph2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_contractNodesInGraph1(threadData_t *threadData, modelica_metatype _contractNodes, modelica_metatype _graphIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_contractNodesInGraph1,2,0) {(void*) boxptr_HpcOmTaskGraph_contractNodesInGraph1,0}};
#define boxvar_HpcOmTaskGraph_contractNodesInGraph1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_contractNodesInGraph1)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_updateInCompsInfo(threadData_t *threadData, modelica_integer _contrNode, modelica_metatype _removedNodes, modelica_metatype _inComps);
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_updateInCompsInfo(threadData_t *threadData, modelica_metatype _contrNode, modelica_metatype _removedNodes, modelica_metatype _inComps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInCompsInfo,2,0) {(void*) boxptr_HpcOmTaskGraph_updateInCompsInfo,0}};
#define boxvar_HpcOmTaskGraph_updateInCompsInfo MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateInCompsInfo)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData_t *threadData, modelica_integer _iTaskIdx, modelica_metatype _iContractedTasks);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData_t *threadData, modelica_metatype _iTaskIdx, modelica_metatype _iContractedTasks);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getRealTaskIdxOfTask,2,0) {(void*) boxptr_HpcOmTaskGraph_getRealTaskIdxOfTask,0}};
#define boxvar_HpcOmTaskGraph_getRealTaskIdxOfTask MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getRealTaskIdxOfTask)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getContractedNodeChildren(threadData_t *threadData, modelica_integer _iParentTask, modelica_integer _iRefValue, modelica_metatype _iTaskGraph, modelica_metatype _iContractedTasks, modelica_metatype _iNodeMarks);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getContractedNodeChildren(threadData_t *threadData, modelica_metatype _iParentTask, modelica_metatype _iRefValue, modelica_metatype _iTaskGraph, modelica_metatype _iContractedTasks, modelica_metatype _iNodeMarks);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getContractedNodeChildren,2,0) {(void*) boxptr_HpcOmTaskGraph_getContractedNodeChildren,0}};
#define boxvar_HpcOmTaskGraph_getContractedNodeChildren MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getContractedNodeChildren)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkIfNodeBelongsToCluster(threadData_t *threadData, modelica_integer _iNegativeRefValue, modelica_integer _iNodeIdx, modelica_metatype _iContractedTasks);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkIfNodeBelongsToCluster(threadData_t *threadData, modelica_metatype _iNegativeRefValue, modelica_metatype _iNodeIdx, modelica_metatype _iContractedTasks);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkIfNodeBelongsToCluster,2,0) {(void*) boxptr_HpcOmTaskGraph_checkIfNodeBelongsToCluster,0}};
#define boxvar_HpcOmTaskGraph_checkIfNodeBelongsToCluster MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_checkIfNodeBelongsToCluster)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getHighestExecCost(threadData_t *threadData, modelica_metatype _iExecCosts, modelica_metatype _iHighestTuple);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getHighestExecCost,2,0) {(void*) boxptr_HpcOmTaskGraph_getHighestExecCost,0}};
#define boxvar_HpcOmTaskGraph_getHighestExecCost MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getHighestExecCost)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addUpExeCosts(threadData_t *threadData, modelica_metatype _iExeCost1, modelica_metatype _iExeCost2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addUpExeCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_addUpExeCosts,0}};
#define boxvar_HpcOmTaskGraph_addUpExeCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addUpExeCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_combineComponentInformations(threadData_t *threadData, modelica_metatype _iComponentInfo, modelica_metatype _iComponentInfo2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_combineComponentInformations,2,0) {(void*) boxptr_HpcOmTaskGraph_combineComponentInformations,0}};
#define boxvar_HpcOmTaskGraph_combineComponentInformations MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_combineComponentInformations)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mergeSinkNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_boolean *out_changed);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_mergeSinkNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_metatype *out_changed);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mergeSinkNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_mergeSinkNodes,0}};
#define boxvar_HpcOmTaskGraph_mergeSinkNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mergeSinkNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mergeParentNodes0(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphT, modelica_metatype _iGraphData, modelica_metatype _contractedTasksIn, modelica_metatype _alreadyMerged, modelica_integer _iNodeIdx, modelica_metatype _iMergedNodes);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_mergeParentNodes0(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphT, modelica_metatype _iGraphData, modelica_metatype _contractedTasksIn, modelica_metatype _alreadyMerged, modelica_metatype _iNodeIdx, modelica_metatype _iMergedNodes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mergeParentNodes0,2,0) {(void*) boxptr_HpcOmTaskGraph_mergeParentNodes0,0}};
#define boxvar_HpcOmTaskGraph_mergeParentNodes0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mergeParentNodes0)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_nextGreaterPowerOf2__impl(threadData_t *threadData, modelica_real _n, modelica_integer _pow);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_nextGreaterPowerOf2__impl(threadData_t *threadData, modelica_metatype _n, modelica_metatype _pow);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_nextGreaterPowerOf2__impl,2,0) {(void*) boxptr_HpcOmTaskGraph_nextGreaterPowerOf2__impl,0}};
#define boxvar_HpcOmTaskGraph_nextGreaterPowerOf2__impl MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_nextGreaterPowerOf2__impl)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_nextGreaterPowerOf2(threadData_t *threadData, modelica_real _n);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_nextGreaterPowerOf2(threadData_t *threadData, modelica_metatype _n);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_nextGreaterPowerOf2,2,0) {(void*) boxptr_HpcOmTaskGraph_nextGreaterPowerOf2,0}};
#define boxvar_HpcOmTaskGraph_nextGreaterPowerOf2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_nextGreaterPowerOf2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_distributeToClusters1(threadData_t *threadData, modelica_metatype _tplIn, modelica_metatype _tplFold, modelica_integer _numClusters, modelica_metatype *out_clusterValuesOut);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_distributeToClusters1(threadData_t *threadData, modelica_metatype _tplIn, modelica_metatype _tplFold, modelica_metatype _numClusters, modelica_metatype *out_clusterValuesOut);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_distributeToClusters1,2,0) {(void*) boxptr_HpcOmTaskGraph_distributeToClusters1,0}};
#define boxvar_HpcOmTaskGraph_distributeToClusters1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_distributeToClusters1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mergeSingleNodes(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _doNotMergeIn, modelica_metatype *out_oTaskGraphMeta, modelica_boolean *out_changed);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_mergeSingleNodes(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _doNotMergeIn, modelica_metatype *out_oTaskGraphMeta, modelica_metatype *out_changed);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mergeSingleNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_mergeSingleNodes,0}};
#define boxvar_HpcOmTaskGraph_mergeSingleNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mergeSingleNodes)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_integer _cpIdx);
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_printCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_metatype _cpIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCriticalPathInfo1,2,0) {(void*) boxptr_HpcOmTaskGraph_printCriticalPathInfo1,0}};
#define boxvar_HpcOmTaskGraph_printCriticalPathInfo1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCriticalPathInfo1)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCriticalPathInfo(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_real _cpCosts);
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_printCriticalPathInfo(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_metatype _cpCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCriticalPathInfo,2,0) {(void*) boxptr_HpcOmTaskGraph_printCriticalPathInfo,0}};
#define boxvar_HpcOmTaskGraph_printCriticalPathInfo MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCriticalPathInfo)
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_dumpCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_integer _cpIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_dumpCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_metatype _cpIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpCriticalPathInfo1,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpCriticalPathInfo1,0}};
#define boxvar_HpcOmTaskGraph_dumpCriticalPathInfo1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpCriticalPathInfo1)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printComponentInformations(threadData_t *threadData, modelica_metatype _iComponentInformations);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printComponentInformations,2,0) {(void*) boxptr_HpcOmTaskGraph_printComponentInformations,0}};
#define boxvar_HpcOmTaskGraph_printComponentInformations MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printComponentInformations)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printNodeMarks(threadData_t *threadData, modelica_metatype _iNodeMarks);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printNodeMarks,2,0) {(void*) boxptr_HpcOmTaskGraph_printNodeMarks,0}};
#define boxvar_HpcOmTaskGraph_printNodeMarks MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printNodeMarks)
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_printCommCost(threadData_t *threadData, modelica_metatype _iComm);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCommCost,2,0) {(void*) boxptr_HpcOmTaskGraph_printCommCost,0}};
#define boxvar_HpcOmTaskGraph_printCommCost MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCommCost)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCommCosts(threadData_t *threadData, modelica_metatype _iCommCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCommCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_printCommCosts,0}};
#define boxvar_HpcOmTaskGraph_printCommCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCommCosts)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printExeCosts(threadData_t *threadData, modelica_metatype _iExeCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printExeCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_printExeCosts,0}};
#define boxvar_HpcOmTaskGraph_printExeCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printExeCosts)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCompDescs(threadData_t *threadData, modelica_metatype _iCompDescs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCompDescs,2,0) {(void*) boxptr_HpcOmTaskGraph_printCompDescs,0}};
#define boxvar_HpcOmTaskGraph_printCompDescs MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCompDescs)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printComponentNames(threadData_t *threadData, modelica_metatype _iCompNames);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printComponentNames,2,0) {(void*) boxptr_HpcOmTaskGraph_printComponentNames,0}};
#define boxvar_HpcOmTaskGraph_printComponentNames MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printComponentNames)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCompParamMapping(threadData_t *threadData, modelica_metatype _iCompParamMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCompParamMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_printCompParamMapping,0}};
#define boxvar_HpcOmTaskGraph_printCompParamMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printCompParamMapping)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printEqCompMapping(threadData_t *threadData, modelica_metatype _iEqCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printEqCompMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_printEqCompMapping,0}};
#define boxvar_HpcOmTaskGraph_printEqCompMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printEqCompMapping)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printVarCompMapping(threadData_t *threadData, modelica_metatype _iVarCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printVarCompMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_printVarCompMapping,0}};
#define boxvar_HpcOmTaskGraph_printVarCompMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printVarCompMapping)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printInComps(threadData_t *threadData, modelica_metatype _iInComps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printInComps,2,0) {(void*) boxptr_HpcOmTaskGraph_printInComps,0}};
#define boxvar_HpcOmTaskGraph_printInComps MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_printInComps)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpAdjacencyRow(threadData_t *threadData, modelica_metatype _inIntegerLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpAdjacencyRow,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpAdjacencyRow,0}};
#define boxvar_HpcOmTaskGraph_dumpAdjacencyRow MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpAdjacencyRow)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpAdjacencyLst(threadData_t *threadData, modelica_metatype _inIntegerLstLst, modelica_integer _rowIndex);
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_dumpAdjacencyLst(threadData_t *threadData, modelica_metatype _inIntegerLstLst, modelica_metatype _rowIndex);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpAdjacencyLst,2,0) {(void*) boxptr_HpcOmTaskGraph_dumpAdjacencyLst,0}};
#define boxvar_HpcOmTaskGraph_dumpAdjacencyLst MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_dumpAdjacencyLst)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeMembershipByComponents(threadData_t *threadData, modelica_metatype _iNodeComponents, modelica_metatype _iCompInformations);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeMembershipByComponents,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodeMembershipByComponents,0}};
#define boxvar_HpcOmTaskGraph_getNodeMembershipByComponents MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodeMembershipByComponents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addDepToGraph(threadData_t *threadData, modelica_integer _childIdx, modelica_integer _parentIdx, modelica_metatype _tGraphDataIn, modelica_metatype _iCommAttIdc, modelica_metatype _iCriticalPathEdges, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addDepToGraph(threadData_t *threadData, modelica_metatype _childIdx, modelica_metatype _parentIdx, modelica_metatype _tGraphDataIn, modelica_metatype _iCommAttIdc, modelica_metatype _iCriticalPathEdges, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addDepToGraph,2,0) {(void*) boxptr_HpcOmTaskGraph_addDepToGraph,0}};
#define boxvar_HpcOmTaskGraph_addDepToGraph MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addDepToGraph)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addNodeToGraphML1(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _exeCosts, modelica_metatype _exeCostsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addNodeToGraphML1(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _exeCosts, modelica_metatype _exeCostsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addNodeToGraphML1,2,0) {(void*) boxptr_HpcOmTaskGraph_addNodeToGraphML1,0}};
#define boxvar_HpcOmTaskGraph_addNodeToGraphML1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addNodeToGraphML1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addNodeToGraphML(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _tGraphDataTuple, modelica_metatype _attIdc, modelica_metatype _sccSimEqMapping, modelica_metatype _iSchedulerInfoCritPath, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addNodeToGraphML(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _tGraphDataTuple, modelica_metatype _attIdc, modelica_metatype _sccSimEqMapping, modelica_metatype _iSchedulerInfoCritPath, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addNodeToGraphML,2,0) {(void*) boxptr_HpcOmTaskGraph_addNodeToGraphML,0}};
#define boxvar_HpcOmTaskGraph_addNodeToGraphML MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_addNodeToGraphML)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_solvesDiscreteValue(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _iOrderedVars, modelica_integer *out_oFirstEqIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_solvesDiscreteValue(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _iOrderedVars, modelica_metatype *out_oFirstEqIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_solvesDiscreteValue,2,0) {(void*) boxptr_HpcOmTaskGraph_solvesDiscreteValue,0}};
#define boxvar_HpcOmTaskGraph_solvesDiscreteValue MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_solvesDiscreteValue)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_integer _offset, modelica_metatype _iOrderedVars, modelica_metatype _discreteEqsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_metatype _offset, modelica_metatype _iOrderedVars, modelica_metatype _discreteEqsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getDiscreteNodesEqs1,2,0) {(void*) boxptr_HpcOmTaskGraph_getDiscreteNodesEqs1,0}};
#define boxvar_HpcOmTaskGraph_getDiscreteNodesEqs1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getDiscreteNodesEqs1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getDiscreteNodesEqs(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eventInfoIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getDiscreteNodesEqs,2,0) {(void*) boxptr_HpcOmTaskGraph_getDiscreteNodesEqs,0}};
#define boxvar_HpcOmTaskGraph_getDiscreteNodesEqs MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getDiscreteNodesEqs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getDiscreteNodes(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eqCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getDiscreteNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_getDiscreteNodes,0}};
#define boxvar_HpcOmTaskGraph_getDiscreteNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getDiscreteNodes)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_getComponentsIncludingTime2(threadData_t *threadData, modelica_metatype _iRef, modelica_boolean _iIncludingTime);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getComponentsIncludingTime2(threadData_t *threadData, modelica_metatype _iRef, modelica_metatype _iIncludingTime);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime2,2,0) {(void*) boxptr_HpcOmTaskGraph_getComponentsIncludingTime2,0}};
#define boxvar_HpcOmTaskGraph_getComponentsIncludingTime2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsIncludingTime1(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inB, modelica_boolean *out_res);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getComponentsIncludingTime1(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inB, modelica_metatype *out_res);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime1,2,0) {(void*) boxptr_HpcOmTaskGraph_getComponentsIncludingTime1,0}};
#define boxvar_HpcOmTaskGraph_getComponentsIncludingTime1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsIncludingTime0(threadData_t *threadData, modelica_metatype _inEq, modelica_metatype _iOffsetResList, modelica_metatype *out_oOffsetResList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime0,2,0) {(void*) boxptr_HpcOmTaskGraph_getComponentsIncludingTime0,0}};
#define boxvar_HpcOmTaskGraph_getComponentsIncludingTime0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsIncludingTime(threadData_t *threadData, modelica_metatype _iSystem, modelica_metatype _iEqCompMapping, modelica_metatype _iOffsetResList);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime,2,0) {(void*) boxptr_HpcOmTaskGraph_getComponentsIncludingTime,0}};
#define boxvar_HpcOmTaskGraph_getComponentsIncludingTime MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsIncludingTime)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsOfZeroCrossing(threadData_t *threadData, modelica_metatype _iZeroCrossing, modelica_metatype _iSimCodeEqCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsOfZeroCrossing,2,0) {(void*) boxptr_HpcOmTaskGraph_getComponentsOfZeroCrossing,0}};
#define boxvar_HpcOmTaskGraph_getComponentsOfZeroCrossing MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getComponentsOfZeroCrossing)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventSystem(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _iSyst, modelica_metatype _iZeroCrossings, modelica_metatype _iSimCodeEqCompMapping, modelica_metatype *out_oTaskGraphMeta);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventSystem,2,0) {(void*) boxptr_HpcOmTaskGraph_getEventSystem,0}};
#define boxvar_HpcOmTaskGraph_getEventSystem MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventSystem)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mapIntegers(threadData_t *threadData, modelica_metatype _iTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mapIntegers,2,0) {(void*) boxptr_HpcOmTaskGraph_mapIntegers,0}};
#define boxvar_HpcOmTaskGraph_mapIntegers MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_mapIntegers)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_reverseTaskGraphIndices(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype *out_oTaskGraphMeta);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_reverseTaskGraphIndices,2,0) {(void*) boxptr_HpcOmTaskGraph_reverseTaskGraphIndices,0}};
#define boxvar_HpcOmTaskGraph_reverseTaskGraphIndices MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_reverseTaskGraphIndices)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodesWithRefCountZero0(threadData_t *threadData, modelica_integer _iRefCount, modelica_metatype _iZeroIdc);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNodesWithRefCountZero0(threadData_t *threadData, modelica_metatype _iRefCount, modelica_metatype _iZeroIdc);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodesWithRefCountZero0,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodesWithRefCountZero0,0}};
#define boxvar_HpcOmTaskGraph_getNodesWithRefCountZero0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodesWithRefCountZero0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodesWithRefCountZero(threadData_t *threadData, modelica_metatype _iRefCounter);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodesWithRefCountZero,2,0) {(void*) boxptr_HpcOmTaskGraph_getNodesWithRefCountZero,0}};
#define boxvar_HpcOmTaskGraph_getNodesWithRefCountZero MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNodesWithRefCountZero)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createRefCounter0(threadData_t *threadData, modelica_metatype _iChildNodes, modelica_metatype _iRefCounter);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createRefCounter0,2,0) {(void*) boxptr_HpcOmTaskGraph_createRefCounter0,0}};
#define boxvar_HpcOmTaskGraph_createRefCounter0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createRefCounter0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createRefCounter(threadData_t *threadData, modelica_metatype _iTaskGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createRefCounter,2,0) {(void*) boxptr_HpcOmTaskGraph_createRefCounter,0}};
#define boxvar_HpcOmTaskGraph_createRefCounter MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createRefCounter)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getLevelNodes2(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getLevelNodes2(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getLevelNodes2,2,0) {(void*) boxptr_HpcOmTaskGraph_getLevelNodes2,0}};
#define boxvar_HpcOmTaskGraph_getLevelNodes2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getLevelNodes2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getLevelNodes1(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _iTaskGraph, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getLevelNodes1(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _iTaskGraph, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getLevelNodes1,2,0) {(void*) boxptr_HpcOmTaskGraph_getLevelNodes1,0}};
#define boxvar_HpcOmTaskGraph_getLevelNodes1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getLevelNodes1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getLevelNodes0(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero, modelica_metatype _iLevelNodes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getLevelNodes0,2,0) {(void*) boxptr_HpcOmTaskGraph_getLevelNodes0,0}};
#define boxvar_HpcOmTaskGraph_getLevelNodes0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getLevelNodes0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_arrayCopyRows(threadData_t *threadData, modelica_metatype _inArray, modelica_metatype _newArray, modelica_metatype _copiedRows, modelica_integer _Idx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_arrayCopyRows(threadData_t *threadData, modelica_metatype _inArray, modelica_metatype _newArray, modelica_metatype _copiedRows, modelica_metatype _Idx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_arrayCopyRows,2,0) {(void*) boxptr_HpcOmTaskGraph_arrayCopyRows,0}};
#define boxvar_HpcOmTaskGraph_arrayCopyRows MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_arrayCopyRows)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_deleteRowInAdjLst(threadData_t *threadData, modelica_metatype _adjacencyLstIn, modelica_metatype _rowsDel, modelica_metatype *out_odeMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_deleteRowInAdjLst,2,0) {(void*) boxptr_HpcOmTaskGraph_deleteRowInAdjLst,0}};
#define boxvar_HpcOmTaskGraph_deleteRowInAdjLst MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_deleteRowInAdjLst)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_removeContinuousEntries1(threadData_t *threadData, modelica_integer _entryIn, modelica_metatype _deleteEntriesIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_removeContinuousEntries1(threadData_t *threadData, modelica_metatype _entryIn, modelica_metatype _deleteEntriesIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeContinuousEntries1,2,0) {(void*) boxptr_HpcOmTaskGraph_removeContinuousEntries1,0}};
#define boxvar_HpcOmTaskGraph_removeContinuousEntries1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeContinuousEntries1)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_setDeleteArr(threadData_t *threadData, modelica_integer _entryIn, modelica_integer _offsetIn, modelica_integer *out_offsetOut);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setDeleteArr(threadData_t *threadData, modelica_metatype _entryIn, modelica_metatype _offsetIn, modelica_metatype *out_offsetOut);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setDeleteArr,2,0) {(void*) boxptr_HpcOmTaskGraph_setDeleteArr,0}};
#define boxvar_HpcOmTaskGraph_setDeleteArr MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_setDeleteArr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getChildNodes(threadData_t *threadData, modelica_metatype _adjacencyLstIn, modelica_metatype _parents, modelica_metatype _childLstTmp, modelica_integer _Idx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getChildNodes(threadData_t *threadData, modelica_metatype _adjacencyLstIn, modelica_metatype _parents, modelica_metatype _childLstTmp, modelica_metatype _Idx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getChildNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_getChildNodes,0}};
#define boxvar_HpcOmTaskGraph_getChildNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getChildNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getAllSuccessors2(threadData_t *threadData, modelica_metatype _nodes, modelica_metatype _graph, modelica_metatype _alreadyVisited, modelica_metatype _successorsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getAllSuccessors2,2,0) {(void*) boxptr_HpcOmTaskGraph_getAllSuccessors2,0}};
#define boxvar_HpcOmTaskGraph_getAllSuccessors2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getAllSuccessors2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_markRemovedNodes(threadData_t *threadData, modelica_integer _nodeMarkIdx, modelica_metatype _removedNodes, modelica_metatype _nodeMarkIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_markRemovedNodes(threadData_t *threadData, modelica_metatype _nodeMarkIdx, modelica_metatype _removedNodes, modelica_metatype _nodeMarkIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_markRemovedNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_markRemovedNodes,0}};
#define boxvar_HpcOmTaskGraph_markRemovedNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_markRemovedNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_cutSystemData(threadData_t *threadData, modelica_metatype _graphDataIn, modelica_metatype _cutNodes, modelica_metatype _cutNodeChildren);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_cutSystemData,2,0) {(void*) boxptr_HpcOmTaskGraph_cutSystemData,0}};
#define boxvar_HpcOmTaskGraph_cutSystemData MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_cutSystemData)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_cutTaskGraph2(threadData_t *threadData, modelica_metatype _daeNodes, modelica_metatype _graphODE, modelica_metatype _cutNodesIn, modelica_metatype _graphDAE, modelica_metatype _odeMap, modelica_metatype *out_cutNodesOut);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_cutTaskGraph2,2,0) {(void*) boxptr_HpcOmTaskGraph_cutTaskGraph2,0}};
#define boxvar_HpcOmTaskGraph_cutTaskGraph2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_cutTaskGraph2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_cutTaskGraph(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _exceptNodes, modelica_metatype _whenNodes, modelica_metatype *out_cutNodesOut);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_cutTaskGraph,2,0) {(void*) boxptr_HpcOmTaskGraph_cutTaskGraph,0}};
#define boxvar_HpcOmTaskGraph_cutTaskGraph MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_cutTaskGraph)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getStates(threadData_t *threadData, modelica_metatype _inVarLst, modelica_metatype _stateVarsIn, modelica_integer _Idx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getStates(threadData_t *threadData, modelica_metatype _inVarLst, modelica_metatype _stateVarsIn, modelica_metatype _Idx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getStates,2,0) {(void*) boxptr_HpcOmTaskGraph_getStates,0}};
#define boxvar_HpcOmTaskGraph_getStates MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getStates)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getAllStateNodes(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _varCompMapping, modelica_metatype _inComps, modelica_metatype _stateInfoIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getAllStateNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_getAllStateNodes,0}};
#define boxvar_HpcOmTaskGraph_getAllStateNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getAllStateNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateMappingTuple(threadData_t *threadData, modelica_integer _varIdx, modelica_integer _sccIdx, modelica_integer _iEqSysIdx, modelica_integer _iVarOffset, modelica_metatype _iMapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateMappingTuple(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _sccIdx, modelica_metatype _iEqSysIdx, modelica_metatype _iVarOffset, modelica_metatype _iMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateMappingTuple,2,0) {(void*) boxptr_HpcOmTaskGraph_updateMappingTuple,0}};
#define boxvar_HpcOmTaskGraph_updateMappingTuple MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateMappingTuple)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateMapping(threadData_t *threadData, modelica_integer _varIdx, modelica_integer _sccIdx, modelica_metatype _iMapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateMapping(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _sccIdx, modelica_metatype _iMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_updateMapping,0}};
#define boxvar_HpcOmTaskGraph_updateMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_othersInTearComp(threadData_t *threadData, modelica_metatype _otherEqnVarTpl, modelica_metatype _othersIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_othersInTearComp,2,0) {(void*) boxptr_HpcOmTaskGraph_othersInTearComp,0}};
#define boxvar_HpcOmTaskGraph_othersInTearComp MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_othersInTearComp)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSccNodeMapping1(threadData_t *threadData, modelica_integer _iCompIdx, modelica_metatype _iNodeMark, modelica_metatype _iArrayNodeIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSccNodeMapping1(threadData_t *threadData, modelica_metatype _iCompIdx, modelica_metatype _iNodeMark, modelica_metatype _iArrayNodeIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSccNodeMapping1,2,0) {(void*) boxptr_HpcOmTaskGraph_getSccNodeMapping1,0}};
#define boxvar_HpcOmTaskGraph_getSccNodeMapping1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSccNodeMapping1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSccNodeMapping0(threadData_t *threadData, modelica_metatype _iCompsOfNode, modelica_metatype _iNodeMarks, modelica_metatype _iArrayNodeIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSccNodeMapping0,2,0) {(void*) boxptr_HpcOmTaskGraph_getSccNodeMapping0,0}};
#define boxvar_HpcOmTaskGraph_getSccNodeMapping0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSccNodeMapping0)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getVarEqCompMapping0(threadData_t *threadData, modelica_metatype _component, modelica_metatype _varCompMapping, modelica_metatype _eqCompMapping, modelica_integer _iEqSysIdx, modelica_metatype _iVarEqOffset, modelica_integer _iSccIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarEqCompMapping0(threadData_t *threadData, modelica_metatype _component, modelica_metatype _varCompMapping, modelica_metatype _eqCompMapping, modelica_metatype _iEqSysIdx, modelica_metatype _iVarEqOffset, modelica_metatype _iSccIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarEqCompMapping0,2,0) {(void*) boxptr_HpcOmTaskGraph_getVarEqCompMapping0,0}};
#define boxvar_HpcOmTaskGraph_getVarEqCompMapping0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarEqCompMapping0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarEqCompMapping(threadData_t *threadData, modelica_metatype _components, modelica_integer _iEqSysIdx, modelica_integer _iVarIdxOffset, modelica_integer _iEqIdxOffset, modelica_metatype _ivarCompMapping, modelica_metatype _ieqCompMapping, modelica_metatype *out_oeqCompMapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarEqCompMapping(threadData_t *threadData, modelica_metatype _components, modelica_metatype _iEqSysIdx, modelica_metatype _iVarIdxOffset, modelica_metatype _iEqIdxOffset, modelica_metatype _ivarCompMapping, modelica_metatype _ieqCompMapping, modelica_metatype *out_oeqCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarEqCompMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_getVarEqCompMapping,0}};
#define boxvar_HpcOmTaskGraph_getVarEqCompMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarEqCompMapping)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareIntTuple2(threadData_t *threadData, modelica_metatype _tuple1, modelica_metatype _tuple2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareIntTuple2(threadData_t *threadData, modelica_metatype _tuple1, modelica_metatype _tuple2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareIntTuple2,2,0) {(void*) boxptr_HpcOmTaskGraph_compareIntTuple2,0}};
#define boxvar_HpcOmTaskGraph_compareIntTuple2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareIntTuple2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarTuple(threadData_t *threadData, modelica_integer _varIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarTuple(threadData_t *threadData, modelica_metatype _varIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarTuple,2,0) {(void*) boxptr_HpcOmTaskGraph_getVarTuple,0}};
#define boxvar_HpcOmTaskGraph_getVarTuple MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarTuple)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarsByEqns(threadData_t *threadData, modelica_metatype _iEqnIdc, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarsByEqns(threadData_t *threadData, modelica_metatype _iEqnIdc, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarsByEqns,2,0) {(void*) boxptr_HpcOmTaskGraph_getVarsByEqns,0}};
#define boxvar_HpcOmTaskGraph_getVarsByEqns MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarsByEqns)
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_tuple3ToString(threadData_t *threadData, modelica_metatype _inTuple);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_tuple3ToString,2,0) {(void*) boxptr_HpcOmTaskGraph_tuple3ToString,0}};
#define boxvar_HpcOmTaskGraph_tuple3ToString MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_tuple3ToString)
PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_tupleToString(threadData_t *threadData, modelica_metatype _inTuple);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_tupleToString,2,0) {(void*) boxptr_HpcOmTaskGraph_tupleToString,0}};
#define boxvar_HpcOmTaskGraph_tupleToString MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_tupleToString)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarsBySCC,2,0) {(void*) boxptr_HpcOmTaskGraph_getVarsBySCC,0}};
#define boxvar_HpcOmTaskGraph_getVarsBySCC MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getVarsBySCC)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareTupleByVarIdx(threadData_t *threadData, modelica_integer _varIdx, modelica_metatype _var2Idx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareTupleByVarIdx(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _var2Idx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareTupleByVarIdx,2,0) {(void*) boxptr_HpcOmTaskGraph_compareTupleByVarIdx,0}};
#define boxvar_HpcOmTaskGraph_compareTupleByVarIdx MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_compareTupleByVarIdx)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_isTupleMember(threadData_t *threadData, modelica_metatype _inTuple, modelica_metatype _varIdc);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_isTupleMember(threadData_t *threadData, modelica_metatype _inTuple, modelica_metatype _varIdc);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_isTupleMember,2,0) {(void*) boxptr_HpcOmTaskGraph_isTupleMember,0}};
#define boxvar_HpcOmTaskGraph_isTupleMember MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_isTupleMember)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_removeEventVars(threadData_t *threadData, modelica_metatype _eventVarLst, modelica_metatype _varLstIn, modelica_integer _varIdx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_removeEventVars(threadData_t *threadData, modelica_metatype _eventVarLst, modelica_metatype _varLstIn, modelica_metatype _varIdx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeEventVars,2,0) {(void*) boxptr_HpcOmTaskGraph_removeEventVars,0}};
#define boxvar_HpcOmTaskGraph_removeEventVars MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_removeEventVars)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC2(threadData_t *threadData, modelica_metatype _iVarType, modelica_metatype _iVarIdx, modelica_metatype _iUnsolvedVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC2,2,0) {(void*) boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC2,0}};
#define boxvar_HpcOmTaskGraph_getUnsolvedVarsBySCC2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC1(threadData_t *threadData, modelica_metatype _iVarIdx, modelica_metatype _orderedVars, modelica_metatype _iUnsolvedVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC1,2,0) {(void*) boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC1,0}};
#define boxvar_HpcOmTaskGraph_getUnsolvedVarsBySCC1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iVarIdc, modelica_metatype _iEventVarLst, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iVarIdc, modelica_metatype _iEventVarLst, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC0,2,0) {(void*) boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC0,0}};
#define boxvar_HpcOmTaskGraph_getUnsolvedVarsBySCC0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC0)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iEventVarLst, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iEventVarLst, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC,2,0) {(void*) boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC,0}};
#define boxvar_HpcOmTaskGraph_getUnsolvedVarsBySCC MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getUnsolvedVarsBySCC)
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_fillRequiredSccs(threadData_t *threadData, modelica_metatype _var, modelica_integer _varType, modelica_metatype _varMapping, modelica_metatype _requiredSccs);
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_fillRequiredSccs(threadData_t *threadData, modelica_metatype _var, modelica_metatype _varType, modelica_metatype _varMapping, modelica_metatype _requiredSccs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_fillRequiredSccs,2,0) {(void*) boxptr_HpcOmTaskGraph_fillRequiredSccs,0}};
#define boxvar_HpcOmTaskGraph_fillRequiredSccs MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_fillRequiredSccs)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_isWhenEquation(threadData_t *threadData, modelica_metatype _inComp);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_isWhenEquation(threadData_t *threadData, modelica_metatype _inComp);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_isWhenEquation,2,0) {(void*) boxptr_HpcOmTaskGraph_isWhenEquation,0}};
#define boxvar_HpcOmTaskGraph_isWhenEquation MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_isWhenEquation)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getArrayTuple31(threadData_t *threadData, modelica_metatype _list1, modelica_metatype _assign);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getArrayTuple31,2,0) {(void*) boxptr_HpcOmTaskGraph_getArrayTuple31,0}};
#define boxvar_HpcOmTaskGraph_getArrayTuple31 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getArrayTuple31)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventNodeEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_integer _offset, modelica_metatype _eventEqsIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getEventNodeEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_metatype _offset, modelica_metatype _eventEqsIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventNodeEqs1,2,0) {(void*) boxptr_HpcOmTaskGraph_getEventNodeEqs1,0}};
#define boxvar_HpcOmTaskGraph_getEventNodeEqs1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventNodeEqs1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventNodeEqs(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eventInfoIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventNodeEqs,2,0) {(void*) boxptr_HpcOmTaskGraph_getEventNodeEqs,0}};
#define boxvar_HpcOmTaskGraph_getEventNodeEqs MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventNodeEqs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventNodes(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eqCompMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventNodes,2,0) {(void*) boxptr_HpcOmTaskGraph_getEventNodes,0}};
#define boxvar_HpcOmTaskGraph_getEventNodes MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEventNodes)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_shortenVarString(threadData_t *threadData, modelica_metatype _iString);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_shortenVarString,2,0) {(void*) boxptr_HpcOmTaskGraph_shortenVarString,0}};
#define boxvar_HpcOmTaskGraph_shortenVarString MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_shortenVarString)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEquationStrings2(threadData_t *threadData, modelica_metatype _comp, modelica_metatype _iEqSystem, modelica_metatype _iEqDesc);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEquationStrings2,2,0) {(void*) boxptr_HpcOmTaskGraph_getEquationStrings2,0}};
#define boxvar_HpcOmTaskGraph_getEquationStrings2 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEquationStrings2)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEquationStrings(threadData_t *threadData, modelica_metatype _iComps, modelica_metatype _iEqSystem);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEquationStrings,2,0) {(void*) boxptr_HpcOmTaskGraph_getEquationStrings,0}};
#define boxvar_HpcOmTaskGraph_getEquationStrings MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getEquationStrings)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_fillAdjacencyList(threadData_t *threadData, modelica_metatype _adjLstIn, modelica_integer _childNode, modelica_metatype _parentLst, modelica_integer _Idx);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_fillAdjacencyList(threadData_t *threadData, modelica_metatype _adjLstIn, modelica_metatype _childNode, modelica_metatype _parentLst, modelica_metatype _Idx);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_fillAdjacencyList,2,0) {(void*) boxptr_HpcOmTaskGraph_fillAdjacencyList,0}};
#define boxvar_HpcOmTaskGraph_fillAdjacencyList MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_fillAdjacencyList)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCostBySccRef1(threadData_t *threadData, modelica_metatype _iEdgeSource, modelica_integer _iEdgeTarget, modelica_metatype _iCommCosts);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCostBySccRef1(threadData_t *threadData, modelica_metatype _iEdgeSource, modelica_metatype _iEdgeTarget, modelica_metatype _iCommCosts);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCostBySccRef1,2,0) {(void*) boxptr_HpcOmTaskGraph_updateCommCostBySccRef1,0}};
#define boxvar_HpcOmTaskGraph_updateCommCostBySccRef1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCostBySccRef1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCommunicationObject(threadData_t *threadData, modelica_metatype _iTuple, modelica_real _requiredTime);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createCommunicationObject(threadData_t *threadData, modelica_metatype _iTuple, modelica_metatype _requiredTime);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCommunicationObject,2,0) {(void*) boxptr_HpcOmTaskGraph_createCommunicationObject,0}};
#define boxvar_HpcOmTaskGraph_createCommunicationObject MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createCommunicationObject)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCostBySccRef(threadData_t *threadData, modelica_metatype _requiredSccs_RefCount, modelica_integer _nodeIdx, modelica_metatype _iCommCosts, modelica_metatype *out_oNodeComms);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCostBySccRef(threadData_t *threadData, modelica_metatype _requiredSccs_RefCount, modelica_metatype _nodeIdx, modelica_metatype _iCommCosts, modelica_metatype *out_oNodeComms);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCostBySccRef,2,0) {(void*) boxptr_HpcOmTaskGraph_updateCommCostBySccRef,0}};
#define boxvar_HpcOmTaskGraph_updateCommCostBySccRef MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCostBySccRef)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createRequiredSccsRefCount(threadData_t *threadData, modelica_metatype _requiredSccs);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createRequiredSccsRefCount,2,0) {(void*) boxptr_HpcOmTaskGraph_createRequiredSccsRefCount,0}};
#define boxvar_HpcOmTaskGraph_createRequiredSccsRefCount MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createRequiredSccsRefCount)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createTaskGraph1(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iSystInfo, modelica_metatype _iVarInfo, modelica_boolean _iAnalyzeParameters, modelica_metatype _graphInfoIn);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createTaskGraph1(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iSystInfo, modelica_metatype _iVarInfo, modelica_metatype _iAnalyzeParameters, modelica_metatype _graphInfoIn);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createTaskGraph1,2,0) {(void*) boxptr_HpcOmTaskGraph_createTaskGraph1,0}};
#define boxvar_HpcOmTaskGraph_createTaskGraph1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_createTaskGraph1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateTaskGraphSystem(threadData_t *threadData, modelica_metatype _graphRowIn, modelica_integer _idxOffset);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateTaskGraphSystem(threadData_t *threadData, modelica_metatype _graphRowIn, modelica_metatype _idxOffset);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateTaskGraphSystem,2,0) {(void*) boxptr_HpcOmTaskGraph_updateTaskGraphSystem,0}};
#define boxvar_HpcOmTaskGraph_updateTaskGraphSystem MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateTaskGraphSystem)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCosts1(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_integer _idxOffset);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCosts1(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_metatype _idxOffset);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCosts1,2,0) {(void*) boxptr_HpcOmTaskGraph_updateCommCosts1,0}};
#define boxvar_HpcOmTaskGraph_updateCommCosts1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCosts1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCosts(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_integer _idxOffset);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCosts(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_metatype _idxOffset);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCosts,2,0) {(void*) boxptr_HpcOmTaskGraph_updateCommCosts,0}};
#define boxvar_HpcOmTaskGraph_updateCommCosts MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_updateCommCosts)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_modifyMapping(threadData_t *threadData, modelica_metatype _iMappingTuple, modelica_integer _iOffset);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_modifyMapping(threadData_t *threadData, modelica_metatype _iMappingTuple, modelica_metatype _iOffset);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_modifyMapping,2,0) {(void*) boxptr_HpcOmTaskGraph_modifyMapping,0}};
#define boxvar_HpcOmTaskGraph_modifyMapping MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_modifyMapping)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_taskGraphAppend(threadData_t *threadData, modelica_metatype _graph1In, modelica_metatype _graphData1In, modelica_metatype _graph2In, modelica_metatype _graphData2In, modelica_metatype *out_graphDataOut);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_taskGraphAppend,2,0) {(void*) boxptr_HpcOmTaskGraph_taskGraphAppend,0}};
#define boxvar_HpcOmTaskGraph_taskGraphAppend MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_taskGraphAppend)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNumberOfEqSystemComponents(threadData_t *threadData, modelica_metatype _iEqSystem, modelica_integer _iNumOfComps);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNumberOfEqSystemComponents(threadData_t *threadData, modelica_metatype _iEqSystem, modelica_metatype _iNumOfComps);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNumberOfEqSystemComponents,2,0) {(void*) boxptr_HpcOmTaskGraph_getNumberOfEqSystemComponents,0}};
#define boxvar_HpcOmTaskGraph_getNumberOfEqSystemComponents MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNumberOfEqSystemComponents)
PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNumberOfSystemComponents(threadData_t *threadData, modelica_metatype _iDae);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNumberOfSystemComponents(threadData_t *threadData, modelica_metatype _iDae);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNumberOfSystemComponents,2,0) {(void*) boxptr_HpcOmTaskGraph_getNumberOfSystemComponents,0}};
#define boxvar_HpcOmTaskGraph_getNumberOfSystemComponents MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getNumberOfSystemComponents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSystemComponents1(threadData_t *threadData, modelica_metatype _icomp, modelica_metatype _isyst, modelica_integer _isystIdx, modelica_metatype _iMapping);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSystemComponents1(threadData_t *threadData, modelica_metatype _icomp, modelica_metatype _isyst, modelica_metatype _isystIdx, modelica_metatype _iMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSystemComponents1,2,0) {(void*) boxptr_HpcOmTaskGraph_getSystemComponents1,0}};
#define boxvar_HpcOmTaskGraph_getSystemComponents1 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSystemComponents1)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSystemComponents0(threadData_t *threadData, modelica_metatype _iSyst, modelica_metatype _iSystMapping);
static const MMC_DEFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSystemComponents0,2,0) {(void*) boxptr_HpcOmTaskGraph_getSystemComponents0,0}};
#define boxvar_HpcOmTaskGraph_getSystemComponents0 MMC_REFSTRUCTLIT(boxvar_lit_HpcOmTaskGraph_getSystemComponents0)

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_dumpSccSimEqMapping2(threadData_t *threadData, modelica_integer _iIndex, modelica_string _iText)
{
  modelica_string _oText = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oText has no default value.
  tmpMeta1 = stringAppend(_iText,intString(_iIndex));
  tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT0);
  _oText = tmpMeta2;
  _return: OMC_LABEL_UNUSED
  return _oText;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_dumpSccSimEqMapping2(threadData_t *threadData, modelica_metatype _iIndex, modelica_metatype _iText)
{
  modelica_integer tmp1;
  modelica_string _oText = NULL;
  tmp1 = mmc_unbox_integer(_iIndex);
  _oText = omc_HpcOmTaskGraph_dumpSccSimEqMapping2(threadData, tmp1, _iText);
  /* skip box _oText; String */
  return _oText;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_dumpSccSimEqMapping1(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _iIndexText)
{
  modelica_metatype _oIndexText = NULL;
  modelica_integer _iIndex;
  modelica_string _text = NULL;
  modelica_string _iText = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oIndexText has no default value.
  // _iIndex has no default value.
  // _text has no default value.
  // _iText has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iIndexText;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _iIndex = tmp3  /* pattern as ty=Integer */;
  _iText = tmpMeta4;

  _text = omc_List_fold(threadData, _iMapping, boxvar_HpcOmTaskGraph_dumpSccSimEqMapping2, _OMC_LIT0);

  tmpMeta5 = stringAppend(_iText,_OMC_LIT1);
  tmpMeta6 = stringAppend(tmpMeta5,intString(_iIndex));
  tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT2);
  tmpMeta8 = stringAppend(tmpMeta7,_text);
  tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT3);
  _text = tmpMeta9;

  tmpMeta10 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _iIndex), _text);
  _oIndexText = tmpMeta10;
  _return: OMC_LABEL_UNUSED
  return _oIndexText;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpSccSimEqMapping(threadData_t *threadData, modelica_metatype _iSccMapping)
{
  modelica_string _text = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _text has no default value.
  _text = _OMC_LIT4;

  /* Pattern-matching assignment */
  tmpMeta1 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1)), _text);
  tmpMeta2 = omc_Array_fold(threadData, _iSccMapping, boxvar_HpcOmTaskGraph_dumpSccSimEqMapping1, tmpMeta1);
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
  _text = tmpMeta3;

  tmpMeta4 = stringAppend(_text,_OMC_LIT5);
  fputs(MMC_STRINGDATA(tmpMeta4),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_dumpSimEqSCCMapping1(threadData_t *threadData, modelica_integer _iMapping, modelica_metatype _iIndexText)
{
  modelica_metatype _oIndexText = NULL;
  modelica_integer _iIndex;
  modelica_string _text = NULL;
  modelica_string _iText = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oIndexText has no default value.
  // _iIndex has no default value.
  // _text has no default value.
  // _iText has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iIndexText;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _iIndex = tmp3  /* pattern as ty=Integer */;
  _iText = tmpMeta4;

  _text = intString(_iMapping);

  tmpMeta5 = stringAppend(_iText,_OMC_LIT6);
  tmpMeta6 = stringAppend(tmpMeta5,intString(_iIndex));
  tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT2);
  tmpMeta8 = stringAppend(tmpMeta7,_text);
  tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT3);
  _text = tmpMeta9;

  tmpMeta10 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _iIndex), _text);
  _oIndexText = tmpMeta10;
  _return: OMC_LABEL_UNUSED
  return _oIndexText;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_dumpSimEqSCCMapping1(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _iIndexText)
{
  modelica_integer tmp1;
  modelica_metatype _oIndexText = NULL;
  tmp1 = mmc_unbox_integer(_iMapping);
  _oIndexText = omc_HpcOmTaskGraph_dumpSimEqSCCMapping1(threadData, tmp1, _iIndexText);
  /* skip box _oIndexText; tuple<#Integer, String> */
  return _oIndexText;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpSimEqSCCMapping(threadData_t *threadData, modelica_metatype _iSccMapping)
{
  modelica_string _text = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _text has no default value.
  _text = _OMC_LIT7;

  /* Pattern-matching assignment */
  tmpMeta1 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1)), _text);
  tmpMeta2 = omc_Array_fold(threadData, _iSccMapping, boxvar_HpcOmTaskGraph_dumpSimEqSCCMapping1, tmpMeta1);
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
  _text = tmpMeta3;

  tmpMeta4 = stringAppend(_text,_OMC_LIT5);
  fputs(MMC_STRINGDATA(tmpMeta4),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqsByTaskList0(threadData_t *threadData, modelica_metatype _iTask, modelica_metatype _iSimEqIdxSimEqMapping)
{
  modelica_metatype _oSimEqs = NULL;
  modelica_metatype _eqIdc = NULL;
  modelica_metatype _tmpSimEqs = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSimEqs has no default value.
  // _eqIdc has no default value.
  // _tmpSimEqs has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iTask;
    {
      int tmp4;
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_1))) {
        case 4: {
          modelica_metatype tmpMeta5;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,6) == 0) goto tmp3_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          _eqIdc = tmpMeta5;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_List_map1r(threadData, _eqIdc, boxvar_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping, _iSimEqIdxSimEqMapping);
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,3) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _eqIdc = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_List_map1r(threadData, _eqIdc, boxvar_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping, _iSimEqIdxSimEqMapping);
          goto tmp3_done;
        }
        default:
        tmp3_default: OMC_LABEL_UNUSED; {
          modelica_metatype tmpMeta7;
          
          /* Pattern matching succeeded */
          tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oSimEqs = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oSimEqs;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqsByTaskList(threadData_t *threadData, modelica_metatype _iTaskList, modelica_metatype _iSimEqIdxSimEqMapping)
{
  modelica_metatype _oSimEqs = NULL;
  modelica_metatype _tmpSimEqs = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSimEqs has no default value.
  // _tmpSimEqs has no default value.
  _tmpSimEqs = omc_List_map1(threadData, _iTaskList, boxvar_HpcOmTaskGraph_getSimCodeEqsByTaskList0, _iSimEqIdxSimEqMapping);

  _oSimEqs = omc_List_flatten(threadData, _tmpSimEqs);
  _return: OMC_LABEL_UNUSED
  return _oSimEqs;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getIndexBySimCodeEq(threadData_t *threadData, modelica_metatype _iEq, modelica_integer *out_oIdx2)
{
  modelica_integer _oIdx;
  modelica_integer _oIdx2;
  modelica_integer _index;
  modelica_integer _index2;
  modelica_integer tmp1_c0 __attribute__((unused)) = 0;
  modelica_integer tmp1_c1 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oIdx has no default value.
  // _oIdx2 has no default value.
  // _index has no default value.
  // _index2 has no default value.
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iEq;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 14; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          
          _index = tmp7  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,5) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          
          _index = tmp9  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,6) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          
          _index = tmp11  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,5) == 0) goto tmp3_end;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          
          _index = tmp13  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,9,5) == 0) goto tmp3_end;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp15 = mmc_unbox_integer(tmpMeta14);
          
          _index = tmp15  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta16;
          modelica_integer tmp17;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,10,3) == 0) goto tmp3_end;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp17 = mmc_unbox_integer(tmpMeta16);
          
          _index = tmp17  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
          tmp20 = mmc_unbox_integer(tmpMeta19);
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (!optionNone(tmpMeta21)) goto tmp3_end;
          
          _index = tmp20  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_integer tmp24;
          modelica_metatype tmpMeta25;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
          tmp24 = mmc_unbox_integer(tmpMeta23);
          tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (!optionNone(tmpMeta25)) goto tmp3_end;
          
          _index = tmp24  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_integer tmp28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_integer tmp32;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,12,3) == 0) goto tmp3_end;
          tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
          tmp28 = mmc_unbox_integer(tmpMeta27);
          tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (optionNone(tmpMeta29)) goto tmp3_end;
          tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta29), 1));
          tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
          tmp32 = mmc_unbox_integer(tmpMeta31);
          
          _index = tmp28  /* pattern as ty=Integer */;
          _index2 = tmp32  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = _index2;
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_integer tmp35;
          modelica_metatype tmpMeta36;
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta38;
          modelica_integer tmp39;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,3) == 0) goto tmp3_end;
          tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta33), 2));
          tmp35 = mmc_unbox_integer(tmpMeta34);
          tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (optionNone(tmpMeta36)) goto tmp3_end;
          tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta36), 1));
          tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 2));
          tmp39 = mmc_unbox_integer(tmpMeta38);
          
          _index = tmp35  /* pattern as ty=Integer */;
          _index2 = tmp39  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = _index2;
          goto tmp3_done;
        }
        case 10: {
          modelica_metatype tmpMeta40;
          modelica_integer tmp41;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,14,6) == 0) goto tmp3_end;
          tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp41 = mmc_unbox_integer(tmpMeta40);
          
          _index = tmp41  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 11: {
          modelica_metatype tmpMeta42;
          modelica_integer tmp43;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,15,7) == 0) goto tmp3_end;
          tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp43 = mmc_unbox_integer(tmpMeta42);
          
          _index = tmp43  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 12: {
          modelica_metatype tmpMeta44;
          modelica_integer tmp45;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,18,2) == 0) goto tmp3_end;
          tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp45 = mmc_unbox_integer(tmpMeta44);
          _index = tmp45  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmp1_c0 = _index;
          tmp1_c1 = ((modelica_integer) 0);
          goto tmp3_done;
        }
        case 13: {
          
          /* Pattern matching succeeded */
          omc_Error_addInternalError(threadData, _OMC_LIT8, _OMC_LIT10);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oIdx = tmp1_c0;
  _oIdx2 = tmp1_c1;
  _return: OMC_LABEL_UNUSED
  if (out_oIdx2) { *out_oIdx2 = _oIdx2; }
  return _oIdx;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getIndexBySimCodeEq(threadData_t *threadData, modelica_metatype _iEq, modelica_metatype *out_oIdx2)
{
  modelica_integer _oIdx2;
  modelica_integer _oIdx;
  modelica_metatype out_oIdx;
  _oIdx = omc_HpcOmTaskGraph_getIndexBySimCodeEq(threadData, _iEq, &_oIdx2);
  out_oIdx = mmc_mk_icon(_oIdx);
  if (out_oIdx2) { *out_oIdx2 = mmc_mk_icon(_oIdx2); }
  return out_oIdx;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqByIndex(threadData_t *threadData, modelica_metatype _iEqs, modelica_integer _iIdx)
{
  modelica_metatype _oEq = NULL;
  modelica_metatype _rest = NULL;
  modelica_metatype _head = NULL;
  modelica_integer _headIdx;
  modelica_integer _headIdx2;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oEq has no default value.
  // _rest has no default value.
  // _head has no default value.
  // _headIdx has no default value.
  // _headIdx2 has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iEqs;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_boolean tmp8;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          _head = tmpMeta6;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          _headIdx = omc_HpcOmTaskGraph_getIndexBySimCodeEq(threadData, _head ,&_headIdx2);

          /* Pattern-matching assignment */
          tmp8 = ((_headIdx == _iIdx) || (_headIdx2 == _iIdx));
          if (1 /* true */ != tmp8) goto goto_2;
          tmpMeta1 = _head;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta9 = MMC_CAR(tmp4_1);
          tmpMeta10 = MMC_CDR(tmp4_1);
          _head = tmpMeta9;
          _rest = tmpMeta10;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_HpcOmTaskGraph_getSimCodeEqByIndex(threadData, _rest, _iIdx);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          
          /* Pattern matching succeeded */
          tmpMeta11 = stringAppend(_OMC_LIT11,intString(_iIdx));
          tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT5);
          fputs(MMC_STRINGDATA(tmpMeta12),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oEq = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oEq;
}
modelica_metatype boxptr_HpcOmTaskGraph_getSimCodeEqByIndex(threadData_t *threadData, modelica_metatype _iEqs, modelica_metatype _iIdx)
{
  modelica_integer tmp1;
  modelica_metatype _oEq = NULL;
  tmp1 = mmc_unbox_integer(_iIdx);
  _oEq = omc_HpcOmTaskGraph_getSimCodeEqByIndex(threadData, _iEqs, tmp1);
  /* skip box _oEq; SimCode.SimEqSystem */
  return _oEq;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1(threadData_t *threadData, modelica_metatype _iSimEqSystem, modelica_integer _iIdx)
{
  modelica_metatype _oSimEqSystem = NULL;
  modelica_metatype _tmpSys = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSimEqSystem has no default value.
  // _tmpSys has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iSimEqSystem;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (optionNone(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          _tmpSys = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _tmpSys;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          
          /* Pattern matching succeeded */
          tmpMeta7 = stringAppend(_OMC_LIT12,intString(_iIdx));
          tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT5);
          fputs(MMC_STRINGDATA(tmpMeta8),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oSimEqSystem = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oSimEqSystem;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1(threadData_t *threadData, modelica_metatype _iSimEqSystem, modelica_metatype _iIdx)
{
  modelica_integer tmp1;
  modelica_metatype _oSimEqSystem = NULL;
  tmp1 = mmc_unbox_integer(_iIdx);
  _oSimEqSystem = omc_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1(threadData, _iSimEqSystem, tmp1);
  /* skip box _oSimEqSystem; SimCode.SimEqSystem */
  return _oSimEqSystem;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping(threadData_t *threadData, modelica_metatype _iSimEqIdxSimEqMapping, modelica_integer _iIdx)
{
  modelica_metatype _oSimEqSystem = NULL;
  modelica_metatype _tmpSimEqSystem = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSimEqSystem has no default value.
  // _tmpSimEqSystem has no default value.
  _tmpSimEqSystem = arrayGet(_iSimEqIdxSimEqMapping, _iIdx);

  _oSimEqSystem = omc_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping1(threadData, _tmpSimEqSystem, _iIdx);
  _return: OMC_LABEL_UNUSED
  return _oSimEqSystem;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping(threadData_t *threadData, modelica_metatype _iSimEqIdxSimEqMapping, modelica_metatype _iIdx)
{
  modelica_integer tmp1;
  modelica_metatype _oSimEqSystem = NULL;
  tmp1 = mmc_unbox_integer(_iIdx);
  _oSimEqSystem = omc_HpcOmTaskGraph_getSimCodeEqByIndexAndMapping(threadData, _iSimEqIdxSimEqMapping, tmp1);
  /* skip box _oSimEqSystem; SimCode.SimEqSystem */
  return _oSimEqSystem;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimEqIdxSimEqMapping1(threadData_t *threadData, modelica_metatype _iEquation, modelica_metatype _iMapping)
{
  modelica_metatype _oMapping = NULL;
  modelica_integer _simEqIdx;
  modelica_metatype _tmpMapping = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  // _simEqIdx has no default value.
  // _tmpMapping has no default value.
  { /* matchcontinue expression */
    {
      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: {
          /* Pattern matching succeeded */
          _simEqIdx = omc_HpcOmTaskGraph_getIndexBySimCodeEq(threadData, _iEquation, NULL);
          tmpMeta1 = arrayUpdate(_iMapping, _simEqIdx, mmc_mk_some(_iEquation));
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          _simEqIdx = omc_HpcOmTaskGraph_getIndexBySimCodeEq(threadData, _iEquation, NULL);
          tmpMeta1 = _iMapping;
          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:;
    }
  }
  _oMapping = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimEqIdxSimEqMapping(threadData_t *threadData, modelica_metatype _iAllEquations, modelica_integer _iSimEqSystemHighestIdx)
{
  modelica_metatype _oMapping = NULL;
  modelica_metatype _tmpMapping = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  // _tmpMapping has no default value.
  _tmpMapping = arrayCreate(_iSimEqSystemHighestIdx, mmc_mk_none());

  _oMapping = omc_List_fold(threadData, _iAllEquations, boxvar_HpcOmTaskGraph_getSimEqIdxSimEqMapping1, _tmpMapping);
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimEqIdxSimEqMapping(threadData_t *threadData, modelica_metatype _iAllEquations, modelica_metatype _iSimEqSystemHighestIdx)
{
  modelica_integer tmp1;
  modelica_metatype _oMapping = NULL;
  tmp1 = mmc_unbox_integer(_iSimEqSystemHighestIdx);
  _oMapping = omc_HpcOmTaskGraph_getSimEqIdxSimEqMapping(threadData, _iAllEquations, tmp1);
  /* skip box _oMapping; array<Option<SimCode.SimEqSystem>> */
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSimeqCompMapping1(threadData_t *threadData, modelica_metatype _iSimEqTuple, modelica_metatype _iMapping)
{
  modelica_metatype _oMapping = NULL;
  modelica_integer _simEqIdx;
  modelica_integer _sccIdx;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  // _simEqIdx has no default value.
  // _sccIdx has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iSimEqTuple;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  _simEqIdx = tmp3  /* pattern as ty=Integer */;
  _sccIdx = tmp5  /* pattern as ty=Integer */;

  _oMapping = arrayUpdate(_iMapping, _simEqIdx, mmc_mk_integer(_sccIdx));
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSimeqCompMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_integer _numOfSimEqs)
{
  modelica_metatype _oMapping = NULL;
  modelica_metatype _tmpMapping = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  // _tmpMapping has no default value.
  _tmpMapping = arrayCreate(_numOfSimEqs, mmc_mk_integer(((modelica_integer) -1)));

  _oMapping = omc_List_fold(threadData, _iMapping, boxvar_HpcOmTaskGraph_convertToSimeqCompMapping1, _tmpMapping);
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertToSimeqCompMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _numOfSimEqs)
{
  modelica_integer tmp1;
  modelica_metatype _oMapping = NULL;
  tmp1 = mmc_unbox_integer(_numOfSimEqs);
  _oMapping = omc_HpcOmTaskGraph_convertToSimeqCompMapping(threadData, _iMapping, tmp1);
  /* skip box _oMapping; array<#Integer> */
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSccSimEqMapping1(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _iSccMapping)
{
  modelica_metatype _oSccMapping = NULL;
  modelica_integer _i1;
  modelica_integer _i2;
  modelica_metatype _tmpList = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSccMapping has no default value.
  // _i1 has no default value.
  // _i2 has no default value.
  // _tmpList has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iMapping;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  _i1 = tmp3  /* pattern as ty=Integer */;
  _i2 = tmp5  /* pattern as ty=Integer */;

  _tmpList = arrayGet(_iSccMapping, _i2);

  tmpMeta6 = mmc_mk_cons(mmc_mk_integer(_i1), _tmpList);
  _tmpList = tmpMeta6;

  _oSccMapping = arrayUpdate(_iSccMapping, _i2, _tmpList);
  _return: OMC_LABEL_UNUSED
  return _oSccMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertToSccSimEqMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_integer _numOfSccs)
{
  modelica_metatype _oMapping = NULL;
  modelica_metatype _tmpMapping = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  // _tmpMapping has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _tmpMapping = arrayCreate(_numOfSccs, tmpMeta1);

  omc_List_fold(threadData, _iMapping, boxvar_HpcOmTaskGraph_convertToSccSimEqMapping1, _tmpMapping);

  _oMapping = _tmpMapping;
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertToSccSimEqMapping(threadData_t *threadData, modelica_metatype _iMapping, modelica_metatype _numOfSccs)
{
  modelica_integer tmp1;
  modelica_metatype _oMapping = NULL;
  tmp1 = mmc_unbox_integer(_numOfSccs);
  _oMapping = omc_HpcOmTaskGraph_convertToSccSimEqMapping(threadData, _iMapping, tmp1);
  /* skip box _oMapping; array<list<#Integer>> */
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_removeDummyStateFromMapping1(threadData_t *threadData, modelica_metatype _iTuple, modelica_metatype _iNewList)
{
  modelica_metatype _oNewList = NULL;
  modelica_integer _eqIdx;
  modelica_integer _sccIdx;
  modelica_metatype _newElem = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNewList has no default value.
  // _eqIdx has no default value.
  // _sccIdx has no default value.
  // _newElem has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iTuple;
    {
      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_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_boolean tmp10;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          _eqIdx = tmp7  /* pattern as ty=Integer */;
          _sccIdx = tmp9  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp10 = (_sccIdx == ((modelica_integer) 1));
          if (1 /* true */ != tmp10) goto goto_2;
          tmpMeta1 = _iNewList;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp12 = mmc_unbox_integer(tmpMeta11);
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          _eqIdx = tmp12  /* pattern as ty=Integer */;
          _sccIdx = tmp14  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta15 = mmc_mk_box2(0, mmc_mk_integer(_eqIdx), mmc_mk_integer(((modelica_integer) -1) + _sccIdx));
          _newElem = tmpMeta15;
          tmpMeta16 = mmc_mk_cons(_newElem, _iNewList);
          tmpMeta1 = tmpMeta16;
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT13),stdout);
          tmpMeta1 = _iNewList;
          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:;
    }
  }
  _oNewList = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oNewList;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_removeDummyStateFromMapping(threadData_t *threadData, modelica_metatype _iEquationSccMapping)
{
  modelica_metatype _oEquationSccMapping = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oEquationSccMapping has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _oEquationSccMapping = omc_List_fold(threadData, _iEquationSccMapping, boxvar_HpcOmTaskGraph_removeDummyStateFromMapping1, tmpMeta1);
  _return: OMC_LABEL_UNUSED
  return _oEquationSccMapping;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData_t *threadData, modelica_metatype _iEquationSccMapping, modelica_integer _iHighestIndex)
{
  modelica_integer _oIndex;
  modelica_integer _eqIdx;
  modelica_integer _sccIdx;
  modelica_metatype _rest = NULL;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oIndex has no default value.
  // _eqIdx has no default value.
  // _sccIdx has no default value.
  // _rest has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iEquationSccMapping;
    {
      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_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_boolean tmp12;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          _eqIdx = tmp9  /* pattern as ty=Integer */;
          _sccIdx = tmp11  /* pattern as ty=Integer */;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp12 = (_sccIdx > _iHighestIndex);
          if (1 /* true */ != tmp12) goto goto_2;
          tmp1 = omc_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData, _rest, _sccIdx);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_integer tmp16;
          modelica_metatype tmpMeta17;
          modelica_integer tmp18;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta13 = MMC_CAR(tmp4_1);
          tmpMeta14 = MMC_CDR(tmp4_1);
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 1));
          tmp16 = mmc_unbox_integer(tmpMeta15);
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
          tmp18 = mmc_unbox_integer(tmpMeta17);
          _eqIdx = tmp16  /* pattern as ty=Integer */;
          _sccIdx = tmp18  /* pattern as ty=Integer */;
          _rest = tmpMeta14;
          /* Pattern matching succeeded */
          tmp1 = omc_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData, _rest, _iHighestIndex);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmp1 = _iHighestIndex;
          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:;
    }
  }
  _oIndex = tmp1;
  _return: OMC_LABEL_UNUSED
  return _oIndex;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData_t *threadData, modelica_metatype _iEquationSccMapping, modelica_metatype _iHighestIndex)
{
  modelica_integer tmp1;
  modelica_integer _oIndex;
  modelica_metatype out_oIndex;
  tmp1 = mmc_unbox_integer(_iHighestIndex);
  _oIndex = omc_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData, _iEquationSccMapping, tmp1);
  out_oIndex = mmc_mk_icon(_oIndex);
  return out_oIndex;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_setUpHpcOmMapping(threadData_t *threadData, modelica_metatype _daeIn, modelica_metatype _simCodeIn, modelica_integer _lastEqMappingIdx, modelica_metatype _equationSccMappingIn, modelica_metatype *out_sccSimEqMapping, modelica_metatype *out_daeSccSimEqMapping)
{
  modelica_metatype _simeqCompMapping = NULL;
  modelica_metatype _sccSimEqMapping = NULL;
  modelica_metatype _daeSccSimEqMapping = NULL;
  modelica_integer _highestSccIdx;
  modelica_integer _compCountPlusDummy;
  modelica_metatype _equationSccMapping = NULL;
  modelica_metatype _equationSccMapping1 = NULL;
  modelica_metatype _allComps = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _simeqCompMapping has no default value.
  // _sccSimEqMapping has no default value.
  // _daeSccSimEqMapping has no default value.
  // _highestSccIdx has no default value.
  // _compCountPlusDummy has no default value.
  // _equationSccMapping has no default value.
  // _equationSccMapping1 has no default value.
  // _allComps has no default value.
  _allComps = omc_HpcOmTaskGraph_getSystemComponents(threadData, _daeIn, NULL);

  _highestSccIdx = omc_HpcOmTaskGraph_findHighestSccIdxInMapping(threadData, _equationSccMappingIn, ((modelica_integer) -1));

  _compCountPlusDummy = ((modelica_integer) 1) + listLength(_allComps);

  _equationSccMapping1 = omc_HpcOmTaskGraph_removeDummyStateFromMapping(threadData, _equationSccMappingIn);

  _equationSccMapping = ((_highestSccIdx == _compCountPlusDummy)?_equationSccMapping1:_equationSccMappingIn);

  _sccSimEqMapping = omc_HpcOmTaskGraph_convertToSccSimEqMapping(threadData, _equationSccMapping, listLength(_allComps));

  _simeqCompMapping = omc_HpcOmTaskGraph_convertToSimeqCompMapping(threadData, _equationSccMapping, _lastEqMappingIdx);

  _daeSccSimEqMapping = listArray(omc_List_map(threadData, omc_SimCodeUtil_getRemovedEquationSimEqSysIdxes(threadData, _simCodeIn), boxvar_List_create));

  _daeSccSimEqMapping = arrayAppend(_sccSimEqMapping, _daeSccSimEqMapping);
  _return: OMC_LABEL_UNUSED
  if (out_sccSimEqMapping) { *out_sccSimEqMapping = _sccSimEqMapping; }
  if (out_daeSccSimEqMapping) { *out_daeSccSimEqMapping = _daeSccSimEqMapping; }
  return _simeqCompMapping;
}
modelica_metatype boxptr_HpcOmTaskGraph_setUpHpcOmMapping(threadData_t *threadData, modelica_metatype _daeIn, modelica_metatype _simCodeIn, modelica_metatype _lastEqMappingIdx, modelica_metatype _equationSccMappingIn, modelica_metatype *out_sccSimEqMapping, modelica_metatype *out_daeSccSimEqMapping)
{
  modelica_integer tmp1;
  modelica_metatype _simeqCompMapping = NULL;
  tmp1 = mmc_unbox_integer(_lastEqMappingIdx);
  _simeqCompMapping = omc_HpcOmTaskGraph_setUpHpcOmMapping(threadData, _daeIn, _simCodeIn, tmp1, _equationSccMappingIn, out_sccSimEqMapping, out_daeSccSimEqMapping);
  /* skip box _simeqCompMapping; array<#Integer> */
  /* skip box _sccSimEqMapping; array<list<#Integer>> */
  /* skip box _daeSccSimEqMapping; array<list<#Integer>> */
  return _simeqCompMapping;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpPartitionData(threadData_t *threadData, modelica_metatype _partData)
{
  modelica_integer _numPartitions;
  modelica_integer _act;
  modelica_integer _part;
  modelica_integer _state;
  modelica_metatype _activatorsForPartitions = NULL;
  modelica_metatype _partitions = NULL;
  modelica_metatype _stateToActivators = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_integer tmp20;
  modelica_integer tmp21;
  modelica_integer tmp22;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _numPartitions has no default value.
  // _act has no default value.
  // _part has no default value.
  // _state has no default value.
  // _activatorsForPartitions has no default value.
  // _partitions has no default value.
  // _stateToActivators has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _partData;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  _numPartitions = tmp3  /* pattern as ty=Integer */;
  _partitions = tmpMeta4;
  _activatorsForPartitions = tmpMeta5;
  _stateToActivators = tmpMeta6;

  fputs(MMC_STRINGDATA(_OMC_LIT14),stdout);

  tmpMeta7 = stringAppend(intString(_numPartitions),_OMC_LIT15);
  fputs(MMC_STRINGDATA(tmpMeta7),stdout);

  _act = ((modelica_integer) 1);

  {
    modelica_metatype _state;
    for (tmpMeta8 = _stateToActivators; !listEmpty(tmpMeta8); tmpMeta8=MMC_CDR(tmpMeta8))
    {
      _state = MMC_CAR(tmpMeta8);
      tmpMeta9 = stringAppend(_OMC_LIT16,intString(_act));
      tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT17);
      tmpMeta11 = stringAppend(tmpMeta10,intString(mmc_unbox_integer(_state)));
      tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta12),stdout);

      _act = ((modelica_integer) 1) + _act;
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT5),stdout);

  tmp20 = ((modelica_integer) 1); tmp21 = 1; tmp22 = _numPartitions;
  if(!(((tmp21 > 0) && (tmp20 > tmp22)) || ((tmp21 < 0) && (tmp20 < tmp22))))
  {
    modelica_integer _part;
    for(_part = ((modelica_integer) 1); in_range_integer(_part, tmp20, tmp22); _part += tmp21)
    {
      tmpMeta14 = stringAppend(_OMC_LIT18,omc_HpcOmTaskGraph_intLstString(threadData, listGet(_activatorsForPartitions, _part)));
      tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT19);
      tmpMeta16 = stringAppend(tmpMeta15,omc_HpcOmTaskGraph_intLstString(threadData, omc_List_map1(threadData, listGet(_activatorsForPartitions, _part), boxvar_List_getIndexFirst, _stateToActivators)));
      tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT20);
      tmpMeta18 = stringAppend(tmpMeta17,omc_HpcOmTaskGraph_intLstString(threadData, listGet(_partitions, _part)));
      tmpMeta19 = stringAppend(tmpMeta18,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta19),stdout);
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpStateAssign(threadData_t *threadData, modelica_metatype _stateAssign)
{
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = stringAppend(_OMC_LIT21,stringDelimitList(omc_List_mapArray(threadData, _stateAssign, boxvar_HpcOmTaskGraph_intLstString), _OMC_LIT5));
  tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT5);
  fputs(MMC_STRINGDATA(tmpMeta2),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_appendToElementUnique(threadData_t *threadData, modelica_integer _inIndex, modelica_metatype _inElements, modelica_metatype _inArray)
{
  modelica_metatype _outArray = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outArray has no default value.
  _outArray = arrayUpdate(_inArray, _inIndex, omc_List_unique(threadData, listAppend(arrayGet(_inArray,_inIndex) /* DAE.ASUB */, _inElements)));
  _return: OMC_LABEL_UNUSED
  return _outArray;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_appendToElementUnique(threadData_t *threadData, modelica_metatype _inIndex, modelica_metatype _inElements, modelica_metatype _inArray)
{
  modelica_integer tmp1;
  modelica_metatype _outArray = NULL;
  tmp1 = mmc_unbox_integer(_inIndex);
  _outArray = omc_HpcOmTaskGraph_appendToElementUnique(threadData, tmp1, _inElements, _inArray);
  /* skip box _outArray; array<list<polymorphic<T>>> */
  return _outArray;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__assignTasksToStates(threadData_t *threadData, modelica_metatype _tasksPerLevel, modelica_metatype _stateTasks, modelica_metatype _odeGraphT)
{
  modelica_metatype _stateTaskAssignOut = NULL;
  modelica_integer _taskIdx;
  modelica_metatype _assignments = NULL;
  modelica_metatype _predecessors = 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
  // _stateTaskAssignOut has no default value.
  // _taskIdx has no default value.
  // _assignments has no default value.
  // _predecessors has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _stateTaskAssignOut = arrayCreate(arrayLength(_odeGraphT), tmpMeta1);

  _taskIdx = ((modelica_integer) 1);

  {
    modelica_metatype _task;
    for (tmpMeta2 = _stateTasks; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
    {
      _task = MMC_CAR(tmpMeta2);
      tmpMeta3 = mmc_mk_cons(mmc_mk_integer(_taskIdx), MMC_REFSTRUCTLIT(mmc_nil));
      _stateTaskAssignOut = arrayUpdate(_stateTaskAssignOut, mmc_unbox_integer(_task), tmpMeta3);

      _taskIdx = ((modelica_integer) 1) + _taskIdx;
    }
  }

  {
    modelica_metatype _levelTasks;
    for (tmpMeta5 = listReverse(_tasksPerLevel); !listEmpty(tmpMeta5); tmpMeta5=MMC_CDR(tmpMeta5))
    {
      _levelTasks = MMC_CAR(tmpMeta5);
      {
        modelica_metatype _task;
        for (tmpMeta6 = _levelTasks; !listEmpty(tmpMeta6); tmpMeta6=MMC_CDR(tmpMeta6))
        {
          _task = MMC_CAR(tmpMeta6);
          _assignments = arrayGet(_stateTaskAssignOut, mmc_unbox_integer(_task));

          _predecessors = arrayGet(_odeGraphT, mmc_unbox_integer(_task));

          _stateTaskAssignOut = omc_List_fold1(threadData, _predecessors, boxvar_HpcOmTaskGraph_appendToElementUnique, _assignments, _stateTaskAssignOut);
        }
      }
    }
  }

  _stateTaskAssignOut = omc_Array_map1(threadData, _stateTaskAssignOut, boxvar_List_sort, boxvar_intGt);
  _return: OMC_LABEL_UNUSED
  return _stateTaskAssignOut;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_hasSameStateAssign(threadData_t *threadData, modelica_integer _task, modelica_metatype _stateTaskAssign, modelica_metatype _refStateAssign)
{
  modelica_boolean _sameStateAssign;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _sameStateAssign has no default value.
  _sameStateAssign = omc_List_isEqual(threadData, arrayGet(_stateTaskAssign, _task), _refStateAssign, 1 /* true */);
  _return: OMC_LABEL_UNUSED
  return _sameStateAssign;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_hasSameStateAssign(threadData_t *threadData, modelica_metatype _task, modelica_metatype _stateTaskAssign, modelica_metatype _refStateAssign)
{
  modelica_integer tmp1;
  modelica_boolean _sameStateAssign;
  modelica_metatype out_sameStateAssign;
  tmp1 = mmc_unbox_integer(_task);
  _sameStateAssign = omc_HpcOmTaskGraph_hasSameStateAssign(threadData, tmp1, _stateTaskAssign, _refStateAssign);
  out_sameStateAssign = mmc_mk_icon(_sameStateAssign);
  return out_sameStateAssign;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_taskIsNotVisited(threadData_t *threadData, modelica_integer _task, modelica_metatype _visitedTasks)
{
  modelica_boolean _isNotVisited;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _isNotVisited has no default value.
  _isNotVisited = (((modelica_integer) -1) == mmc_unbox_integer(arrayGet(_visitedTasks, _task)));
  _return: OMC_LABEL_UNUSED
  return _isNotVisited;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_taskIsNotVisited(threadData_t *threadData, modelica_metatype _task, modelica_metatype _visitedTasks)
{
  modelica_integer tmp1;
  modelica_boolean _isNotVisited;
  modelica_metatype out_isNotVisited;
  tmp1 = mmc_unbox_integer(_task);
  _isNotVisited = omc_HpcOmTaskGraph_taskIsNotVisited(threadData, tmp1, _visitedTasks);
  out_isNotVisited = mmc_mk_icon(_isNotVisited);
  return out_isNotVisited;
}

static modelica_metatype closure0_HpcOmTaskGraph_hasSameStateAssign(threadData_t *thData, modelica_metatype closure, modelica_metatype task)
{
  modelica_metatype stateTaskAssign = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype refStateAssign = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_HpcOmTaskGraph_hasSameStateAssign(thData, task, stateTaskAssign, refStateAssign);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__getPartitionPredecessors(threadData_t *threadData, modelica_metatype _leavesIn, modelica_metatype _odeGraphT, modelica_metatype _stateTaskAssign, modelica_metatype _refStateAssign, modelica_metatype _visitedTasks, modelica_metatype *out_otherLeaveNodes)
{
  modelica_metatype _partitionTasks = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _otherLeaveNodes = NULL;
  modelica_metatype tmpMeta2;
  modelica_boolean _cont;
  modelica_integer _task;
  modelica_metatype _tasks = NULL;
  modelica_metatype _predecessors = NULL;
  modelica_metatype _samePartTasks = NULL;
  modelica_metatype _otherLeaves = NULL;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_integer tmp6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _partitionTasks = tmpMeta1;
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _otherLeaveNodes = tmpMeta2;
  // _cont has no default value.
  // _task has no default value.
  // _tasks has no default value.
  // _predecessors has no default value.
  // _samePartTasks has no default value.
  // _otherLeaves has no default value.
  _cont = 1 /* true */;

  _tasks = _leavesIn;

  while(1)
  {
    if(!_cont) break;
    /* Pattern-matching assignment */
    tmpMeta3 = _tasks;
    if (listEmpty(tmpMeta3)) MMC_THROW_INTERNAL();
    tmpMeta4 = MMC_CAR(tmpMeta3);
    tmpMeta5 = MMC_CDR(tmpMeta3);
    tmp6 = mmc_unbox_integer(tmpMeta4);
    _task = tmp6  /* pattern as ty=Integer */;
    _tasks = tmpMeta5;

    _predecessors = arrayGet(_odeGraphT, _task);

    _predecessors = omc_List_filter1OnTrue(threadData, _predecessors, boxvar_HpcOmTaskGraph_taskIsNotVisited, _visitedTasks);

    tmpMeta7 = mmc_mk_box2(0, _stateTaskAssign, _refStateAssign);
    _samePartTasks = omc_List_separateOnTrue(threadData, _predecessors, (modelica_fnptr) mmc_mk_box2(0,closure0_HpcOmTaskGraph_hasSameStateAssign,tmpMeta7) ,&_otherLeaves);

    tmpMeta8 = mmc_mk_cons(mmc_mk_integer(_task), _partitionTasks);
    _partitionTasks = tmpMeta8;

    _partitionTasks = listAppend(_samePartTasks, _partitionTasks);

    _tasks = listAppend(_samePartTasks, _tasks);

    _otherLeaveNodes = listAppend(_otherLeaves, _otherLeaveNodes);

    arrayUpdate(_visitedTasks, _task, mmc_mk_integer(((modelica_integer) 0)));

    omc_List_map2__0(threadData, _samePartTasks, boxvar_Array_updateIndexFirst, mmc_mk_integer(((modelica_integer) 0)), _visitedTasks);

    omc_List_map2__0(threadData, _otherLeaves, boxvar_Array_updateIndexFirst, mmc_mk_integer(((modelica_integer) 0)), _visitedTasks);

    if(listEmpty(_tasks))
    {
      _cont = 0 /* false */;
    }
  }

  _partitionTasks = omc_List_unique(threadData, _partitionTasks);

  _otherLeaveNodes = omc_List_unique(threadData, _otherLeaveNodes);
  _return: OMC_LABEL_UNUSED
  if (out_otherLeaveNodes) { *out_otherLeaveNodes = _otherLeaveNodes; }
  return _partitionTasks;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_multirate__dispatchLeaveNodes(threadData_t *threadData, modelica_metatype _tasksIn, modelica_metatype _stateTaskAssign, modelica_metatype _leaveNodesWithNassigns)
{
  modelica_integer _numAss;
  modelica_metatype _stateAss = NULL;
  modelica_metatype _leaveNodes = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _numAss has no default value.
  // _stateAss has no default value.
  // _leaveNodes has no default value.
  {
    modelica_metatype _task;
    for (tmpMeta1 = _tasksIn; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _task = MMC_CAR(tmpMeta1);
      _stateAss = arrayGet(_stateTaskAssign, mmc_unbox_integer(_task));

      _numAss = listLength(_stateAss);

      _leaveNodes = arrayGet(_leaveNodesWithNassigns, _numAss);

      tmpMeta2 = mmc_mk_cons(_task, _leaveNodes);
      _leaveNodes = tmpMeta2;

      arrayUpdate(_leaveNodesWithNassigns, _numAss, _leaveNodes);
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}

static modelica_metatype closure1_HpcOmTaskGraph_hasSameStateAssign(threadData_t *thData, modelica_metatype closure, modelica_metatype task)
{
  modelica_metatype stateTaskAssign = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype refStateAssign = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_HpcOmTaskGraph_hasSameStateAssign(thData, task, stateTaskAssign, refStateAssign);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__getPartitions(threadData_t *threadData, modelica_metatype _stateTaskAssign, modelica_metatype _stateTasks, modelica_metatype _odeGraphT)
{
  modelica_metatype _partitions = NULL;
  modelica_metatype tmpMeta1;
  modelica_integer _task;
  modelica_integer _numStates;
  modelica_integer _numAssigns;
  modelica_metatype _leaveNodes = NULL;
  modelica_metatype _predecessors = NULL;
  modelica_metatype _samePartTasks = NULL;
  modelica_metatype _partition = NULL;
  modelica_metatype _otherPartTasks = NULL;
  modelica_metatype _stateAss = NULL;
  modelica_metatype _visitedTasks = NULL;
  modelica_metatype _leaveNodesWithNassigns = NULL;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _partitions = tmpMeta1;
  // _task has no default value.
  // _numStates has no default value.
  // _numAssigns has no default value.
  // _leaveNodes has no default value.
  // _predecessors has no default value.
  // _samePartTasks has no default value.
  // _partition has no default value.
  // _otherPartTasks has no default value.
  // _stateAss has no default value.
  // _visitedTasks has no default value.
  // _leaveNodesWithNassigns has no default value.
  _visitedTasks = arrayCreate(arrayLength(_odeGraphT), mmc_mk_integer(((modelica_integer) -1)));

  _numStates = listLength(_stateTasks);

  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _leaveNodesWithNassigns = arrayCreate(_numStates, tmpMeta2);

  arrayUpdate(_leaveNodesWithNassigns, ((modelica_integer) 1), _stateTasks);

  {
    modelica_metatype _numAssigns;
    for (tmpMeta3 = omc_List_intRange(threadData, _numStates); !listEmpty(tmpMeta3); tmpMeta3=MMC_CDR(tmpMeta3))
    {
      _numAssigns = MMC_CAR(tmpMeta3);
      _leaveNodes = arrayGet(_leaveNodesWithNassigns, mmc_unbox_integer(_numAssigns));

      _leaveNodes = omc_List_unique(threadData, _leaveNodes);

      while(1)
      {
        if(!(!listEmpty(_leaveNodes))) break;
        _stateAss = arrayGet(_stateTaskAssign, mmc_unbox_integer(listHead(_leaveNodes)));

        tmpMeta4 = mmc_mk_box2(0, _stateTaskAssign, _stateAss);
        _samePartTasks = omc_List_separateOnTrue(threadData, _leaveNodes, (modelica_fnptr) mmc_mk_box2(0,closure1_HpcOmTaskGraph_hasSameStateAssign,tmpMeta4) ,&_leaveNodes);

        _partition = omc_HpcOmTaskGraph_multirate__getPartitionPredecessors(threadData, _samePartTasks, _odeGraphT, _stateTaskAssign, _stateAss, _visitedTasks ,&_otherPartTasks);

        _partition = omc_List_sort(threadData, _partition, boxvar_intGt);

        omc_HpcOmTaskGraph_multirate__dispatchLeaveNodes(threadData, _otherPartTasks, _stateTaskAssign, _leaveNodesWithNassigns);

        tmpMeta5 = mmc_mk_cons(_partition, _partitions);
        _partitions = tmpMeta5;
      }
    }
  }
  _return: OMC_LABEL_UNUSED
  return _partitions;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSimEqsIdxLstForSCCIdxLst(threadData_t *threadData, modelica_metatype _sccIdxs, modelica_metatype _sccSimEqMapping)
{
  modelica_metatype _simEqIdxs = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _simEqIdxs has no default value.
  _simEqIdxs = omc_List_map1(threadData, _sccIdxs, boxvar_HpcOmTaskGraph_getSimEqIdxForSCCIdx, _sccSimEqMapping);
  _return: OMC_LABEL_UNUSED
  return _simEqIdxs;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getSimEqIdxForSCCIdx(threadData_t *threadData, modelica_integer _sccIdx, modelica_metatype _sccSimEqMapping)
{
  modelica_integer _simEqIdx;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _simEqIdx has no default value.
  _simEqIdx = mmc_unbox_integer(listHead(arrayGet(_sccSimEqMapping, _sccIdx)));
  _return: OMC_LABEL_UNUSED
  return _simEqIdx;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSimEqIdxForSCCIdx(threadData_t *threadData, modelica_metatype _sccIdx, modelica_metatype _sccSimEqMapping)
{
  modelica_integer tmp1;
  modelica_integer _simEqIdx;
  modelica_metatype out_simEqIdx;
  tmp1 = mmc_unbox_integer(_sccIdx);
  _simEqIdx = omc_HpcOmTaskGraph_getSimEqIdxForSCCIdx(threadData, tmp1, _sccSimEqMapping);
  out_simEqIdx = mmc_mk_icon(_simEqIdx);
  return out_simEqIdx;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_varMappingTupleCompEqual(threadData_t *threadData, modelica_metatype _tpl, modelica_integer _compIdx)
{
  modelica_boolean _compEqual;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compEqual has no default value.
  _compEqual = (_compIdx == mmc_unbox_integer(omc_Util_tuple31(threadData, _tpl)));
  _return: OMC_LABEL_UNUSED
  return _compEqual;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_varMappingTupleCompEqual(threadData_t *threadData, modelica_metatype _tpl, modelica_metatype _compIdx)
{
  modelica_integer tmp1;
  modelica_boolean _compEqual;
  modelica_metatype out_compEqual;
  tmp1 = mmc_unbox_integer(_compIdx);
  _compEqual = omc_HpcOmTaskGraph_varMappingTupleCompEqual(threadData, _tpl, tmp1);
  out_compEqual = mmc_mk_icon(_compEqual);
  return out_compEqual;
}

static modelica_metatype closure2_HpcOmTaskGraph_varMappingTupleCompEqual(threadData_t *thData, modelica_metatype closure, modelica_metatype tpl)
{
  modelica_metatype compIdx = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_HpcOmTaskGraph_varMappingTupleCompEqual(thData, tpl, compIdx);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_multirate__orderStateTasksInSimVarStateOrder(threadData_t *threadData, modelica_metatype _stateTasks, modelica_metatype _taskGraphData, modelica_metatype _dae, modelica_metatype _simCode)
{
  modelica_metatype _orderedTasks = NULL;
  modelica_integer _state;
  modelica_integer _compIdx;
  modelica_integer _eqSysIdx;
  modelica_integer _offset;
  modelica_integer _varIdx;
  modelica_integer _simVarIdx;
  modelica_metatype _simVarIdxs = NULL;
  modelica_metatype _order = NULL;
  modelica_metatype _varMapTpl = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _var = NULL;
  modelica_metatype _eqSys = NULL;
  modelica_metatype _cref = NULL;
  modelica_metatype _simVar = NULL;
  modelica_metatype _eqSystems = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_integer tmp10;
  modelica_metatype tmpMeta11;
  modelica_integer tmp12;
  modelica_metatype tmpMeta13;
  modelica_integer tmp14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _orderedTasks has no default value.
  // _state has no default value.
  // _compIdx has no default value.
  // _eqSysIdx has no default value.
  // _offset has no default value.
  // _varIdx has no default value.
  // _simVarIdx has no default value.
  // _simVarIdxs has no default value.
  // _order has no default value.
  // _varMapTpl has no default value.
  // _varCompMapping has no default value.
  // _var has no default value.
  // _eqSys has no default value.
  // _cref has no default value.
  // _simVar has no default value.
  // _eqSystems has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _dae;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _eqSystems = tmpMeta2;

  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  _simVarIdxs = tmpMeta3;

  {
    modelica_metatype _state;
    for (tmpMeta4 = _stateTasks; !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
    {
      _state = MMC_CAR(tmpMeta4);
      _compIdx = mmc_unbox_integer(listHead(arrayGet((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_taskGraphData), 2))), mmc_unbox_integer(_state))));

      /* Pattern-matching tuple assignment */
      tmpMeta6 = mmc_mk_box1(0, mmc_mk_integer(_compIdx));
      tmpMeta7 = omc_Array_findFirstOnTrueWithIdx(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_taskGraphData), 3))), (modelica_fnptr) mmc_mk_box2(0,closure2_HpcOmTaskGraph_varMappingTupleCompEqual,tmpMeta6), &tmp5);
      if (optionNone(tmpMeta7)) MMC_THROW_INTERNAL();
      tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
      tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
      tmp10 = mmc_unbox_integer(tmpMeta9);
      tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
      tmp12 = mmc_unbox_integer(tmpMeta11);
      tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
      tmp14 = mmc_unbox_integer(tmpMeta13);
      _compIdx = tmp10  /* pattern as ty=Integer */;
      _eqSysIdx = tmp12  /* pattern as ty=Integer */;
      _offset = tmp14  /* pattern as ty=Integer */;
      _varIdx = tmp5;

      _eqSys = listGet(_eqSystems, _eqSysIdx);

      _varIdx = _varIdx - _offset;

      _var = omc_BackendVariable_getVarAt(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_eqSys), 2))), _varIdx);

      _cref = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_var), 2)));

      /* Pattern-matching assignment */
      tmpMeta15 = mmc_mk_cons(_cref, MMC_REFSTRUCTLIT(mmc_nil));
      tmpMeta16 = omc_SimCodeUtil_getSimVars2Crefs(threadData, tmpMeta15, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_simCode), 44))));
      if (listEmpty(tmpMeta16)) MMC_THROW_INTERNAL();
      tmpMeta17 = MMC_CAR(tmpMeta16);
      tmpMeta18 = MMC_CDR(tmpMeta16);
      if (!listEmpty(tmpMeta18)) MMC_THROW_INTERNAL();
      _simVar = tmpMeta17;

      _simVarIdx = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_simVar), 7))));

      tmpMeta19 = mmc_mk_cons(mmc_mk_integer(_simVarIdx), _simVarIdxs);
      _simVarIdxs = tmpMeta19;
    }
  }

  omc_HpcOmScheduler_quicksortWithOrder(threadData, omc_List_map(threadData, listReverse(_simVarIdxs), boxvar_intReal) ,&_order);

  _orderedTasks = omc_List_map1(threadData, _order, boxvar_List_getIndexFirst, _stateTasks);
  _return: OMC_LABEL_UNUSED
  return _orderedTasks;
}

static modelica_metatype closure3_Array_getIndexFirst(threadData_t *thData, modelica_metatype closure, modelica_metatype inIndex)
{
  modelica_metatype inArray = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_Array_getIndexFirst(thData, inIndex, inArray);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_multirate__partitioning(threadData_t *threadData, modelica_metatype _odeGraph, modelica_metatype _odeGraphData, modelica_metatype _backendDAE, modelica_metatype _simCode, modelica_metatype _sccSimEqMapping)
{
  modelica_metatype _partitionDataOut = NULL;
  modelica_metatype _stateTasksArray = NULL;
  modelica_metatype _stateTaskAssign = NULL;
  modelica_metatype _stateTasks = NULL;
  modelica_metatype _tasksPerLevel = NULL;
  modelica_metatype _partitions = NULL;
  modelica_metatype _odeGraphT = NULL;
  modelica_integer _numPartitions;
  modelica_metatype _activatorsForPartitions = NULL;
  modelica_metatype _stateToActivators = 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
  // _partitionDataOut has no default value.
  // _stateTasksArray has no default value.
  // _stateTaskAssign has no default value.
  // _stateTasks has no default value.
  // _tasksPerLevel has no default value.
  // _partitions has no default value.
  // _odeGraphT has no default value.
  // _numPartitions has no default value.
  // _activatorsForPartitions has no default value.
  // _stateToActivators has no default value.
  _tasksPerLevel = omc_HpcOmTaskGraph_getLevelNodes(threadData, _odeGraph);

  tmpMeta1 = stringAppend(_OMC_LIT22,stringDelimitList(omc_List_map(threadData, _tasksPerLevel, boxvar_HpcOmTaskGraph_intLstString), _OMC_LIT5));
  tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT5);
  fputs(MMC_STRINGDATA(tmpMeta2),stdout);

  _stateTasks = omc_HpcOmTaskGraph_getLeafNodes(threadData, _odeGraph);

  _stateTasks = omc_HpcOmTaskGraph_multirate__orderStateTasksInSimVarStateOrder(threadData, _stateTasks, _odeGraphData, _backendDAE, _simCode);

  tmpMeta3 = stringAppend(_OMC_LIT23,omc_HpcOmTaskGraph_intLstString(threadData, _stateTasks));
  tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT5);
  fputs(MMC_STRINGDATA(tmpMeta4),stdout);

  _odeGraphT = omc_AdjacencyMatrix_transposeAdjacencyMatrix(threadData, _odeGraph, arrayLength(_odeGraph));

  _stateTaskAssign = omc_HpcOmTaskGraph_multirate__assignTasksToStates(threadData, _tasksPerLevel, _stateTasks, _odeGraphT);

  omc_HpcOmTaskGraph_dumpStateAssign(threadData, _stateTaskAssign);

  _partitions = omc_HpcOmTaskGraph_multirate__getPartitions(threadData, _stateTaskAssign, _stateTasks, _odeGraphT);

  tmpMeta5 = stringAppend(_OMC_LIT24,stringDelimitList(omc_List_map(threadData, _partitions, boxvar_HpcOmTaskGraph_intLstString), _OMC_LIT5));
  tmpMeta6 = stringAppend(tmpMeta5,_OMC_LIT5);
  fputs(MMC_STRINGDATA(tmpMeta6),stdout);

  tmpMeta7 = mmc_mk_box1(0, _stateTaskAssign);
  _activatorsForPartitions = omc_List_mapMap(threadData, _partitions, boxvar_listHead, (modelica_fnptr) mmc_mk_box2(0,closure3_Array_getIndexFirst,tmpMeta7));

  _partitions = omc_List_map1(threadData, _partitions, boxvar_HpcOmTaskGraph_getSimEqsIdxLstForSCCIdxLst, _sccSimEqMapping);

  _numPartitions = listLength(_partitions);

  _stateToActivators = omc_List_intRange(threadData, listLength(_stateTasks));

  tmpMeta8 = mmc_mk_box5(3, &SimCode_PartitionData_PARTITIONDATA__desc, mmc_mk_integer(_numPartitions), _partitions, _activatorsForPartitions, _stateToActivators);
  _partitionDataOut = tmpMeta8;

  omc_HpcOmTaskGraph_dumpPartitionData(threadData, _partitionDataOut);
  _return: OMC_LABEL_UNUSED
  return _partitionDataOut;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNodeForVarIdx(threadData_t *threadData, modelica_integer _varIdx, modelica_integer _eqSysIdx, modelica_metatype _varCompMapping, modelica_integer _inTryThisIndex)
{
  modelica_integer _node;
  modelica_integer _offset;
  modelica_integer _eqSys;
  modelica_integer _tryThisIndex;
  modelica_integer _n;
  modelica_integer _arrayLengthVarCompMapping;
  modelica_boolean _eqSysNeq;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _node has no default value.
  // _offset has no default value.
  // _eqSys has no default value.
  _tryThisIndex = _inTryThisIndex;
  _n = ((modelica_integer) 0);
  // _arrayLengthVarCompMapping has no default value.
  // _eqSysNeq has no default value.
  _arrayLengthVarCompMapping = arrayLength(_varCompMapping);

  while(1)
  {
    if(!1 /* true */) break;
    if(((_tryThisIndex >= ((modelica_integer) 1)) && (_tryThisIndex <= _arrayLengthVarCompMapping)))
    {
      /* Pattern-matching assignment */
      tmpMeta1 = arrayGet(_varCompMapping, _tryThisIndex);
      tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
      tmp3 = mmc_unbox_integer(tmpMeta2);
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
      tmp5 = mmc_unbox_integer(tmpMeta4);
      tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
      tmp7 = mmc_unbox_integer(tmpMeta6);
      _node = tmp3  /* pattern as ty=Integer */;
      _eqSys = tmp5  /* pattern as ty=Integer */;
      _offset = tmp7  /* pattern as ty=Integer */;

      if((_eqSys == _eqSysIdx))
      {
        _node = ((modelica_integer) -1) + _node + _varIdx;

        goto _return;
      }
      else
      {
        _tryThisIndex = ((modelica_integer) 2) + _offset;
      }
    }
    else
    {
      if(((_varIdx == ((modelica_integer) -1)) && (_eqSysIdx == ((modelica_integer) -1))))
      {
        _node = ((modelica_integer) -1);

        goto _return;
      }
      else
      {
        fputs(MMC_STRINGDATA(_OMC_LIT25),stdout);
      }
    }

    _n = ((modelica_integer) 1) + _n;

    if((_n > _arrayLengthVarCompMapping))
    {
      omc_Error_addInternalError(threadData, _OMC_LIT26, _OMC_LIT27);

      MMC_THROW_INTERNAL();
    }
  }
  _return: OMC_LABEL_UNUSED
  return _node;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNodeForVarIdx(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _eqSysIdx, modelica_metatype _varCompMapping, modelica_metatype _inTryThisIndex)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_integer _node;
  modelica_metatype out_node;
  tmp1 = mmc_unbox_integer(_varIdx);
  tmp2 = mmc_unbox_integer(_eqSysIdx);
  tmp3 = mmc_unbox_integer(_inTryThisIndex);
  _node = omc_HpcOmTaskGraph_getNodeForVarIdx(threadData, tmp1, tmp2, _varCompMapping, tmp3);
  out_node = mmc_mk_icon(_node);
  return out_node;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNodeForCref1(threadData_t *threadData, modelica_metatype _eqSystems, modelica_metatype _cref, modelica_integer _eqSysIdxIn, modelica_integer *out_varIdx, modelica_boolean *out_found)
{
  modelica_integer _eqSysIdx;
  modelica_integer _varIdx;
  modelica_boolean _found;
  modelica_integer tmp1_c0 __attribute__((unused)) = 0;
  modelica_integer tmp1_c1 __attribute__((unused)) = 0;
  modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eqSysIdx has no default value.
  // _varIdx has no default value.
  // _found has no default value.
  
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _eqSystems;
    {
      modelica_boolean _b;
      modelica_integer _esIdx;
      modelica_integer _vIdx;
      modelica_metatype _lst = NULL;
      modelica_metatype _rest = NULL;
      modelica_metatype _vars = NULL;
      modelica_metatype _varLst = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _b has no default value.
      // _esIdx has no default value.
      // _vIdx has no default value.
      // _lst has no default value.
      // _rest has no default value.
      // _vars has no default value.
      // _varLst has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_metatype tmpMeta20;
          modelica_integer tmp21;
          modelica_metatype tmpMeta22;
          modelica_integer tmp23;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          
          _vars = tmpMeta8;
          /* Pattern matching succeeded */
          _varLst = omc_BackendVariable_getVar(threadData, _cref, _vars ,&_lst);

          if((listLength(_lst) != ((modelica_integer) 1)))
          {
            fputs(MMC_STRINGDATA(_OMC_LIT28),stdout);
          }

          if(omc_BackendVariable_isStateVar(threadData, listHead(_varLst)))
          {
            /* Pattern-matching assignment */
            tmpMeta9 = _OMC_LIT29;
            tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
            tmp11 = mmc_unbox_integer(tmpMeta10);
            tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
            tmp13 = mmc_unbox_integer(tmpMeta12);
            tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
            tmp15 = mmc_unbox_integer(tmpMeta14);
            _esIdx = tmp11  /* pattern as ty=Integer */;
            _vIdx = tmp13  /* pattern as ty=Integer */;
            _b = tmp15  /* pattern as ty=Boolean */;
          }
          else
          {
            /* Pattern-matching assignment */
            tmpMeta16 = mmc_mk_box3(0, mmc_mk_integer(_eqSysIdxIn), listHead(_lst), mmc_mk_boolean(1 /* true */));
            tmpMeta17 = tmpMeta16;
            tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 1));
            tmp19 = mmc_unbox_integer(tmpMeta18);
            tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
            tmp21 = mmc_unbox_integer(tmpMeta20);
            tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 3));
            tmp23 = mmc_unbox_integer(tmpMeta22);
            _esIdx = tmp19  /* pattern as ty=Integer */;
            _vIdx = tmp21  /* pattern as ty=Integer */;
            _b = tmp23  /* pattern as ty=Boolean */;
          }
          tmp1_c0 = _esIdx;
          tmp1_c1 = _vIdx;
          tmp1_c2 = _b;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta24 = MMC_CAR(tmp4_1);
          tmpMeta25 = MMC_CDR(tmp4_1);
          
          _rest = tmpMeta25;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmp1_c0 = omc_HpcOmTaskGraph_getNodeForCref1(threadData, _rest, _cref, ((modelica_integer) 1) + _eqSysIdxIn, &tmp1_c1, &tmp1_c2);
          goto tmp3_done;
        }
        case 2: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmp1_c0 = ((modelica_integer) -1);
          tmp1_c1 = ((modelica_integer) -1);
          tmp1_c2 = 0 /* false */;
          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:;
    }
  }
  _eqSysIdx = tmp1_c0;
  _varIdx = tmp1_c1;
  _found = tmp1_c2;
  _return: OMC_LABEL_UNUSED
  if (out_varIdx) { *out_varIdx = _varIdx; }
  if (out_found) { *out_found = _found; }
  return _eqSysIdx;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNodeForCref1(threadData_t *threadData, modelica_metatype _eqSystems, modelica_metatype _cref, modelica_metatype _eqSysIdxIn, modelica_metatype *out_varIdx, modelica_metatype *out_found)
{
  modelica_integer tmp1;
  modelica_integer _varIdx;
  modelica_boolean _found;
  modelica_integer _eqSysIdx;
  modelica_metatype out_eqSysIdx;
  tmp1 = mmc_unbox_integer(_eqSysIdxIn);
  _eqSysIdx = omc_HpcOmTaskGraph_getNodeForCref1(threadData, _eqSystems, _cref, tmp1, &_varIdx, &_found);
  out_eqSysIdx = mmc_mk_icon(_eqSysIdx);
  if (out_varIdx) { *out_varIdx = mmc_mk_icon(_varIdx); }
  if (out_found) { *out_found = mmc_mk_icon(_found); }
  return out_eqSysIdx;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeForCref(threadData_t *threadData, modelica_metatype _iCref, modelica_metatype _iDae, modelica_metatype _iVarCompMapping)
{
  modelica_metatype _oNodeVarIdx = NULL;
  modelica_integer _eqSysIdx;
  modelica_integer _varIdx;
  modelica_integer _nodeIdx;
  modelica_metatype _eqSystems = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNodeVarIdx has no default value.
  // _eqSysIdx has no default value.
  // _varIdx has no default value.
  // _nodeIdx has no default value.
  // _eqSystems has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iDae;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _eqSystems = tmpMeta2;

  _eqSysIdx = omc_HpcOmTaskGraph_getNodeForCref1(threadData, _eqSystems, _iCref, ((modelica_integer) 1) ,&_varIdx ,NULL);

  _nodeIdx = omc_HpcOmTaskGraph_getNodeForVarIdx(threadData, _varIdx, _eqSysIdx, _iVarCompMapping, _varIdx);

  tmpMeta3 = mmc_mk_box2(0, mmc_mk_integer(_nodeIdx), mmc_mk_integer(_varIdx));
  _oNodeVarIdx = tmpMeta3;
  _return: OMC_LABEL_UNUSED
  return _oNodeVarIdx;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_nodeIsDependent(threadData_t *threadData, modelica_metatype _node)
{
  modelica_boolean _dep;
  modelica_integer _tpl1;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _dep has no default value.
  // _tpl1 has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _node;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  _tpl1 = tmp3  /* pattern as ty=Integer */;

  _dep = (_tpl1 != ((modelica_integer) -1));
  _return: OMC_LABEL_UNUSED
  return _dep;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_nodeIsDependent(threadData_t *threadData, modelica_metatype _node)
{
  modelica_boolean _dep;
  modelica_metatype out_dep;
  _dep = omc_HpcOmTaskGraph_nodeIsDependent(threadData, _node);
  out_dep = mmc_mk_icon(_dep);
  return out_dep;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeForCrefLst(threadData_t *threadData, modelica_metatype _iCrefs, modelica_metatype _iDae, modelica_metatype _iVarCompMap)
{
  modelica_metatype _oNodeVarLst = NULL;
  modelica_metatype _tmpNodeVarLst = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNodeVarLst has no default value.
  // _tmpNodeVarLst has no default value.
  _tmpNodeVarLst = omc_List_map2(threadData, _iCrefs, boxvar_HpcOmTaskGraph_getNodeForCref, _iDae, _iVarCompMap);

  _oNodeVarLst = omc_List_filterOnTrue(threadData, _tmpNodeVarLst, boxvar_HpcOmTaskGraph_nodeIsDependent);
  _return: OMC_LABEL_UNUSED
  return _oNodeVarLst;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addEdgeToGraph(threadData_t *threadData, modelica_integer _parent, modelica_integer _child, modelica_metatype _graphIn)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _row = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _row has no default value.
  _row = arrayGet(_graphIn, _parent);

  tmpMeta1 = mmc_mk_cons(mmc_mk_integer(_child), _row);
  _row = omc_List_unique(threadData, tmpMeta1);

  _graphOut = arrayUpdate(_graphIn, _parent, _row);
  _return: OMC_LABEL_UNUSED
  return _graphOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addEdgeToGraph(threadData_t *threadData, modelica_metatype _parent, modelica_metatype _child, modelica_metatype _graphIn)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _graphOut = NULL;
  tmp1 = mmc_unbox_integer(_parent);
  tmp2 = mmc_unbox_integer(_child);
  _graphOut = omc_HpcOmTaskGraph_addEdgeToGraph(threadData, tmp1, tmp2, _graphIn);
  /* skip box _graphOut; array<list<#Integer>> */
  return _graphOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addEdgesToGraph(threadData_t *threadData, modelica_metatype _parents, modelica_integer _child, modelica_metatype _graphIn)
{
  modelica_metatype _graphOut = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  _graphOut = omc_List_fold1(threadData, omc_List_map(threadData, _parents, boxvar_Util_tuple21), boxvar_HpcOmTaskGraph_addEdgeToGraph, mmc_mk_integer(_child), _graphIn);
  _return: OMC_LABEL_UNUSED
  return _graphOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addEdgesToGraph(threadData_t *threadData, modelica_metatype _parents, modelica_metatype _child, modelica_metatype _graphIn)
{
  modelica_integer tmp1;
  modelica_metatype _graphOut = NULL;
  tmp1 = mmc_unbox_integer(_child);
  _graphOut = omc_HpcOmTaskGraph_addEdgesToGraph(threadData, _parents, tmp1, _graphIn);
  /* skip box _graphOut; array<list<#Integer>> */
  return _graphOut;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_isCommunicationChildEqualToIdx(threadData_t *threadData, modelica_metatype _iComm, modelica_integer _iIdx)
{
  modelica_boolean _isEq;
  modelica_integer _childNode;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _isEq has no default value.
  // _childNode has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iComm;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  _childNode = tmp3  /* pattern as ty=Integer */;

  _isEq = (_childNode != _iIdx);
  _return: OMC_LABEL_UNUSED
  return _isEq;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_isCommunicationChildEqualToIdx(threadData_t *threadData, modelica_metatype _iComm, modelica_metatype _iIdx)
{
  modelica_integer tmp1;
  modelica_boolean _isEq;
  modelica_metatype out_isEq;
  tmp1 = mmc_unbox_integer(_iIdx);
  _isEq = omc_HpcOmTaskGraph_isCommunicationChildEqualToIdx(threadData, _iComm, tmp1);
  out_isEq = mmc_mk_icon(_isEq);
  return out_isEq;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setCommCosts(threadData_t *threadData, modelica_metatype _parent, modelica_integer _child, modelica_real _reqCycles, modelica_metatype _commCostsIn)
{
  modelica_metatype _commCostsOut = NULL;
  modelica_metatype _row = NULL;
  modelica_integer _parentNodeIdx;
  modelica_integer _varIdx;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _commCostsOut has no default value.
  // _row has no default value.
  // _parentNodeIdx has no default value.
  // _varIdx has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _parent;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  _parentNodeIdx = tmp3  /* pattern as ty=Integer */;
  _varIdx = tmp5  /* pattern as ty=Integer */;

  _row = arrayGet(_commCostsIn, _parentNodeIdx);

  _row = omc_List_filter1OnTrue(threadData, _row, boxvar_HpcOmTaskGraph_isCommunicationChildEqualToIdx, mmc_mk_integer(_child));

  tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta8 = mmc_mk_cons(mmc_mk_integer(_varIdx), MMC_REFSTRUCTLIT(mmc_nil));
  tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta11 = mmc_mk_box8(3, &HpcOmTaskGraph_Communication_COMMUNICATION__desc, mmc_mk_integer(((modelica_integer) 1)), tmpMeta7, tmpMeta8, tmpMeta9, tmpMeta10, mmc_mk_integer(_child), mmc_mk_real(_reqCycles));
  tmpMeta6 = mmc_mk_cons(tmpMeta11, _row);
  _row = tmpMeta6;

  _commCostsOut = arrayUpdate(_commCostsIn, _parentNodeIdx, _row);
  _return: OMC_LABEL_UNUSED
  return _commCostsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setCommCosts(threadData_t *threadData, modelica_metatype _parent, modelica_metatype _child, modelica_metatype _reqCycles, modelica_metatype _commCostsIn)
{
  modelica_integer tmp1;
  modelica_real tmp2;
  modelica_metatype _commCostsOut = NULL;
  tmp1 = mmc_unbox_integer(_child);
  tmp2 = mmc_unbox_real(_reqCycles);
  _commCostsOut = omc_HpcOmTaskGraph_setCommCosts(threadData, _parent, tmp1, tmp2, _commCostsIn);
  /* skip box _commCostsOut; array<list<HpcOmTaskGraph.Communication>> */
  return _commCostsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setCommCostsToParent(threadData_t *threadData, modelica_metatype _parents, modelica_integer _child, modelica_real _reqCycles, modelica_metatype _commCostsIn)
{
  modelica_metatype _commCostsOut = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _commCostsOut has no default value.
  _commCostsOut = omc_List_fold2(threadData, _parents, boxvar_HpcOmTaskGraph_setCommCosts, mmc_mk_integer(_child), mmc_mk_real(_reqCycles), _commCostsIn);
  _return: OMC_LABEL_UNUSED
  return _commCostsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setCommCostsToParent(threadData_t *threadData, modelica_metatype _parents, modelica_metatype _child, modelica_metatype _reqCycles, modelica_metatype _commCostsIn)
{
  modelica_integer tmp1;
  modelica_real tmp2;
  modelica_metatype _commCostsOut = NULL;
  tmp1 = mmc_unbox_integer(_child);
  tmp2 = mmc_unbox_real(_reqCycles);
  _commCostsOut = omc_HpcOmTaskGraph_setCommCostsToParent(threadData, _parents, tmp1, tmp2, _commCostsIn);
  /* skip box _commCostsOut; array<list<HpcOmTaskGraph.Communication>> */
  return _commCostsOut;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_printNodeVars1(threadData_t *threadData, modelica_metatype _node)
{
  modelica_string _s = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _s has no default value.
  tmpMeta1 = stringAppend(_OMC_LIT30,intString(mmc_unbox_integer(omc_Util_tuple21(threadData, _node))));
  tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT31);
  tmpMeta3 = stringAppend(tmpMeta2,intString(mmc_unbox_integer(omc_Util_tuple22(threadData, _node))));
  tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT32);
  _s = tmpMeta4;
  _return: OMC_LABEL_UNUSED
  return _s;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_printNodeVars(threadData_t *threadData, modelica_metatype _nodes)
{
  modelica_string _s = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _s has no default value.
  tmpMeta1 = stringAppend(_OMC_LIT33,stringDelimitList(omc_List_map(threadData, _nodes, boxvar_HpcOmTaskGraph_printNodeVars1), _OMC_LIT34));
  _s = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _s;
}

static modelica_metatype closure4_BackendDAEOptimize_countOperationsExp(threadData_t *thData, modelica_metatype closure, modelica_metatype inExp, modelica_metatype inTpl, modelica_metatype tmp18)
{
  modelica_metatype shared = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_BackendDAEOptimize_countOperationsExp(thData, inExp, shared, inTpl, tmp18);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_estimateEquationCosts(threadData_t *threadData, modelica_metatype _eqIn, modelica_metatype _sharedIn)
{
  modelica_metatype _tplOut = NULL;
  modelica_integer _numAdd;
  modelica_integer _numMul;
  modelica_integer _numDiv;
  modelica_integer _numTrig;
  modelica_integer _numRel;
  modelica_integer _numOth;
  modelica_integer _numFuncs;
  modelica_integer _numLog;
  modelica_metatype _compInfo = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_integer tmp9;
  modelica_metatype tmpMeta10;
  modelica_integer tmp11;
  modelica_metatype tmpMeta12;
  modelica_integer tmp13;
  modelica_metatype tmpMeta14;
  modelica_integer tmp15;
  modelica_metatype tmpMeta16;
  modelica_integer tmp17;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _tplOut has no default value.
  // _numAdd has no default value.
  // _numMul has no default value.
  // _numDiv has no default value.
  // _numTrig has no default value.
  // _numRel has no default value.
  // _numOth has no default value.
  // _numFuncs has no default value.
  // _numLog has no default value.
  // _compInfo has no default value.
  /* Pattern-matching tuple assignment, wild first pattern */
  tmpMeta19 = mmc_mk_box1(0, _sharedIn);
  omc_BackendEquation_traverseExpsOfEquation(threadData, _eqIn, (modelica_fnptr) mmc_mk_box2(0,closure4_BackendDAEOptimize_countOperationsExp,tmpMeta19), _OMC_LIT35, &tmpMeta1);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmp7 = mmc_unbox_integer(tmpMeta6);
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmp9 = mmc_unbox_integer(tmpMeta8);
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmp11 = mmc_unbox_integer(tmpMeta10);
  tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmp13 = mmc_unbox_integer(tmpMeta12);
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmp15 = mmc_unbox_integer(tmpMeta14);
  tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmp17 = mmc_unbox_integer(tmpMeta16);
  _numAdd = tmp3  /* pattern as ty=Integer */;
  _numMul = tmp5  /* pattern as ty=Integer */;
  _numDiv = tmp7  /* pattern as ty=Integer */;
  _numTrig = tmp9  /* pattern as ty=Integer */;
  _numRel = tmp11  /* pattern as ty=Integer */;
  _numLog = tmp13  /* pattern as ty=Integer */;
  _numOth = tmp15  /* pattern as ty=Integer */;
  _numFuncs = tmp17  /* pattern as ty=Integer */;

  tmpMeta20 = mmc_mk_box9(6, &BackendDAE_CompInfo_NO__COMP__desc, mmc_mk_integer(_numAdd), mmc_mk_integer(_numMul), mmc_mk_integer(_numDiv), mmc_mk_integer(_numTrig), mmc_mk_integer(_numRel), mmc_mk_integer(_numLog), mmc_mk_integer(_numOth), mmc_mk_integer(_numFuncs));
  _compInfo = tmpMeta20;

  _tplOut = omc_HpcOmTaskGraph_calculateCosts(threadData, _compInfo);
  _return: OMC_LABEL_UNUSED
  return _tplOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_appendRemovedEquations(threadData_t *threadData, modelica_metatype _dae, modelica_metatype _graphIn, modelica_metatype _graphDataIn, modelica_metatype *out_graphDataOut)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _graphDataOut = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _graphDataOut has no default value.
  
  
  { /* matchcontinue expression */
    {
      modelica_integer _numNewComps;
      modelica_metatype _newComps = NULL;
      modelica_metatype _nodeVarLst = NULL;
      modelica_metatype _varCompMap = NULL;
      modelica_metatype _graph = NULL;
      modelica_metatype _graphData = NULL;
      modelica_metatype _remEqs = NULL;
      modelica_metatype _shared = NULL;
      modelica_metatype _eqLst = NULL;
      modelica_metatype _crefsLst = NULL;
      modelica_metatype _inComps1 = NULL;
      modelica_metatype _inComps2 = NULL;
      modelica_metatype _varCompMapping1 = NULL;
      modelica_metatype _eqCompMapping1 = NULL;
      modelica_metatype _compParamMapping1 = NULL;
      modelica_metatype _compNames1 = NULL;
      modelica_metatype _compNames2 = NULL;
      modelica_metatype _compDescs1 = NULL;
      modelica_metatype _compDescs2 = NULL;
      modelica_metatype _exeCosts1 = NULL;
      modelica_metatype _exeCosts2 = NULL;
      modelica_metatype _commCosts1 = NULL;
      modelica_metatype _nodeMark1 = NULL;
      modelica_metatype _nodeMark2 = NULL;
      modelica_metatype _compInformations1 = NULL;
      modelica_metatype _compInformations2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _numNewComps has no default value.
      // _newComps has no default value.
      // _nodeVarLst has no default value.
      // _varCompMap has no default value.
      // _graph has no default value.
      // _graphData has no default value.
      // _remEqs has no default value.
      // _shared has no default value.
      // _eqLst has no default value.
      // _crefsLst has no default value.
      // _inComps1 has no default value.
      // _inComps2 has no default value.
      // _varCompMapping1 has no default value.
      // _eqCompMapping1 has no default value.
      // _compParamMapping1 has no default value.
      // _compNames1 has no default value.
      // _compNames2 has no default value.
      // _compDescs1 has no default value.
      // _compDescs2 has no default value.
      // _exeCosts1 has no default value.
      // _exeCosts2 has no default value.
      // _commCosts1 has no default value.
      // _nodeMark1 has no default value.
      // _nodeMark2 has no default value.
      // _compInformations1 has no default value.
      // _compInformations2 has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_boolean tmp10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta6 = _dae;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          _shared = tmpMeta7;

          _remEqs = omc_BackendDAEUtil_collapseRemovedEqs(threadData, _dae);

          /* Pattern-matching assignment */
          tmpMeta8 = _graphDataIn;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
          _varCompMap = tmpMeta9;

          _eqLst = omc_BackendEquation_equationList(threadData, _remEqs);

          _numNewComps = listLength(_eqLst);

          /* Pattern-matching assignment */
          tmp10 = (_numNewComps != ((modelica_integer) 0));
          if (1 /* true */ != tmp10) goto goto_2;

          _crefsLst = omc_List_map(threadData, _eqLst, boxvar_BackendEquation_equationCrefs);

          _nodeVarLst = omc_List_map2(threadData, _crefsLst, boxvar_HpcOmTaskGraph_getNodeForCrefLst, _dae, _varCompMap);

          /* Pattern-matching assignment */
          tmpMeta11 = _graphDataIn;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 2));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 3));
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 4));
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 5));
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 6));
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 7));
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 8));
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 9));
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 10));
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 11));
          _inComps1 = tmpMeta12;
          _varCompMapping1 = tmpMeta13;
          _eqCompMapping1 = tmpMeta14;
          _compParamMapping1 = tmpMeta15;
          _compNames1 = tmpMeta16;
          _compDescs1 = tmpMeta17;
          _exeCosts1 = tmpMeta18;
          _commCosts1 = tmpMeta19;
          _nodeMark1 = tmpMeta20;
          _compInformations1 = tmpMeta21;

          tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
          _graph = arrayAppend(_graphIn, arrayCreate(_numNewComps, tmpMeta22));

          _newComps = omc_List_intRange2(threadData, ((modelica_integer) 1) + arrayLength(_graphIn), arrayLength(_graphIn) + _numNewComps);

          _graph = omc_List_threadFold(threadData, _nodeVarLst, _newComps, boxvar_HpcOmTaskGraph_addEdgesToGraph, _graph);

          _inComps2 = listArray(omc_List_map(threadData, _newComps, boxvar_List_create));

          _compNames2 = arrayCreate(_numNewComps, _OMC_LIT36);

          _compDescs2 = listArray(omc_List_map(threadData, _eqLst, boxvar_BackendDump_equationString));

          _nodeMark2 = arrayCreate(_numNewComps, mmc_mk_integer(((modelica_integer) -2)));

          _exeCosts2 = listArray(omc_List_map1(threadData, _eqLst, boxvar_HpcOmTaskGraph_estimateEquationCosts, _shared));

          _compInformations2 = arrayCreate(_numNewComps, _OMC_LIT37);

          _inComps1 = arrayAppend(_inComps1, _inComps2);

          _compNames1 = arrayAppend(_compNames1, _compNames2);

          _compDescs1 = arrayAppend(_compDescs1, _compDescs2);

          _nodeMark1 = arrayAppend(_nodeMark1, _nodeMark2);

          _exeCosts1 = arrayAppend(_exeCosts1, _exeCosts2);

          _compInformations1 = arrayAppend(_compInformations1, _compInformations2);

          _commCosts1 = omc_List_threadFold1(threadData, _nodeVarLst, _newComps, boxvar_HpcOmTaskGraph_setCommCostsToParent, _OMC_LIT38, _commCosts1);

          tmpMeta23 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps1, _varCompMapping1, _eqCompMapping1, _compParamMapping1, _compNames1, _compDescs1, _exeCosts1, _commCosts1, _nodeMark1, _compInformations1);
          _graphData = tmpMeta23;
          tmpMeta[0+0] = _graph;
          tmpMeta[0+1] = _graphData;
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _graphIn;
          tmpMeta[0+1] = _graphDataIn;
          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:;
    }
  }
  _graphOut = tmpMeta[0+0];
  _graphDataOut = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_graphDataOut) { *out_graphDataOut = _graphDataOut; }
  return _graphOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setAnnotationsForVar(threadData_t *threadData, modelica_integer _backendVarIdx, modelica_metatype _vars, modelica_metatype _taskGraphInfo, modelica_integer _eqSysOffset, modelica_metatype _annotInfoIn)
{
  modelica_metatype _annotInfoOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _annotInfoOut has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _taskGraphInfo;
    {
      modelica_integer _compIdx;
      modelica_integer _taskIdx;
      modelica_string _annotString = NULL;
      modelica_metatype _var = NULL;
      modelica_metatype _cr = NULL;
      modelica_metatype _annot = NULL;
      modelica_metatype _inComps = NULL;
      modelica_metatype _varCompMapping = NULL;
      modelica_metatype _nodeMark = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _compIdx has no default value.
      // _taskIdx has no default value.
      // _annotString has no default value.
      // _var has no default value.
      // _cr has no default value.
      // _annot has no default value.
      // _inComps has no default value.
      // _varCompMapping has no default value.
      // _nodeMark has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_boolean tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          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), 10));
          
          _inComps = tmpMeta6;
          _varCompMapping = tmpMeta7;
          _nodeMark = tmpMeta8;
          /* Pattern matching succeeded */
          _var = omc_BackendVariable_getVarAt(threadData, _vars, _backendVarIdx);

          omc_BackendDump_printVar(threadData, _var);

          /* Pattern-matching assignment */
          tmp9 = omc_BackendVariable_hasAnnotation(threadData, _var);
          if (1 /* true */ != tmp9) goto goto_2;

          /* Pattern-matching assignment */
          tmpMeta10 = arrayGet(_varCompMapping, _backendVarIdx + _eqSysOffset);
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
          tmp12 = mmc_unbox_integer(tmpMeta11);
          _compIdx = tmp12  /* pattern as ty=Integer */;

          _taskIdx = omc_HpcOmTaskGraph_getCompInComps(threadData, _compIdx, ((modelica_integer) 1), _inComps, _nodeMark);

          _annot = omc_BackendVariable_getAnnotationComment(threadData, _var);

          _annotString = arrayGet(_annotInfoIn, _taskIdx);

          _cr = omc_BackendVariable_varCref(threadData, _var);

          tmpMeta13 = stringAppend(_annotString,_OMC_LIT30);
          tmpMeta14 = stringAppend(tmpMeta13,omc_ComponentReference_printComponentRefStr(threadData, _cr));
          tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT39);
          tmpMeta16 = stringAppend(tmpMeta15,omc_DAEDump_dumpCommentAnnotationStr(threadData, _annot));
          tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT40);
          _annotString = tmpMeta17;

          arrayUpdate(_annotInfoIn, _taskIdx, _annotString);
          tmpMeta1 = _annotInfoIn;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _annotInfoIn;
          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:;
    }
  }
  _annotInfoOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _annotInfoOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setAnnotationsForVar(threadData_t *threadData, modelica_metatype _backendVarIdx, modelica_metatype _vars, modelica_metatype _taskGraphInfo, modelica_metatype _eqSysOffset, modelica_metatype _annotInfoIn)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _annotInfoOut = NULL;
  tmp1 = mmc_unbox_integer(_backendVarIdx);
  tmp2 = mmc_unbox_integer(_eqSysOffset);
  _annotInfoOut = omc_HpcOmTaskGraph_setAnnotationsForVar(threadData, tmp1, _vars, _taskGraphInfo, tmp2, _annotInfoIn);
  /* skip box _annotInfoOut; array<String> */
  return _annotInfoOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setAnnotationsForTasks1(threadData_t *threadData, modelica_metatype _syst, modelica_metatype _taskGraphInfo, modelica_metatype _infoIn)
{
  modelica_metatype _infoOut = NULL;
  modelica_integer _idx;
  modelica_metatype _annots = NULL;
  modelica_metatype _vars = NULL;
  modelica_metatype _eqs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _infoOut has no default value.
  // _idx has no default value.
  // _annots has no default value.
  // _vars has no default value.
  // _eqs has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _infoIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _idx = tmp3  /* pattern as ty=Integer */;
  _annots = tmpMeta4;

  /* Pattern-matching assignment */
  tmpMeta5 = _syst;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 3));
  _vars = tmpMeta6;
  _eqs = tmpMeta7;

  _annots = omc_List_fold3(threadData, omc_List_intRange(threadData, omc_BackendVariable_varsSize(threadData, _vars)), boxvar_HpcOmTaskGraph_setAnnotationsForVar, _vars, _taskGraphInfo, mmc_mk_integer(_idx), _annots);

  tmpMeta8 = mmc_mk_box2(0, mmc_mk_integer(omc_BackendVariable_varsSize(threadData, _vars) + _idx), _annots);
  _infoOut = tmpMeta8;
  _return: OMC_LABEL_UNUSED
  return _infoOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setAnnotationsForTasks(threadData_t *threadData, modelica_metatype _taskGraphInfo, modelica_metatype _backendDAE, modelica_metatype _annotInfoIn)
{
  modelica_metatype _annotInfoOut = NULL;
  modelica_metatype _systs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _annotInfoOut has no default value.
  // _systs has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _backendDAE;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _systs = tmpMeta2;

  /* Pattern-matching assignment */
  tmpMeta3 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 0)), _annotInfoIn);
  tmpMeta4 = omc_List_fold1(threadData, _systs, boxvar_HpcOmTaskGraph_setAnnotationsForTasks1, _taskGraphInfo, tmpMeta3);
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
  _annotInfoOut = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _annotInfoOut;
}

DLLDirection
modelica_real omc_HpcOmTaskGraph_roundReal(threadData_t *threadData, modelica_real _inReal, modelica_integer _nIn)
{
  modelica_real _outReal;
  modelica_integer _int;
  modelica_real _real;
  modelica_real tmp1;
  modelica_real tmp2;
  modelica_real tmp3;
  modelica_real tmp4;
  modelica_real tmp5;
  modelica_real tmp6;
  modelica_real tmp7;
  modelica_real tmp8;
  modelica_real tmp9;
  modelica_real tmp10;
  modelica_real tmp11;
  modelica_real tmp12;
  modelica_real tmp13;
  modelica_real tmp14;
  modelica_real tmp15;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outReal has no default value.
  // _int has no default value.
  // _real has no default value.
  tmp1 = 10.0;
  tmp2 = ((modelica_real)_nIn);
  if(tmp1 < 0.0 && tmp2 != 0.0)
  {
    tmp4 = modf(tmp2, &tmp5);
    
    if(tmp4 > 0.5)
    {
      tmp4 -= 1.0;
      tmp5 += 1.0;
    }
    else if(tmp4 < -0.5)
    {
      tmp4 += 1.0;
      tmp5 -= 1.0;
    }
    
    if(fabs(tmp4) < 1e-10)
      tmp3 = pow(tmp1, tmp5);
    else
    {
      tmp7 = modf(1.0/tmp2, &tmp6);
      if(tmp7 > 0.5)
      {
        tmp7 -= 1.0;
        tmp6 += 1.0;
      }
      else if(tmp7 < -0.5)
      {
        tmp7 += 1.0;
        tmp6 -= 1.0;
      }
      if(fabs(tmp7) < 1e-10 && ((unsigned long)tmp6 & 1))
      {
        tmp3 = -pow(-tmp1, tmp4)*pow(tmp1, tmp5);
      }
      else
      {
        MMC_THROW_INTERNAL();
      }
    }
  }
  else
  {
    tmp3 = pow(tmp1, tmp2);
  }
  if(isnan(tmp3) || isinf(tmp3))
  {
    MMC_THROW_INTERNAL();
  }
  _real = (_inReal) * (tmp3);

  _real = floor(_real);

  tmp8 = 10.0;
  tmp9 = ((modelica_real)_nIn);
  if(tmp8 < 0.0 && tmp9 != 0.0)
  {
    tmp11 = modf(tmp9, &tmp12);
    
    if(tmp11 > 0.5)
    {
      tmp11 -= 1.0;
      tmp12 += 1.0;
    }
    else if(tmp11 < -0.5)
    {
      tmp11 += 1.0;
      tmp12 -= 1.0;
    }
    
    if(fabs(tmp11) < 1e-10)
      tmp10 = pow(tmp8, tmp12);
    else
    {
      tmp14 = modf(1.0/tmp9, &tmp13);
      if(tmp14 > 0.5)
      {
        tmp14 -= 1.0;
        tmp13 += 1.0;
      }
      else if(tmp14 < -0.5)
      {
        tmp14 += 1.0;
        tmp13 -= 1.0;
      }
      if(fabs(tmp14) < 1e-10 && ((unsigned long)tmp13 & 1))
      {
        tmp10 = -pow(-tmp8, tmp11)*pow(tmp8, tmp12);
      }
      else
      {
        MMC_THROW_INTERNAL();
      }
    }
  }
  else
  {
    tmp10 = pow(tmp8, tmp9);
  }
  if(isnan(tmp10) || isinf(tmp10))
  {
    MMC_THROW_INTERNAL();
  }tmp15 = tmp10;
  if (tmp15 == 0) {MMC_THROW_INTERNAL();}
  _outReal = (_real) / tmp15;
  _return: OMC_LABEL_UNUSED
  return _outReal;
}
modelica_metatype boxptr_HpcOmTaskGraph_roundReal(threadData_t *threadData, modelica_metatype _inReal, modelica_metatype _nIn)
{
  modelica_real tmp1;
  modelica_integer tmp2;
  modelica_real _outReal;
  modelica_metatype out_outReal;
  tmp1 = mmc_unbox_real(_inReal);
  tmp2 = mmc_unbox_integer(_nIn);
  _outReal = omc_HpcOmTaskGraph_roundReal(threadData, tmp1, tmp2);
  out_outReal = mmc_mk_rcon(_outReal);
  return out_outReal;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getAllSCCsOfGraph(threadData_t *threadData, modelica_metatype _iTaskGraphMeta)
{
  modelica_metatype _oSccs = NULL;
  modelica_integer _taskIdx;
  modelica_integer _mark;
  modelica_metatype _inComps = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _tmpSccs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSccs has no default value.
  // _taskIdx has no default value.
  // _mark has no default value.
  // _inComps has no default value.
  // _comps has no default value.
  // _nodeMark has no default value.
  // _tmpSccs has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _tmpSccs = tmpMeta1;

  /* Pattern-matching assignment */
  tmpMeta2 = _iTaskGraphMeta;
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 10));
  _inComps = tmpMeta3;
  _nodeMark = tmpMeta4;

  tmp5 = ((modelica_integer) 1); tmp6 = 1; tmp7 = arrayLength(_inComps);
  if(!(((tmp6 > 0) && (tmp5 > tmp7)) || ((tmp6 < 0) && (tmp5 < tmp7))))
  {
    modelica_integer _taskIdx;
    for(_taskIdx = ((modelica_integer) 1); in_range_integer(_taskIdx, tmp5, tmp7); _taskIdx += tmp6)
    {
      _comps = arrayGet(_inComps, _taskIdx);

      _tmpSccs = omc_List_append__reverse(threadData, _comps, _tmpSccs);
    }
  }

  _oSccs = listReverse(_tmpSccs);
  _return: OMC_LABEL_UNUSED
  return _oSccs;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_sumUpExeCosts(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iMeta)
{
  modelica_metatype _execCosts = NULL;
  modelica_integer _cost1;
  modelica_real _cost2;
  modelica_metatype _comps = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _costs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _exeCostLst = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _execCosts has no default value.
  // _cost1 has no default value.
  // _cost2 has no default value.
  // _comps has no default value.
  // _inComps has no default value.
  // _costs has no default value.
  // _exeCosts has no default value.
  // _exeCostLst has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iMeta;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          
          _inComps = tmpMeta6;
          _exeCosts = tmpMeta7;
          /* Pattern matching succeeded */
          _comps = omc_List_flatten(threadData, omc_List_map1(threadData, omc_List_intRange(threadData, arrayLength(_iGraph)), boxvar_Array_getIndexFirst, _inComps));

          _exeCostLst = omc_List_map1(threadData, _comps, boxvar_Array_getIndexFirst, _exeCosts);

          _cost1 = mmc_unbox_integer(omc_List_fold(threadData, omc_List_map(threadData, _exeCostLst, boxvar_Util_tuple21), boxvar_intAdd, mmc_mk_integer(((modelica_integer) 0))));

          _cost2 = mmc_unbox_real(omc_List_fold(threadData, omc_List_map(threadData, _exeCostLst, boxvar_Util_tuple22), boxvar_realAdd, _OMC_LIT41));
          tmpMeta8 = mmc_mk_box2(0, mmc_mk_integer(_cost1), mmc_mk_real(_cost2));
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _OMC_LIT42;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _execCosts = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _execCosts;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getHighestCommCost(threadData_t *threadData, modelica_metatype _iCommCosts, modelica_metatype _iHighestTuple)
{
  modelica_metatype _oHighestTuple = NULL;
  modelica_real _highestCost;
  modelica_real _currentCost;
  modelica_metatype _head = NULL;
  modelica_metatype _rest = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oHighestTuple has no default value.
  // _highestCost has no default value.
  // _currentCost has no default value.
  // _head has no default value.
  // _rest has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _iCommCosts;
    tmp4_2 = _iHighestTuple;
    {
      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_real tmp9;
          modelica_metatype tmpMeta10;
          modelica_real tmp11;
          modelica_boolean tmp12;
          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), 8));
          tmp9 = mmc_unbox_real(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 8));
          tmp11 = mmc_unbox_real(tmpMeta10);
          _head = tmpMeta6;
          _currentCost = tmp9  /* pattern as ty=Real */;
          _rest = tmpMeta7;
          _highestCost = tmp11  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp12 = (_currentCost > _highestCost);
          if (1 /* true */ != tmp12) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_getHighestCommCost(threadData, _rest, _head);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta13 = MMC_CAR(tmp4_1);
          tmpMeta14 = MMC_CDR(tmp4_1);
          
          _head = tmpMeta13;
          _rest = tmpMeta14;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_HpcOmTaskGraph_getHighestCommCost(threadData, _rest, _iHighestTuple);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iHighestTuple;
          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:;
    }
  }
  _oHighestTuple = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oHighestTuple;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_getCommCostBetweenNodes1(threadData_t *threadData, modelica_metatype _iCommCost, modelica_metatype _iChildComps)
{
  modelica_boolean _oResult;
  modelica_integer _compIdx;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oResult has no default value.
  // _compIdx has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iCommCost;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  _compIdx = tmp3  /* pattern as ty=Integer */;

  _oResult = omc_List_exist1(threadData, _iChildComps, boxvar_intEq, mmc_mk_integer(_compIdx));
  _return: OMC_LABEL_UNUSED
  return _oResult;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommCostBetweenNodes1(threadData_t *threadData, modelica_metatype _iCommCost, modelica_metatype _iChildComps)
{
  modelica_boolean _oResult;
  modelica_metatype out_oResult;
  _oResult = omc_HpcOmTaskGraph_getCommCostBetweenNodes1(threadData, _iCommCost, _iChildComps);
  out_oResult = mmc_mk_icon(_oResult);
  return out_oResult;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommCostBetweenNodes0(threadData_t *threadData, modelica_integer _iParentComp, modelica_metatype _iChildComps, modelica_metatype _iCommCosts)
{
  modelica_metatype _oHighestComm = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _filteredCommCosts = NULL;
  modelica_metatype _highestCommCost = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oHighestComm has no default value.
  // _commCosts has no default value.
  // _filteredCommCosts has no default value.
  // _highestCommCost has no default value.
  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          /* Pattern matching succeeded */
          _commCosts = arrayGet(_iCommCosts, _iParentComp);

          _filteredCommCosts = omc_List_filter1OnTrue(threadData, _commCosts, boxvar_HpcOmTaskGraph_getCommCostBetweenNodes1, _iChildComps);

          /* Pattern-matching assignment */
          tmp6 = listEmpty(_filteredCommCosts);
          if (0 /* false */ != tmp6) goto goto_2;

          _highestCommCost = omc_HpcOmTaskGraph_getHighestCommCost(threadData, _filteredCommCosts, _OMC_LIT44);
          tmpMeta1 = mmc_mk_some(_highestCommCost);
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmpMeta1 = mmc_mk_none();
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oHighestComm = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oHighestComm;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommCostBetweenNodes0(threadData_t *threadData, modelica_metatype _iParentComp, modelica_metatype _iChildComps, modelica_metatype _iCommCosts)
{
  modelica_integer tmp1;
  modelica_metatype _oHighestComm = NULL;
  tmp1 = mmc_unbox_integer(_iParentComp);
  _oHighestComm = omc_HpcOmTaskGraph_getCommCostBetweenNodes0(threadData, tmp1, _iChildComps, _iCommCosts);
  /* skip box _oHighestComm; Option<HpcOmTaskGraph.Communication> */
  return _oHighestComm;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommCostBetweenNodes(threadData_t *threadData, modelica_integer _iParentNodeIdx, modelica_integer _iChildNodeIdx, modelica_metatype _iTaskGraphMeta)
{
  modelica_metatype _oCommCost = NULL;
  modelica_metatype _childComps = NULL;
  modelica_metatype _parentComps = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _concreteCommCostsOpt = NULL;
  modelica_metatype _concreteCommCosts = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommCost has no default value.
  // _childComps has no default value.
  // _parentComps has no default value.
  // _inComps has no default value.
  // _commCosts has no default value.
  // _concreteCommCostsOpt has no default value.
  // _concreteCommCosts has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iTaskGraphMeta;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  _inComps = tmpMeta2;
  _commCosts = tmpMeta3;

  _parentComps = arrayGet(_inComps, _iParentNodeIdx);

  _childComps = arrayGet(_inComps, _iChildNodeIdx);

  _concreteCommCostsOpt = omc_List_map2(threadData, _parentComps, boxvar_HpcOmTaskGraph_getCommCostBetweenNodes0, _childComps, _commCosts);

  {
    modelica_metatype __omcQ_24tmpVar3;
    modelica_metatype* tmp5;
    modelica_metatype tmpMeta6;
    modelica_metatype __omcQ_24tmpVar2;
    modelica_integer tmp7;
    modelica_metatype _c_loopVar = 0;
    modelica_metatype _c;
    _c_loopVar = _concreteCommCostsOpt;
    tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar3 = tmpMeta6; /* defaultValue */
    tmp5 = &__omcQ_24tmpVar3;
    while(1) {
      tmp7 = 1;
      while (!listEmpty(_c_loopVar)) {
        _c = MMC_CAR(_c_loopVar);
        _c_loopVar = MMC_CDR(_c_loopVar);
        if (isSome(_c)) {
          tmp7--;
          break;
        }
      }
      if (tmp7 == 0) {
        __omcQ_24tmpVar2 = omc_Util_getOption(threadData, _c);
        *tmp5 = mmc_mk_cons(__omcQ_24tmpVar2,0);
        tmp5 = &MMC_CDR(*tmp5);
      } else if (tmp7 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp5 = mmc_mk_nil();
    tmpMeta4 = __omcQ_24tmpVar3;
  }
  _concreteCommCosts = tmpMeta4;

  _oCommCost = omc_HpcOmTaskGraph_getHighestCommCost(threadData, _concreteCommCosts, _OMC_LIT44);
  _return: OMC_LABEL_UNUSED
  return _oCommCost;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommCostBetweenNodes(threadData_t *threadData, modelica_metatype _iParentNodeIdx, modelica_metatype _iChildNodeIdx, modelica_metatype _iTaskGraphMeta)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _oCommCost = NULL;
  tmp1 = mmc_unbox_integer(_iParentNodeIdx);
  tmp2 = mmc_unbox_integer(_iChildNodeIdx);
  _oCommCost = omc_HpcOmTaskGraph_getCommCostBetweenNodes(threadData, tmp1, tmp2, _iTaskGraphMeta);
  /* skip box _oCommCost; HpcOmTaskGraph.Communication */
  return _oCommCost;
}

DLLDirection
modelica_real omc_HpcOmTaskGraph_getCommCostTimeBetweenNodes(threadData_t *threadData, modelica_integer _iParentNodeIdx, modelica_integer _iChildNodeIdx, modelica_metatype _iTaskGraphMeta)
{
  modelica_real _oCommCost;
  modelica_real _requiredTime;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_real tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommCost has no default value.
  // _requiredTime has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = omc_HpcOmTaskGraph_getCommCostBetweenNodes(threadData, _iParentNodeIdx, _iChildNodeIdx, _iTaskGraphMeta);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmp3 = mmc_unbox_real(tmpMeta2);
  _requiredTime = tmp3  /* pattern as ty=Real */;

  _oCommCost = _requiredTime;
  _return: OMC_LABEL_UNUSED
  return _oCommCost;
}
modelica_metatype boxptr_HpcOmTaskGraph_getCommCostTimeBetweenNodes(threadData_t *threadData, modelica_metatype _iParentNodeIdx, modelica_metatype _iChildNodeIdx, modelica_metatype _iTaskGraphMeta)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_real _oCommCost;
  modelica_metatype out_oCommCost;
  tmp1 = mmc_unbox_integer(_iParentNodeIdx);
  tmp2 = mmc_unbox_integer(_iChildNodeIdx);
  _oCommCost = omc_HpcOmTaskGraph_getCommCostTimeBetweenNodes(threadData, tmp1, tmp2, _iTaskGraphMeta);
  out_oCommCost = mmc_mk_rcon(_oCommCost);
  return out_oCommCost;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommunicationByChildIdx(threadData_t *threadData, modelica_metatype _iComms, modelica_integer _iChildIdx)
{
  modelica_metatype _oComm = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oComm has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iComms;
    {
      modelica_integer _currentCommChild;
      modelica_metatype _head = NULL;
      modelica_metatype _rest = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _currentCommChild has no default value.
      // _head has no default value.
      // _rest has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_boolean tmp10;
          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), 7));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          
          _currentCommChild = tmp9  /* pattern as ty=Integer */;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp10 = (_currentCommChild == _iChildIdx);
          if (0 /* false */ != tmp10) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_getCommunicationByChildIdx(threadData, _rest, _iChildIdx);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_boolean tmp15;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta11 = MMC_CAR(tmp4_1);
          tmpMeta12 = MMC_CDR(tmp4_1);
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 7));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          
          _head = tmpMeta11;
          _currentCommChild = tmp14  /* pattern as ty=Integer */;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          /* Pattern-matching assignment */
          tmp15 = (_currentCommChild == _iChildIdx);
          if (1 /* true */ != tmp15) goto goto_2;
          tmpMeta1 = _head;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta16 = stringAppend(_OMC_LIT45,intString(_iChildIdx));
          tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT46);
          fputs(MMC_STRINGDATA(tmpMeta17),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oComm = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oComm;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommunicationByChildIdx(threadData_t *threadData, modelica_metatype _iComms, modelica_metatype _iChildIdx)
{
  modelica_integer tmp1;
  modelica_metatype _oComm = NULL;
  tmp1 = mmc_unbox_integer(_iChildIdx);
  _oComm = omc_HpcOmTaskGraph_getCommunicationByChildIdx(threadData, _iComms, tmp1);
  /* skip box _oComm; HpcOmTaskGraph.Communication */
  return _oComm;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommunicationCost(threadData_t *threadData, modelica_integer _childIdx, modelica_integer _parentIdx, modelica_metatype _commCosts)
{
  modelica_metatype _oComm = NULL;
  modelica_metatype _commRow = NULL;
  modelica_metatype _commEntry = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oComm has no default value.
  // _commRow has no default value.
  // _commEntry has no default value.
  _commRow = arrayGet(_commCosts, _parentIdx);

  _commEntry = omc_HpcOmTaskGraph_getCommunicationByChildIdx(threadData, _commRow, _childIdx);

  _oComm = _commEntry;
  _return: OMC_LABEL_UNUSED
  return _oComm;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCommunicationCost(threadData_t *threadData, modelica_metatype _childIdx, modelica_metatype _parentIdx, modelica_metatype _commCosts)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _oComm = NULL;
  tmp1 = mmc_unbox_integer(_childIdx);
  tmp2 = mmc_unbox_integer(_parentIdx);
  _oComm = omc_HpcOmTaskGraph_getCommunicationCost(threadData, tmp1, tmp2, _commCosts);
  /* skip box _oComm; HpcOmTaskGraph.Communication */
  return _oComm;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_transposeCommCosts1(threadData_t *threadData, modelica_metatype _iCost, modelica_integer _iParentCompIdx, modelica_metatype _iCommCosts)
{
  modelica_metatype _oCommCosts = NULL;
  modelica_metatype _tmpCommCosts = NULL;
  modelica_metatype _costs = NULL;
  modelica_integer _numberOfVars;
  modelica_integer _nodeIdx;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_metatype _stringVars = NULL;
  modelica_real _requiredTime;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommCosts has no default value.
  // _tmpCommCosts has no default value.
  // _costs has no default value.
  // _numberOfVars has no default value.
  // _nodeIdx has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _stringVars has no default value.
  // _requiredTime has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iCost;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          modelica_real tmp15;
          modelica_boolean tmp16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          tmp15 = mmc_unbox_real(tmpMeta14);
          _numberOfVars = tmp7  /* pattern as ty=Integer */;
          _integerVars = tmpMeta8;
          _floatVars = tmpMeta9;
          _booleanVars = tmpMeta10;
          _stringVars = tmpMeta11;
          _nodeIdx = tmp13  /* pattern as ty=Integer */;
          _requiredTime = tmp15  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp16 = (_nodeIdx <= arrayLength(_iCommCosts));
          if (1 /* true */ != tmp16) goto goto_2;

          _costs = arrayGet(_iCommCosts, _nodeIdx);

          tmpMeta18 = mmc_mk_box8(3, &HpcOmTaskGraph_Communication_COMMUNICATION__desc, mmc_mk_integer(_numberOfVars), _integerVars, _floatVars, _booleanVars, _stringVars, mmc_mk_integer(_iParentCompIdx), mmc_mk_real(_requiredTime));
          tmpMeta17 = mmc_mk_cons(tmpMeta18, _costs);
          _costs = tmpMeta17;
          tmpMeta1 = arrayUpdate(_iCommCosts, _nodeIdx, _costs);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iCommCosts;
          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:;
    }
  }
  _oCommCosts = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oCommCosts;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_transposeCommCosts1(threadData_t *threadData, modelica_metatype _iCost, modelica_metatype _iParentCompIdx, modelica_metatype _iCommCosts)
{
  modelica_integer tmp1;
  modelica_metatype _oCommCosts = NULL;
  tmp1 = mmc_unbox_integer(_iParentCompIdx);
  _oCommCosts = omc_HpcOmTaskGraph_transposeCommCosts1(threadData, _iCost, tmp1, _iCommCosts);
  /* skip box _oCommCosts; array<list<HpcOmTaskGraph.Communication>> */
  return _oCommCosts;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_transposeCommCosts0(threadData_t *threadData, modelica_metatype _iCosts, modelica_metatype _iCommCosts)
{
  modelica_metatype _oCommCosts = NULL;
  modelica_integer _iParentCompIdx;
  modelica_metatype _tmpCommCosts = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommCosts has no default value.
  // _iParentCompIdx has no default value.
  // _tmpCommCosts has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iCommCosts;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _iParentCompIdx = tmp3  /* pattern as ty=Integer */;
  _tmpCommCosts = tmpMeta4;

  _tmpCommCosts = omc_List_fold1(threadData, _iCosts, boxvar_HpcOmTaskGraph_transposeCommCosts1, mmc_mk_integer(_iParentCompIdx), _tmpCommCosts);

  tmpMeta5 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _iParentCompIdx), _tmpCommCosts);
  _oCommCosts = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _oCommCosts;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_transposeCommCosts(threadData_t *threadData, modelica_metatype _iCommCosts)
{
  modelica_metatype _oCommCosts = NULL;
  modelica_metatype _tmpCommCosts = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommCosts has no default value.
  // _tmpCommCosts has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _tmpCommCosts = arrayCreate(arrayLength(_iCommCosts), tmpMeta1);

  /* Pattern-matching assignment */
  tmpMeta2 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1)), _tmpCommCosts);
  tmpMeta3 = omc_Array_fold(threadData, _iCommCosts, boxvar_HpcOmTaskGraph_transposeCommCosts0, tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
  _tmpCommCosts = tmpMeta4;

  _oCommCosts = _tmpCommCosts;
  _return: OMC_LABEL_UNUSED
  return _oCommCosts;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_tupleToStringIntRealInt(threadData_t *threadData, modelica_metatype _inTuple)
{
  modelica_string _result = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _result has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inTuple;
    {
      modelica_integer _int1;
      modelica_integer _int2;
      modelica_real _real1;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _int1 has no default value.
      // _int2 has no default value.
      // _real1 has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_real tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_real(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          _int1 = tmp7  /* pattern as ty=Integer */;
          _real1 = tmp9  /* pattern as ty=Real */;
          _int2 = tmp11  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta12 = stringAppend(_OMC_LIT30,intString(_int1));
          tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT31);
          tmpMeta14 = stringAppend(tmpMeta13,realString(_real1));
          tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT47);
          tmpMeta16 = stringAppend(tmpMeta15,intString(_int2));
          tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT32);
          tmp1 = tmpMeta17;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _result = tmp1;
  _return: OMC_LABEL_UNUSED
  return _result;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_setLevelInNodeMark(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _inComps, modelica_metatype _nodeCoords, modelica_metatype _nodeMarkIn)
{
  modelica_metatype _nodeMarkOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodeMarkOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _components = NULL;
      modelica_integer _primalComp;
      modelica_integer _nodeMarkEntry;
      modelica_integer _yCoord;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _components has no default value.
      // _primalComp has no default value.
      // _nodeMarkEntry has no default value.
      // _yCoord has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          /* Pattern matching succeeded */
          _nodeMarkEntry = mmc_unbox_integer(arrayGet(_nodeMarkIn, _nodeIdx));

          _components = arrayGet(_inComps, _nodeIdx);

          _primalComp = mmc_unbox_integer(omc_List_last(threadData, _components));

          _nodeMarkEntry = mmc_unbox_integer(arrayGet(_nodeMarkIn, _primalComp));

          /* Pattern-matching assignment */
          tmp6 = (((modelica_integer) -1) == _nodeMarkEntry);
          if (1 /* true */ != tmp6) goto goto_2;
          tmpMeta1 = _nodeMarkIn;
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_integer tmp10;
          /* Pattern matching succeeded */
          _nodeMarkEntry = mmc_unbox_integer(arrayGet(_nodeMarkIn, _nodeIdx));

          _components = arrayGet(_inComps, _nodeIdx);

          _primalComp = mmc_unbox_integer(omc_List_last(threadData, _components));

          _nodeMarkEntry = mmc_unbox_integer(arrayGet(_nodeMarkIn, _primalComp));

          /* Pattern-matching assignment */
          tmp7 = (((modelica_integer) -1) == _nodeMarkEntry);
          if (0 /* false */ != tmp7) goto goto_2;

          /* Pattern-matching assignment */
          tmpMeta8 = arrayGet(_nodeCoords, _nodeIdx);
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          tmp10 = mmc_unbox_integer(tmpMeta9);
          _yCoord = tmp10  /* pattern as ty=Integer */;
          tmpMeta1 = arrayUpdate(_nodeMarkIn, _primalComp, mmc_mk_integer(_yCoord));
          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:;
    }
  }
  _nodeMarkOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _nodeMarkOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setLevelInNodeMark(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _inComps, modelica_metatype _nodeCoords, modelica_metatype _nodeMarkIn)
{
  modelica_integer tmp1;
  modelica_metatype _nodeMarkOut = NULL;
  tmp1 = mmc_unbox_integer(_nodeIdx);
  _nodeMarkOut = omc_HpcOmTaskGraph_setLevelInNodeMark(threadData, tmp1, _inComps, _nodeCoords, _nodeMarkIn);
  /* skip box _nodeMarkOut; array<#Integer> */
  return _nodeMarkOut;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getParallelSetForComp(threadData_t *threadData, modelica_integer _compIn, modelica_integer _setIdx, modelica_metatype _parallelSets)
{
  modelica_integer _parallelSetOut;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _parallelSetOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _parallelSet = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _parallelSet has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_boolean tmp7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (_setIdx <= listLength(_parallelSets));
          if (1 /* true */ != tmp6) goto goto_2;

          _parallelSet = listGet(_parallelSets, _setIdx);

          /* Pattern-matching assignment */
          tmp7 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_compIn), _parallelSet, boxvar_intEq);
          if (1 /* true */ != tmp7) goto goto_2;
          tmp1 = _setIdx;
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp8;
          modelica_boolean tmp9;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = (_setIdx <= listLength(_parallelSets));
          if (1 /* true */ != tmp8) goto goto_2;

          _parallelSet = listGet(_parallelSets, _setIdx);

          /* Pattern-matching assignment */
          tmp9 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_compIn), _parallelSet, boxvar_intEq);
          if (0 /* false */ != tmp9) goto goto_2;
          tmp1 = omc_HpcOmTaskGraph_getParallelSetForComp(threadData, _compIn, ((modelica_integer) 1) + _setIdx, _parallelSets);
          goto tmp3_done;
        }
        case 2: {
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT48),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _parallelSetOut = tmp1;
  _return: OMC_LABEL_UNUSED
  return _parallelSetOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getParallelSetForComp(threadData_t *threadData, modelica_metatype _compIn, modelica_metatype _setIdx, modelica_metatype _parallelSets)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer _parallelSetOut;
  modelica_metatype out_parallelSetOut;
  tmp1 = mmc_unbox_integer(_compIn);
  tmp2 = mmc_unbox_integer(_setIdx);
  _parallelSetOut = omc_HpcOmTaskGraph_getParallelSetForComp(threadData, tmp1, tmp2, _parallelSets);
  out_parallelSetOut = mmc_mk_icon(_parallelSetOut);
  return out_parallelSetOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getYCoordForNode(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _parallelSets, modelica_metatype _nodeCoordsIn)
{
  modelica_metatype _nodeCoordsOut = NULL;
  modelica_integer _parallelSetIdx;
  modelica_integer _xCoord;
  modelica_integer _yCoord;
  modelica_integer _levelInterval;
  modelica_metatype _coords = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodeCoordsOut has no default value.
  // _parallelSetIdx has no default value.
  // _xCoord has no default value.
  // _yCoord has no default value.
  // _levelInterval has no default value.
  // _coords has no default value.
  _parallelSetIdx = omc_HpcOmTaskGraph_getParallelSetForComp(threadData, _compIdx, ((modelica_integer) 1), _parallelSets);

  /* Pattern-matching assignment */
  tmpMeta1 = arrayGet(_nodeCoordsIn, _compIdx);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  _xCoord = tmp3  /* pattern as ty=Integer */;
  _yCoord = tmp5  /* pattern as ty=Integer */;

  tmpMeta6 = mmc_mk_box2(0, mmc_mk_integer(_xCoord), mmc_mk_integer(_parallelSetIdx));
  _coords = tmpMeta6;

  _nodeCoordsOut = arrayUpdate(_nodeCoordsIn, _compIdx, _coords);
  _return: OMC_LABEL_UNUSED
  return _nodeCoordsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getYCoordForNode(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _parallelSets, modelica_metatype _nodeCoordsIn)
{
  modelica_integer tmp1;
  modelica_metatype _nodeCoordsOut = NULL;
  tmp1 = mmc_unbox_integer(_compIdx);
  _nodeCoordsOut = omc_HpcOmTaskGraph_getYCoordForNode(threadData, tmp1, _parallelSets, _nodeCoordsIn);
  /* skip box _nodeCoordsOut; array<tuple<#Integer, #Integer>> */
  return _nodeCoordsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeCoords(threadData_t *threadData, modelica_metatype _parallelSets, modelica_metatype _graphIn)
{
  modelica_metatype _nodeCoordsOut = NULL;
  modelica_metatype _nodeCoords = NULL;
  modelica_integer _size;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodeCoordsOut has no default value.
  // _nodeCoords has no default value.
  // _size has no default value.
  _size = arrayLength(_graphIn);

  _nodeCoords = arrayCreate(_size, _OMC_LIT49);

  _nodeCoords = omc_List_fold1(threadData, omc_List_intRange(threadData, _size), boxvar_HpcOmTaskGraph_getYCoordForNode, _parallelSets, _nodeCoords);

  _nodeCoordsOut = _nodeCoords;
  _return: OMC_LABEL_UNUSED
  return _nodeCoordsOut;
}

PROTECTED_FUNCTION_STATIC modelica_real omc_HpcOmTaskGraph_getCostsForContractedNodes1(threadData_t *threadData, modelica_integer _node, modelica_metatype _exeCosts, modelica_real _costsIn)
{
  modelica_real _costsOut;
  modelica_real _exeCost;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_real tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _costsOut has no default value.
  // _exeCost has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = arrayGet(_exeCosts, _node);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_real(tmpMeta2);
  _exeCost = tmp3  /* pattern as ty=Real */;

  _costsOut = _costsIn + _exeCost;
  _return: OMC_LABEL_UNUSED
  return _costsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCostsForContractedNodes1(threadData_t *threadData, modelica_metatype _node, modelica_metatype _exeCosts, modelica_metatype _costsIn)
{
  modelica_integer tmp1;
  modelica_real tmp2;
  modelica_real _costsOut;
  modelica_metatype out_costsOut;
  tmp1 = mmc_unbox_integer(_node);
  tmp2 = mmc_unbox_real(_costsIn);
  _costsOut = omc_HpcOmTaskGraph_getCostsForContractedNodes1(threadData, tmp1, _exeCosts, tmp2);
  out_costsOut = mmc_mk_rcon(_costsOut);
  return out_costsOut;
}

DLLDirection
modelica_real omc_HpcOmTaskGraph_getCostsForContractedNodes(threadData_t *threadData, modelica_metatype _nodeList, modelica_metatype _exeCosts)
{
  modelica_real _costsOut;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _costsOut has no default value.
  _costsOut = mmc_unbox_real(omc_List_fold1(threadData, _nodeList, boxvar_HpcOmTaskGraph_getCostsForContractedNodes1, _exeCosts, _OMC_LIT41));
  _return: OMC_LABEL_UNUSED
  return _costsOut;
}
modelica_metatype boxptr_HpcOmTaskGraph_getCostsForContractedNodes(threadData_t *threadData, modelica_metatype _nodeList, modelica_metatype _exeCosts)
{
  modelica_real _costsOut;
  modelica_metatype out_costsOut;
  _costsOut = omc_HpcOmTaskGraph_getCostsForContractedNodes(threadData, _nodeList, _exeCosts);
  out_costsOut = mmc_mk_rcon(_costsOut);
  return out_costsOut;
}

PROTECTED_FUNCTION_STATIC modelica_real omc_HpcOmTaskGraph_getCostsForNode(threadData_t *threadData, modelica_integer _parentNode, modelica_integer _childNode, modelica_metatype _inComps, modelica_metatype _exeCosts, modelica_metatype _commCosts)
{
  modelica_real _costsOut;
  modelica_real tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _costsOut has no default value.
  { /* matchcontinue expression */
    volatile modelica_integer tmp4_1;
    tmp4_1 = _parentNode;
    {
      modelica_real _costs;
      modelica_real _commCost;
      modelica_integer _primalChild;
      modelica_integer _primalParent;
      modelica_metatype _primalChildLst = NULL;
      modelica_metatype _primalParentLst = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _costs has no default value.
      // _commCost has no default value.
      // _primalChild has no default value.
      // _primalParent has no default value.
      // _primalChildLst has no default value.
      // _primalParentLst has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_real tmp9;
          if (0 != tmp4_1) goto tmp3_end;
          /* Pattern matching succeeded */
          _primalChildLst = arrayGet(_inComps, _childNode);

          /* Pattern-matching assignment */
          tmp6 = (listLength(_primalChildLst) == ((modelica_integer) 1));
          if (1 /* true */ != tmp6) goto goto_2;

          _primalChild = mmc_unbox_integer(listGet(_primalChildLst, ((modelica_integer) 1)));

          /* Pattern-matching assignment */
          tmpMeta7 = arrayGet(_exeCosts, _primalChild);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
          tmp9 = mmc_unbox_real(tmpMeta8);
          _costs = tmp9  /* pattern as ty=Real */;
          tmp1 = _costs;
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp10;
          if (0 != tmp4_1) goto tmp3_end;
          /* Pattern matching succeeded */
          _primalChildLst = arrayGet(_inComps, _childNode);

          /* Pattern-matching assignment */
          tmp10 = (listLength(_primalChildLst) > ((modelica_integer) 1));
          if (1 /* true */ != tmp10) goto goto_2;

          listGet(_primalChildLst, ((modelica_integer) 1));
          tmp1 = omc_HpcOmTaskGraph_getCostsForContractedNodes(threadData, _primalChildLst, _exeCosts);
          goto tmp3_done;
        }
        case 2: {
          modelica_boolean tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_real tmp14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_real tmp17;
          
          /* Pattern matching succeeded */
          _primalChildLst = arrayGet(_inComps, _childNode);

          _primalParentLst = arrayGet(_inComps, _parentNode);

          /* Pattern-matching assignment */
          tmp11 = (listLength(_primalChildLst) == ((modelica_integer) 1));
          if (1 /* true */ != tmp11) goto goto_2;

          _primalChild = mmc_unbox_integer(listGet(_primalChildLst, ((modelica_integer) 1)));

          _primalParent = mmc_unbox_integer(listGet(_primalParentLst, ((modelica_integer) 1)));

          /* Pattern-matching assignment */
          tmpMeta12 = arrayGet(_exeCosts, _primalChild);
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
          tmp14 = mmc_unbox_real(tmpMeta13);
          _costs = tmp14  /* pattern as ty=Real */;

          /* Pattern-matching assignment */
          tmpMeta15 = omc_HpcOmTaskGraph_getCommunicationCost(threadData, _primalChild, _primalParent, _commCosts);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 8));
          tmp17 = mmc_unbox_real(tmpMeta16);
          _commCost = tmp17  /* pattern as ty=Real */;
          tmp1 = _costs + _commCost;
          goto tmp3_done;
        }
        case 3: {
          modelica_boolean tmp18;
          
          /* Pattern matching succeeded */
          _primalChildLst = arrayGet(_inComps, _childNode);

          arrayGet(_inComps, _parentNode);

          /* Pattern-matching assignment */
          tmp18 = (listLength(_primalChildLst) > ((modelica_integer) 1));
          if (1 /* true */ != tmp18) goto goto_2;
          tmp1 = omc_HpcOmTaskGraph_getCostsForContractedNodes(threadData, _primalChildLst, _exeCosts);
          goto tmp3_done;
        }
        case 4: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT50),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 5) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _costsOut = tmp1;
  _return: OMC_LABEL_UNUSED
  return _costsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCostsForNode(threadData_t *threadData, modelica_metatype _parentNode, modelica_metatype _childNode, modelica_metatype _inComps, modelica_metatype _exeCosts, modelica_metatype _commCosts)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_real _costsOut;
  modelica_metatype out_costsOut;
  tmp1 = mmc_unbox_integer(_parentNode);
  tmp2 = mmc_unbox_integer(_childNode);
  _costsOut = omc_HpcOmTaskGraph_getCostsForNode(threadData, tmp1, tmp2, _inComps, _exeCosts, _commCosts);
  out_costsOut = mmc_mk_rcon(_costsOut);
  return out_costsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_gatherParallelSets1(threadData_t *threadData, modelica_integer _idx, modelica_metatype _nodeInfo, modelica_metatype _parallelSetIn)
{
  modelica_metatype _parallelSetOut = NULL;
  modelica_integer _level;
  modelica_metatype _pSet = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _parallelSetOut has no default value.
  // _level has no default value.
  // _pSet has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = arrayGet(_nodeInfo, _idx);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  _level = tmp3  /* pattern as ty=Integer */;

  _pSet = listGet(_parallelSetIn, _level);

  tmpMeta4 = mmc_mk_cons(mmc_mk_integer(_idx), _pSet);
  _pSet = tmpMeta4;

  _parallelSetOut = omc_List_replaceAt(threadData, _pSet, _level, _parallelSetIn);
  _return: OMC_LABEL_UNUSED
  return _parallelSetOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_gatherParallelSets1(threadData_t *threadData, modelica_metatype _idx, modelica_metatype _nodeInfo, modelica_metatype _parallelSetIn)
{
  modelica_integer tmp1;
  modelica_metatype _parallelSetOut = NULL;
  tmp1 = mmc_unbox_integer(_idx);
  _parallelSetOut = omc_HpcOmTaskGraph_gatherParallelSets1(threadData, tmp1, _nodeInfo, _parallelSetIn);
  /* skip box _parallelSetOut; list<list<#Integer>> */
  return _parallelSetOut;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_numberOfLevels(threadData_t *threadData, modelica_metatype _nodeInfoEntry, modelica_integer _numLevelsIn)
{
  modelica_integer _numLevelsOut;
  modelica_integer _levelIn;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _numLevelsOut has no default value.
  // _levelIn has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _nodeInfoEntry;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  _levelIn = tmp3  /* pattern as ty=Integer */;

  _numLevelsOut = modelica_integer_max((modelica_integer)(_levelIn),(modelica_integer)(_numLevelsIn));
  _return: OMC_LABEL_UNUSED
  return _numLevelsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_numberOfLevels(threadData_t *threadData, modelica_metatype _nodeInfoEntry, modelica_metatype _numLevelsIn)
{
  modelica_integer tmp1;
  modelica_integer _numLevelsOut;
  modelica_metatype out_numLevelsOut;
  tmp1 = mmc_unbox_integer(_numLevelsIn);
  _numLevelsOut = omc_HpcOmTaskGraph_numberOfLevels(threadData, _nodeInfoEntry, tmp1);
  out_numLevelsOut = mmc_mk_icon(_numLevelsOut);
  return out_numLevelsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_gatherParallelSets(threadData_t *threadData, modelica_metatype _nodeInfo)
{
  modelica_metatype _parallelSetsOut = NULL;
  modelica_integer _numLevels;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _parallelSetsOut has no default value.
  // _numLevels has no default value.
  _numLevels = mmc_unbox_integer(omc_Array_fold(threadData, _nodeInfo, boxvar_HpcOmTaskGraph_numberOfLevels, mmc_mk_integer(((modelica_integer) 0))));

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _parallelSetsOut = omc_List_fold1(threadData, omc_List_intRange(threadData, arrayLength(_nodeInfo)), boxvar_HpcOmTaskGraph_gatherParallelSets1, _nodeInfo, omc_List_fill(threadData, tmpMeta1, _numLevels));
  _return: OMC_LABEL_UNUSED
  return _parallelSetsOut;
}

PROTECTED_FUNCTION_STATIC modelica_real omc_HpcOmTaskGraph_addUpExeCostsForNode(threadData_t *threadData, modelica_metatype _iNodeComps, modelica_metatype _iExeCosts, modelica_real _iExeCost)
{
  modelica_real _oExeCost;
  modelica_integer _head;
  modelica_metatype _rest = NULL;
  modelica_real _cost;
  modelica_real tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oExeCost has no default value.
  // _head has no default value.
  // _rest has no default value.
  // _cost has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iNodeComps;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_real tmp11;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmp8 = mmc_unbox_integer(tmpMeta6);
          _head = tmp8  /* pattern as ty=Integer */;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta9 = arrayGet(_iExeCosts, _head);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
          tmp11 = mmc_unbox_real(tmpMeta10);
          _cost = tmp11  /* pattern as ty=Real */;

          _cost = _cost + _iExeCost;
          /* Tail recursive call */
          _iNodeComps = _rest;
          _iExeCost = _cost;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmp1 = _iExeCost;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oExeCost = tmp1;
  _return: OMC_LABEL_UNUSED
  return _oExeCost;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addUpExeCostsForNode(threadData_t *threadData, modelica_metatype _iNodeComps, modelica_metatype _iExeCosts, modelica_metatype _iExeCost)
{
  modelica_real tmp1;
  modelica_real _oExeCost;
  modelica_metatype out_oExeCost;
  tmp1 = mmc_unbox_real(_iExeCost);
  _oExeCost = omc_HpcOmTaskGraph_addUpExeCostsForNode(threadData, _iNodeComps, _iExeCosts, tmp1);
  out_oExeCost = mmc_mk_rcon(_oExeCost);
  return out_oExeCost;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getCriticalPath2(threadData_t *threadData, modelica_metatype _iCriticalPaths, modelica_integer _iListIdx, modelica_real _iLongestPath, modelica_integer _iLongestPathIndex)
{
  modelica_integer _oLongestPathIndex;
  modelica_real _cpCost;
  modelica_metatype _criticalPath = NULL;
  modelica_metatype _rest = NULL;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oLongestPathIndex has no default value.
  // _cpCost has no default value.
  // _criticalPath has no default value.
  // _rest has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iCriticalPaths;
    {
      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_real tmp9;
          modelica_metatype tmpMeta10;
          modelica_boolean tmp11;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
          tmp9 = mmc_unbox_real(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          _cpCost = tmp9  /* pattern as ty=Real */;
          _criticalPath = tmpMeta10;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp11 = (_cpCost > _iLongestPath);
          if (1 /* true */ != tmp11) goto goto_2;
          tmp1 = omc_HpcOmTaskGraph_getCriticalPath2(threadData, _rest, ((modelica_integer) 1) + _iListIdx, _cpCost, _iListIdx);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_real tmp15;
          modelica_metatype tmpMeta16;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta12 = MMC_CAR(tmp4_1);
          tmpMeta13 = MMC_CDR(tmp4_1);
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
          tmp15 = mmc_unbox_real(tmpMeta14);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
          _cpCost = tmp15  /* pattern as ty=Real */;
          _criticalPath = tmpMeta16;
          _rest = tmpMeta13;
          /* Pattern matching succeeded */
          tmp1 = omc_HpcOmTaskGraph_getCriticalPath2(threadData, _rest, ((modelica_integer) 1) + _iListIdx, _iLongestPath, _iLongestPathIndex);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmp1 = _iLongestPathIndex;
          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:;
    }
  }
  _oLongestPathIndex = tmp1;
  _return: OMC_LABEL_UNUSED
  return _oLongestPathIndex;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCriticalPath2(threadData_t *threadData, modelica_metatype _iCriticalPaths, modelica_metatype _iListIdx, modelica_metatype _iLongestPath, modelica_metatype _iLongestPathIndex)
{
  modelica_integer tmp1;
  modelica_real tmp2;
  modelica_integer tmp3;
  modelica_integer _oLongestPathIndex;
  modelica_metatype out_oLongestPathIndex;
  tmp1 = mmc_unbox_integer(_iListIdx);
  tmp2 = mmc_unbox_real(_iLongestPath);
  tmp3 = mmc_unbox_integer(_iLongestPathIndex);
  _oLongestPathIndex = omc_HpcOmTaskGraph_getCriticalPath2(threadData, _iCriticalPaths, tmp1, tmp2, tmp3);
  out_oLongestPathIndex = mmc_mk_icon(_oLongestPathIndex);
  return out_oLongestPathIndex;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCriticalPath1(threadData_t *threadData, modelica_integer _iNode, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_boolean _iHandleCommCosts, modelica_metatype _iNodeCriticalPaths)
{
  modelica_metatype _criticalPathOut = NULL;
  modelica_real _cpCalcTime;
  modelica_real _calcTime;
  modelica_real _commTime;
  modelica_integer _criticalPathIdx;
  modelica_metatype _commCost = NULL;
  modelica_metatype _childNodes = NULL;
  modelica_metatype _criticalPathChild = NULL;
  modelica_metatype _criticalPath = NULL;
  modelica_metatype _nodeComps = NULL;
  modelica_metatype _criticalPaths = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _criticalPathOut has no default value.
  // _cpCalcTime has no default value.
  // _calcTime has no default value.
  // _commTime has no default value.
  // _criticalPathIdx has no default value.
  // _commCost has no default value.
  // _childNodes has no default value.
  // _criticalPathChild has no default value.
  // _criticalPath has no default value.
  // _nodeComps has no default value.
  // _criticalPaths has no default value.
  // _exeCosts has no default value.
  // _inComps has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iGraphData;
    {
      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_real tmp10;
          modelica_metatype tmpMeta11;
          modelica_boolean tmp12;
          modelica_metatype tmpMeta13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          
          _inComps = tmpMeta6;
          _exeCosts = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta8 = arrayGet(_iNodeCriticalPaths, _iNode);
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
          tmp10 = mmc_unbox_real(tmpMeta9);
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          _cpCalcTime = tmp10  /* pattern as ty=Real */;
          _criticalPath = tmpMeta11;

          /* Pattern-matching assignment */
          tmp12 = (_cpCalcTime >= 0.0);
          if (1 /* true */ != tmp12) goto goto_2;
          tmpMeta13 = mmc_mk_box2(0, mmc_mk_real(_cpCalcTime), _criticalPath);
          tmpMeta1 = tmpMeta13;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_boolean tmp16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_real tmp19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_real tmp24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          
          _inComps = tmpMeta14;
          _exeCosts = tmpMeta15;
          /* Pattern matching succeeded */
          _childNodes = arrayGet(_iGraph, _iNode);

          /* Pattern-matching assignment */
          tmp16 = listEmpty(_childNodes);
          if (0 /* false */ != tmp16) goto goto_2;

          _criticalPaths = omc_List_map4(threadData, _childNodes, boxvar_HpcOmTaskGraph_getCriticalPath1, _iGraph, _iGraphData, mmc_mk_boolean(_iHandleCommCosts), _iNodeCriticalPaths);

          _criticalPathIdx = omc_HpcOmTaskGraph_getCriticalPath2(threadData, _criticalPaths, ((modelica_integer) 1), -1.0, ((modelica_integer) -1));

          /* Pattern-matching assignment */
          tmpMeta17 = listGet(_criticalPaths, _criticalPathIdx);
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 1));
          tmp19 = mmc_unbox_real(tmpMeta18);
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
          _cpCalcTime = tmp19  /* pattern as ty=Real */;
          _criticalPathChild = tmpMeta20;

          tmpMeta21 = mmc_mk_cons(mmc_mk_integer(_iNode), _criticalPathChild);
          _criticalPath = tmpMeta21;

          _commCost = (_iHandleCommCosts?omc_HpcOmTaskGraph_getCommCostBetweenNodes(threadData, _iNode, mmc_unbox_integer(listHead(_criticalPathChild)), _iGraphData):_OMC_LIT51);

          _nodeComps = arrayGet(_inComps, _iNode);

          _calcTime = omc_HpcOmTaskGraph_addUpExeCostsForNode(threadData, _nodeComps, _exeCosts, 0.0);

          _calcTime = _cpCalcTime + _calcTime;

          /* Pattern-matching assignment */
          tmpMeta22 = _commCost;
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 8));
          tmp24 = mmc_unbox_real(tmpMeta23);
          _commTime = tmp24  /* pattern as ty=Real */;

          _calcTime = _calcTime + _commTime;

          tmpMeta25 = mmc_mk_box2(0, mmc_mk_real(_calcTime), _criticalPath);
          arrayUpdate(_iNodeCriticalPaths, _iNode, tmpMeta25);
          tmpMeta26 = mmc_mk_box2(0, mmc_mk_real(_calcTime), _criticalPath);
          tmpMeta1 = tmpMeta26;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_boolean tmp29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          
          _inComps = tmpMeta27;
          _exeCosts = tmpMeta28;
          /* Pattern matching succeeded */
          _childNodes = arrayGet(_iGraph, _iNode);

          /* Pattern-matching assignment */
          tmp29 = listEmpty(_childNodes);
          if (1 /* true */ != tmp29) goto goto_2;

          tmpMeta30 = mmc_mk_cons(mmc_mk_integer(_iNode), MMC_REFSTRUCTLIT(mmc_nil));
          _criticalPath = tmpMeta30;

          _nodeComps = arrayGet(_inComps, _iNode);

          _calcTime = omc_HpcOmTaskGraph_addUpExeCostsForNode(threadData, _nodeComps, _exeCosts, 0.0);

          tmpMeta31 = mmc_mk_box2(0, mmc_mk_real(_calcTime), _criticalPath);
          arrayUpdate(_iNodeCriticalPaths, _iNode, tmpMeta31);
          tmpMeta32 = mmc_mk_box2(0, mmc_mk_real(_calcTime), _criticalPath);
          tmpMeta1 = tmpMeta32;
          goto tmp3_done;
        }
        case 3: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT52),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 4) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _criticalPathOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _criticalPathOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCriticalPath1(threadData_t *threadData, modelica_metatype _iNode, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_metatype _iHandleCommCosts, modelica_metatype _iNodeCriticalPaths)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _criticalPathOut = NULL;
  tmp1 = mmc_unbox_integer(_iNode);
  tmp2 = mmc_unbox_integer(_iHandleCommCosts);
  _criticalPathOut = omc_HpcOmTaskGraph_getCriticalPath1(threadData, tmp1, _iGraph, _iGraphData, tmp2, _iNodeCriticalPaths);
  /* skip box _criticalPathOut; tuple<#Real, list<#Integer>> */
  return _criticalPathOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCriticalPath(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_metatype _iRootNodes, modelica_boolean _iHandleCommCosts, modelica_real *out_oCpCosts)
{
  modelica_metatype _oCriticalPathsOut = NULL;
  modelica_real _oCpCosts;
  modelica_metatype _nodeCriticalPaths = NULL;
  modelica_metatype _criticalPaths = NULL;
  modelica_integer _criticalPathIdx;
  modelica_metatype _criticalPath = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_real tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCriticalPathsOut has no default value.
  // _oCpCosts has no default value.
  // _nodeCriticalPaths has no default value.
  // _criticalPaths has no default value.
  // _criticalPathIdx has no default value.
  // _criticalPath has no default value.
  _nodeCriticalPaths = arrayCreate(arrayLength(_iGraph), _OMC_LIT53);

  _criticalPaths = omc_List_map4(threadData, _iRootNodes, boxvar_HpcOmTaskGraph_getCriticalPath1, _iGraph, _iGraphData, mmc_mk_boolean(_iHandleCommCosts), _nodeCriticalPaths);

  _criticalPathIdx = omc_HpcOmTaskGraph_getCriticalPath2(threadData, _criticalPaths, ((modelica_integer) 1), -1.0, ((modelica_integer) -1));

  /* Pattern-matching assignment */
  tmpMeta1 = listGet(_criticalPaths, _criticalPathIdx);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_real(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _oCpCosts = tmp3  /* pattern as ty=Real */;
  _criticalPath = tmpMeta4;

  tmpMeta5 = mmc_mk_cons(_criticalPath, MMC_REFSTRUCTLIT(mmc_nil));
  _oCriticalPathsOut = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  if (out_oCpCosts) { *out_oCpCosts = _oCpCosts; }
  return _oCriticalPathsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getCriticalPath(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_metatype _iRootNodes, modelica_metatype _iHandleCommCosts, modelica_metatype *out_oCpCosts)
{
  modelica_integer tmp1;
  modelica_real _oCpCosts;
  modelica_metatype _oCriticalPathsOut = NULL;
  tmp1 = mmc_unbox_integer(_iHandleCommCosts);
  _oCriticalPathsOut = omc_HpcOmTaskGraph_getCriticalPath(threadData, _iGraph, _iGraphData, _iRootNodes, tmp1, &_oCpCosts);
  /* skip box _oCriticalPathsOut; list<list<#Integer>> */
  if (out_oCpCosts) { *out_oCpCosts = mmc_mk_rcon(_oCpCosts); }
  return _oCriticalPathsOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getCriticalPaths(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphDataIn, modelica_metatype *out_criticalPathOutWoC)
{
  modelica_metatype _criticalPathOut = NULL;
  modelica_metatype _criticalPathOutWoC = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _criticalPathOut has no default value.
  // _criticalPathOutWoC has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _graphDataIn;
    {
      modelica_metatype _rootNodes = NULL;
      modelica_metatype _cpWCpaths = NULL;
      modelica_metatype _CpWoCpaths = NULL;
      modelica_real _cpWCcosts;
      modelica_real _cpWoCcosts;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _rootNodes has no default value.
      // _cpWCpaths has no default value.
      // _CpWoCpaths has no default value.
      // _cpWCcosts has no default value.
      // _cpWoCcosts has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (arrayLength(_graphIn) != ((modelica_integer) 0));
          if (1 /* true */ != tmp6) goto goto_2;

          _rootNodes = omc_HpcOmTaskGraph_getRootNodes(threadData, _graphIn);

          _cpWCpaths = omc_HpcOmTaskGraph_getCriticalPath(threadData, _graphIn, _graphDataIn, _rootNodes, 1 /* true */ ,&_cpWCcosts);

          _CpWoCpaths = omc_HpcOmTaskGraph_getCriticalPath(threadData, _graphIn, _graphDataIn, _rootNodes, 0 /* false */ ,&_cpWoCcosts);

          _cpWCcosts = omc_HpcOmTaskGraph_roundReal(threadData, _cpWCcosts, ((modelica_integer) 2));

          _cpWoCcosts = omc_HpcOmTaskGraph_roundReal(threadData, _cpWoCcosts, ((modelica_integer) 2));
          tmpMeta7 = mmc_mk_box2(0, _cpWCpaths, mmc_mk_real(_cpWCcosts));
          tmpMeta8 = mmc_mk_box2(0, _CpWoCpaths, mmc_mk_real(_cpWoCcosts));
          tmpMeta[0+0] = tmpMeta7;
          tmpMeta[0+1] = tmpMeta8;
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp9;
          
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp9 = (arrayLength(_graphIn) == ((modelica_integer) 0));
          if (1 /* true */ != tmp9) goto goto_2;
          tmpMeta[0+0] = _OMC_LIT55;
          tmpMeta[0+1] = _OMC_LIT55;
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT56),stdout);
          tmpMeta[0+0] = _OMC_LIT55;
          tmpMeta[0+1] = _OMC_LIT55;
          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:;
    }
  }
  _criticalPathOut = tmpMeta[0+0];
  _criticalPathOutWoC = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_criticalPathOutWoC) { *out_criticalPathOutWoC = _criticalPathOutWoC; }
  return _criticalPathOut;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareComponents(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2)
{
  modelica_boolean _res;
  modelica_string _comp1Str = NULL;
  modelica_string _comp2Str = NULL;
  modelica_integer _minLength;
  modelica_integer _compRes;
  modelica_integer _comp1Idx;
  modelica_integer _comp2Idx;
  modelica_metatype _comp1 = NULL;
  modelica_metatype _comp2 = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_integer tmp4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _res has no default value.
  // _comp1Str has no default value.
  // _comp2Str has no default value.
  // _minLength has no default value.
  // _compRes has no default value.
  // _comp1Idx has no default value.
  // _comp2Idx has no default value.
  // _comp1 has no default value.
  // _comp2 has no default value.
  if(omc_HpcOmTaskGraph_componentsEqual(threadData, _iComp1, _iComp2))
  {
    _res = 0 /* false */;
  }
  else
  {
    /* Pattern-matching assignment */
    tmpMeta1 = _iComp1;
    tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
    tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
    tmp4 = mmc_unbox_integer(tmpMeta3);
    _comp1 = tmpMeta2;
    _comp1Idx = tmp4  /* pattern as ty=Integer */;

    /* Pattern-matching assignment */
    tmpMeta5 = _iComp2;
    tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
    tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
    tmp8 = mmc_unbox_integer(tmpMeta7);
    _comp2 = tmpMeta6;
    _comp2Idx = tmp8  /* pattern as ty=Integer */;

    tmpMeta9 = stringAppend(omc_BackendDump_printComponent(threadData, _comp1, mmc_mk_none()),_OMC_LIT57);
    tmpMeta10 = stringAppend(tmpMeta9,intString(_comp1Idx));
    _comp1Str = tmpMeta10;

    tmpMeta11 = stringAppend(omc_BackendDump_printComponent(threadData, _comp2, mmc_mk_none()),_OMC_LIT57);
    tmpMeta12 = stringAppend(tmpMeta11,intString(_comp2Idx));
    _comp2Str = tmpMeta12;

    _minLength = modelica_integer_min((modelica_integer)(stringLength(_comp1Str)),(modelica_integer)(stringLength(_comp2Str)));

    _compRes = omc_System_strncmp(threadData, _comp1Str, _comp2Str, _minLength);

    if((_compRes == ((modelica_integer) 0)))
    {
      _res = (stringLength(_comp1Str) < stringLength(_comp2Str));
    }
    else
    {
      _res = (_compRes < ((modelica_integer) 0));
    }
  }
  _return: OMC_LABEL_UNUSED
  return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareComponents(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2)
{
  modelica_boolean _res;
  modelica_metatype out_res;
  _res = omc_HpcOmTaskGraph_compareComponents(threadData, _iComp1, _iComp2);
  out_res = mmc_mk_icon(_res);
  return out_res;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_componentsEqual(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2)
{
  modelica_boolean _res;
  modelica_string _comp1Str = NULL;
  modelica_string _comp2Str = NULL;
  modelica_integer _comp1Idx;
  modelica_integer _comp2Idx;
  modelica_metatype _comp1 = NULL;
  modelica_metatype _comp2 = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_integer tmp4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _res has no default value.
  // _comp1Str has no default value.
  // _comp2Str has no default value.
  // _comp1Idx has no default value.
  // _comp2Idx has no default value.
  // _comp1 has no default value.
  // _comp2 has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iComp1;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp4 = mmc_unbox_integer(tmpMeta3);
  _comp1 = tmpMeta2;
  _comp1Idx = tmp4  /* pattern as ty=Integer */;

  /* Pattern-matching assignment */
  tmpMeta5 = _iComp2;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
  tmp8 = mmc_unbox_integer(tmpMeta7);
  _comp2 = tmpMeta6;
  _comp2Idx = tmp8  /* pattern as ty=Integer */;

  tmpMeta9 = stringAppend(omc_BackendDump_printComponent(threadData, _comp1, mmc_mk_none()),_OMC_LIT57);
  tmpMeta10 = stringAppend(tmpMeta9,intString(_comp1Idx));
  _comp1Str = tmpMeta10;

  tmpMeta11 = stringAppend(omc_BackendDump_printComponent(threadData, _comp2, mmc_mk_none()),_OMC_LIT57);
  tmpMeta12 = stringAppend(tmpMeta11,intString(_comp2Idx));
  _comp2Str = tmpMeta12;

  if((stringLength(_comp1Str) != stringLength(_comp2Str)))
  {
    _res = 0 /* false */;
  }
  else
  {
    _res = (omc_System_strncmp(threadData, _comp1Str, _comp2Str, stringLength(_comp1Str)) == ((modelica_integer) 0));
  }
  _return: OMC_LABEL_UNUSED
  return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_componentsEqual(threadData_t *threadData, modelica_metatype _iComp1, modelica_metatype _iComp2)
{
  modelica_boolean _res;
  modelica_metatype out_res;
  _res = omc_HpcOmTaskGraph_componentsEqual(threadData, _iComp1, _iComp2);
  out_res = mmc_mk_icon(_res);
  return out_res;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents2(threadData_t *threadData, modelica_integer _nodeMark, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping)
{
  modelica_metatype _oNodeComps_Mapping = NULL;
  modelica_integer _nodeIdx;
  modelica_metatype _comp = NULL;
  modelica_metatype _eqSyst = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _eqSysts = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNodeComps_Mapping has no default value.
  // _nodeIdx has no default value.
  // _comp has no default value.
  // _eqSyst has no default value.
  // _comps has no default value.
  // _eqSysts has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iNodeComps_Mapping;
    {
      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_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_boolean tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
          _nodeIdx = tmp7  /* pattern as ty=Integer */;
          _comps = tmpMeta9;
          _eqSysts = tmpMeta10;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp11 = (_nodeMark >= ((modelica_integer) 0));
          if (1 /* true */ != tmp11) goto goto_2;
          tmpMeta12 = mmc_mk_box2(0, _comps, _eqSysts);
          tmpMeta13 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _nodeIdx), tmpMeta12);
          tmpMeta1 = tmpMeta13;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_boolean tmp19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp15 = mmc_unbox_integer(tmpMeta14);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 1));
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
          _nodeIdx = tmp15  /* pattern as ty=Integer */;
          _comps = tmpMeta17;
          _eqSysts = tmpMeta18;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp19 = (_nodeMark == ((modelica_integer) -2));
          if (1 /* true */ != tmp19) goto goto_2;
          tmpMeta20 = mmc_mk_box2(0, _comps, _eqSysts);
          tmpMeta21 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _nodeIdx), tmpMeta20);
          tmpMeta1 = tmpMeta21;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta22;
          modelica_integer tmp23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp23 = mmc_unbox_integer(tmpMeta22);
          tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 1));
          tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 2));
          _nodeIdx = tmp23  /* pattern as ty=Integer */;
          _comps = tmpMeta25;
          _eqSysts = tmpMeta26;
          /* Pattern matching succeeded */
          _comp = arrayGet(_systComps, _nodeIdx);

          _eqSyst = arrayGet(_iCompEqSysMapping, _nodeIdx);

          tmpMeta27 = mmc_mk_cons(_comp, _comps);
          _comps = tmpMeta27;

          tmpMeta28 = mmc_mk_cons(_eqSyst, _eqSysts);
          _eqSysts = tmpMeta28;
          tmpMeta29 = mmc_mk_box2(0, _comps, _eqSysts);
          tmpMeta30 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _nodeIdx), tmpMeta29);
          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 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oNodeComps_Mapping = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oNodeComps_Mapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getGraphComponents2(threadData_t *threadData, modelica_metatype _nodeMark, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping)
{
  modelica_integer tmp1;
  modelica_metatype _oNodeComps_Mapping = NULL;
  tmp1 = mmc_unbox_integer(_nodeMark);
  _oNodeComps_Mapping = omc_HpcOmTaskGraph_getGraphComponents2(threadData, tmp1, _systComps, _iCompEqSysMapping, _iNodeComps_Mapping);
  /* skip box _oNodeComps_Mapping; tuple<#Integer, tuple<list<BackendDAE.StrongComponent>, list<tuple<BackendDAE.EqSystem, #Integer>>>> */
  return _oNodeComps_Mapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents1(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping)
{
  modelica_metatype _oNodeComps_Mapping = NULL;
  modelica_metatype _comp = NULL;
  modelica_metatype _eqSyst = NULL;
  modelica_metatype _tmpComps = NULL;
  modelica_metatype _tmpSysts = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNodeComps_Mapping has no default value.
  // _comp has no default value.
  // _eqSyst has no default value.
  // _tmpComps has no default value.
  // _tmpSysts has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iNodeComps_Mapping;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _tmpComps = tmpMeta2;
  _tmpSysts = tmpMeta3;

  _comp = arrayGet(_systComps, _compIdx);

  _eqSyst = arrayGet(_iCompEqSysMapping, _compIdx);

  tmpMeta4 = mmc_mk_cons(_comp, _tmpComps);
  _tmpComps = tmpMeta4;

  tmpMeta5 = mmc_mk_cons(_eqSyst, _tmpSysts);
  _tmpSysts = tmpMeta5;

  tmpMeta6 = mmc_mk_box2(0, _tmpComps, _tmpSysts);
  _oNodeComps_Mapping = tmpMeta6;
  _return: OMC_LABEL_UNUSED
  return _oNodeComps_Mapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getGraphComponents1(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping)
{
  modelica_integer tmp1;
  modelica_metatype _oNodeComps_Mapping = NULL;
  tmp1 = mmc_unbox_integer(_compIdx);
  _oNodeComps_Mapping = omc_HpcOmTaskGraph_getGraphComponents1(threadData, tmp1, _systComps, _iCompEqSysMapping, _iNodeComps_Mapping);
  /* skip box _oNodeComps_Mapping; tuple<list<BackendDAE.StrongComponent>, list<tuple<BackendDAE.EqSystem, #Integer>>> */
  return _oNodeComps_Mapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents0(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _systComps, modelica_metatype _iCompEqSysMapping, modelica_metatype _iNodeComps_Mapping)
{
  modelica_metatype _oNodeComps_Mapping = NULL;
  modelica_metatype _iNodeComps = NULL;
  modelica_metatype _tmpNodeComps = NULL;
  modelica_metatype _iCompsMapping = NULL;
  modelica_metatype _tmpCompsMapping = 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
  // _oNodeComps_Mapping has no default value.
  // _iNodeComps has no default value.
  // _tmpNodeComps has no default value.
  // _iCompsMapping has no default value.
  // _tmpCompsMapping has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iNodeComps_Mapping;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _iNodeComps = tmpMeta2;
  _iCompsMapping = tmpMeta3;

  /* Pattern-matching assignment */
  tmpMeta4 = omc_List_fold2(threadData, _inComp, boxvar_HpcOmTaskGraph_getGraphComponents1, _systComps, _iCompEqSysMapping, _OMC_LIT58);
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 1));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
  _tmpNodeComps = tmpMeta5;
  _tmpCompsMapping = tmpMeta6;

  _tmpNodeComps = listAppend(_iNodeComps, _tmpNodeComps);

  _tmpCompsMapping = listAppend(_iCompsMapping, _tmpCompsMapping);

  tmpMeta7 = mmc_mk_box2(0, _tmpNodeComps, _tmpCompsMapping);
  _oNodeComps_Mapping = tmpMeta7;
  _return: OMC_LABEL_UNUSED
  return _oNodeComps_Mapping;
}

static modelica_metatype closure5_HpcOmTaskGraph_getGraphComponents0(threadData_t *thData, modelica_metatype closure, modelica_metatype inComp, modelica_metatype iNodeComps_Mapping)
{
  modelica_metatype systComps = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype iCompEqSysMapping = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_HpcOmTaskGraph_getGraphComponents0(thData, inComp, systComps, iCompEqSysMapping, iNodeComps_Mapping);
}static modelica_metatype closure6_HpcOmTaskGraph_getGraphComponents2(threadData_t *thData, modelica_metatype closure, modelica_metatype nodeMark, modelica_metatype iNodeComps_Mapping)
{
  modelica_metatype systComps = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype iCompEqSysMapping = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_HpcOmTaskGraph_getGraphComponents2(thData, nodeMark, systComps, iCompEqSysMapping, iNodeComps_Mapping);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getGraphComponents(threadData_t *threadData, modelica_metatype _iTaskGraphMeta, modelica_metatype _iSystComps, modelica_metatype _iCompEqSysMapping, modelica_metatype *out_oCompEqGraphMapping)
{
  modelica_metatype _oComps = NULL;
  modelica_metatype _oCompEqGraphMapping = NULL;
  modelica_metatype _tmpComps = NULL;
  modelica_metatype _tmpMapping = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _nodeMarks = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oComps has no default value.
  // _oCompEqGraphMapping has no default value.
  // _tmpComps has no default value.
  // _tmpMapping has no default value.
  // _inComps has no default value.
  // _nodeMarks has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _tmpComps = tmpMeta1;

  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _tmpMapping = tmpMeta2;

  /* Pattern-matching assignment */
  tmpMeta3 = _iTaskGraphMeta;
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 10));
  _inComps = tmpMeta4;
  _nodeMarks = tmpMeta5;

  /* Pattern-matching assignment */
  tmpMeta6 = mmc_mk_box2(0, _iSystComps, _iCompEqSysMapping);
  tmpMeta7 = mmc_mk_box2(0, _tmpComps, _tmpMapping);
  tmpMeta8 = omc_Array_fold(threadData, _inComps, (modelica_fnptr) mmc_mk_box2(0,closure5_HpcOmTaskGraph_getGraphComponents0,tmpMeta6), tmpMeta7);
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
  _tmpComps = tmpMeta9;
  _tmpMapping = tmpMeta10;

  /* Pattern-matching assignment */
  tmpMeta11 = mmc_mk_box2(0, _iSystComps, _iCompEqSysMapping);
  tmpMeta12 = mmc_mk_box2(0, _tmpComps, _tmpMapping);
  tmpMeta13 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1)), tmpMeta12);
  tmpMeta14 = omc_Array_fold(threadData, _nodeMarks, (modelica_fnptr) mmc_mk_box2(0,closure6_HpcOmTaskGraph_getGraphComponents2,tmpMeta11), tmpMeta13);
  tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
  tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 1));
  tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
  _tmpComps = tmpMeta16;
  _tmpMapping = tmpMeta17;

  _oComps = _tmpComps;

  _oCompEqGraphMapping = listArray(_tmpMapping);
  _return: OMC_LABEL_UNUSED
  if (out_oCompEqGraphMapping) { *out_oCompEqGraphMapping = _oCompEqGraphMapping; }
  return _oComps;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_checkForDuplicates0(threadData_t *threadData, modelica_metatype _currentComp_idx, modelica_metatype _iLastComp)
{
  modelica_metatype _oLastComp = NULL;
  modelica_metatype _lastComp = NULL;
  modelica_metatype _currentComp = NULL;
  modelica_metatype _lastComp_idx = NULL;
  modelica_integer _idxLast;
  modelica_integer _idxCurrent;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oLastComp has no default value.
  // _lastComp has no default value.
  // _currentComp has no default value.
  // _lastComp_idx has no default value.
  // _idxLast has no default value.
  // _idxCurrent has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _currentComp_idx;
    tmp4_2 = _iLastComp;
    {
      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_integer tmp7;
          modelica_metatype tmpMeta8;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          if (0 /* false */ != tmp7) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta8 = mmc_mk_box2(0, mmc_mk_boolean(0 /* false */), mmc_mk_some(_currentComp_idx));
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          if (!optionNone(tmpMeta9)) goto tmp3_end;
          
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta10 = mmc_mk_box2(0, mmc_mk_boolean(1 /* true */), mmc_mk_some(_currentComp_idx));
          tmpMeta1 = tmpMeta10;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_integer tmp18;
          modelica_boolean tmp19;
          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;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          if (optionNone(tmpMeta11)) goto tmp3_end;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta11), 1));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
          tmp15 = mmc_unbox_integer(tmpMeta14);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp18 = mmc_unbox_integer(tmpMeta17);
          _lastComp_idx = tmpMeta12;
          _lastComp = tmpMeta13;
          _idxLast = tmp15  /* pattern as ty=Integer */;
          _currentComp = tmpMeta16;
          _idxCurrent = tmp18  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp19 = omc_HpcOmTaskGraph_componentsEqual(threadData, _currentComp_idx, _lastComp_idx);
          if (1 /* true */ != tmp19) goto goto_2;

          tmpMeta20 = stringAppend(_OMC_LIT59,omc_BackendDump_printComponent(threadData, _currentComp, mmc_mk_none()));
          tmpMeta21 = stringAppend(tmpMeta20,_OMC_LIT60);
          tmpMeta22 = stringAppend(tmpMeta21,intString(_idxCurrent));
          tmpMeta23 = stringAppend(tmpMeta22,_OMC_LIT61);
          tmpMeta24 = stringAppend(tmpMeta23,omc_BackendDump_printComponent(threadData, _lastComp, mmc_mk_none()));
          tmpMeta25 = stringAppend(tmpMeta24,_OMC_LIT60);
          tmpMeta26 = stringAppend(tmpMeta25,intString(_idxLast));
          tmpMeta27 = stringAppend(tmpMeta26,_OMC_LIT62);
          fputs(MMC_STRINGDATA(tmpMeta27),stdout);
          tmpMeta28 = mmc_mk_box2(0, mmc_mk_boolean(0 /* false */), mmc_mk_some(_currentComp_idx));
          tmpMeta1 = tmpMeta28;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta29;
          
          /* Pattern matching succeeded */
          tmpMeta29 = mmc_mk_box2(0, mmc_mk_boolean(1 /* true */), mmc_mk_some(_currentComp_idx));
          tmpMeta1 = tmpMeta29;
          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:;
    }
  }
  _oLastComp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oLastComp;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkForDuplicates(threadData_t *threadData, modelica_metatype _iComps)
{
  modelica_boolean _res;
  modelica_metatype _sortedComps = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _res has no default value.
  // _sortedComps has no default value.
  _sortedComps = omc_List_sort(threadData, _iComps, boxvar_HpcOmTaskGraph_compareComponents);

  /* Pattern-matching assignment */
  tmpMeta1 = omc_List_fold(threadData, _sortedComps, boxvar_HpcOmTaskGraph_checkForDuplicates0, _OMC_LIT63);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  _res = tmp3  /* pattern as ty=Boolean */;
  _return: OMC_LABEL_UNUSED
  return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkForDuplicates(threadData_t *threadData, modelica_metatype _iComps)
{
  modelica_boolean _res;
  modelica_metatype out_res;
  _res = omc_HpcOmTaskGraph_checkForDuplicates(threadData, _iComps);
  out_res = mmc_mk_icon(_res);
  return out_res;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_validateComponents(threadData_t *threadData, modelica_metatype _graphComps, modelica_metatype _systComps)
{
  modelica_boolean _res;
  modelica_boolean _isEqual;
  modelica_integer _i1;
  modelica_integer _i2;
  modelica_metatype _comp1 = NULL;
  modelica_metatype _comp2 = NULL;
  modelica_metatype _tpl1 = NULL;
  modelica_metatype _tpl2 = NULL;
  modelica_metatype _sortedGraphComps = NULL;
  modelica_metatype _sortedSystComps = NULL;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _res has no default value.
  // _isEqual has no default value.
  // _i1 has no default value.
  // _i2 has no default value.
  // _comp1 has no default value.
  // _comp2 has no default value.
  // _tpl1 has no default value.
  // _tpl2 has no default value.
  // _sortedGraphComps has no default value.
  // _sortedSystComps has no default value.
  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          /* Pattern matching succeeded */
          _sortedGraphComps = omc_List_sort(threadData, _graphComps, boxvar_HpcOmTaskGraph_compareComponents);

          _sortedSystComps = omc_List_sort(threadData, _systComps, boxvar_HpcOmTaskGraph_compareComponents);

          if((listLength(_sortedSystComps) != listLength(_sortedGraphComps)))
          {
            fputs(MMC_STRINGDATA(_OMC_LIT64),stdout);
          }

          _isEqual = 1 /* true */;

          while(1)
          {
            if(!(_isEqual && (!listEmpty(_sortedGraphComps)))) break;
            /* Pattern-matching assignment */
            tmpMeta6 = _sortedGraphComps;
            if (listEmpty(tmpMeta6)) goto goto_2;
            tmpMeta7 = MMC_CAR(tmpMeta6);
            tmpMeta8 = MMC_CDR(tmpMeta6);
            _tpl1 = tmpMeta7;
            _sortedGraphComps = tmpMeta8;

            /* Pattern-matching assignment */
            tmpMeta9 = _sortedSystComps;
            if (listEmpty(tmpMeta9)) goto goto_2;
            tmpMeta10 = MMC_CAR(tmpMeta9);
            tmpMeta11 = MMC_CDR(tmpMeta9);
            _tpl2 = tmpMeta10;
            _sortedSystComps = tmpMeta11;

            /* Pattern-matching assignment */
            tmpMeta12 = _tpl1;
            tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
            tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
            tmp15 = mmc_unbox_integer(tmpMeta14);
            _comp1 = tmpMeta13;
            _i1 = tmp15  /* pattern as ty=Integer */;

            /* Pattern-matching assignment */
            tmpMeta16 = _tpl2;
            tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 1));
            tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
            tmp19 = mmc_unbox_integer(tmpMeta18);
            _comp2 = tmpMeta17;
            _i2 = tmp19  /* pattern as ty=Integer */;

            if(omc_HpcOmTaskGraph_componentsEqual(threadData, _tpl1, _tpl2))
            {
              _isEqual = 1 /* true */;
            }
            else
            {
              _isEqual = 0 /* false */;

              tmpMeta20 = stringAppend(_OMC_LIT65,intString(_i1));
              tmpMeta21 = stringAppend(tmpMeta20,omc_BackendDump_printComponent(threadData, _comp1, mmc_mk_none()));
              tmpMeta22 = stringAppend(tmpMeta21,_OMC_LIT66);
              tmpMeta23 = stringAppend(tmpMeta22,_OMC_LIT67);
              tmpMeta24 = stringAppend(tmpMeta23,intString(_i2));
              tmpMeta25 = stringAppend(tmpMeta24,omc_BackendDump_printComponent(threadData, _comp2, mmc_mk_none()));
              tmpMeta26 = stringAppend(tmpMeta25,_OMC_LIT5);
              fputs(MMC_STRINGDATA(tmpMeta26),stdout);
            }
          }
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT68),stdout);
          tmp1 = 0 /* false */;
          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:;
    }
  }
  _res = tmp1;
  _return: OMC_LABEL_UNUSED
  return _res;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_validateComponents(threadData_t *threadData, modelica_metatype _graphComps, modelica_metatype _systComps)
{
  modelica_boolean _res;
  modelica_metatype out_res;
  _res = omc_HpcOmTaskGraph_validateComponents(threadData, _graphComps, _systComps);
  out_res = mmc_mk_icon(_res);
  return out_res;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_validateTaskGraphMeta0(threadData_t *threadData, modelica_metatype _iEqSysMapping, modelica_metatype _iCompsTpl)
{
  modelica_metatype _oCompsTpl = NULL;
  modelica_integer _currentIdx;
  modelica_integer _eqSysIdx;
  modelica_metatype _iComps = NULL;
  modelica_metatype _rest = NULL;
  modelica_metatype _head = NULL;
  modelica_metatype _iCompEqSysMapping = NULL;
  modelica_metatype _oCompEqSysMapping = NULL;
  modelica_metatype _tmpCompsTpl = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCompsTpl has no default value.
  // _currentIdx has no default value.
  // _eqSysIdx has no default value.
  // _iComps has no default value.
  // _rest has no default value.
  // _head has no default value.
  // _iCompEqSysMapping has no default value.
  // _oCompEqSysMapping has no default value.
  // _tmpCompsTpl has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iCompsTpl;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (listEmpty(tmpMeta8)) goto tmp3_end;
          tmpMeta9 = MMC_CAR(tmpMeta8);
          tmpMeta10 = MMC_CDR(tmpMeta8);
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _currentIdx = tmp7  /* pattern as ty=Integer */;
          _head = tmpMeta9;
          _rest = tmpMeta10;
          _iCompEqSysMapping = tmpMeta11;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta12 = arrayGet(_iEqSysMapping, _currentIdx);
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          _eqSysIdx = tmp14  /* pattern as ty=Integer */;

          tmpMeta16 = mmc_mk_box2(0, _head, mmc_mk_integer(_eqSysIdx));
          tmpMeta15 = mmc_mk_cons(tmpMeta16, _iCompEqSysMapping);
          _oCompEqSysMapping = tmpMeta15;
          tmpMeta17 = mmc_mk_box3(0, mmc_mk_integer(((modelica_integer) 1) + _currentIdx), _rest, _oCompEqSysMapping);
          /* Tail recursive call */
          _iCompsTpl = tmpMeta17;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iCompsTpl;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oCompsTpl = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oCompsTpl;
}

DLLDirection
modelica_boolean omc_HpcOmTaskGraph_validateTaskGraphMeta(threadData_t *threadData, modelica_metatype _iMeta, modelica_metatype _iDae)
{
  modelica_boolean _valid;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _valid has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _systComps = NULL;
      modelica_metatype _graphComps = NULL;
      modelica_metatype _systCompsArray = NULL;
      modelica_metatype _systCompEqSysMapping = NULL;
      modelica_metatype _graphCompEqSysMapping = NULL;
      modelica_metatype _systCompEqSysMappingIdx = NULL;
      modelica_metatype _graphCompEqSysMappingIdx = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _systComps has no default value.
      // _graphComps has no default value.
      // _systCompsArray has no default value.
      // _systCompEqSysMapping has no default value.
      // _graphCompEqSysMapping has no default value.
      // _systCompEqSysMappingIdx has no default value.
      // _graphCompEqSysMappingIdx has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_boolean tmp14;
          modelica_boolean tmp15;
          modelica_boolean tmp16;
          /* Pattern matching succeeded */
          _systComps = omc_HpcOmTaskGraph_getSystemComponents(threadData, _iDae ,&_systCompEqSysMapping);

          _systCompsArray = listArray(_systComps);

          _graphComps = omc_HpcOmTaskGraph_getGraphComponents(threadData, _iMeta, _systCompsArray, _systCompEqSysMapping ,&_graphCompEqSysMapping);

          /* Pattern-matching assignment */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta7 = mmc_mk_box3(0, mmc_mk_integer(((modelica_integer) 1)), _systComps, tmpMeta6);
          tmpMeta8 = omc_HpcOmTaskGraph_validateTaskGraphMeta0(threadData, _systCompEqSysMapping, tmpMeta7);
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
          _systCompEqSysMappingIdx = tmpMeta9;

          /* Pattern-matching assignment */
          tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta11 = mmc_mk_box3(0, mmc_mk_integer(((modelica_integer) 1)), _graphComps, tmpMeta10);
          tmpMeta12 = omc_HpcOmTaskGraph_validateTaskGraphMeta0(threadData, _graphCompEqSysMapping, tmpMeta11);
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
          _graphCompEqSysMappingIdx = tmpMeta13;

          /* Pattern-matching assignment */
          tmp14 = omc_HpcOmTaskGraph_validateComponents(threadData, _graphCompEqSysMappingIdx, _systCompEqSysMappingIdx);
          if (1 /* true */ != tmp14) goto goto_2;

          /* Pattern-matching assignment */
          tmp15 = omc_HpcOmTaskGraph_checkForDuplicates(threadData, _graphCompEqSysMappingIdx);
          if (1 /* true */ != tmp15) goto goto_2;

          /* Pattern-matching assignment */
          tmp16 = omc_HpcOmTaskGraph_checkForExecutionCosts(threadData, _iMeta);
          if (1 /* true */ != tmp16) goto goto_2;
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          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:;
    }
  }
  _valid = tmp1;
  _return: OMC_LABEL_UNUSED
  return _valid;
}
modelica_metatype boxptr_HpcOmTaskGraph_validateTaskGraphMeta(threadData_t *threadData, modelica_metatype _iMeta, modelica_metatype _iDae)
{
  modelica_boolean _valid;
  modelica_metatype out_valid;
  _valid = omc_HpcOmTaskGraph_validateTaskGraphMeta(threadData, _iMeta, _iDae);
  out_valid = mmc_mk_icon(_valid);
  return out_valid;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCommCosts0(threadData_t *threadData, modelica_metatype _iComm, modelica_metatype _iReqTimeCom)
{
  modelica_metatype _oComm = NULL;
  modelica_integer _childNode;
  modelica_integer _reqTimeM;
  modelica_integer _reqTimeN;
  modelica_integer _numberOfVars;
  modelica_real _requiredTime;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_metatype _stringVars = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_integer tmp9;
  modelica_metatype tmpMeta10;
  modelica_real tmp11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_integer tmp14;
  modelica_metatype tmpMeta15;
  modelica_integer tmp16;
  modelica_metatype tmpMeta17;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oComm has no default value.
  // _childNode has no default value.
  // _reqTimeM has no default value.
  // _reqTimeN has no default value.
  // _numberOfVars has no default value.
  // _requiredTime has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _stringVars has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iComm;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmp9 = mmc_unbox_integer(tmpMeta8);
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmp11 = mmc_unbox_real(tmpMeta10);
  _numberOfVars = tmp3  /* pattern as ty=Integer */;
  _integerVars = tmpMeta4;
  _floatVars = tmpMeta5;
  _booleanVars = tmpMeta6;
  _stringVars = tmpMeta7;
  _childNode = tmp9  /* pattern as ty=Integer */;
  _requiredTime = tmp11  /* pattern as ty=Real */;

  /* Pattern-matching assignment */
  tmpMeta12 = _iReqTimeCom;
  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
  tmp14 = mmc_unbox_integer(tmpMeta13);
  tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
  tmp16 = mmc_unbox_integer(tmpMeta15);
  _reqTimeM = tmp14  /* pattern as ty=Integer */;
  _reqTimeN = tmp16  /* pattern as ty=Integer */;

  _requiredTime = ((modelica_real)_reqTimeN + (_numberOfVars) * (_reqTimeM));

  tmpMeta17 = mmc_mk_box8(3, &HpcOmTaskGraph_Communication_COMMUNICATION__desc, mmc_mk_integer(_numberOfVars), _integerVars, _floatVars, _booleanVars, _stringVars, mmc_mk_integer(_childNode), mmc_mk_real(_requiredTime));
  _oComm = tmpMeta17;
  _return: OMC_LABEL_UNUSED
  return _oComm;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCommCosts(threadData_t *threadData, modelica_metatype _iCosts, modelica_integer _iCurrentIndex, modelica_metatype _iReqTimeCom)
{
  modelica_metatype _oCosts = NULL;
  modelica_metatype _tmpCosts = NULL;
  modelica_metatype _currentCom = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCosts has no default value.
  // _tmpCosts has no default value.
  // _currentCom has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iCosts;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          
          _tmpCosts = tmp4_1;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (_iCurrentIndex <= arrayLength(_iCosts));
          if (1 /* true */ != tmp6) goto goto_2;

          _currentCom = arrayGet(_tmpCosts, _iCurrentIndex);

          _currentCom = omc_List_map1(threadData, _currentCom, boxvar_HpcOmTaskGraph_createCommCosts0, _iReqTimeCom);

          _tmpCosts = arrayUpdate(_tmpCosts, _iCurrentIndex, _currentCom);
          tmpMeta1 = omc_HpcOmTaskGraph_createCommCosts(threadData, _tmpCosts, ((modelica_integer) 1) + _iCurrentIndex, _iReqTimeCom);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iCosts;
          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:;
    }
  }
  _oCosts = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oCosts;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createCommCosts(threadData_t *threadData, modelica_metatype _iCosts, modelica_metatype _iCurrentIndex, modelica_metatype _iReqTimeCom)
{
  modelica_integer tmp1;
  modelica_metatype _oCosts = NULL;
  tmp1 = mmc_unbox_integer(_iCurrentIndex);
  _oCosts = omc_HpcOmTaskGraph_createCommCosts(threadData, _iCosts, tmp1, _iReqTimeCom);
  /* skip box _oCosts; array<list<HpcOmTaskGraph.Communication>> */
  return _oCosts;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createExecCost0(threadData_t *threadData, modelica_integer _sccIndex, modelica_metatype _icomps_shared, modelica_metatype _compMapping, modelica_metatype _iRequiredTime, modelica_metatype _iCosts)
{
  modelica_metatype _oCosts = NULL;
  modelica_integer _costAdd;
  modelica_integer _costMul;
  modelica_integer _costTrig;
  modelica_integer _iCosts_op;
  modelica_real _iCosts_cyc;
  modelica_metatype _comp = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _syst = NULL;
  modelica_metatype _shared = NULL;
  modelica_real _reqTime;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_integer tmp6;
  modelica_metatype tmpMeta7;
  modelica_real tmp8;
  modelica_metatype tmpMeta9;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCosts has no default value.
  // _costAdd has no default value.
  // _costMul has no default value.
  // _costTrig has no default value.
  // _iCosts_op has no default value.
  // _iCosts_cyc has no default value.
  // _comp has no default value.
  // _comps has no default value.
  // _syst has no default value.
  // _shared has no default value.
  // _reqTime has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _icomps_shared;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _comps = tmpMeta2;
  _shared = tmpMeta3;

  /* Pattern-matching assignment */
  tmpMeta4 = _iCosts;
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 1));
  tmp6 = mmc_unbox_integer(tmpMeta5);
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
  tmp8 = mmc_unbox_real(tmpMeta7);
  _iCosts_op = tmp6  /* pattern as ty=Integer */;
  _iCosts_cyc = tmp8  /* pattern as ty=Real */;

  _comp = listGet(_comps, _sccIndex);

  _syst = arrayGet(_compMapping, _sccIndex);

  _reqTime = mmc_unbox_real(arrayGet(_iRequiredTime, _sccIndex));

  tmpMeta9 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) -100) + _iCosts_op), mmc_mk_real(_iCosts_cyc + _reqTime));
  _oCosts = tmpMeta9;
  _return: OMC_LABEL_UNUSED
  return _oCosts;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createExecCost0(threadData_t *threadData, modelica_metatype _sccIndex, modelica_metatype _icomps_shared, modelica_metatype _compMapping, modelica_metatype _iRequiredTime, modelica_metatype _iCosts)
{
  modelica_integer tmp1;
  modelica_metatype _oCosts = NULL;
  tmp1 = mmc_unbox_integer(_sccIndex);
  _oCosts = omc_HpcOmTaskGraph_createExecCost0(threadData, tmp1, _icomps_shared, _compMapping, _iRequiredTime, _iCosts);
  /* skip box _oCosts; tuple<#Integer, #Real> */
  return _oCosts;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_createExecCost(threadData_t *threadData, modelica_metatype _iNodeSccs, modelica_metatype _icomps_shared, modelica_metatype _iRequiredTime, modelica_metatype _iExecCosts, modelica_metatype _compMapping, modelica_integer _iNodeIdx)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* matchcontinue expression */
    {
      modelica_metatype _execCost = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _execCost has no default value.
      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: {
          /* Pattern matching succeeded */
          _execCost = omc_List_fold3(threadData, _iNodeSccs, boxvar_HpcOmTaskGraph_createExecCost0, _icomps_shared, _compMapping, _iRequiredTime, _OMC_LIT42);

          arrayUpdate(_iExecCosts, _iNodeIdx, _execCost);
          goto tmp2_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 2) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_createExecCost(threadData_t *threadData, modelica_metatype _iNodeSccs, modelica_metatype _icomps_shared, modelica_metatype _iRequiredTime, modelica_metatype _iExecCosts, modelica_metatype _compMapping, modelica_metatype _iNodeIdx)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  omc_HpcOmTaskGraph_createExecCost(threadData, _iNodeSccs, _icomps_shared, _iRequiredTime, _iExecCosts, _compMapping, tmp1);
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCosts1(threadData_t *threadData, modelica_metatype _iTuple, modelica_metatype _iReqTime)
{
  modelica_metatype _oReqTime = NULL;
  modelica_metatype _tmpArray = NULL;
  modelica_integer _simEqIdx;
  modelica_integer _calcTimeCount;
  modelica_real _calcTime;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oReqTime has no default value.
  // _tmpArray has no default value.
  // _simEqIdx has no default value.
  // _calcTimeCount has no default value.
  // _calcTime has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _iTuple;
    tmp4_2 = _iReqTime;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_real tmp11;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          if (0 != tmp7) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp11 = mmc_unbox_real(tmpMeta10);
          
          _calcTimeCount = tmp9  /* pattern as ty=Integer */;
          _calcTime = tmp11  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          tmpMeta1 = _iReqTime;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          modelica_integer tmp15;
          modelica_metatype tmpMeta16;
          modelica_real tmp17;
          modelica_metatype tmpMeta18;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp15 = mmc_unbox_integer(tmpMeta14);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp17 = mmc_unbox_real(tmpMeta16);
          
          _simEqIdx = tmp13  /* pattern as ty=Integer */;
          _calcTimeCount = tmp15  /* pattern as ty=Integer */;
          _calcTime = tmp17  /* pattern as ty=Real */;
          _tmpArray = tmp4_2;
          /* Pattern matching succeeded */
          tmpMeta18 = mmc_mk_box2(0, mmc_mk_integer(_calcTimeCount), mmc_mk_real(_calcTime));
          tmpMeta1 = arrayUpdate(_iReqTime, _simEqIdx, tmpMeta18);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oReqTime = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oReqTime;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCosts0(threadData_t *threadData, modelica_metatype _iNode, modelica_metatype _iComps_shared, modelica_metatype _iCompMapping, modelica_metatype _reqTimeOp, modelica_metatype _reqTimeCom, modelica_metatype _iTaskGraphMeta)
{
  modelica_metatype _oTaskGraphMeta = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _nodeRefCount = NULL;
  modelica_metatype _execCosts = NULL;
  modelica_metatype _comp = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_integer _nodeNumber;
  modelica_metatype _taskGraphMeta = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraphMeta has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compParamMapping has no default value.
  // _nodeRefCount has no default value.
  // _execCosts has no default value.
  // _comp has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _inComps has no default value.
  // _commCosts has no default value.
  // _nodeNumber has no default value.
  // _taskGraphMeta has no default value.
  // _compInformations has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iTaskGraphMeta;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _nodeNumber = tmp3  /* pattern as ty=Integer */;
  _taskGraphMeta = tmpMeta4;

  /* Pattern-matching assignment */
  tmpMeta5 = _taskGraphMeta;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 3));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 4));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 5));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 6));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 7));
  tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 8));
  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 9));
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 10));
  tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 11));
  _inComps = tmpMeta6;
  _varCompMapping = tmpMeta7;
  _eqCompMapping = tmpMeta8;
  _compParamMapping = tmpMeta9;
  _compNames = tmpMeta10;
  _compDescs = tmpMeta11;
  _execCosts = tmpMeta12;
  _commCosts = tmpMeta13;
  _nodeRefCount = tmpMeta14;
  _compInformations = tmpMeta15;

  omc_HpcOmTaskGraph_createExecCost(threadData, _iNode, _iComps_shared, _reqTimeOp, _execCosts, _iCompMapping, _nodeNumber);

  tmpMeta16 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _execCosts, _commCosts, _nodeRefCount, _compInformations);
  tmpMeta17 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _nodeNumber), tmpMeta16);
  _oTaskGraphMeta = tmpMeta17;
  _return: OMC_LABEL_UNUSED
  return _oTaskGraphMeta;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertSimEqToSccCosts2(threadData_t *threadData, modelica_metatype _iReqTime, modelica_real _iSimEqCalcTime, modelica_integer _iSimEqIdx, modelica_metatype _iSimeqCompMapping)
{
  modelica_metatype _oReqTime = NULL;
  modelica_metatype _reqTime = NULL;
  modelica_integer _sccIdx;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oReqTime has no default value.
  // _reqTime has no default value.
  // _sccIdx has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iReqTime;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_boolean tmp7;
          
          _reqTime = tmp4_1;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (arrayLength(_iSimeqCompMapping) >= _iSimEqIdx);
          if (1 /* true */ != tmp6) goto goto_2;

          _sccIdx = mmc_unbox_integer(arrayGet(_iSimeqCompMapping, _iSimEqIdx));

          /* Pattern-matching assignment */
          tmp7 = (_sccIdx > ((modelica_integer) 0));
          if (1 /* true */ != tmp7) goto goto_2;
          tmpMeta1 = arrayUpdate(_reqTime, _sccIdx, mmc_mk_real(_iSimEqCalcTime));
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iReqTime;
          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:;
    }
  }
  _oReqTime = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oReqTime;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertSimEqToSccCosts2(threadData_t *threadData, modelica_metatype _iReqTime, modelica_metatype _iSimEqCalcTime, modelica_metatype _iSimEqIdx, modelica_metatype _iSimeqCompMapping)
{
  modelica_real tmp1;
  modelica_integer tmp2;
  modelica_metatype _oReqTime = NULL;
  tmp1 = mmc_unbox_real(_iSimEqCalcTime);
  tmp2 = mmc_unbox_integer(_iSimEqIdx);
  _oReqTime = omc_HpcOmTaskGraph_convertSimEqToSccCosts2(threadData, _iReqTime, tmp1, tmp2, _iSimeqCompMapping);
  /* skip box _oReqTime; array<#Real> */
  return _oReqTime;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertSimEqToSccCosts1(threadData_t *threadData, modelica_metatype _iReqTimeOpSimCode, modelica_metatype _iSimeqCompMapping, modelica_metatype _iReqTimeOp)
{
  modelica_metatype _oReqTimeOp = NULL;
  modelica_integer _simEqCalcCount;
  modelica_integer _simEqIdx;
  modelica_real _simEqCalcTime;
  modelica_real _realSimEqCalcCount;
  modelica_metatype _reqTime = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oReqTimeOp has no default value.
  // _simEqCalcCount has no default value.
  // _simEqIdx has no default value.
  // _simEqCalcTime has no default value.
  // _realSimEqCalcCount has no default value.
  // _reqTime has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _iReqTimeOpSimCode;
    tmp4_2 = _iReqTimeOp;
    {
      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_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_real tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_boolean tmp13;
          modelica_real tmp14;
          modelica_metatype tmpMeta15;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_real(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          _simEqCalcCount = tmp7  /* pattern as ty=Integer */;
          _simEqCalcTime = tmp9  /* pattern as ty=Real */;
          _simEqIdx = tmp11  /* pattern as ty=Integer */;
          _reqTime = tmpMeta12;
          /* Pattern matching succeeded */
          _realSimEqCalcCount = ((modelica_real)_simEqCalcCount);

          /* Pattern-matching assignment */
          tmp13 = (_realSimEqCalcCount != 0.0);
          if (1 /* true */ != tmp13) goto goto_2;

          tmp14 = _realSimEqCalcCount;
          if (tmp14 == 0) {goto goto_2;}
          _reqTime = omc_HpcOmTaskGraph_convertSimEqToSccCosts2(threadData, _reqTime, (_simEqCalcTime) / tmp14, _simEqIdx, _iSimeqCompMapping);
          tmpMeta15 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _simEqIdx), _reqTime);
          tmpMeta1 = tmpMeta15;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta16;
          modelica_integer tmp17;
          modelica_metatype tmpMeta18;
          modelica_real tmp19;
          modelica_metatype tmpMeta20;
          modelica_integer tmp21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp17 = mmc_unbox_integer(tmpMeta16);
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp19 = mmc_unbox_real(tmpMeta18);
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp21 = mmc_unbox_integer(tmpMeta20);
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          _simEqCalcCount = tmp17  /* pattern as ty=Integer */;
          _simEqCalcTime = tmp19  /* pattern as ty=Real */;
          _simEqIdx = tmp21  /* pattern as ty=Integer */;
          _reqTime = tmpMeta22;
          /* Pattern matching succeeded */
          _realSimEqCalcCount = ((modelica_real)_simEqCalcCount);

          _reqTime = omc_HpcOmTaskGraph_convertSimEqToSccCosts2(threadData, _reqTime, 0.0, _simEqIdx, _iSimeqCompMapping);
          tmpMeta23 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1) + _simEqIdx), _reqTime);
          tmpMeta1 = tmpMeta23;
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT69),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oReqTimeOp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oReqTimeOp;
}

static modelica_metatype closure7_HpcOmTaskGraph_convertSimEqToSccCosts1(threadData_t *thData, modelica_metatype closure, modelica_metatype iReqTimeOpSimCode, modelica_metatype iReqTimeOp)
{
  modelica_metatype iSimeqCompMapping = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_HpcOmTaskGraph_convertSimEqToSccCosts1(thData, iReqTimeOpSimCode, iSimeqCompMapping, iReqTimeOp);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertSimEqToSccCosts(threadData_t *threadData, modelica_metatype _iReqTimeOpSimCode, modelica_metatype _iSimeqCompMapping, modelica_metatype _iReqTimeOp)
{
  modelica_metatype _oReqTimeOp = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oReqTimeOp has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = mmc_mk_box1(0, _iSimeqCompMapping);
  tmpMeta2 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1)), _iReqTimeOp);
  tmpMeta3 = omc_Array_fold(threadData, _iReqTimeOpSimCode, (modelica_fnptr) mmc_mk_box2(0,closure7_HpcOmTaskGraph_convertSimEqToSccCosts1,tmpMeta1), tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
  _oReqTimeOp = tmpMeta4;
  _return: OMC_LABEL_UNUSED
  return _oReqTimeOp;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_convertNodeListToEdgeTuples0(threadData_t *threadData, modelica_metatype _iNodeList, modelica_integer _iNodeIdx, modelica_metatype _iEdgeList)
{
  modelica_metatype _oEdgeList = NULL;
  modelica_metatype _tmpEdgeList = NULL;
  modelica_integer _elem;
  modelica_integer _preElem;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oEdgeList has no default value.
  // _tmpEdgeList has no default value.
  // _elem has no default value.
  // _preElem has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iEdgeList;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          
          _tmpEdgeList = tmp4_1;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (_iNodeIdx > ((modelica_integer) 1));
          if (1 /* true */ != tmp6) goto goto_2;

          _elem = mmc_unbox_integer(listGet(_iNodeList, _iNodeIdx));

          _preElem = mmc_unbox_integer(listGet(_iNodeList, ((modelica_integer) -1) + _iNodeIdx));

          tmpMeta8 = mmc_mk_box2(0, mmc_mk_integer(_preElem), mmc_mk_integer(_elem));
          tmpMeta7 = mmc_mk_cons(tmpMeta8, _tmpEdgeList);
          _tmpEdgeList = tmpMeta7;
          tmpMeta1 = omc_HpcOmTaskGraph_convertNodeListToEdgeTuples0(threadData, _iNodeList, ((modelica_integer) -1) + _iNodeIdx, _tmpEdgeList);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iEdgeList;
          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:;
    }
  }
  _oEdgeList = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oEdgeList;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_convertNodeListToEdgeTuples0(threadData_t *threadData, modelica_metatype _iNodeList, modelica_metatype _iNodeIdx, modelica_metatype _iEdgeList)
{
  modelica_integer tmp1;
  modelica_metatype _oEdgeList = NULL;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  _oEdgeList = omc_HpcOmTaskGraph_convertNodeListToEdgeTuples0(threadData, _iNodeList, tmp1, _iEdgeList);
  /* skip box _oEdgeList; list<tuple<#Integer, #Integer>> */
  return _oEdgeList;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_convertNodeListToEdgeTuples(threadData_t *threadData, modelica_metatype _iNodeList)
{
  modelica_metatype _oEdgeList = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oEdgeList has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _oEdgeList = omc_HpcOmTaskGraph_convertNodeListToEdgeTuples0(threadData, _iNodeList, listLength(_iNodeList), tmpMeta1);
  _return: OMC_LABEL_UNUSED
  return _oEdgeList;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkTpl2ForZero(threadData_t *threadData, modelica_integer _comp, modelica_metatype _exeCosts, modelica_boolean _bIn)
{
  modelica_boolean _bOut;
  modelica_boolean _b;
  modelica_real _value;
  modelica_metatype _tpl = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_real tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _bOut has no default value.
  // _b has no default value.
  // _value has no default value.
  // _tpl has no default value.
  _tpl = arrayGet(_exeCosts, _comp);

  /* Pattern-matching assignment */
  tmpMeta1 = _tpl;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_real(tmpMeta2);
  _value = tmp3  /* pattern as ty=Real */;

  _b = (_value == 0.0);

  _bOut = (_b || _bIn);
  _return: OMC_LABEL_UNUSED
  return _bOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkTpl2ForZero(threadData_t *threadData, modelica_metatype _comp, modelica_metatype _exeCosts, modelica_metatype _bIn)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_boolean _bOut;
  modelica_metatype out_bOut;
  tmp1 = mmc_unbox_integer(_comp);
  tmp2 = mmc_unbox_integer(_bIn);
  _bOut = omc_HpcOmTaskGraph_checkTpl2ForZero(threadData, tmp1, _exeCosts, tmp2);
  out_bOut = mmc_mk_icon(_bOut);
  return out_bOut;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkForExecutionCosts1(threadData_t *threadData, modelica_metatype _exeCosts, modelica_metatype _inComps, modelica_integer _nodeIdx)
{
  modelica_boolean _bOut;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _bOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_boolean _isZero;
      modelica_metatype _comps = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _isZero has no default value.
      // _comps has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_boolean tmp7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (arrayLength(_inComps) >= _nodeIdx);
          if (1 /* true */ != tmp6) goto goto_2;

          _comps = arrayGet(_inComps, _nodeIdx);

          _isZero = mmc_unbox_boolean(omc_List_fold1(threadData, _comps, boxvar_HpcOmTaskGraph_checkTpl2ForZero, _exeCosts, mmc_mk_boolean(0 /* false */)));

          /* Pattern-matching assignment */
          tmp7 = _isZero;
          if (0 /* false */ != tmp7) goto goto_2;
          tmp1 = omc_HpcOmTaskGraph_checkForExecutionCosts1(threadData, _exeCosts, _inComps, ((modelica_integer) 1) + _nodeIdx);
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp8;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = (arrayLength(_inComps) < _nodeIdx);
          if (1 /* true */ != tmp8) goto goto_2;
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 2: {
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          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:;
    }
  }
  _bOut = tmp1;
  _return: OMC_LABEL_UNUSED
  return _bOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkForExecutionCosts1(threadData_t *threadData, modelica_metatype _exeCosts, modelica_metatype _inComps, modelica_metatype _nodeIdx)
{
  modelica_integer tmp1;
  modelica_boolean _bOut;
  modelica_metatype out_bOut;
  tmp1 = mmc_unbox_integer(_nodeIdx);
  _bOut = omc_HpcOmTaskGraph_checkForExecutionCosts1(threadData, _exeCosts, _inComps, tmp1);
  out_bOut = mmc_mk_icon(_bOut);
  return out_bOut;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkForExecutionCosts(threadData_t *threadData, modelica_metatype _dataIn)
{
  modelica_boolean _isFine;
  modelica_metatype _inComps = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _isFine has no default value.
  // _inComps has no default value.
  // _exeCosts has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _dataIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  _inComps = tmpMeta2;
  _exeCosts = tmpMeta3;

  _isFine = omc_HpcOmTaskGraph_checkForExecutionCosts1(threadData, _exeCosts, _inComps, ((modelica_integer) 1));

  if((!_isFine))
  {
    fputs(MMC_STRINGDATA(_OMC_LIT70),stdout);
  }
  _return: OMC_LABEL_UNUSED
  return _isFine;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkForExecutionCosts(threadData_t *threadData, modelica_metatype _dataIn)
{
  modelica_boolean _isFine;
  modelica_metatype out_isFine;
  _isFine = omc_HpcOmTaskGraph_checkForExecutionCosts(threadData, _dataIn);
  out_isFine = mmc_mk_icon(_isFine);
  return out_isFine;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getCommCostsOnly(threadData_t *threadData, modelica_metatype _commCostsIn)
{
  modelica_metatype _commCostsOut = NULL;
  modelica_metatype _reqTimeCom = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _commCostsOut has no default value.
  // _reqTimeCom has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = omc_HpcOmBenchmark_benchSystem(threadData);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _reqTimeCom = tmpMeta2;

  _commCostsOut = omc_HpcOmTaskGraph_createCommCosts(threadData, _commCostsIn, ((modelica_integer) 1), _reqTimeCom);
  _return: OMC_LABEL_UNUSED
  return _commCostsOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_copyCosts(threadData_t *threadData, modelica_metatype _iSourceTaskGraphData, modelica_metatype _iTargetTaskGraphData)
{
  modelica_metatype _oTaskGraphData = NULL;
  modelica_metatype _inCompsSource = NULL;
  modelica_metatype _inCompsTarget = NULL;
  modelica_metatype _exeCostsSource = NULL;
  modelica_metatype _exeCostsTarget = NULL;
  modelica_integer _compIdx;
  modelica_integer _childIdx;
  modelica_metatype _commCostsTarget = NULL;
  modelica_metatype _reqTimeCom = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraphData has no default value.
  // _inCompsSource has no default value.
  // _inCompsTarget has no default value.
  // _exeCostsSource has no default value.
  // _exeCostsTarget has no default value.
  // _compIdx has no default value.
  // _childIdx has no default value.
  // _commCostsTarget has no default value.
  // _reqTimeCom has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iSourceTaskGraphData;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  _inCompsSource = tmpMeta2;
  _exeCostsSource = tmpMeta3;

  /* Pattern-matching assignment */
  tmpMeta4 = _iTargetTaskGraphData;
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 8));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 9));
  _inCompsTarget = tmpMeta5;
  _exeCostsTarget = tmpMeta6;
  _commCostsTarget = tmpMeta7;

  _compIdx = modelica_integer_min((modelica_integer)(arrayLength(_exeCostsSource)),(modelica_integer)(arrayLength(_exeCostsTarget)));

  while(1)
  {
    if(!(_compIdx > ((modelica_integer) 0))) break;
    _exeCostsTarget = arrayUpdate(_exeCostsTarget, _compIdx, arrayGet(_exeCostsSource, _compIdx));

    _compIdx = ((modelica_integer) -1) + _compIdx;
  }

  /* Pattern-matching assignment */
  tmpMeta8 = omc_HpcOmBenchmark_benchSystem(threadData);
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
  _reqTimeCom = tmpMeta9;

  _commCostsTarget = omc_HpcOmTaskGraph_createCommCosts(threadData, _commCostsTarget, ((modelica_integer) 1), _reqTimeCom);

  _oTaskGraphData = _iTargetTaskGraphData;
  _return: OMC_LABEL_UNUSED
  return _oTaskGraphData;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_calculateCosts(threadData_t *threadData, modelica_metatype _compInfo)
{
  modelica_metatype _exeCost = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _exeCost has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _compInfo;
    {
      modelica_integer _numAdds;
      modelica_integer _numMul;
      modelica_integer _numDiv;
      modelica_integer _numOth;
      modelica_integer _numTrig;
      modelica_integer _numRel;
      modelica_integer _numLog;
      modelica_integer _numFuncs;
      modelica_integer _costs;
      modelica_integer _ops;
      modelica_integer _ops1;
      modelica_integer _offset;
      modelica_integer _size;
      modelica_real _allOpCosts;
      modelica_real _tornCosts;
      modelica_real _otherCosts;
      modelica_real _dens;
      modelica_metatype _comp = NULL;
      modelica_metatype _torn = NULL;
      modelica_metatype _other = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _numAdds has no default value.
      // _numMul has no default value.
      // _numDiv has no default value.
      // _numOth has no default value.
      // _numTrig has no default value.
      // _numRel has no default value.
      // _numLog has no default value.
      // _numFuncs has no default value.
      // _costs has no default value.
      // _ops has no default value.
      // _ops1 has no default value.
      // _offset has no default value.
      // _size has no default value.
      // _allOpCosts has no default value.
      // _tornCosts has no default value.
      // _otherCosts has no default value.
      // _dens has no default value.
      // _comp has no default value.
      // _torn has no default value.
      // _other has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          modelica_integer tmp10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_metatype tmpMeta15;
          modelica_integer tmp16;
          modelica_metatype tmpMeta17;
          modelica_integer tmp18;
          modelica_metatype tmpMeta19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          modelica_integer tmp22;
          modelica_metatype tmpMeta23;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,9) == 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), 6));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          tmp16 = mmc_unbox_integer(tmpMeta15);
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          tmp18 = mmc_unbox_integer(tmpMeta17);
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
          tmp20 = mmc_unbox_integer(tmpMeta19);
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 10));
          tmp22 = mmc_unbox_integer(tmpMeta21);
          _comp = tmpMeta6;
          _numAdds = tmp8  /* pattern as ty=Integer */;
          _numMul = tmp10  /* pattern as ty=Integer */;
          _numDiv = tmp12  /* pattern as ty=Integer */;
          _numTrig = tmp14  /* pattern as ty=Integer */;
          _numRel = tmp16  /* pattern as ty=Integer */;
          _numLog = tmp18  /* pattern as ty=Integer */;
          _numOth = tmp20  /* pattern as ty=Integer */;
          _numFuncs = tmp22  /* pattern as ty=Integer */;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          _ops = _numAdds + _numMul + _numOth + _numTrig + _numRel + _numLog;

          if(omc_BackendDAEUtil_isSingleEquationComp(threadData, _comp))
          {
            _offset = ((modelica_integer) 35);
          }
          else
          {
            if(omc_BackendDAEUtil_isWhenComp(threadData, _comp))
            {
              _offset = ((modelica_integer) 113);
            }
            else
            {
              if(omc_BackendDAEUtil_isArrayComp(threadData, _comp))
              {
                _offset = ((modelica_integer) 100);
              }
              else
              {
                _offset = ((modelica_integer) 0);
              }
            }
          }

          _costs = _offset + (((modelica_integer) 12)) * (_numAdds) + (((modelica_integer) 32)) * (_numMul) + (((modelica_integer) 37)) * (_numDiv) + (((modelica_integer) 236)) * (_numTrig) + (((modelica_integer) 2)) * (_numRel) + (((modelica_integer) 4)) * (_numLog) + (((modelica_integer) 110)) * (_numOth) + (((modelica_integer) 375)) * (_numFuncs);
          tmpMeta23 = mmc_mk_box2(0, mmc_mk_integer(_ops), mmc_mk_real(((modelica_real)_costs)));
          tmpMeta1 = tmpMeta23;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta24;
          modelica_integer tmp25;
          modelica_metatype tmpMeta26;
          modelica_real tmp27;
          modelica_real tmp28;
          modelica_metatype tmpMeta29;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,4) == 0) goto tmp3_end;
          tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmp25 = mmc_unbox_integer(tmpMeta24);
          tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmp27 = mmc_unbox_real(tmpMeta26);
          _size = tmp25  /* pattern as ty=Integer */;
          _dens = tmp27  /* pattern as ty=Real */;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmp28 = (((modelica_real)_size)) * (1.0 + (19.0) * (_dens));
          _allOpCosts = (0.049) * ((tmp28 * tmp28 * tmp28));
          tmpMeta29 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1)), mmc_mk_real(_allOpCosts));
          tmpMeta1 = tmpMeta29;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          modelica_integer tmp33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          modelica_integer tmp36;
          modelica_metatype tmpMeta37;
          modelica_real tmp38;
          modelica_metatype tmpMeta39;
          modelica_metatype tmpMeta40;
          modelica_integer tmp41;
          modelica_metatype tmpMeta42;
          modelica_real tmp43;
          modelica_real tmp44;
          modelica_metatype tmpMeta45;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,4) == 0) goto tmp3_end;
          tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmp33 = mmc_unbox_integer(tmpMeta32);
          _torn = tmpMeta30;
          _other = tmpMeta31;
          _size = tmp33  /* pattern as ty=Integer */;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          /* Pattern-matching assignment */
          tmpMeta34 = omc_HpcOmTaskGraph_calculateCosts(threadData, _torn);
          tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 1));
          tmp36 = mmc_unbox_integer(tmpMeta35);
          tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 2));
          tmp38 = mmc_unbox_real(tmpMeta37);
          _ops = tmp36  /* pattern as ty=Integer */;
          _tornCosts = tmp38  /* pattern as ty=Real */;

          /* Pattern-matching assignment */
          tmpMeta39 = omc_HpcOmTaskGraph_calculateCosts(threadData, _other);
          tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 1));
          tmp41 = mmc_unbox_integer(tmpMeta40);
          tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta39), 2));
          tmp43 = mmc_unbox_real(tmpMeta42);
          _ops1 = tmp41  /* pattern as ty=Integer */;
          _otherCosts = tmp43  /* pattern as ty=Real */;

          tmp44 = ((modelica_real)_size);
          _allOpCosts = 3000.0 + (7.62) * ((tmp44 * tmp44 * tmp44)) + (2.0) * (_tornCosts) + (1.4) * (_otherCosts);
          tmpMeta45 = mmc_mk_box2(0, mmc_mk_integer(_ops + _ops1), mmc_mk_real(_allOpCosts));
          tmpMeta1 = tmpMeta45;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta46;
          modelica_integer tmp47;
          modelica_metatype tmpMeta48;
          modelica_integer tmp49;
          modelica_metatype tmpMeta50;
          modelica_integer tmp51;
          modelica_metatype tmpMeta52;
          modelica_integer tmp53;
          modelica_metatype tmpMeta54;
          modelica_integer tmp55;
          modelica_metatype tmpMeta56;
          modelica_integer tmp57;
          modelica_metatype tmpMeta58;
          modelica_integer tmp59;
          modelica_metatype tmpMeta60;
          modelica_integer tmp61;
          modelica_metatype tmpMeta62;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,8) == 0) goto tmp3_end;
          tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp47 = mmc_unbox_integer(tmpMeta46);
          tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp49 = mmc_unbox_integer(tmpMeta48);
          tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmp51 = mmc_unbox_integer(tmpMeta50);
          tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmp53 = mmc_unbox_integer(tmpMeta52);
          tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          tmp55 = mmc_unbox_integer(tmpMeta54);
          tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          tmp57 = mmc_unbox_integer(tmpMeta56);
          tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          tmp59 = mmc_unbox_integer(tmpMeta58);
          tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
          tmp61 = mmc_unbox_integer(tmpMeta60);
          _numAdds = tmp47  /* pattern as ty=Integer */;
          _numMul = tmp49  /* pattern as ty=Integer */;
          _numDiv = tmp51  /* pattern as ty=Integer */;
          _numTrig = tmp53  /* pattern as ty=Integer */;
          _numRel = tmp55  /* pattern as ty=Integer */;
          _numLog = tmp57  /* pattern as ty=Integer */;
          _numOth = tmp59  /* pattern as ty=Integer */;
          _numFuncs = tmp61  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          _ops = _numAdds + _numMul + _numOth + _numTrig + _numRel + _numLog;

          _offset = ((modelica_integer) 50);

          _costs = _offset + (((modelica_integer) 12)) * (_numAdds) + (((modelica_integer) 32)) * (_numMul) + (((modelica_integer) 37)) * (_numDiv) + (((modelica_integer) 236)) * (_numTrig) + (((modelica_integer) 2)) * (_numRel) + (((modelica_integer) 4)) * (_numLog) + (((modelica_integer) 110)) * (_numOth) + (((modelica_integer) 375)) * (_numFuncs);
          tmpMeta62 = mmc_mk_box2(0, mmc_mk_integer(_ops), mmc_mk_real(((modelica_real)_costs)));
          tmpMeta1 = tmpMeta62;
          goto tmp3_done;
        }
        case 4: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT71),stdout);
          tmpMeta1 = _OMC_LIT72;
          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:;
    }
  }
  _exeCost = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _exeCost;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_estimateCosts0(threadData_t *threadData, modelica_integer _systIdx, modelica_metatype _compsLstIn, modelica_metatype _eqSystemsIn, modelica_metatype _sharedIn)
{
  modelica_metatype _exeCostsOut = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _eqSys = NULL;
  modelica_metatype _compsInfos = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _exeCostsOut has no default value.
  // _comps has no default value.
  // _eqSys has no default value.
  // _compsInfos has no default value.
  _comps = listGet(_compsLstIn, _systIdx);

  _eqSys = listGet(_eqSystemsIn, _systIdx);

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _compsInfos = listReverse(omc_BackendDAEOptimize_countOperationstraverseComps(threadData, _comps, _eqSys, _sharedIn, tmpMeta1));

  _exeCostsOut = omc_List_map(threadData, _compsInfos, boxvar_HpcOmTaskGraph_calculateCosts);
  _return: OMC_LABEL_UNUSED
  return _exeCostsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_estimateCosts0(threadData_t *threadData, modelica_metatype _systIdx, modelica_metatype _compsLstIn, modelica_metatype _eqSystemsIn, modelica_metatype _sharedIn)
{
  modelica_integer tmp1;
  modelica_metatype _exeCostsOut = NULL;
  tmp1 = mmc_unbox_integer(_systIdx);
  _exeCostsOut = omc_HpcOmTaskGraph_estimateCosts0(threadData, tmp1, _compsLstIn, _eqSystemsIn, _sharedIn);
  /* skip box _exeCostsOut; list<tuple<#Integer, #Real>> */
  return _exeCostsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_estimateCosts(threadData_t *threadData, modelica_metatype _daeIn, modelica_metatype _taskGraphMetaIn)
{
  modelica_metatype _taskGraphMetaOut = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _comNumLst = NULL;
  modelica_metatype _exeCostsLst = NULL;
  modelica_metatype _eqSystems = NULL;
  modelica_metatype _shared = NULL;
  modelica_metatype _compsLst = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_integer _compIdx;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _taskGraphMetaOut has no default value.
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _nodeMark has no default value.
  // _comNumLst has no default value.
  // _exeCostsLst has no default value.
  // _eqSystems has no default value.
  // _shared has no default value.
  // _compsLst has no default value.
  // _compParamMapping has no default value.
  // _compInformations has no default value.
  // _compIdx has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _daeIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  _eqSystems = tmpMeta2;
  _shared = tmpMeta3;

  _compsLst = omc_List_map(threadData, _eqSystems, boxvar_BackendDAEUtil_getStrongComponents);

  _comNumLst = omc_List_map(threadData, _compsLst, boxvar_listLength);

  /* Pattern-matching assignment */
  tmpMeta4 = _taskGraphMetaIn;
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 3));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 4));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 5));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 6));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 7));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 8));
  tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 9));
  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 10));
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 11));
  _inComps = tmpMeta5;
  _varCompMapping = tmpMeta6;
  _eqCompMapping = tmpMeta7;
  _compParamMapping = tmpMeta8;
  _compNames = tmpMeta9;
  _compDescs = tmpMeta10;
  _exeCosts = tmpMeta11;
  _commCosts = tmpMeta12;
  _nodeMark = tmpMeta13;
  _compInformations = tmpMeta14;

  _commCosts = omc_HpcOmTaskGraph_getCommCostsOnly(threadData, _commCosts);

  _exeCostsLst = omc_List_flatten(threadData, omc_List_map3(threadData, omc_List_intRange(threadData, listLength(_compsLst)), boxvar_HpcOmTaskGraph_estimateCosts0, _compsLst, _eqSystems, _shared));

  _compIdx = ((modelica_integer) 1);

  {
    modelica_metatype _exeCost;
    for (tmpMeta15 = _exeCostsLst; !listEmpty(tmpMeta15); tmpMeta15=MMC_CDR(tmpMeta15))
    {
      _exeCost = MMC_CAR(tmpMeta15);
      arrayUpdate(_exeCosts, _compIdx, _exeCost);

      _compIdx = ((modelica_integer) 1) + _compIdx;
    }
  }

  tmpMeta17 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _taskGraphMetaOut = tmpMeta17;
  _return: OMC_LABEL_UNUSED
  return _taskGraphMetaOut;
}

static modelica_metatype closure8_HpcOmTaskGraph_createCosts0(threadData_t *thData, modelica_metatype closure, modelica_metatype iNode, modelica_metatype iTaskGraphMeta)
{
  modelica_metatype iComps_shared = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype iCompMapping = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype reqTimeOp = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype reqTimeCom = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_HpcOmTaskGraph_createCosts0(thData, iNode, iComps_shared, iCompMapping, reqTimeOp, reqTimeCom, iTaskGraphMeta);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_createCosts(threadData_t *threadData, modelica_metatype _iDae, modelica_string _iBenchFilePrefix, modelica_metatype _iSimEqCompMapping, modelica_metatype _iTaskGraphMeta)
{
  modelica_metatype _oTaskGraphMeta = NULL;
  modelica_metatype _compMapping = NULL;
  modelica_metatype _compMapping_withIdx = NULL;
  modelica_metatype _shared = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _reqTimeCom = NULL;
  modelica_metatype _reqTimeOpLstSimCode = NULL;
  modelica_metatype _reqTimeOpSimCode = NULL;
  modelica_metatype _tmpTaskGraphMeta = NULL;
  modelica_metatype _reqTimeOp = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraphMeta has no default value.
  // _compMapping has no default value.
  // _compMapping_withIdx has no default value.
  // _shared has no default value.
  // _comps has no default value.
  // _reqTimeCom has no default value.
  // _reqTimeOpLstSimCode has no default value.
  // _reqTimeOpSimCode has no default value.
  // _tmpTaskGraphMeta has no default value.
  // _reqTimeOp has no default value.
  // _inComps has no default value.
  // _commCosts has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _iDae;
    tmp4_2 = _iTaskGraphMeta;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 9));
          
          _shared = tmpMeta6;
          _inComps = tmpMeta7;
          _commCosts = tmpMeta8;
          /* Pattern matching succeeded */
          _comps = omc_HpcOmTaskGraph_getSystemComponents(threadData, _iDae ,&_compMapping_withIdx);

          _compMapping = omc_Array_map(threadData, _compMapping_withIdx, boxvar_Util_tuple21);

          /* Pattern-matching assignment */
          tmpMeta9 = omc_HpcOmBenchmark_benchSystem(threadData);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
          _reqTimeCom = tmpMeta10;

          _reqTimeOpLstSimCode = omc_HpcOmBenchmark_readCalcTimesFromFile(threadData, _iBenchFilePrefix);

          _reqTimeOpSimCode = arrayCreate(listLength(_reqTimeOpLstSimCode), _OMC_LIT72);

          _reqTimeOpSimCode = omc_List_fold(threadData, _reqTimeOpLstSimCode, boxvar_HpcOmTaskGraph_createCosts1, _reqTimeOpSimCode);

          _reqTimeOp = arrayCreate(listLength(_comps), _OMC_LIT43);

          _reqTimeOp = omc_HpcOmTaskGraph_convertSimEqToSccCosts(threadData, _reqTimeOpSimCode, _iSimEqCompMapping, _reqTimeOp);

          _commCosts = omc_HpcOmTaskGraph_createCommCosts(threadData, _commCosts, ((modelica_integer) 1), _reqTimeCom);

          /* Pattern-matching assignment */
          tmpMeta12 = mmc_mk_box2(0, _comps, _shared);
          tmpMeta11 = mmc_mk_box4(0, tmpMeta12, _compMapping, _reqTimeOp, _reqTimeCom);
          tmpMeta13 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) 1)), _iTaskGraphMeta);
          tmpMeta14 = omc_Array_fold(threadData, _inComps, (modelica_fnptr) mmc_mk_box2(0,closure8_HpcOmTaskGraph_createCosts0,tmpMeta11), tmpMeta13);
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
          _tmpTaskGraphMeta = tmpMeta15;
          tmpMeta1 = _tmpTaskGraphMeta;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          
          /* Pattern matching succeeded */
          _tmpTaskGraphMeta = omc_HpcOmTaskGraph_estimateCosts(threadData, _iDae, _iTaskGraphMeta);

          tmpMeta16 = stringAppend(_OMC_LIT73,_iBenchFilePrefix);
          tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT74);
          fputs(MMC_STRINGDATA(tmpMeta17),stdout);
          tmpMeta1 = _tmpTaskGraphMeta;
          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:;
    }
  }
  _oTaskGraphMeta = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oTaskGraphMeta;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_checkParentNode(threadData_t *threadData, modelica_integer _lstIdx, modelica_metatype _graphIn, modelica_metatype _lstIn)
{
  modelica_metatype _lstOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _lstOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _childLst = NULL;
      modelica_integer _child;
      modelica_integer _parent;
      modelica_metatype _parents = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _childLst has no default value.
      // _child has no default value.
      // _parent has no default value.
      // _parents has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          /* Pattern matching succeeded */
          _childLst = listGet(_lstIn, _lstIdx);

          _child = mmc_unbox_integer(omc_List_last(threadData, _childLst));

          _parents = omc_HpcOmTaskGraph_getParentNodes(threadData, _child, _graphIn);

          /* Pattern-matching assignment */
          tmp6 = (listLength(_parents) == ((modelica_integer) 1));
          if (1 /* true */ != tmp6) goto goto_2;

          _parent = mmc_unbox_integer(listGet(_parents, ((modelica_integer) 1)));

          _childLst = listReverse(_childLst);

          tmpMeta7 = mmc_mk_cons(mmc_mk_integer(_parent), _childLst);
          _childLst = tmpMeta7;

          _childLst = listReverse(_childLst);
          tmpMeta1 = omc_List_replaceAt(threadData, _childLst, _lstIdx, _lstIn);
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp8;
          /* Pattern matching succeeded */
          _childLst = listGet(_lstIn, _lstIdx);

          _child = mmc_unbox_integer(omc_List_last(threadData, _childLst));

          _parents = omc_HpcOmTaskGraph_getParentNodes(threadData, _child, _graphIn);

          /* Pattern-matching assignment */
          tmp8 = (listLength(_parents) == ((modelica_integer) 1));
          if (0 /* false */ != tmp8) goto goto_2;
          tmpMeta1 = _lstIn;
          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:;
    }
  }
  _lstOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _lstOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkParentNode(threadData_t *threadData, modelica_metatype _lstIdx, modelica_metatype _graphIn, modelica_metatype _lstIn)
{
  modelica_integer tmp1;
  modelica_metatype _lstOut = NULL;
  tmp1 = mmc_unbox_integer(_lstIdx);
  _lstOut = omc_HpcOmTaskGraph_checkParentNode(threadData, tmp1, _graphIn, _lstIn);
  /* skip box _lstOut; list<list<#Integer>> */
  return _lstOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getParentNodes(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _graphIn)
{
  modelica_metatype _parentNodes = NULL;
  modelica_metatype _graphInT = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _parentNodes has no default value.
  // _graphInT has no default value.
  _graphInT = omc_AdjacencyMatrix_transposeAdjacencyMatrix(threadData, _graphIn, arrayLength(_graphIn));

  _parentNodes = arrayGet(_graphInT, _nodeIdx);
  _return: OMC_LABEL_UNUSED
  return _parentNodes;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getParentNodes(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _graphIn)
{
  modelica_integer tmp1;
  modelica_metatype _parentNodes = NULL;
  tmp1 = mmc_unbox_integer(_nodeIdx);
  _parentNodes = omc_HpcOmTaskGraph_getParentNodes(threadData, tmp1, _graphIn);
  /* skip box _parentNodes; list<#Integer> */
  return _parentNodes;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_findOneChildParents(threadData_t *threadData, modelica_metatype _allNodes, modelica_metatype _graphIn, modelica_metatype _doNotMerge, modelica_metatype _lstIn, modelica_integer _inPath, modelica_metatype _contrNodes)
{
  modelica_metatype _lstOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _lstOut has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _allNodes;
    {
      modelica_integer _child;
      modelica_integer _head;
      modelica_metatype _nodeChildren = NULL;
      modelica_metatype _parents = NULL;
      modelica_metatype _pathLst = NULL;
      modelica_metatype _rest = NULL;
      modelica_metatype _lstTmp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _child has no default value.
      // _head has no default value.
      // _nodeChildren has no default value.
      // _parents has no default value.
      // _pathLst has no default value.
      // _rest has no default value.
      // _lstTmp has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 9; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          tmp4 += 7; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta1 = _lstIn;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_boolean tmp9;
          modelica_boolean tmp10;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmp8 = mmc_unbox_integer(tmpMeta6);
          _head = tmp8  /* pattern as ty=Integer */;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp9 = (_inPath == ((modelica_integer) 0));
          if (1 /* true */ != tmp9) goto goto_2;

          _nodeChildren = arrayGet(_graphIn, _head);

          _nodeChildren = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _nodeChildren, _contrNodes);

          /* Pattern-matching assignment */
          tmp10 = (listLength(_nodeChildren) == ((modelica_integer) 1));
          if (0 /* false */ != tmp10) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_findOneChildParents(threadData, _rest, _graphIn, _doNotMerge, _lstIn, ((modelica_integer) 0), _contrNodes);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_boolean tmp14;
          modelica_boolean tmp15;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta11 = MMC_CAR(tmp4_1);
          tmpMeta12 = MMC_CDR(tmp4_1);
          tmp13 = mmc_unbox_integer(tmpMeta11);
          _head = tmp13  /* pattern as ty=Integer */;
          _rest = tmpMeta12;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp14 = (_inPath == ((modelica_integer) 0));
          if (1 /* true */ != tmp14) goto goto_2;

          /* Pattern-matching assignment */
          tmp15 = listMember(mmc_mk_integer(_head), _doNotMerge);
          if (1 /* true */ != tmp15) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_findOneChildParents(threadData, _rest, _graphIn, _doNotMerge, _lstIn, ((modelica_integer) 0), _contrNodes);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_integer tmp18;
          modelica_boolean tmp19;
          modelica_boolean tmp20;
          modelica_boolean tmp21;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta16 = MMC_CAR(tmp4_1);
          tmpMeta17 = MMC_CDR(tmp4_1);
          tmp18 = mmc_unbox_integer(tmpMeta16);
          _head = tmp18  /* pattern as ty=Integer */;
          _rest = tmpMeta17;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp19 = (_inPath == ((modelica_integer) 0));
          if (1 /* true */ != tmp19) goto goto_2;

          _nodeChildren = arrayGet(_graphIn, _head);

          _nodeChildren = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _nodeChildren, _contrNodes);

          /* Pattern-matching assignment */
          tmp20 = (listLength(_nodeChildren) == ((modelica_integer) 1));
          if (1 /* true */ != tmp20) goto goto_2;

          _child = mmc_unbox_integer(listGet(_nodeChildren, ((modelica_integer) 1)));

          /* Pattern-matching assignment */
          tmp21 = listMember(mmc_mk_integer(_child), _doNotMerge);
          if (1 /* true */ != tmp21) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_findOneChildParents(threadData, _rest, _graphIn, _doNotMerge, _lstIn, _child, _contrNodes);
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_integer tmp24;
          modelica_boolean tmp25;
          modelica_boolean tmp26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta22 = MMC_CAR(tmp4_1);
          tmpMeta23 = MMC_CDR(tmp4_1);
          tmp24 = mmc_unbox_integer(tmpMeta22);
          _head = tmp24  /* pattern as ty=Integer */;
          _rest = tmpMeta23;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp25 = (_inPath == ((modelica_integer) 0));
          if (1 /* true */ != tmp25) goto goto_2;

          _nodeChildren = arrayGet(_graphIn, _head);

          _nodeChildren = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _nodeChildren, _contrNodes);

          /* Pattern-matching assignment */
          tmp26 = (listLength(_nodeChildren) == ((modelica_integer) 1));
          if (1 /* true */ != tmp26) goto goto_2;

          _child = mmc_unbox_integer(listGet(_nodeChildren, ((modelica_integer) 1)));

          tmpMeta28 = mmc_mk_cons(mmc_mk_integer(_head), MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta27 = mmc_mk_cons(tmpMeta28, _lstIn);
          _lstTmp = tmpMeta27;
          tmpMeta1 = omc_HpcOmTaskGraph_findOneChildParents(threadData, _rest, _graphIn, _doNotMerge, _lstTmp, _child, _contrNodes);
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_boolean tmp31;
          modelica_boolean tmp32;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta29 = MMC_CAR(tmp4_1);
          tmpMeta30 = MMC_CDR(tmp4_1);
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp31 = (_inPath == ((modelica_integer) 0));
          if (0 /* false */ != tmp31) goto goto_2;

          /* Pattern-matching assignment */
          tmp32 = listMember(mmc_mk_integer(_inPath), _doNotMerge);
          if (1 /* true */ != tmp32) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_findOneChildParents(threadData, _allNodes, _graphIn, _doNotMerge, _lstIn, ((modelica_integer) 0), _contrNodes);
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_boolean tmp35;
          modelica_boolean tmp36;
          modelica_metatype tmpMeta37;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta33 = MMC_CAR(tmp4_1);
          tmpMeta34 = MMC_CDR(tmp4_1);
          _rest = tmpMeta34;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp35 = (_inPath == ((modelica_integer) 0));
          if (0 /* false */ != tmp35) goto goto_2;

          _nodeChildren = arrayGet(_graphIn, _inPath);

          _nodeChildren = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _nodeChildren, _contrNodes);

          _parents = omc_HpcOmTaskGraph_getParentNodes(threadData, _inPath, _graphIn);

          _parents = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _parents, _contrNodes);

          /* Pattern-matching assignment */
          tmp36 = (((listLength(_nodeChildren) == ((modelica_integer) 1)) && (!listEmpty(_nodeChildren))) && (listLength(_parents) == ((modelica_integer) 1)));
          if (1 /* true */ != tmp36) goto goto_2;

          _child = mmc_unbox_integer(listGet(_nodeChildren, ((modelica_integer) 1)));

          _pathLst = listHead(_lstIn);

          tmpMeta37 = mmc_mk_cons(mmc_mk_integer(_inPath), _pathLst);
          _pathLst = tmpMeta37;

          _lstTmp = omc_List_replaceAt(threadData, _pathLst, ((modelica_integer) 1), _lstIn);

          _rest = omc_List_deleteMemberOnTrue(threadData, mmc_mk_integer(_inPath), _allNodes, boxvar_intEq, NULL);
          tmpMeta1 = omc_HpcOmTaskGraph_findOneChildParents(threadData, _rest, _graphIn, _doNotMerge, _lstTmp, _child, _contrNodes);
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta38;
          modelica_metatype tmpMeta39;
          modelica_boolean tmp40;
          modelica_metatype tmpMeta41;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta38 = MMC_CAR(tmp4_1);
          tmpMeta39 = MMC_CDR(tmp4_1);
          _rest = tmpMeta39;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp40 = (_inPath == ((modelica_integer) 0));
          if (0 /* false */ != tmp40) goto goto_2;

          _nodeChildren = arrayGet(_graphIn, _inPath);

          _nodeChildren = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _nodeChildren, _contrNodes);

          _parents = omc_HpcOmTaskGraph_getParentNodes(threadData, _inPath, _graphIn);

          _parents = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _parents, _contrNodes);

          _pathLst = listHead(_lstIn);

          tmpMeta41 = mmc_mk_cons(mmc_mk_integer(_inPath), _pathLst);
          _pathLst = tmpMeta41;

          _lstTmp = omc_List_replaceAt(threadData, _pathLst, ((modelica_integer) 1), _lstIn);

          _rest = omc_List_deleteMemberOnTrue(threadData, mmc_mk_integer(_inPath), _allNodes, boxvar_intEq, NULL);
          tmpMeta1 = omc_HpcOmTaskGraph_findOneChildParents(threadData, _rest, _graphIn, _doNotMerge, _lstTmp, ((modelica_integer) 0), _contrNodes);
          goto tmp3_done;
        }
        case 8: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT75),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 9) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _lstOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _lstOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_findOneChildParents(threadData_t *threadData, modelica_metatype _allNodes, modelica_metatype _graphIn, modelica_metatype _doNotMerge, modelica_metatype _lstIn, modelica_metatype _inPath, modelica_metatype _contrNodes)
{
  modelica_integer tmp1;
  modelica_metatype _lstOut = NULL;
  tmp1 = mmc_unbox_integer(_inPath);
  _lstOut = omc_HpcOmTaskGraph_findOneChildParents(threadData, _allNodes, _graphIn, _doNotMerge, _lstIn, tmp1, _contrNodes);
  /* skip box _lstOut; list<list<#Integer>> */
  return _lstOut;
}

DLLDirection
modelica_boolean omc_HpcOmTaskGraph_equalLists(threadData_t *threadData, modelica_metatype _inList1, modelica_metatype _inList2)
{
  modelica_boolean _outIsEqual;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outIsEqual has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _inList1;
    tmp4_2 = _inList2;
    {
      modelica_integer _e1;
      modelica_integer _e2;
      modelica_metatype _rest1 = NULL;
      modelica_metatype _rest2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _e1 has no default value.
      // _e2 has no default value.
      // _rest1 has no default value.
      // _rest2 has no default value.
      tmp4 = 0;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          if (!listEmpty(tmp4_2)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          goto tmp3_done;
        }
        case 2: {
          if (!listEmpty(tmp4_2)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmp8 = mmc_unbox_integer(tmpMeta6);
          if (listEmpty(tmp4_2)) goto tmp3_end;
          tmpMeta9 = MMC_CAR(tmp4_2);
          tmpMeta10 = MMC_CDR(tmp4_2);
          tmp11 = mmc_unbox_integer(tmpMeta9);
          _e1 = tmp8  /* pattern as ty=Integer */;
          _rest1 = tmpMeta7;
          _e2 = tmp11  /* pattern as ty=Integer */;
          _rest2 = tmpMeta10;
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!(_e1 == _e2)) goto tmp3_end;
          /* Tail recursive call */
          _inList1 = _rest1;
          _inList2 = _rest2;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 4: {
          
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outIsEqual = tmp1;
  _return: OMC_LABEL_UNUSED
  return _outIsEqual;
}
modelica_metatype boxptr_HpcOmTaskGraph_equalLists(threadData_t *threadData, modelica_metatype _inList1, modelica_metatype _inList2)
{
  modelica_boolean _outIsEqual;
  modelica_metatype out_outIsEqual;
  _outIsEqual = omc_HpcOmTaskGraph_equalLists(threadData, _inList1, _inList2);
  out_outIsEqual = mmc_mk_icon(_outIsEqual);
  return out_outIsEqual;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateInComps2(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _inCompLstIn)
{
  modelica_metatype _inCompLstOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _inCompLstOut has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _inCompLstOut = omc_List_replaceAt(threadData, tmpMeta1, _iNodeIdx, _inCompLstIn);
  _return: OMC_LABEL_UNUSED
  return _inCompLstOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateInComps2(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _inCompLstIn)
{
  modelica_integer tmp1;
  modelica_metatype _inCompLstOut = NULL;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  _inCompLstOut = omc_HpcOmTaskGraph_updateInComps2(threadData, tmp1, _inCompLstIn);
  /* skip box _inCompLstOut; list<list<#Integer>> */
  return _inCompLstOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateInComps1(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _mergeInfo, modelica_metatype _primInComps, modelica_metatype _inCompLstIn)
{
  modelica_metatype _inCompLstOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _inCompLstOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_integer _mergeGroupIdx;
      modelica_metatype _inComps = NULL;
      modelica_metatype _mergedSet = NULL;
      modelica_metatype _mergedNodes = NULL;
      modelica_metatype _startNodes = NULL;
      modelica_metatype _mergedPaths = NULL;
      modelica_metatype _inCompLstTmp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _mergeGroupIdx has no default value.
      // _inComps has no default value.
      // _mergedSet has no default value.
      // _mergedNodes has no default value.
      // _startNodes has no default value.
      // _mergedPaths has no default value.
      // _inCompLstTmp has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_boolean tmp9;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta6 = _mergeInfo;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
          _startNodes = tmpMeta7;
          _mergedPaths = tmpMeta8;

          _inComps = listGet(_inCompLstIn, _nodeIdx);

          listGet(_inComps, ((modelica_integer) 1));

          /* Pattern-matching assignment */
          tmp9 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_nodeIdx), _startNodes, boxvar_intEq);
          if (1 /* true */ != tmp9) goto goto_2;

          _mergeGroupIdx = omc_List_position(threadData, mmc_mk_integer(_nodeIdx), _startNodes);

          _mergedNodes = listGet(_mergedPaths, _mergeGroupIdx);

          _mergedSet = omc_List_flatten(threadData, omc_List_map1(threadData, _mergedNodes, boxvar_Array_getIndexFirst, _primInComps));

          _inCompLstTmp = omc_List_fold(threadData, _mergedNodes, boxvar_HpcOmTaskGraph_updateInComps2, _inCompLstIn);
          tmpMeta1 = omc_List_replaceAt(threadData, _mergedSet, _nodeIdx, _inCompLstTmp);
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmpMeta1 = _inCompLstIn;
          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:;
    }
  }
  _inCompLstOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _inCompLstOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateInComps1(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _mergeInfo, modelica_metatype _primInComps, modelica_metatype _inCompLstIn)
{
  modelica_integer tmp1;
  modelica_metatype _inCompLstOut = NULL;
  tmp1 = mmc_unbox_integer(_nodeIdx);
  _inCompLstOut = omc_HpcOmTaskGraph_updateInComps1(threadData, tmp1, _mergeInfo, _primInComps, _inCompLstIn);
  /* skip box _inCompLstOut; list<list<#Integer>> */
  return _inCompLstOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateInCompsForMerging(threadData_t *threadData, modelica_metatype _inCompsIn, modelica_metatype _mergedPaths)
{
  modelica_metatype _inCompsOut = NULL;
  modelica_metatype _inCompsTmp = NULL;
  modelica_metatype _inCompsLst = NULL;
  modelica_metatype _deleteNodes = NULL;
  modelica_metatype _startNodes = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _inCompsOut has no default value.
  // _inCompsTmp has no default value.
  // _inCompsLst has no default value.
  // _deleteNodes has no default value.
  // _startNodes has no default value.
  _startNodes = omc_List_map(threadData, _mergedPaths, boxvar_List_last);

  omc_List_intersection1OnTrue(threadData, omc_List_flatten(threadData, _mergedPaths), _startNodes, boxvar_intEq ,&_deleteNodes ,NULL);

  _inCompsLst = arrayList(_inCompsIn);

  tmpMeta1 = mmc_mk_box3(0, _startNodes, _deleteNodes, _mergedPaths);
  _inCompsLst = omc_List_fold2(threadData, omc_List_intRange(threadData, arrayLength(_inCompsIn)), boxvar_HpcOmTaskGraph_updateInComps1, tmpMeta1, _inCompsIn, _inCompsLst);

  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _inCompsLst = omc_List_removeOnTrue(threadData, tmpMeta2, boxvar_HpcOmTaskGraph_equalLists, _inCompsLst);

  _inCompsOut = listArray(_inCompsLst);
  _return: OMC_LABEL_UNUSED
  return _inCompsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCompNamesForMerging(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _inComps, modelica_metatype _nodeMark, modelica_metatype _compNamesIn)
{
  modelica_metatype _compNamesOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compNamesOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_integer _unionNode;
      modelica_metatype _mergedComps = NULL;
      modelica_string _compName = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _unionNode has no default value.
      // _mergedComps has no default value.
      // _compName has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_boolean tmp7;
          modelica_boolean tmp8;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (_compIdx <= arrayLength(_compNamesIn));
          if (1 /* true */ != tmp6) goto goto_2;

          _unionNode = omc_HpcOmTaskGraph_getCompInComps(threadData, _compIdx, ((modelica_integer) 1), _inComps, _nodeMark);

          /* Pattern-matching assignment */
          tmp7 = (_unionNode != ((modelica_integer) -1));
          if (1 /* true */ != tmp7) goto goto_2;

          _mergedComps = arrayGet(_inComps, _unionNode);

          /* Pattern-matching assignment */
          tmp8 = (listLength(_mergedComps) == ((modelica_integer) 1));
          if (1 /* true */ != tmp8) goto goto_2;
          tmpMeta1 = _compNamesIn;
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp9;
          modelica_boolean tmp10;
          modelica_boolean tmp11;
          modelica_metatype tmpMeta12;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp9 = (_compIdx <= arrayLength(_compNamesIn));
          if (1 /* true */ != tmp9) goto goto_2;

          _unionNode = omc_HpcOmTaskGraph_getCompInComps(threadData, _compIdx, ((modelica_integer) 1), _inComps, _nodeMark);

          /* Pattern-matching assignment */
          tmp10 = (_unionNode != ((modelica_integer) -1));
          if (1 /* true */ != tmp10) goto goto_2;

          _mergedComps = arrayGet(_inComps, _unionNode);

          /* Pattern-matching assignment */
          tmp11 = (listLength(_mergedComps) == ((modelica_integer) 1));
          if (0 /* false */ != tmp11) goto goto_2;

          tmpMeta12 = stringAppend(_OMC_LIT76,stringDelimitList(omc_List_map(threadData, _mergedComps, boxvar_intString), _OMC_LIT31));
          _compName = tmpMeta12;
          tmpMeta1 = arrayUpdate(_compNamesIn, _compIdx, _compName);
          goto tmp3_done;
        }
        case 2: {
          modelica_boolean tmp13;
          modelica_boolean tmp14;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp13 = (_compIdx <= arrayLength(_compNamesIn));
          if (1 /* true */ != tmp13) goto goto_2;

          _unionNode = omc_HpcOmTaskGraph_getCompInComps(threadData, _compIdx, ((modelica_integer) 1), _inComps, _nodeMark);

          /* Pattern-matching assignment */
          tmp14 = (_unionNode == ((modelica_integer) -1));
          if (1 /* true */ != tmp14) goto goto_2;
          tmpMeta1 = _compNamesIn;
          goto tmp3_done;
        }
        case 3: {
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT77),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 4) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _compNamesOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _compNamesOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCompNamesForMerging(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _inComps, modelica_metatype _nodeMark, modelica_metatype _compNamesIn)
{
  modelica_integer tmp1;
  modelica_metatype _compNamesOut = NULL;
  tmp1 = mmc_unbox_integer(_compIdx);
  _compNamesOut = omc_HpcOmTaskGraph_updateCompNamesForMerging(threadData, tmp1, _inComps, _nodeMark, _compNamesIn);
  /* skip box _compNamesOut; array<String> */
  return _compNamesOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getMergedSystemData(threadData_t *threadData, modelica_metatype _graphDataIn, modelica_metatype _contractNodes)
{
  modelica_metatype _graphDataOut = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _inCompsLst = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphDataOut has no default value.
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compParamMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _nodeMark has no default value.
  // _inCompsLst has no default value.
  // _compInformations has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _graphDataIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
  _inComps = tmpMeta2;
  _varCompMapping = tmpMeta3;
  _eqCompMapping = tmpMeta4;
  _compParamMapping = tmpMeta5;
  _compNames = tmpMeta6;
  _compDescs = tmpMeta7;
  _exeCosts = tmpMeta8;
  _commCosts = tmpMeta9;
  _nodeMark = tmpMeta10;
  _compInformations = tmpMeta11;

  _inComps = omc_HpcOmTaskGraph_updateInCompsForMerging(threadData, _inComps, _contractNodes);

  _compNames = omc_List_fold2(threadData, omc_List_intRange(threadData, arrayLength(_compNames)), boxvar_HpcOmTaskGraph_updateCompNamesForMerging, _inComps, _nodeMark, _compNames);

  tmpMeta12 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _graphDataOut = tmpMeta12;
  _return: OMC_LABEL_UNUSED
  return _graphDataOut;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareListLengthOnTrue(threadData_t *threadData, modelica_integer _inValue, modelica_metatype _inLst)
{
  modelica_boolean _equalLength;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _equalLength has no default value.
  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (_inValue == listLength(_inLst));
          if (1 /* true */ != tmp6) goto goto_2;
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          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:;
    }
  }
  _equalLength = tmp1;
  _return: OMC_LABEL_UNUSED
  return _equalLength;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareListLengthOnTrue(threadData_t *threadData, modelica_metatype _inValue, modelica_metatype _inLst)
{
  modelica_integer tmp1;
  modelica_boolean _equalLength;
  modelica_metatype out_equalLength;
  tmp1 = mmc_unbox_integer(_inValue);
  _equalLength = omc_HpcOmTaskGraph_compareListLengthOnTrue(threadData, tmp1, _inLst);
  out_equalLength = mmc_mk_icon(_equalLength);
  return out_equalLength;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_contractNodesInGraph2(threadData_t *threadData, modelica_integer _iParentNode, modelica_metatype _iDeletedNodes, modelica_integer _iNewNodeIdx, modelica_metatype _iGraph)
{
  modelica_metatype _oGraph = NULL;
  modelica_metatype _adjLstEntry = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oGraph has no default value.
  // _adjLstEntry has no default value.
  _adjLstEntry = arrayGet(_iGraph, _iParentNode);

  _adjLstEntry = omc_List_setDifferenceOnTrue(threadData, _adjLstEntry, _iDeletedNodes, boxvar_intEq);

  tmpMeta1 = mmc_mk_cons(mmc_mk_integer(_iNewNodeIdx), _adjLstEntry);
  _adjLstEntry = tmpMeta1;

  _adjLstEntry = omc_List_sortedUnique(threadData, omc_List_sort(threadData, _adjLstEntry, boxvar_intGt), boxvar_intEq);

  _oGraph = arrayUpdate(_iGraph, _iParentNode, _adjLstEntry);
  _return: OMC_LABEL_UNUSED
  return _oGraph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_contractNodesInGraph2(threadData_t *threadData, modelica_metatype _iParentNode, modelica_metatype _iDeletedNodes, modelica_metatype _iNewNodeIdx, modelica_metatype _iGraph)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _oGraph = NULL;
  tmp1 = mmc_unbox_integer(_iParentNode);
  tmp2 = mmc_unbox_integer(_iNewNodeIdx);
  _oGraph = omc_HpcOmTaskGraph_contractNodesInGraph2(threadData, tmp1, _iDeletedNodes, tmp2, _iGraph);
  /* skip box _oGraph; array<list<#Integer>> */
  return _oGraph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_contractNodesInGraph1(threadData_t *threadData, modelica_metatype _contractNodes, modelica_metatype _graphIn)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _graphInT = NULL;
  modelica_integer _endNode;
  modelica_integer _startNode;
  modelica_metatype _deleteEntries = NULL;
  modelica_metatype _startNodeChildren = NULL;
  modelica_metatype _endChildren = NULL;
  modelica_metatype _deleteNodesParents = NULL;
  modelica_metatype _graphTmp = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _graphInT has no default value.
  // _endNode has no default value.
  // _startNode has no default value.
  // _deleteEntries has no default value.
  // _startNodeChildren has no default value.
  // _endChildren has no default value.
  // _deleteNodesParents has no default value.
  // _graphTmp has no default value.
  _graphInT = omc_AdjacencyMatrix_transposeAdjacencyMatrix(threadData, _graphIn, arrayLength(_graphIn));

  _startNode = mmc_unbox_integer(omc_List_last(threadData, _contractNodes));

  _deleteEntries = omc_List_deleteMemberOnTrue(threadData, mmc_mk_integer(_startNode), _contractNodes, boxvar_intEq, NULL);

  _deleteNodesParents = omc_List_flatten(threadData, omc_List_map1(threadData, _deleteEntries, boxvar_Array_getIndexFirst, _graphInT));

  _deleteNodesParents = omc_List_sortedUnique(threadData, omc_List_sort(threadData, _deleteNodesParents, boxvar_intGt), boxvar_intEq);

  _deleteNodesParents = omc_List_setDifferenceOnTrue(threadData, _deleteNodesParents, _contractNodes, boxvar_intEq);

  _endNode = mmc_unbox_integer(listHead(_contractNodes));

  _endChildren = arrayGet(_graphIn, _endNode);

  _startNodeChildren = arrayGet(_graphIn, _startNode);

  _startNodeChildren = omc_List_setDifferenceOnTrue(threadData, _startNodeChildren, _deleteEntries, boxvar_intEq);

  _graphTmp = arrayUpdate(_graphIn, _startNode, _startNodeChildren);

  _graphTmp = omc_List_fold2(threadData, _deleteNodesParents, boxvar_HpcOmTaskGraph_contractNodesInGraph2, _deleteEntries, mmc_mk_integer(_startNode), _graphTmp);

  _graphTmp = arrayUpdate(_graphIn, _startNode, _endChildren);

  _graphOut = _graphTmp;
  _return: OMC_LABEL_UNUSED
  return _graphOut;
}

DLLDirection
modelica_boolean omc_HpcOmTaskGraph_isNodeContracted(threadData_t *threadData, modelica_integer _iNode, modelica_metatype _iContrNodes)
{
  modelica_boolean _oIsContracted;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oIsContracted has no default value.
  if((_iNode <= arrayLength(_iContrNodes)))
  {
    _oIsContracted = (mmc_unbox_integer(arrayGet(_iContrNodes, _iNode)) < ((modelica_integer) 0));
  }
  else
  {
    _oIsContracted = 0 /* false */;
  }
  _return: OMC_LABEL_UNUSED
  return _oIsContracted;
}
modelica_metatype boxptr_HpcOmTaskGraph_isNodeContracted(threadData_t *threadData, modelica_metatype _iNode, modelica_metatype _iContrNodes)
{
  modelica_integer tmp1;
  modelica_boolean _oIsContracted;
  modelica_metatype out_oIsContracted;
  tmp1 = mmc_unbox_integer(_iNode);
  _oIsContracted = omc_HpcOmTaskGraph_isNodeContracted(threadData, tmp1, _iContrNodes);
  out_oIsContracted = mmc_mk_icon(_oIsContracted);
  return out_oIsContracted;
}

static modelica_metatype closure9_HpcOmTaskGraph_isNodeContracted(threadData_t *thData, modelica_metatype closure, modelica_metatype iNode)
{
  modelica_metatype iContrNodes = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_HpcOmTaskGraph_isNodeContracted(thData, iNode, iContrNodes);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_filterNonContractedNodes(threadData_t *threadData, modelica_metatype _nodesIn, modelica_metatype _contrNodes)
{
  modelica_metatype _nodesOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodesOut has no default value.
  tmpMeta1 = mmc_mk_box1(0, _contrNodes);
  _nodesOut = omc_List_filterOnTrue(threadData, _nodesIn, (modelica_fnptr) mmc_mk_box2(0,closure9_HpcOmTaskGraph_isNodeContracted,tmpMeta1));
  _return: OMC_LABEL_UNUSED
  return _nodesOut;
}

static modelica_metatype closure10_HpcOmTaskGraph_isNodeContracted(threadData_t *thData, modelica_metatype closure, modelica_metatype iNode)
{
  modelica_metatype iContrNodes = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_HpcOmTaskGraph_isNodeContracted(thData, iNode, iContrNodes);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_filterContractedNodes(threadData_t *threadData, modelica_metatype _nodesIn, modelica_metatype _contrNodes)
{
  modelica_metatype _nodesOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodesOut has no default value.
  tmpMeta1 = mmc_mk_box1(0, _contrNodes);
  _nodesOut = omc_List_filterOnFalse(threadData, _nodesIn, (modelica_fnptr) mmc_mk_box2(0,closure10_HpcOmTaskGraph_isNodeContracted,tmpMeta1));
  _return: OMC_LABEL_UNUSED
  return _nodesOut;
}

static modelica_metatype closure11_Array_getIndexFirst(threadData_t *thData, modelica_metatype closure, modelica_metatype inIndex)
{
  modelica_metatype inArray = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_Array_getIndexFirst(thData, inIndex, inArray);
}
PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_updateInCompsInfo(threadData_t *threadData, modelica_integer _contrNode, modelica_metatype _removedNodes, modelica_metatype _inComps)
{
  modelica_metatype _comps = NULL;
  modelica_metatype _contrComps = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _comps has no default value.
  // _contrComps has no default value.
  _comps = arrayGet(_inComps, _contrNode);

  tmpMeta1 = mmc_mk_box1(0, _inComps);
  _contrComps = omc_List_flatten(threadData, omc_List_map(threadData, _removedNodes, (modelica_fnptr) mmc_mk_box2(0,closure11_Array_getIndexFirst,tmpMeta1)));

  _comps = omc_List_unique(threadData, listAppend(_contrComps, _comps));

  arrayUpdate(_inComps, _contrNode, _comps);
  _return: OMC_LABEL_UNUSED
  return;
}
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_updateInCompsInfo(threadData_t *threadData, modelica_metatype _contrNode, modelica_metatype _removedNodes, modelica_metatype _inComps)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_contrNode);
  omc_HpcOmTaskGraph_updateInCompsInfo(threadData, tmp1, _removedNodes, _inComps);
  return;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_setInCompsInMeta(threadData_t *threadData, modelica_metatype _inComps, modelica_metatype _metaIn)
{
  modelica_metatype _metaOut = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _metaOut has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _compParamMapping has no default value.
  // _nodeMark has no default value.
  // _compInformations has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _metaIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
  _varCompMapping = tmpMeta2;
  _eqCompMapping = tmpMeta3;
  _compParamMapping = tmpMeta4;
  _compNames = tmpMeta5;
  _compDescs = tmpMeta6;
  _exeCosts = tmpMeta7;
  _commCosts = tmpMeta8;
  _nodeMark = tmpMeta9;
  _compInformations = tmpMeta10;

  tmpMeta11 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _metaOut = tmpMeta11;
  _return: OMC_LABEL_UNUSED
  return _metaOut;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData_t *threadData, modelica_integer _iTaskIdx, modelica_metatype _iContractedTasks)
{
  modelica_integer _oTaskIdx;
  modelica_integer _contractionMark;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskIdx has no default value.
  // _contractionMark has no default value.
  _contractionMark = mmc_unbox_integer(arrayGet(_iContractedTasks, _iTaskIdx));

  if((_contractionMark < ((modelica_integer) 0)))
  {
    /* Tail recursive call */
    _iTaskIdx = (-_contractionMark);
    goto _tailrecursive;
    /* TODO: Make sure any eventual dead code below is never generated */
    ;
  }
  else
  {
    _oTaskIdx = _iTaskIdx;
  }
  _return: OMC_LABEL_UNUSED
  return _oTaskIdx;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData_t *threadData, modelica_metatype _iTaskIdx, modelica_metatype _iContractedTasks)
{
  modelica_integer tmp1;
  modelica_integer _oTaskIdx;
  modelica_metatype out_oTaskIdx;
  tmp1 = mmc_unbox_integer(_iTaskIdx);
  _oTaskIdx = omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData, tmp1, _iContractedTasks);
  out_oTaskIdx = mmc_mk_icon(_oTaskIdx);
  return out_oTaskIdx;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getContractedNodeChildren(threadData_t *threadData, modelica_integer _iParentTask, modelica_integer _iRefValue, modelica_metatype _iTaskGraph, modelica_metatype _iContractedTasks, modelica_metatype _iNodeMarks)
{
  modelica_metatype _oChildTasks = NULL;
  modelica_integer _task;
  modelica_integer _taskMark;
  modelica_integer _contractedValue;
  modelica_metatype _childTasks = NULL;
  modelica_metatype _resultTasks = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oChildTasks has no default value.
  // _task has no default value.
  // _taskMark has no default value.
  // _contractedValue has no default value.
  // _childTasks has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _resultTasks = tmpMeta1;
  _childTasks = arrayGet(_iTaskGraph, _iParentTask);

  {
    modelica_metatype _task;
    for (tmpMeta2 = _childTasks; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
    {
      _task = MMC_CAR(tmpMeta2);
      _task = mmc_mk_integer(omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData, mmc_unbox_integer(_task), _iContractedTasks));

      _taskMark = mmc_unbox_integer(arrayGet(_iNodeMarks, mmc_unbox_integer(_task)));

      if(((_taskMark != _iRefValue) && (mmc_unbox_integer(_task) != _iRefValue)))
      {
        tmpMeta3 = mmc_mk_cons(_task, _resultTasks);
        _resultTasks = tmpMeta3;

        arrayUpdate(_iNodeMarks, mmc_unbox_integer(_task), mmc_mk_integer(_iRefValue));
      }
    }
  }

  _oChildTasks = _resultTasks;
  _return: OMC_LABEL_UNUSED
  return _oChildTasks;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getContractedNodeChildren(threadData_t *threadData, modelica_metatype _iParentTask, modelica_metatype _iRefValue, modelica_metatype _iTaskGraph, modelica_metatype _iContractedTasks, modelica_metatype _iNodeMarks)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _oChildTasks = NULL;
  tmp1 = mmc_unbox_integer(_iParentTask);
  tmp2 = mmc_unbox_integer(_iRefValue);
  _oChildTasks = omc_HpcOmTaskGraph_getContractedNodeChildren(threadData, tmp1, tmp2, _iTaskGraph, _iContractedTasks, _iNodeMarks);
  /* skip box _oChildTasks; list<#Integer> */
  return _oChildTasks;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_checkIfNodeBelongsToCluster(threadData_t *threadData, modelica_integer _iNegativeRefValue, modelica_integer _iNodeIdx, modelica_metatype _iContractedTasks)
{
  modelica_boolean _oIsNodePartOfCluster;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oIsNodePartOfCluster has no default value.
  _oIsNodePartOfCluster = (_iNegativeRefValue == mmc_unbox_integer(arrayGet(_iContractedTasks, _iNodeIdx)));
  _return: OMC_LABEL_UNUSED
  return _oIsNodePartOfCluster;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_checkIfNodeBelongsToCluster(threadData_t *threadData, modelica_metatype _iNegativeRefValue, modelica_metatype _iNodeIdx, modelica_metatype _iContractedTasks)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_boolean _oIsNodePartOfCluster;
  modelica_metatype out_oIsNodePartOfCluster;
  tmp1 = mmc_unbox_integer(_iNegativeRefValue);
  tmp2 = mmc_unbox_integer(_iNodeIdx);
  _oIsNodePartOfCluster = omc_HpcOmTaskGraph_checkIfNodeBelongsToCluster(threadData, tmp1, tmp2, _iContractedTasks);
  out_oIsNodePartOfCluster = mmc_mk_icon(_oIsNodePartOfCluster);
  return out_oIsNodePartOfCluster;
}

static modelica_metatype closure12_HpcOmTaskGraph_checkIfNodeBelongsToCluster(threadData_t *thData, modelica_metatype closure, modelica_metatype iNegativeRefValue, modelica_metatype iNodeIdx)
{
  modelica_metatype iContractedTasks = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_HpcOmTaskGraph_checkIfNodeBelongsToCluster(thData, iNegativeRefValue, iNodeIdx, iContractedTasks);
}static void closure13_Array_updateIndexFirst(threadData_t *thData, modelica_metatype closure, modelica_metatype inIndex)
{
  modelica_metatype inValue = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype inArray = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  boxptr_Array_updateIndexFirst(thData, inIndex, inValue, inArray);
}static void closure14_Array_updateIndexFirst(threadData_t *thData, modelica_metatype closure, modelica_metatype inIndex)
{
  modelica_metatype inValue = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype inArray = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  boxptr_Array_updateIndexFirst(thData, inIndex, inValue, inArray);
}static modelica_metatype closure15_HpcOmTaskGraph_getContractedNodeChildren(threadData_t *thData, modelica_metatype closure, modelica_metatype iParentTask)
{
  modelica_metatype iRefValue = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype iTaskGraph = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype iContractedTasks = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype iNodeMarks = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_HpcOmTaskGraph_getContractedNodeChildren(thData, iParentTask, iRefValue, iTaskGraph, iContractedTasks, iNodeMarks);
}static modelica_metatype closure16_HpcOmTaskGraph_getContractedNodeChildren(threadData_t *thData, modelica_metatype closure, modelica_metatype iParentTask)
{
  modelica_metatype iRefValue = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype iTaskGraph = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype iContractedTasks = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype iNodeMarks = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_HpcOmTaskGraph_getContractedNodeChildren(thData, iParentTask, iRefValue, iTaskGraph, iContractedTasks, iNodeMarks);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_contractNodesInGraph(threadData_t *threadData, modelica_metatype _iContractNodes, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphT, modelica_metatype _iTaskGraphMeta, modelica_metatype _iContractedTasks, modelica_metatype *out_oTaskGraphT, modelica_metatype *out_oTaskGraphMeta, modelica_metatype *out_oContractedTasks)
{
  modelica_metatype _oTaskGraph = NULL;
  modelica_metatype _oTaskGraphT = NULL;
  modelica_metatype _oTaskGraphMeta = NULL;
  modelica_metatype _oContractedTasks = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _tmpTaskGraph = NULL;
  modelica_metatype _tmpTaskGraphT = NULL;
  modelica_metatype _tmpContractedTasks = NULL;
  modelica_integer _nodeListHeadIdx;
  modelica_integer _negNodeListHeadIdx;
  modelica_integer _nodeIdx;
  modelica_integer _nodeContractionValue;
  modelica_integer _parentChild;
  modelica_integer _parentChildContractionValue;
  modelica_metatype _nodeListRestIdc = NULL;
  modelica_metatype _nodeCompIdc = NULL;
  modelica_metatype _headCompIdc = NULL;
  modelica_metatype _parentNodeChildList = NULL;
  modelica_metatype _parentNodeChildListNew = NULL;
  modelica_metatype _outgoingEdges = NULL;
  modelica_metatype _incomingEdges = NULL;
  modelica_metatype _nodeMarks = NULL;
  modelica_metatype _nodeMarksT = NULL;
  modelica_metatype _iNodeList = NULL;
  modelica_metatype _nodeList = NULL;
  modelica_metatype _childNodes = NULL;
  modelica_metatype _parentNodes = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_integer tmp15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  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;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraph has no default value.
  // _oTaskGraphT has no default value.
  // _oTaskGraphMeta has no default value.
  // _oContractedTasks has no default value.
  // _inComps has no default value.
  _tmpTaskGraph = _iTaskGraph;
  _tmpTaskGraphT = _iTaskGraphT;
  _tmpContractedTasks = _iContractedTasks;
  // _nodeListHeadIdx has no default value.
  // _negNodeListHeadIdx has no default value.
  // _nodeIdx has no default value.
  // _nodeContractionValue has no default value.
  // _parentChild has no default value.
  // _parentChildContractionValue has no default value.
  // _nodeListRestIdc has no default value.
  // _nodeCompIdc has no default value.
  // _headCompIdc has no default value.
  // _parentNodeChildList has no default value.
  // _parentNodeChildListNew has no default value.
  // _outgoingEdges has no default value.
  // _incomingEdges has no default value.
  // _nodeMarks has no default value.
  // _nodeMarksT has no default value.
  // _iNodeList has no default value.
  // _nodeList has no default value.
  // _childNodes has no default value.
  // _parentNodes has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iTaskGraphMeta;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _inComps = tmpMeta2;

  _nodeMarks = arrayCreate(arrayLength(_iTaskGraph), mmc_mk_integer(((modelica_integer) 0)));

  _nodeMarksT = arrayCreate(arrayLength(_iTaskGraph), mmc_mk_integer(((modelica_integer) 0)));

  {
    modelica_metatype _iNodeList;
    for (tmpMeta3 = _iContractNodes; !listEmpty(tmpMeta3); tmpMeta3=MMC_CDR(tmpMeta3))
    {
      _iNodeList = MMC_CAR(tmpMeta3);
      tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
      _nodeList = tmpMeta4;

      /* Pattern-matching assignment */
      tmpMeta5 = _iNodeList;
      if (listEmpty(tmpMeta5)) MMC_THROW_INTERNAL();
      tmpMeta6 = MMC_CAR(tmpMeta5);
      tmpMeta7 = MMC_CDR(tmpMeta5);
      tmp8 = mmc_unbox_integer(tmpMeta6);
      _nodeListHeadIdx = tmp8  /* pattern as ty=Integer */;
      _nodeListRestIdc = tmpMeta7;

      {
        modelica_metatype _nodeIdx;
        for (tmpMeta9 = _iNodeList; !listEmpty(tmpMeta9); tmpMeta9=MMC_CDR(tmpMeta9))
        {
          _nodeIdx = MMC_CAR(tmpMeta9);
          _nodeIdx = mmc_mk_integer(omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData, mmc_unbox_integer(_nodeIdx), _tmpContractedTasks));

          if((mmc_unbox_integer(arrayGet(_nodeMarks, mmc_unbox_integer(_nodeIdx))) != _nodeListHeadIdx))
          {
            _nodeMarks = arrayUpdate(_nodeMarks, mmc_unbox_integer(_nodeIdx), mmc_mk_integer(_nodeListHeadIdx));

            tmpMeta10 = mmc_mk_cons(_nodeIdx, _nodeList);
            _nodeList = tmpMeta10;
          }
        }
      }

      /* Pattern-matching assignment */
      tmpMeta12 = _nodeList;
      if (listEmpty(tmpMeta12)) MMC_THROW_INTERNAL();
      tmpMeta13 = MMC_CAR(tmpMeta12);
      tmpMeta14 = MMC_CDR(tmpMeta12);
      tmp15 = mmc_unbox_integer(tmpMeta13);
      _nodeListHeadIdx = tmp15  /* pattern as ty=Integer */;
      _nodeListRestIdc = tmpMeta14;

      _nodeListHeadIdx = omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData, _nodeListHeadIdx, _tmpContractedTasks);

      _negNodeListHeadIdx = (-_nodeListHeadIdx);

      {
        modelica_metatype _nodeIdx;
        for (tmpMeta16 = _nodeListRestIdc; !listEmpty(tmpMeta16); tmpMeta16=MMC_CDR(tmpMeta16))
        {
          _nodeIdx = MMC_CAR(tmpMeta16);
          _nodeMarks = arrayUpdate(_nodeMarks, mmc_unbox_integer(_nodeIdx), mmc_mk_integer(_nodeListHeadIdx));

          _nodeMarksT = arrayUpdate(_nodeMarksT, mmc_unbox_integer(_nodeIdx), mmc_mk_integer(_nodeListHeadIdx));

          _tmpContractedTasks = arrayUpdate(_tmpContractedTasks, mmc_unbox_integer(_nodeIdx), mmc_mk_integer(_negNodeListHeadIdx));
        }
      }

      _nodeMarks = arrayUpdate(_nodeMarks, _nodeListHeadIdx, mmc_mk_integer(_nodeListHeadIdx));

      _nodeMarksT = arrayUpdate(_nodeMarksT, _nodeListHeadIdx, mmc_mk_integer(_nodeListHeadIdx));

      _outgoingEdges = arrayGet(_tmpTaskGraph, _nodeListHeadIdx);

      tmpMeta18 = mmc_mk_box1(0, _tmpContractedTasks);
      _outgoingEdges = omc_List_deleteMemberOnTrue(threadData, mmc_mk_integer(_negNodeListHeadIdx), _outgoingEdges, (modelica_fnptr) mmc_mk_box2(0,closure12_HpcOmTaskGraph_checkIfNodeBelongsToCluster,tmpMeta18), NULL);

      _incomingEdges = arrayGet(_tmpTaskGraphT, _nodeListHeadIdx);

      tmpMeta19 = mmc_mk_box2(0, mmc_mk_integer(_nodeListHeadIdx), _nodeMarks);
      omc_List_map__0(threadData, _outgoingEdges, (modelica_fnptr) mmc_mk_box2(0,closure13_Array_updateIndexFirst,tmpMeta19));

      tmpMeta20 = mmc_mk_box2(0, mmc_mk_integer(_nodeListHeadIdx), _nodeMarksT);
      omc_List_map__0(threadData, _incomingEdges, (modelica_fnptr) mmc_mk_box2(0,closure14_Array_updateIndexFirst,tmpMeta20));

      tmpMeta21 = mmc_mk_box4(0, mmc_mk_integer(_nodeListHeadIdx), _tmpTaskGraph, _tmpContractedTasks, _nodeMarks);
      _childNodes = omc_List_flatten(threadData, omc_List_map(threadData, _nodeListRestIdc, (modelica_fnptr) mmc_mk_box2(0,closure15_HpcOmTaskGraph_getContractedNodeChildren,tmpMeta21)));

      tmpMeta22 = mmc_mk_box4(0, mmc_mk_integer(_nodeListHeadIdx), _iTaskGraphT, _tmpContractedTasks, _nodeMarks);
      _parentNodes = omc_List_flatten(threadData, omc_List_map(threadData, _nodeList, (modelica_fnptr) mmc_mk_box2(0,closure16_HpcOmTaskGraph_getContractedNodeChildren,tmpMeta22)));

      _headCompIdc = arrayGet(_inComps, _nodeListHeadIdx);

      {
        modelica_metatype _nodeIdx;
        for (tmpMeta23 = _nodeListRestIdc; !listEmpty(tmpMeta23); tmpMeta23=MMC_CDR(tmpMeta23))
        {
          _nodeIdx = MMC_CAR(tmpMeta23);
          tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
          _tmpTaskGraph = arrayUpdate(_tmpTaskGraph, mmc_unbox_integer(_nodeIdx), tmpMeta24);

          tmpMeta25 = MMC_REFSTRUCTLIT(mmc_nil);
          _tmpTaskGraphT = arrayUpdate(_tmpTaskGraphT, mmc_unbox_integer(_nodeIdx), tmpMeta25);

          _nodeCompIdc = arrayGet(_inComps, mmc_unbox_integer(_nodeIdx));

          tmpMeta26 = MMC_REFSTRUCTLIT(mmc_nil);
          _inComps = arrayUpdate(_inComps, mmc_unbox_integer(_nodeIdx), tmpMeta26);

          _headCompIdc = omc_List_insertListSorted(threadData, _headCompIdc, _nodeCompIdc, boxvar_intLt);
        }
      }

      arrayUpdate(_inComps, _nodeListHeadIdx, _headCompIdc);

      {
        modelica_metatype _nodeIdx;
        for (tmpMeta28 = _parentNodes; !listEmpty(tmpMeta28); tmpMeta28=MMC_CDR(tmpMeta28))
        {
          _nodeIdx = MMC_CAR(tmpMeta28);
          if((mmc_unbox_integer(arrayGet(_nodeMarksT, mmc_unbox_integer(_nodeIdx))) != _nodeListHeadIdx))
          {
            tmpMeta29 = mmc_mk_cons(_nodeIdx, _incomingEdges);
            _incomingEdges = tmpMeta29;
          }
        }
      }

      _tmpTaskGraphT = arrayUpdate(_tmpTaskGraphT, _nodeListHeadIdx, _incomingEdges);

      {
        modelica_metatype _nodeIdx;
        for (tmpMeta31 = _childNodes; !listEmpty(tmpMeta31); tmpMeta31=MMC_CDR(tmpMeta31))
        {
          _nodeIdx = MMC_CAR(tmpMeta31);
          _parentNodeChildList = arrayGet(_tmpTaskGraphT, mmc_unbox_integer(_nodeIdx));

          tmpMeta32 = MMC_REFSTRUCTLIT(mmc_nil);
          _parentNodeChildListNew = tmpMeta32;

          {
            modelica_metatype _parentChild;
            for (tmpMeta33 = _parentNodeChildList; !listEmpty(tmpMeta33); tmpMeta33=MMC_CDR(tmpMeta33))
            {
              _parentChild = MMC_CAR(tmpMeta33);
              _parentChildContractionValue = mmc_unbox_integer(arrayGet(_tmpContractedTasks, mmc_unbox_integer(_parentChild)));

              _parentChild = mmc_mk_integer(omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData, mmc_unbox_integer(_parentChild), _tmpContractedTasks));

              if(((mmc_unbox_integer(_parentChild) == _nodeListHeadIdx) || (_parentChildContractionValue == _negNodeListHeadIdx)))
              {
                if((mmc_unbox_integer(arrayGet(_nodeMarksT, mmc_unbox_integer(_parentChild))) != mmc_unbox_integer(_nodeIdx)))
                {
                  tmpMeta34 = mmc_mk_cons(mmc_mk_integer(_nodeListHeadIdx), _parentNodeChildListNew);
                  _parentNodeChildListNew = tmpMeta34;

                  arrayUpdate(_nodeMarksT, mmc_unbox_integer(_parentChild), _nodeIdx);
                }
              }
              else
              {
                tmpMeta35 = mmc_mk_cons(_parentChild, _parentNodeChildListNew);
                _parentNodeChildListNew = tmpMeta35;
              }
            }
          }

          _tmpTaskGraphT = arrayUpdate(_tmpTaskGraphT, mmc_unbox_integer(_nodeIdx), _parentNodeChildListNew);
        }
      }

      _outgoingEdges = listAppend(_outgoingEdges, _childNodes);

      _nodeMarks = arrayUpdate(_nodeMarks, _nodeListHeadIdx, mmc_mk_integer(((modelica_integer) 0)));

      {
        modelica_metatype _nodeIdx;
        for (tmpMeta38 = _parentNodes; !listEmpty(tmpMeta38); tmpMeta38=MMC_CDR(tmpMeta38))
        {
          _nodeIdx = MMC_CAR(tmpMeta38);
          _parentNodeChildList = arrayGet(_tmpTaskGraph, mmc_unbox_integer(_nodeIdx));

          tmpMeta39 = MMC_REFSTRUCTLIT(mmc_nil);
          _parentNodeChildListNew = tmpMeta39;

          {
            modelica_metatype _parentChild;
            for (tmpMeta40 = _parentNodeChildList; !listEmpty(tmpMeta40); tmpMeta40=MMC_CDR(tmpMeta40))
            {
              _parentChild = MMC_CAR(tmpMeta40);
              _parentChildContractionValue = mmc_unbox_integer(arrayGet(_tmpContractedTasks, mmc_unbox_integer(_parentChild)));

              _parentChild = mmc_mk_integer(omc_HpcOmTaskGraph_getRealTaskIdxOfTask(threadData, mmc_unbox_integer(_parentChild), _tmpContractedTasks));

              if(((mmc_unbox_integer(_parentChild) == _nodeListHeadIdx) || (_parentChildContractionValue == _negNodeListHeadIdx)))
              {
                if((mmc_unbox_integer(arrayGet(_nodeMarks, mmc_unbox_integer(_parentChild))) != mmc_unbox_integer(_nodeIdx)))
                {
                  tmpMeta41 = mmc_mk_cons(mmc_mk_integer(_nodeListHeadIdx), _parentNodeChildListNew);
                  _parentNodeChildListNew = tmpMeta41;

                  arrayUpdate(_nodeMarks, mmc_unbox_integer(_parentChild), _nodeIdx);
                }
              }
              else
              {
                tmpMeta42 = mmc_mk_cons(_parentChild, _parentNodeChildListNew);
                _parentNodeChildListNew = tmpMeta42;
              }
            }
          }

          _tmpTaskGraph = arrayUpdate(_tmpTaskGraph, mmc_unbox_integer(_nodeIdx), _parentNodeChildListNew);
        }
      }

      _tmpTaskGraph = arrayUpdate(_tmpTaskGraph, _nodeListHeadIdx, _outgoingEdges);
    }
  }

  _oTaskGraph = _tmpTaskGraph;

  _oTaskGraphT = _tmpTaskGraphT;

  _oTaskGraphMeta = _iTaskGraphMeta;

  _oContractedTasks = _iContractedTasks;
  _return: OMC_LABEL_UNUSED
  if (out_oTaskGraphT) { *out_oTaskGraphT = _oTaskGraphT; }
  if (out_oTaskGraphMeta) { *out_oTaskGraphMeta = _oTaskGraphMeta; }
  if (out_oContractedTasks) { *out_oContractedTasks = _oContractedTasks; }
  return _oTaskGraph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getHighestExecCost(threadData_t *threadData, modelica_metatype _iExecCosts, modelica_metatype _iHighestTuple)
{
  modelica_metatype _oHighestTuple = NULL;
  modelica_real _highestCost;
  modelica_real _currentCost;
  modelica_metatype _head = NULL;
  modelica_metatype _rest = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oHighestTuple has no default value.
  // _highestCost has no default value.
  // _currentCost has no default value.
  // _head has no default value.
  // _rest has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _iExecCosts;
    tmp4_2 = _iHighestTuple;
    {
      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_real tmp9;
          modelica_metatype tmpMeta10;
          modelica_real tmp11;
          modelica_boolean tmp12;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          tmp9 = mmc_unbox_real(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp11 = mmc_unbox_real(tmpMeta10);
          _head = tmpMeta6;
          _currentCost = tmp9  /* pattern as ty=Real */;
          _rest = tmpMeta7;
          _highestCost = tmp11  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp12 = (_currentCost > _highestCost);
          if (1 /* true */ != tmp12) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_getHighestExecCost(threadData, _rest, _head);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_real tmp16;
          modelica_metatype tmpMeta17;
          modelica_real tmp18;
          modelica_boolean tmp19;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta13 = MMC_CAR(tmp4_1);
          tmpMeta14 = MMC_CDR(tmp4_1);
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
          tmp16 = mmc_unbox_real(tmpMeta15);
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp18 = mmc_unbox_real(tmpMeta17);
          _head = tmpMeta13;
          _currentCost = tmp16  /* pattern as ty=Real */;
          _rest = tmpMeta14;
          _highestCost = tmp18  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp19 = (_currentCost > _highestCost);
          if (1 /* true */ != tmp19) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_getHighestExecCost(threadData, _rest, _iHighestTuple);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iHighestTuple;
          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:;
    }
  }
  _oHighestTuple = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oHighestTuple;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getExeCost(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _iGraphData)
{
  modelica_metatype _oExeCost = NULL;
  modelica_integer _comp;
  modelica_integer _opCount;
  modelica_integer _opCount1;
  modelica_real _exeCost;
  modelica_real _exeCost1;
  modelica_metatype _inComps = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_real tmp9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oExeCost has no default value.
  // _comp has no default value.
  // _opCount has no default value.
  // _opCount1 has no default value.
  // _exeCost has no default value.
  // _exeCost1 has no default value.
  // _inComps has no default value.
  // _comps has no default value.
  // _exeCosts has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iGraphData;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  _inComps = tmpMeta2;
  _exeCosts = tmpMeta3;

  _exeCost = 0.0;

  _opCount = ((modelica_integer) 0);

  _comps = arrayGet(_inComps, _iNodeIdx);

  {
    modelica_metatype _comp;
    for (tmpMeta4 = _comps; !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
    {
      _comp = MMC_CAR(tmpMeta4);
      /* Pattern-matching assignment */
      tmpMeta5 = arrayGet(_exeCosts, mmc_unbox_integer(_comp));
      tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
      tmp7 = mmc_unbox_integer(tmpMeta6);
      tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
      tmp9 = mmc_unbox_real(tmpMeta8);
      _opCount1 = tmp7  /* pattern as ty=Integer */;
      _exeCost1 = tmp9  /* pattern as ty=Real */;

      _opCount = _opCount + _opCount1;

      _exeCost = _exeCost + _exeCost1;
    }
  }

  tmpMeta11 = mmc_mk_box2(0, mmc_mk_integer(_opCount), mmc_mk_real(_exeCost));
  _oExeCost = tmpMeta11;
  _return: OMC_LABEL_UNUSED
  return _oExeCost;
}
modelica_metatype boxptr_HpcOmTaskGraph_getExeCost(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _iGraphData)
{
  modelica_integer tmp1;
  modelica_metatype _oExeCost = NULL;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  _oExeCost = omc_HpcOmTaskGraph_getExeCost(threadData, tmp1, _iGraphData);
  /* skip box _oExeCost; tuple<#Integer, #Real> */
  return _oExeCost;
}

DLLDirection
modelica_real omc_HpcOmTaskGraph_getExeCostReqCycles(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _iGraphData)
{
  modelica_real _oExeCost;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oExeCost has no default value.
  _oExeCost = mmc_unbox_real(omc_Util_tuple22(threadData, omc_HpcOmTaskGraph_getExeCost(threadData, _iNodeIdx, _iGraphData)));
  _return: OMC_LABEL_UNUSED
  return _oExeCost;
}
modelica_metatype boxptr_HpcOmTaskGraph_getExeCostReqCycles(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _iGraphData)
{
  modelica_integer tmp1;
  modelica_real _oExeCost;
  modelica_metatype out_oExeCost;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  _oExeCost = omc_HpcOmTaskGraph_getExeCostReqCycles(threadData, tmp1, _iGraphData);
  out_oExeCost = mmc_mk_rcon(_oExeCost);
  return out_oExeCost;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addUpExeCosts(threadData_t *threadData, modelica_metatype _iExeCost1, modelica_metatype _iExeCost2)
{
  modelica_metatype _oExeCost = NULL;
  modelica_real _ex1;
  modelica_real _ex2;
  modelica_integer _op1;
  modelica_integer _op2;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_real tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_real tmp10;
  modelica_metatype tmpMeta11;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oExeCost has no default value.
  // _ex1 has no default value.
  // _ex2 has no default value.
  // _op1 has no default value.
  // _op2 has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iExeCost1;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_real(tmpMeta4);
  _op1 = tmp3  /* pattern as ty=Integer */;
  _ex1 = tmp5  /* pattern as ty=Real */;

  /* Pattern-matching assignment */
  tmpMeta6 = _iExeCost2;
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
  tmp8 = mmc_unbox_integer(tmpMeta7);
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
  tmp10 = mmc_unbox_real(tmpMeta9);
  _op2 = tmp8  /* pattern as ty=Integer */;
  _ex2 = tmp10  /* pattern as ty=Real */;

  tmpMeta11 = mmc_mk_box2(0, mmc_mk_integer(_op1 + _op2), mmc_mk_real(_ex1 + _ex2));
  _oExeCost = tmpMeta11;
  _return: OMC_LABEL_UNUSED
  return _oExeCost;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_combineComponentInformations(threadData_t *threadData, modelica_metatype _iComponentInfo, modelica_metatype _iComponentInfo2)
{
  modelica_metatype _oComponentInfo = NULL;
  modelica_boolean _isPartOfODESystem;
  modelica_boolean _iIsPartOfODESystem;
  modelica_boolean _isPartOfZeroFuncSystem;
  modelica_boolean _iisPartOfZeroFuncSystem;
  modelica_boolean _isRemovedComponent;
  modelica_boolean _iIsRemovedComponent;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_integer tmp10;
  modelica_metatype tmpMeta11;
  modelica_integer tmp12;
  modelica_metatype tmpMeta13;
  modelica_integer tmp14;
  modelica_metatype tmpMeta15;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oComponentInfo has no default value.
  // _isPartOfODESystem has no default value.
  // _iIsPartOfODESystem has no default value.
  // _isPartOfZeroFuncSystem has no default value.
  // _iisPartOfZeroFuncSystem has no default value.
  // _isRemovedComponent has no default value.
  // _iIsRemovedComponent has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iComponentInfo;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmp7 = mmc_unbox_integer(tmpMeta6);
  _isPartOfODESystem = tmp3  /* pattern as ty=Boolean */;
  _isPartOfZeroFuncSystem = tmp5  /* pattern as ty=Boolean */;
  _isRemovedComponent = tmp7  /* pattern as ty=Boolean */;

  /* Pattern-matching assignment */
  tmpMeta8 = _iComponentInfo2;
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
  tmp10 = mmc_unbox_integer(tmpMeta9);
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 3));
  tmp12 = mmc_unbox_integer(tmpMeta11);
  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 4));
  tmp14 = mmc_unbox_integer(tmpMeta13);
  _iIsPartOfODESystem = tmp10  /* pattern as ty=Boolean */;
  _iisPartOfZeroFuncSystem = tmp12  /* pattern as ty=Boolean */;
  _iIsRemovedComponent = tmp14  /* pattern as ty=Boolean */;

  tmpMeta15 = mmc_mk_box4(3, &HpcOmTaskGraph_ComponentInfo_COMPONENTINFO__desc, mmc_mk_boolean((_isPartOfODESystem || _iIsPartOfODESystem)), mmc_mk_boolean((_isPartOfZeroFuncSystem || _iisPartOfZeroFuncSystem)), mmc_mk_boolean((_isRemovedComponent || _iIsRemovedComponent)));
  _oComponentInfo = tmpMeta15;
  _return: OMC_LABEL_UNUSED
  return _oComponentInfo;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_markSystemComponents(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _iComponentMarks, modelica_metatype _iTargetTaskGraphMeta)
{
  modelica_metatype _oTargetTaskGraphMeta = NULL;
  modelica_metatype _odeInComps = NULL;
  modelica_metatype _nodeComps = NULL;
  modelica_integer _nodeIdx;
  modelica_integer _compIdx;
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype _componentInformation = NULL;
  modelica_metatype _iComponentInformation = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_integer tmp17;
  modelica_integer tmp18;
  modelica_integer tmp19;
  modelica_metatype tmpMeta20;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTargetTaskGraphMeta has no default value.
  // _odeInComps has no default value.
  // _nodeComps has no default value.
  // _nodeIdx has no default value.
  // _compIdx has no default value.
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compParamMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _nodeMark has no default value.
  // _compInformations has no default value.
  // _componentInformation has no default value.
  // _iComponentInformation has no default value.
  tmpMeta1 = mmc_mk_box4(3, &HpcOmTaskGraph_ComponentInfo_COMPONENTINFO__desc, omc_Util_tuple31(threadData, _iComponentMarks), omc_Util_tuple32(threadData, _iComponentMarks), omc_Util_tuple33(threadData, _iComponentMarks));
  _iComponentInformation = tmpMeta1;

  /* Pattern-matching assignment */
  tmpMeta2 = _iTaskGraphMeta;
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
  _odeInComps = tmpMeta3;

  /* Pattern-matching assignment */
  tmpMeta4 = _iTargetTaskGraphMeta;
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 3));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 4));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 5));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 6));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 7));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 8));
  tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 9));
  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 10));
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 11));
  _inComps = tmpMeta5;
  _varCompMapping = tmpMeta6;
  _eqCompMapping = tmpMeta7;
  _compParamMapping = tmpMeta8;
  _compNames = tmpMeta9;
  _compDescs = tmpMeta10;
  _exeCosts = tmpMeta11;
  _commCosts = tmpMeta12;
  _nodeMark = tmpMeta13;
  _compInformations = tmpMeta14;

  tmp17 = ((modelica_integer) 1); tmp18 = 1; tmp19 = arrayLength(_iTaskGraph);
  if(!(((tmp18 > 0) && (tmp17 > tmp19)) || ((tmp18 < 0) && (tmp17 < tmp19))))
  {
    modelica_integer _nodeIdx;
    for(_nodeIdx = ((modelica_integer) 1); in_range_integer(_nodeIdx, tmp17, tmp19); _nodeIdx += tmp18)
    {
      _nodeComps = arrayGet(_odeInComps, _nodeIdx);

      {
        modelica_metatype _compIdx;
        for (tmpMeta15 = _nodeComps; !listEmpty(tmpMeta15); tmpMeta15=MMC_CDR(tmpMeta15))
        {
          _compIdx = MMC_CAR(tmpMeta15);
          _componentInformation = omc_HpcOmTaskGraph_combineComponentInformations(threadData, arrayGet(_compInformations, mmc_unbox_integer(_compIdx)), _iComponentInformation);

          _compInformations = arrayUpdate(_compInformations, mmc_unbox_integer(_compIdx), _componentInformation);
        }
      }
    }
  }

  tmpMeta20 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _oTargetTaskGraphMeta = tmpMeta20;
  _return: OMC_LABEL_UNUSED
  return _oTargetTaskGraphMeta;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mergeSinkNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_boolean *out_changed)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _graphTOut = NULL;
  modelica_metatype _graphDataOut = NULL;
  modelica_metatype _contractedTasksOut = NULL;
  modelica_boolean _changed;
  modelica_metatype _alreadyMerged = NULL;
  modelica_metatype _mergedNodes = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _graphTOut has no default value.
  // _graphDataOut has no default value.
  // _contractedTasksOut has no default value.
  // _changed has no default value.
  // _alreadyMerged has no default value.
  // _mergedNodes has no default value.
  _alreadyMerged = arrayCreate(arrayLength(_graphIn), mmc_mk_integer(((modelica_integer) 0)));

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _mergedNodes = omc_HpcOmTaskGraph_mergeParentNodes0(threadData, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn, _alreadyMerged, ((modelica_integer) 1), tmpMeta1);

  _graphOut = omc_HpcOmTaskGraph_contractNodesInGraph(threadData, _mergedNodes, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn ,&_graphTOut ,&_graphDataOut ,&_contractedTasksOut);

  _changed = (!listEmpty(_mergedNodes));
  _return: OMC_LABEL_UNUSED
  if (out_graphTOut) { *out_graphTOut = _graphTOut; }
  if (out_graphDataOut) { *out_graphDataOut = _graphDataOut; }
  if (out_contractedTasksOut) { *out_contractedTasksOut = _contractedTasksOut; }
  if (out_changed) { *out_changed = _changed; }
  return _graphOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_mergeSinkNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_metatype *out_changed)
{
  modelica_boolean _changed;
  modelica_metatype _graphOut = NULL;
  _graphOut = omc_HpcOmTaskGraph_mergeSinkNodes(threadData, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn, out_graphTOut, out_graphDataOut, out_contractedTasksOut, &_changed);
  /* skip box _graphOut; array<list<#Integer>> */
  /* skip box _graphTOut; array<list<#Integer>> */
  /* skip box _graphDataOut; HpcOmTaskGraph.TaskGraphMeta */
  /* skip box _contractedTasksOut; array<#Integer> */
  if (out_changed) { *out_changed = mmc_mk_icon(_changed); }
  return _graphOut;
}

static void closure17_Array_updateIndexFirst(threadData_t *thData, modelica_metatype closure, modelica_metatype inIndex)
{
  modelica_metatype inValue = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype inArray = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  boxptr_Array_updateIndexFirst(thData, inIndex, inValue, inArray);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mergeParentNodes0(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphT, modelica_metatype _iGraphData, modelica_metatype _contractedTasksIn, modelica_metatype _alreadyMerged, modelica_integer _iNodeIdx, modelica_metatype _iMergedNodes)
{
  modelica_metatype _oMergedNodes = NULL;
  modelica_metatype _tmpGraph = NULL;
  modelica_metatype _tmpGraphData = NULL;
  modelica_boolean _tmpChanged;
  modelica_real _highestParentExeCost;
  modelica_real _sumParentExeCosts;
  modelica_metatype _parentNodes = NULL;
  modelica_metatype _mergeNodeList = NULL;
  modelica_real _highestCommCost;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _parentExeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _parentCommCosts = NULL;
  modelica_metatype _parentChilds = NULL;
  modelica_metatype _tmpMergedNodes = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMergedNodes has no default value.
  // _tmpGraph has no default value.
  // _tmpGraphData has no default value.
  // _tmpChanged has no default value.
  // _highestParentExeCost has no default value.
  // _sumParentExeCosts has no default value.
  // _parentNodes has no default value.
  // _mergeNodeList has no default value.
  // _highestCommCost has no default value.
  // _exeCosts has no default value.
  // _parentExeCosts has no default value.
  // _commCosts has no default value.
  // _parentCommCosts has no default value.
  // _parentChilds has no default value.
  // _tmpMergedNodes has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iGraphData;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_boolean tmp8;
          modelica_boolean tmp9;
          modelica_boolean tmp10;
          modelica_boolean tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_real tmp14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_real tmp17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_real tmp20;
          modelica_boolean tmp21;
          modelica_boolean tmp22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 8));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 9));
          
          _exeCosts = tmpMeta6;
          _commCosts = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = (_iNodeIdx <= arrayLength(_iGraphT));
          if (1 /* true */ != tmp8) goto goto_2;

          /* Pattern-matching assignment */
          tmp9 = (mmc_unbox_integer(arrayGet(_contractedTasksIn, _iNodeIdx)) != ((modelica_integer) -1));
          if (1 /* true */ != tmp9) goto goto_2;

          /* Pattern-matching assignment */
          tmp10 = (mmc_unbox_integer(arrayGet(_alreadyMerged, _iNodeIdx)) != ((modelica_integer) -1));
          if (1 /* true */ != tmp10) goto goto_2;

          _parentNodes = arrayGet(_iGraphT, _iNodeIdx);

          _parentNodes = omc_HpcOmTaskGraph_filterContractedNodes(threadData, _parentNodes, _contractedTasksIn);

          /* Pattern-matching assignment */
          tmp11 = omc_List_exist1(threadData, _parentNodes, boxvar_HpcOmTaskGraph_isNodeContracted, _alreadyMerged);
          if (0 /* false */ != tmp11) goto goto_2;

          _parentCommCosts = omc_List_map2(threadData, _parentNodes, boxvar_HpcOmTaskGraph_getCommCostBetweenNodes, mmc_mk_integer(_iNodeIdx), _iGraphData);

          /* Pattern-matching assignment */
          tmpMeta12 = omc_HpcOmTaskGraph_getHighestCommCost(threadData, _parentCommCosts, _OMC_LIT44);
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 8));
          tmp14 = mmc_unbox_real(tmpMeta13);
          _highestCommCost = tmp14  /* pattern as ty=Real */;

          _parentExeCosts = omc_List_map1(threadData, _parentNodes, boxvar_HpcOmTaskGraph_getExeCost, _iGraphData);

          /* Pattern-matching assignment */
          tmpMeta15 = omc_List_fold(threadData, _parentExeCosts, boxvar_HpcOmTaskGraph_addUpExeCosts, _OMC_LIT42);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
          tmp17 = mmc_unbox_real(tmpMeta16);
          _sumParentExeCosts = tmp17  /* pattern as ty=Real */;

          /* Pattern-matching assignment */
          tmpMeta18 = omc_HpcOmTaskGraph_getHighestExecCost(threadData, _parentExeCosts, _OMC_LIT42);
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
          tmp20 = mmc_unbox_real(tmpMeta19);
          _highestParentExeCost = tmp20  /* pattern as ty=Real */;

          /* Pattern-matching assignment */
          tmp21 = (_highestCommCost + _highestParentExeCost > _sumParentExeCosts);
          if (1 /* true */ != tmp21) goto goto_2;

          _parentChilds = omc_List_map1(threadData, _parentNodes, boxvar_Array_getIndexFirst, _iGraph);

          /* Pattern-matching assignment */
          tmp22 = listEmpty(omc_List_removeOnTrue(threadData, mmc_mk_integer(((modelica_integer) 1)), boxvar_intEq, omc_List_map(threadData, _parentChilds, boxvar_listLength)));
          if (1 /* true */ != tmp22) goto goto_2;

          tmpMeta23 = mmc_mk_cons(mmc_mk_integer(_iNodeIdx), _parentNodes);
          _mergeNodeList = tmpMeta23;

          tmpMeta24 = mmc_mk_cons(_mergeNodeList, _iMergedNodes);
          _tmpMergedNodes = tmpMeta24;

          tmpMeta25 = mmc_mk_box2(0, mmc_mk_integer(((modelica_integer) -1)), _alreadyMerged);
          omc_List_map__0(threadData, _mergeNodeList, (modelica_fnptr) mmc_mk_box2(0,closure17_Array_updateIndexFirst,tmpMeta25));
          tmpMeta1 = omc_HpcOmTaskGraph_mergeParentNodes0(threadData, _iGraph, _iGraphT, _iGraphData, _contractedTasksIn, _alreadyMerged, ((modelica_integer) 1) + _iNodeIdx, _tmpMergedNodes);
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp26;
          
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp26 = (_iNodeIdx <= arrayLength(_iGraphT));
          if (1 /* true */ != tmp26) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_mergeParentNodes0(threadData, _iGraph, _iGraphT, _iGraphData, _contractedTasksIn, _alreadyMerged, ((modelica_integer) 1) + _iNodeIdx, _iMergedNodes);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iMergedNodes;
          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:;
    }
  }
  _oMergedNodes = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oMergedNodes;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_mergeParentNodes0(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphT, modelica_metatype _iGraphData, modelica_metatype _contractedTasksIn, modelica_metatype _alreadyMerged, modelica_metatype _iNodeIdx, modelica_metatype _iMergedNodes)
{
  modelica_integer tmp1;
  modelica_metatype _oMergedNodes = NULL;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  _oMergedNodes = omc_HpcOmTaskGraph_mergeParentNodes0(threadData, _iGraph, _iGraphT, _iGraphData, _contractedTasksIn, _alreadyMerged, tmp1, _iMergedNodes);
  /* skip box _oMergedNodes; list<list<#Integer>> */
  return _oMergedNodes;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_mergeParentNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_boolean *out_changed)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _graphTOut = NULL;
  modelica_metatype _graphDataOut = NULL;
  modelica_metatype _contractedTasksOut = NULL;
  modelica_boolean _changed;
  modelica_metatype _alreadyMerged = NULL;
  modelica_metatype _mergedNodes = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _graphTOut has no default value.
  // _graphDataOut has no default value.
  // _contractedTasksOut has no default value.
  // _changed has no default value.
  // _alreadyMerged has no default value.
  // _mergedNodes has no default value.
  _alreadyMerged = arrayCreate(arrayLength(_graphIn), mmc_mk_integer(((modelica_integer) 0)));

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _mergedNodes = omc_HpcOmTaskGraph_mergeParentNodes0(threadData, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn, _alreadyMerged, ((modelica_integer) 1), tmpMeta1);

  _graphOut = omc_HpcOmTaskGraph_contractNodesInGraph(threadData, _mergedNodes, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn ,&_graphTOut ,&_graphDataOut ,&_contractedTasksOut);

  _changed = (!listEmpty(_mergedNodes));
  _return: OMC_LABEL_UNUSED
  if (out_graphTOut) { *out_graphTOut = _graphTOut; }
  if (out_graphDataOut) { *out_graphDataOut = _graphDataOut; }
  if (out_contractedTasksOut) { *out_contractedTasksOut = _contractedTasksOut; }
  if (out_changed) { *out_changed = _changed; }
  return _graphOut;
}
modelica_metatype boxptr_HpcOmTaskGraph_mergeParentNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_metatype *out_changed)
{
  modelica_boolean _changed;
  modelica_metatype _graphOut = NULL;
  _graphOut = omc_HpcOmTaskGraph_mergeParentNodes(threadData, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn, out_graphTOut, out_graphDataOut, out_contractedTasksOut, &_changed);
  /* skip box _graphOut; array<list<#Integer>> */
  /* skip box _graphTOut; array<list<#Integer>> */
  /* skip box _graphDataOut; HpcOmTaskGraph.TaskGraphMeta */
  /* skip box _contractedTasksOut; array<#Integer> */
  if (out_changed) { *out_changed = mmc_mk_icon(_changed); }
  return _graphOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_mergeSimpleNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_boolean *out_changed)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _graphTOut = NULL;
  modelica_metatype _graphDataOut = NULL;
  modelica_metatype _contractedTasksOut = NULL;
  modelica_boolean _changed;
  modelica_metatype _allNodes = NULL;
  modelica_metatype _child = NULL;
  modelica_metatype _oneChildren = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _graphTOut has no default value.
  // _graphDataOut has no default value.
  // _contractedTasksOut has no default value.
  // _changed has no default value.
  // _allNodes has no default value.
  // _child has no default value.
  // _oneChildren has no default value.
  _allNodes = omc_List_intRange(threadData, arrayLength(_graphIn));

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _oneChildren = omc_HpcOmTaskGraph_findOneChildParents(threadData, _allNodes, _graphIn, tmpMeta1, _OMC_LIT54, ((modelica_integer) 0), _contractedTasksIn);

  _oneChildren = listDelete(_oneChildren, listLength(_oneChildren));

  _oneChildren = omc_List_removeOnTrue(threadData, mmc_mk_integer(((modelica_integer) 1)), boxvar_HpcOmTaskGraph_compareListLengthOnTrue, _oneChildren);

  _graphOut = omc_HpcOmTaskGraph_contractNodesInGraph(threadData, _oneChildren, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn ,&_graphTOut ,&_graphDataOut ,&_contractedTasksOut);

  _changed = (!listEmpty(_oneChildren));
  _return: OMC_LABEL_UNUSED
  if (out_graphTOut) { *out_graphTOut = _graphTOut; }
  if (out_graphDataOut) { *out_graphDataOut = _graphDataOut; }
  if (out_contractedTasksOut) { *out_contractedTasksOut = _contractedTasksOut; }
  if (out_changed) { *out_changed = _changed; }
  return _graphOut;
}
modelica_metatype boxptr_HpcOmTaskGraph_mergeSimpleNodes(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphTIn, modelica_metatype _graphDataIn, modelica_metatype _contractedTasksIn, modelica_metatype *out_graphTOut, modelica_metatype *out_graphDataOut, modelica_metatype *out_contractedTasksOut, modelica_metatype *out_changed)
{
  modelica_boolean _changed;
  modelica_metatype _graphOut = NULL;
  _graphOut = omc_HpcOmTaskGraph_mergeSimpleNodes(threadData, _graphIn, _graphTIn, _graphDataIn, _contractedTasksIn, out_graphTOut, out_graphDataOut, out_contractedTasksOut, &_changed);
  /* skip box _graphOut; array<list<#Integer>> */
  /* skip box _graphTOut; array<list<#Integer>> */
  /* skip box _graphDataOut; HpcOmTaskGraph.TaskGraphMeta */
  /* skip box _contractedTasksOut; array<#Integer> */
  if (out_changed) { *out_changed = mmc_mk_icon(_changed); }
  return _graphOut;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_nextGreaterPowerOf2__impl(threadData_t *threadData, modelica_real _n, modelica_integer _pow)
{
  modelica_integer _powOf2;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _powOf2 has no default value.
  { /* matchcontinue expression */
    {
      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_real tmp6;
          modelica_real tmp7;
          modelica_real tmp8;
          modelica_real tmp9;
          modelica_real tmp10;
          modelica_real tmp11;
          modelica_real tmp12;
          modelica_boolean tmp13;
          modelica_real tmp14;
          modelica_real tmp15;
          modelica_real tmp16;
          modelica_real tmp17;
          modelica_real tmp18;
          modelica_real tmp19;
          modelica_real tmp20;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = 2.0;
          tmp7 = ((modelica_real)_pow);
          if(tmp6 < 0.0 && tmp7 != 0.0)
          {
            tmp9 = modf(tmp7, &tmp10);
            
            if(tmp9 > 0.5)
            {
              tmp9 -= 1.0;
              tmp10 += 1.0;
            }
            else if(tmp9 < -0.5)
            {
              tmp9 += 1.0;
              tmp10 -= 1.0;
            }
            
            if(fabs(tmp9) < 1e-10)
              tmp8 = pow(tmp6, tmp10);
            else
            {
              tmp12 = modf(1.0/tmp7, &tmp11);
              if(tmp12 > 0.5)
              {
                tmp12 -= 1.0;
                tmp11 += 1.0;
              }
              else if(tmp12 < -0.5)
              {
                tmp12 += 1.0;
                tmp11 -= 1.0;
              }
              if(fabs(tmp12) < 1e-10 && ((unsigned long)tmp11 & 1))
              {
                tmp8 = -pow(-tmp6, tmp9)*pow(tmp6, tmp10);
              }
              else
              {
                goto goto_2;
              }
            }
          }
          else
          {
            tmp8 = pow(tmp6, tmp7);
          }
          if(isnan(tmp8) || isinf(tmp8))
          {
            goto goto_2;
          }
          tmp13 = (_n <= tmp8);
          if (1 /* true */ != tmp13) goto goto_2;
          tmp14 = 2.0;
          tmp15 = ((modelica_real)_pow);
          if(tmp14 < 0.0 && tmp15 != 0.0)
          {
            tmp17 = modf(tmp15, &tmp18);
            
            if(tmp17 > 0.5)
            {
              tmp17 -= 1.0;
              tmp18 += 1.0;
            }
            else if(tmp17 < -0.5)
            {
              tmp17 += 1.0;
              tmp18 -= 1.0;
            }
            
            if(fabs(tmp17) < 1e-10)
              tmp16 = pow(tmp14, tmp18);
            else
            {
              tmp20 = modf(1.0/tmp15, &tmp19);
              if(tmp20 > 0.5)
              {
                tmp20 -= 1.0;
                tmp19 += 1.0;
              }
              else if(tmp20 < -0.5)
              {
                tmp20 += 1.0;
                tmp19 -= 1.0;
              }
              if(fabs(tmp20) < 1e-10 && ((unsigned long)tmp19 & 1))
              {
                tmp16 = -pow(-tmp14, tmp17)*pow(tmp14, tmp18);
              }
              else
              {
                goto goto_2;
              }
            }
          }
          else
          {
            tmp16 = pow(tmp14, tmp15);
          }
          if(isnan(tmp16) || isinf(tmp16))
          {
            goto goto_2;
          }tmp1 = ((modelica_integer)floor(tmp16));
          goto tmp3_done;
        }
        case 1: {
          modelica_real tmp21;
          modelica_real tmp22;
          modelica_real tmp23;
          modelica_real tmp24;
          modelica_real tmp25;
          modelica_real tmp26;
          modelica_real tmp27;
          modelica_boolean tmp28;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp21 = 2.0;
          tmp22 = ((modelica_real)_pow);
          if(tmp21 < 0.0 && tmp22 != 0.0)
          {
            tmp24 = modf(tmp22, &tmp25);
            
            if(tmp24 > 0.5)
            {
              tmp24 -= 1.0;
              tmp25 += 1.0;
            }
            else if(tmp24 < -0.5)
            {
              tmp24 += 1.0;
              tmp25 -= 1.0;
            }
            
            if(fabs(tmp24) < 1e-10)
              tmp23 = pow(tmp21, tmp25);
            else
            {
              tmp27 = modf(1.0/tmp22, &tmp26);
              if(tmp27 > 0.5)
              {
                tmp27 -= 1.0;
                tmp26 += 1.0;
              }
              else if(tmp27 < -0.5)
              {
                tmp27 += 1.0;
                tmp26 -= 1.0;
              }
              if(fabs(tmp27) < 1e-10 && ((unsigned long)tmp26 & 1))
              {
                tmp23 = -pow(-tmp21, tmp24)*pow(tmp21, tmp25);
              }
              else
              {
                goto goto_2;
              }
            }
          }
          else
          {
            tmp23 = pow(tmp21, tmp22);
          }
          if(isnan(tmp23) || isinf(tmp23))
          {
            goto goto_2;
          }
          tmp28 = (_n > tmp23);
          if (1 /* true */ != tmp28) goto goto_2;
          tmp1 = omc_HpcOmTaskGraph_nextGreaterPowerOf2__impl(threadData, _n, ((modelica_integer) 1) + _pow);
          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:;
    }
  }
  _powOf2 = tmp1;
  _return: OMC_LABEL_UNUSED
  return _powOf2;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_nextGreaterPowerOf2__impl(threadData_t *threadData, modelica_metatype _n, modelica_metatype _pow)
{
  modelica_real tmp1;
  modelica_integer tmp2;
  modelica_integer _powOf2;
  modelica_metatype out_powOf2;
  tmp1 = mmc_unbox_real(_n);
  tmp2 = mmc_unbox_integer(_pow);
  _powOf2 = omc_HpcOmTaskGraph_nextGreaterPowerOf2__impl(threadData, tmp1, tmp2);
  out_powOf2 = mmc_mk_icon(_powOf2);
  return out_powOf2;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_nextGreaterPowerOf2(threadData_t *threadData, modelica_real _n)
{
  modelica_integer _powOf2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _powOf2 has no default value.
  _powOf2 = omc_HpcOmTaskGraph_nextGreaterPowerOf2__impl(threadData, _n, ((modelica_integer) 1));
  _return: OMC_LABEL_UNUSED
  return _powOf2;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_nextGreaterPowerOf2(threadData_t *threadData, modelica_metatype _n)
{
  modelica_real tmp1;
  modelica_integer _powOf2;
  modelica_metatype out_powOf2;
  tmp1 = mmc_unbox_real(_n);
  _powOf2 = omc_HpcOmTaskGraph_nextGreaterPowerOf2(threadData, tmp1);
  out_powOf2 = mmc_mk_icon(_powOf2);
  return out_powOf2;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_distributeToClusters1(threadData_t *threadData, modelica_metatype _tplIn, modelica_metatype _tplFold, modelica_integer _numClusters, modelica_metatype *out_clusterValuesOut)
{
  modelica_metatype _clustersOut = NULL;
  modelica_metatype _clusterValuesOut = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _clustersOut has no default value.
  // _clusterValuesOut has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _tplIn;
    tmp4_2 = _tplFold;
    {
      modelica_integer _numCl;
      modelica_integer _diff;
      modelica_metatype _itemsIn = NULL;
      modelica_metatype _lst1 = NULL;
      modelica_metatype _idcsLst1_2 = NULL;
      modelica_metatype _idcsLst2 = NULL;
      modelica_metatype _idcsLst1 = NULL;
      modelica_metatype _entries = NULL;
      modelica_metatype _entries2 = NULL;
      modelica_metatype _valuesIn = NULL;
      modelica_metatype _values = NULL;
      modelica_metatype _addValues = NULL;
      modelica_metatype _clusters = NULL;
      modelica_metatype _clustersFinal = NULL;
      modelica_metatype _clusterValues = NULL;
      modelica_metatype _clusterValuesFinal = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _numCl has no default value.
      // _diff has no default value.
      // _itemsIn has no default value.
      // _lst1 has no default value.
      // _idcsLst1_2 has no default value.
      // _idcsLst2 has no default value.
      // _idcsLst1 has no default value.
      // _entries has no default value.
      // _entries2 has no default value.
      // _valuesIn has no default value.
      // _values has no default value.
      // _addValues has no default value.
      // _clusters has no default value.
      // _clustersFinal has no default value.
      // _clusterValues has no default value.
      // _clusterValuesFinal has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_boolean tmp9;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          _itemsIn = tmpMeta6;
          _clusters = tmpMeta7;
          _clusterValues = tmpMeta8;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp9 = (listLength(_itemsIn) <= _numClusters);
          if (1 /* true */ != tmp9) goto goto_2;

          _idcsLst1 = omc_List_intRange(threadData, _numClusters);

          _clustersFinal = omc_Array_select(threadData, _clusters, _idcsLst1);

          _clusterValuesFinal = omc_Array_select(threadData, _clusterValues, _idcsLst1);
          tmpMeta[0+0] = _clustersFinal;
          tmpMeta[0+1] = _clusterValuesFinal;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_boolean tmp14;
          modelica_boolean tmp15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          _itemsIn = tmpMeta10;
          _valuesIn = tmpMeta11;
          _clusters = tmpMeta12;
          _clusterValues = tmpMeta13;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp14 = (listLength(_itemsIn) > _numClusters);
          if (1 /* true */ != tmp14) goto goto_2;

          /* Pattern-matching assignment */
          tmp15 = ((0.5) * (((modelica_real)listLength(_itemsIn))) < ((modelica_real)_numClusters));
          if (1 /* true */ != tmp15) goto goto_2;

          _lst1 = omc_List_split(threadData, _itemsIn, _numClusters, NULL);

          _diff = listLength(_itemsIn) - _numClusters;

          _idcsLst1 = omc_List_intRange2(threadData, ((modelica_integer) 1) + _numClusters - _diff, _numClusters);

          _idcsLst2 = omc_List_intRange2(threadData, ((modelica_integer) 1) + _numClusters, listLength(_itemsIn));

          _entries = omc_List_map1(threadData, _idcsLst2, boxvar_Array_getIndexFirst, _clusters);

          _entries = listReverse(_entries);

          _entries2 = omc_List_map1(threadData, _idcsLst1, boxvar_Array_getIndexFirst, _clusters);

          _entries = omc_List_threadMap(threadData, _entries, _entries2, boxvar_listAppend);

          omc_List_threadMap1__0(threadData, _idcsLst1, _entries, boxvar_Array_updateIndexFirst, _clusters);

          _values = omc_List_map1(threadData, _idcsLst1, boxvar_Array_getIndexFirst, _clusterValues);

          _addValues = omc_List_map1(threadData, _idcsLst2, boxvar_Array_getIndexFirst, _clusterValues);

          _values = omc_List_threadMap(threadData, _values, _addValues, boxvar_realAdd);

          omc_List_threadMap1__0(threadData, _idcsLst1, _values, boxvar_Array_updateIndexFirst, _clusterValues);
          tmpMeta16 = mmc_mk_box2(0, _lst1, _valuesIn);
          tmpMeta17 = mmc_mk_box2(0, _clusters, _clusterValues);
          tmpMeta[0+0] = omc_HpcOmTaskGraph_distributeToClusters1(threadData, tmpMeta16, tmpMeta17, _numClusters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_boolean tmp22;
          modelica_boolean tmp23;
          modelica_integer tmp24;
          modelica_integer tmp25;
          modelica_integer tmp26;
          modelica_integer tmp27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          _itemsIn = tmpMeta18;
          _valuesIn = tmpMeta19;
          _clusters = tmpMeta20;
          _clusterValues = tmpMeta21;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp22 = (listLength(_itemsIn) > _numClusters);
          if (1 /* true */ != tmp22) goto goto_2;

          /* Pattern-matching assignment */
          tmp23 = ((0.5) * (((modelica_real)listLength(_itemsIn))) >= ((modelica_real)_numClusters));
          if (1 /* true */ != tmp23) goto goto_2;

          _numCl = omc_HpcOmTaskGraph_nextGreaterPowerOf2(threadData, ((modelica_real)listLength(_itemsIn)));

          tmp24 = ((modelica_integer) 2);
          if (tmp24 == 0) {goto goto_2;}
          _lst1 = omc_List_split(threadData, _itemsIn, modelica_div_integer(_numCl,tmp24).quot, NULL);

          tmp25 = ((modelica_integer) 2);
          if (tmp25 == 0) {goto goto_2;}
          _idcsLst2 = omc_List_intRange2(threadData, ((modelica_integer) 1) + modelica_div_integer(_numCl,tmp25).quot, listLength(_itemsIn));

          tmp26 = ((modelica_integer) 2);
          if (tmp26 == 0) {goto goto_2;}
          tmp27 = ((modelica_integer) 2);
          if (tmp27 == 0) {goto goto_2;}
          _idcsLst1_2 = omc_List_intRange2(threadData, ((modelica_integer) 1) + modelica_div_integer(_numCl,tmp26).quot - listLength(_idcsLst2), modelica_div_integer(_numCl,tmp27).quot);

          _entries = omc_List_map1(threadData, _idcsLst2, boxvar_Array_getIndexFirst, _clusters);

          _entries = listReverse(_entries);

          _entries2 = omc_List_map1(threadData, _idcsLst1_2, boxvar_Array_getIndexFirst, _clusters);

          _entries = omc_List_threadMap(threadData, _entries, _entries2, boxvar_listAppend);

          omc_List_threadMap1__0(threadData, _idcsLst1_2, _entries, boxvar_Array_updateIndexFirst, _clusters);

          _values = omc_List_map1(threadData, _idcsLst1_2, boxvar_Array_getIndexFirst, _clusterValues);

          _addValues = omc_List_map1(threadData, _idcsLst2, boxvar_Array_getIndexFirst, _clusterValues);

          _values = omc_List_threadMap(threadData, _values, _addValues, boxvar_realAdd);

          omc_List_threadMap1__0(threadData, _idcsLst1_2, _values, boxvar_Array_updateIndexFirst, _clusterValues);
          tmpMeta28 = mmc_mk_box2(0, _lst1, _valuesIn);
          tmpMeta29 = mmc_mk_box2(0, _clusters, _clusterValues);
          tmpMeta[0+0] = omc_HpcOmTaskGraph_distributeToClusters1(threadData, tmpMeta28, tmpMeta29, _numClusters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 3: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT78),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 4) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _clustersOut = tmpMeta[0+0];
  _clusterValuesOut = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_clusterValuesOut) { *out_clusterValuesOut = _clusterValuesOut; }
  return _clustersOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_distributeToClusters1(threadData_t *threadData, modelica_metatype _tplIn, modelica_metatype _tplFold, modelica_metatype _numClusters, modelica_metatype *out_clusterValuesOut)
{
  modelica_integer tmp1;
  modelica_metatype _clustersOut = NULL;
  tmp1 = mmc_unbox_integer(_numClusters);
  _clustersOut = omc_HpcOmTaskGraph_distributeToClusters1(threadData, _tplIn, _tplFold, tmp1, out_clusterValuesOut);
  /* skip box _clustersOut; array<list<#Integer>> */
  /* skip box _clusterValuesOut; array<#Real> */
  return _clustersOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_distributeToClusters(threadData_t *threadData, modelica_metatype _items, modelica_metatype _values, modelica_integer _numClusters, modelica_metatype *out_clusterValuesOut)
{
  modelica_metatype _clustersOut = NULL;
  modelica_metatype _clusterValuesOut = NULL;
  modelica_boolean _b;
  modelica_metatype _itemArr = NULL;
  modelica_metatype _itemsCopy = NULL;
  modelica_metatype _clusters = NULL;
  modelica_metatype _clusterValues = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _clustersOut has no default value.
  // _clusterValuesOut has no default value.
  // _b has no default value.
  // _itemArr has no default value.
  // _itemsCopy has no default value.
  // _clusters has no default value.
  // _clusterValues has no default value.
  _b = (listLength(_items) > _numClusters);

  _clusters = listArray(omc_List_map(threadData, omc_List_intRange(threadData, listLength(_items)), boxvar_List_create));

  _clusterValues = listArray(_values);

  _itemArr = listArray(_items);

  _itemsCopy = omc_Array_map(threadData, _itemArr, boxvar_List_create);

  _clusters = omc_Array_copy(threadData, _itemsCopy, _clusters);

  _clusterValues = ((!_b)?omc_Array_copy(threadData, listArray(_values), _clusterValues):_clusterValues);

  if(_b)
  {
    tmpMeta1 = mmc_mk_box2(0, _items, _values);
    tmpMeta2 = mmc_mk_box2(0, _clusters, _clusterValues);
    _clustersOut = omc_HpcOmTaskGraph_distributeToClusters1(threadData, tmpMeta1, tmpMeta2, _numClusters ,&_clusterValuesOut);
  }
  else
  {
    /* Pattern-matching assignment */
    tmpMeta3 = mmc_mk_box2(0, _clusters, _clusterValues);
    tmpMeta4 = tmpMeta3;
    tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 1));
    tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
    _clustersOut = tmpMeta5;
    _clusterValuesOut = tmpMeta6;
  }
  _return: OMC_LABEL_UNUSED
  if (out_clusterValuesOut) { *out_clusterValuesOut = _clusterValuesOut; }
  return _clustersOut;
}
modelica_metatype boxptr_HpcOmTaskGraph_distributeToClusters(threadData_t *threadData, modelica_metatype _items, modelica_metatype _values, modelica_metatype _numClusters, modelica_metatype *out_clusterValuesOut)
{
  modelica_integer tmp1;
  modelica_metatype _clustersOut = NULL;
  tmp1 = mmc_unbox_integer(_numClusters);
  _clustersOut = omc_HpcOmTaskGraph_distributeToClusters(threadData, _items, _values, tmp1, out_clusterValuesOut);
  /* skip box _clustersOut; array<list<#Integer>> */
  /* skip box _clusterValuesOut; array<#Real> */
  return _clustersOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mergeSingleNodes(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _doNotMergeIn, modelica_metatype *out_oTaskGraphMeta, modelica_boolean *out_changed)
{
  modelica_metatype _oTaskGraph = NULL;
  modelica_metatype _oTaskGraphMeta = NULL;
  modelica_boolean _changed;
  modelica_boolean tmp1_c2 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraph has no default value.
  // _oTaskGraphMeta has no default value.
  // _changed has no default value.
  
  
  
  { /* matchcontinue expression */
    {
      modelica_integer _numProc;
      modelica_metatype _singleNodes = NULL;
      modelica_metatype _singleNodes1 = NULL;
      modelica_metatype _pos = NULL;
      modelica_metatype _exeCosts = NULL;
      modelica_metatype _taskGraphT = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _numProc has no default value.
      // _singleNodes has no default value.
      // _singleNodes1 has no default value.
      // _pos has no default value.
      // _exeCosts has no default value.
      // _taskGraphT has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          /* Pattern matching succeeded */
          _numProc = omc_Flags_getConfigInt(threadData, _OMC_LIT86);

          _taskGraphT = omc_AdjacencyMatrix_transposeAdjacencyMatrix(threadData, _iTaskGraph, arrayLength(_iTaskGraph));

          omc_List_filterOnTrueSync(threadData, arrayList(_iTaskGraph), boxvar_listEmpty, omc_List_intRange(threadData, arrayLength(_iTaskGraph)) ,&_singleNodes);

          omc_List_filterOnTrueSync(threadData, arrayList(_taskGraphT), boxvar_listEmpty, omc_List_intRange(threadData, arrayLength(_taskGraphT)) ,&_singleNodes1);

          _singleNodes = omc_List_intersection1OnTrue(threadData, _singleNodes, _singleNodes1, boxvar_intEq, NULL, NULL);

          omc_List_intersection1OnTrue(threadData, _singleNodes, _doNotMergeIn, boxvar_intEq ,&_singleNodes ,NULL);

          _exeCosts = omc_List_map1(threadData, _singleNodes, boxvar_HpcOmTaskGraph_getExeCostReqCycles, _iTaskGraphMeta);

          _exeCosts = omc_HpcOmScheduler_quicksortWithOrder(threadData, _exeCosts ,&_pos);

          _singleNodes = omc_List_map1(threadData, _pos, boxvar_List_getIndexFirst, _singleNodes);

          _singleNodes = listReverse(_singleNodes);

          _exeCosts = listReverse(_exeCosts);

          omc_HpcOmTaskGraph_distributeToClusters(threadData, _singleNodes, _exeCosts, _numProc, NULL);

          _changed = (listLength(_singleNodes) > _numProc);
          tmpMeta[0+0] = _iTaskGraph;
          tmpMeta[0+1] = _iTaskGraphMeta;
          tmp1_c2 = _changed;
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _iTaskGraph;
          tmpMeta[0+1] = _iTaskGraphMeta;
          tmp1_c2 = 0 /* false */;
          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:;
    }
  }
  _oTaskGraph = tmpMeta[0+0];
  _oTaskGraphMeta = tmpMeta[0+1];
  _changed = tmp1_c2;
  _return: OMC_LABEL_UNUSED
  if (out_oTaskGraphMeta) { *out_oTaskGraphMeta = _oTaskGraphMeta; }
  if (out_changed) { *out_changed = _changed; }
  return _oTaskGraph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_mergeSingleNodes(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _doNotMergeIn, modelica_metatype *out_oTaskGraphMeta, modelica_metatype *out_changed)
{
  modelica_boolean _changed;
  modelica_metatype _oTaskGraph = NULL;
  _oTaskGraph = omc_HpcOmTaskGraph_mergeSingleNodes(threadData, _iTaskGraph, _iTaskGraphMeta, _doNotMergeIn, out_oTaskGraphMeta, &_changed);
  /* skip box _oTaskGraph; array<list<#Integer>> */
  /* skip box _oTaskGraphMeta; HpcOmTaskGraph.TaskGraphMeta */
  if (out_changed) { *out_changed = mmc_mk_icon(_changed); }
  return _oTaskGraph;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_integer _cpIdx)
{
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = stringAppend(intString(_cpIdx),_OMC_LIT87);
  tmpMeta2 = stringAppend(tmpMeta1,omc_HpcOmTaskGraph_intLstString(threadData, listGet(_criticalPathsIn, _cpIdx)));
  tmpMeta3 = stringAppend(tmpMeta2,_OMC_LIT5);
  fputs(MMC_STRINGDATA(tmpMeta3),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_printCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_metatype _cpIdx)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_cpIdx);
  omc_HpcOmTaskGraph_printCriticalPathInfo1(threadData, _criticalPathsIn, tmp1);
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCriticalPathInfo(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_real _cpCosts)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* matchcontinue expression */
    volatile modelica_metatype tmp3_1;
    tmp3_1 = _criticalPathsIn;
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT89),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);

          tmpMeta5 = stringAppend(_OMC_LIT90,intString(listLength(_criticalPathsIn)));
          tmpMeta6 = stringAppend(tmpMeta5,_OMC_LIT91);
          tmpMeta7 = stringAppend(tmpMeta6,realString(_cpCosts));
          tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT92);
          fputs(MMC_STRINGDATA(tmpMeta8),stdout);

          omc_HpcOmTaskGraph_printCriticalPathInfo1(threadData, _criticalPathsIn, ((modelica_integer) 1));
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 2) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_printCriticalPathInfo(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_metatype _cpCosts)
{
  modelica_real tmp1;
  tmp1 = mmc_unbox_real(_cpCosts);
  omc_HpcOmTaskGraph_printCriticalPathInfo(threadData, _criticalPathsIn, tmp1);
  return;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_dumpCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_integer _cpIdx)
{
  modelica_string _oString = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oString has no default value.
  tmpMeta1 = stringAppend(omc_HpcOmTaskGraph_intLstString(threadData, listGet(_criticalPathsIn, _cpIdx)),_OMC_LIT93);
  _oString = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oString;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_dumpCriticalPathInfo1(threadData_t *threadData, modelica_metatype _criticalPathsIn, modelica_metatype _cpIdx)
{
  modelica_integer tmp1;
  modelica_string _oString = NULL;
  tmp1 = mmc_unbox_integer(_cpIdx);
  _oString = omc_HpcOmTaskGraph_dumpCriticalPathInfo1(threadData, _criticalPathsIn, tmp1);
  /* skip box _oString; String */
  return _oString;
}

DLLDirection
modelica_string omc_HpcOmTaskGraph_dumpCriticalPathInfo(threadData_t *threadData, modelica_metatype _iCriticalPaths, modelica_metatype _iCriticalPathsWoC)
{
  modelica_string _oString = NULL;
  modelica_string _tmpString = NULL;
  modelica_metatype _critPath = NULL;
  modelica_metatype _critPathWoC = NULL;
  modelica_real _costPath;
  modelica_real _costPathWoC;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oString has no default value.
  // _tmpString has no default value.
  // _critPath has no default value.
  // _critPathWoC has no default value.
  // _costPath has no default value.
  // _costPathWoC has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _iCriticalPaths;
    tmp4_2 = _iCriticalPathsWoC;
    {
      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;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          if (!listEmpty(tmpMeta6)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmp1 = _OMC_LIT93;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_real tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_real tmp12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_real(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp12 = mmc_unbox_real(tmpMeta11);
          _critPath = tmpMeta7;
          _costPath = tmp9  /* pattern as ty=Real */;
          _critPathWoC = tmpMeta10;
          _costPathWoC = tmp12  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          tmpMeta13 = stringAppend(_OMC_LIT94,realString(_costPath));
          tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT95);
          _tmpString = tmpMeta14;

          tmpMeta15 = stringAppend(_tmpString,omc_HpcOmTaskGraph_dumpCriticalPathInfo1(threadData, _critPath, ((modelica_integer) 1)));
          _tmpString = tmpMeta15;

          tmpMeta16 = stringAppend(_OMC_LIT96,_tmpString);
          tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT97);
          tmpMeta18 = stringAppend(tmpMeta17,realString(_costPathWoC));
          tmpMeta19 = stringAppend(tmpMeta18,_OMC_LIT95);
          _tmpString = tmpMeta19;
          tmpMeta20 = stringAppend(_tmpString,omc_HpcOmTaskGraph_dumpCriticalPathInfo1(threadData, _critPathWoC, ((modelica_integer) 1)));
          tmp1 = tmpMeta20;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oString = tmp1;
  _return: OMC_LABEL_UNUSED
  return _oString;
}

DLLDirection
modelica_string omc_HpcOmTaskGraph_intLstString(threadData_t *threadData, modelica_metatype _lstIn)
{
  modelica_string _strOut = NULL;
  modelica_string _str = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _strOut has no default value.
  // _str has no default value.
  _str = stringDelimitList(omc_List_map(threadData, _lstIn, boxvar_intString), _OMC_LIT31);

  _strOut = (listEmpty(_lstIn)?_OMC_LIT98:_str);
  _return: OMC_LABEL_UNUSED
  return _strOut;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printComponentInformations(threadData_t *threadData, modelica_metatype _iComponentInformations)
{
  modelica_integer _compIdx;
  modelica_boolean _isPartOfODESystem;
  modelica_boolean _isPartOfZeroFuncSystem;
  modelica_boolean _isRemovedComponent;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_integer tmp16;
  modelica_integer tmp17;
  modelica_integer tmp18;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compIdx has no default value.
  // _isPartOfODESystem has no default value.
  // _isPartOfZeroFuncSystem has no default value.
  // _isRemovedComponent has no default value.
  tmp16 = ((modelica_integer) 1); tmp17 = 1; tmp18 = arrayLength(_iComponentInformations);
  if(!(((tmp17 > 0) && (tmp16 > tmp18)) || ((tmp17 < 0) && (tmp16 < tmp18))))
  {
    modelica_integer _compIdx;
    for(_compIdx = ((modelica_integer) 1); in_range_integer(_compIdx, tmp16, tmp18); _compIdx += tmp17)
    {
      /* Pattern-matching assignment */
      tmpMeta1 = arrayGet(_iComponentInformations, _compIdx);
      tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
      tmp3 = mmc_unbox_integer(tmpMeta2);
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
      tmp5 = mmc_unbox_integer(tmpMeta4);
      tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
      tmp7 = mmc_unbox_integer(tmpMeta6);
      _isPartOfODESystem = tmp3  /* pattern as ty=Boolean */;
      _isPartOfZeroFuncSystem = tmp5  /* pattern as ty=Boolean */;
      _isRemovedComponent = tmp7  /* pattern as ty=Boolean */;

      tmpMeta8 = stringAppend(_OMC_LIT99,intString(_compIdx));
      tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT100);
      fputs(MMC_STRINGDATA(tmpMeta9),stdout);

      tmpMeta10 = stringAppend(_OMC_LIT101,(_isPartOfODESystem?_OMC_LIT102:_OMC_LIT103));
      tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta11),stdout);

      tmpMeta12 = stringAppend(_OMC_LIT104,(_isPartOfZeroFuncSystem?_OMC_LIT102:_OMC_LIT103));
      tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta13),stdout);

      tmpMeta14 = stringAppend(_OMC_LIT105,(_isRemovedComponent?_OMC_LIT102:_OMC_LIT103));
      tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta15),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printNodeMarks(threadData_t *threadData, modelica_metatype _iNodeMarks)
{
  modelica_integer _compIdx;
  modelica_integer _mark;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compIdx has no default value.
  // _mark has no default value.
  tmp5 = ((modelica_integer) 1); tmp6 = 1; tmp7 = arrayLength(_iNodeMarks);
  if(!(((tmp6 > 0) && (tmp5 > tmp7)) || ((tmp6 < 0) && (tmp5 < tmp7))))
  {
    modelica_integer _compIdx;
    for(_compIdx = ((modelica_integer) 1); in_range_integer(_compIdx, tmp5, tmp7); _compIdx += tmp6)
    {
      _mark = mmc_unbox_integer(arrayGet(_iNodeMarks, _compIdx));

      tmpMeta1 = stringAppend(_OMC_LIT99,intString(_compIdx));
      tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT106);
      tmpMeta3 = stringAppend(tmpMeta2,intString(_mark));
      tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta4),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_printCommCost(threadData_t *threadData, modelica_metatype _iComm)
{
  modelica_string _oCommString = NULL;
  modelica_integer _numberOfVars;
  modelica_integer _numberOfIntegers;
  modelica_integer _numberOfFloats;
  modelica_integer _numberOfBooleans;
  modelica_integer _childNode;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_real _requiredTime;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_real tmp10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  modelica_metatype tmpMeta21;
  modelica_metatype tmpMeta22;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommString has no default value.
  // _numberOfVars has no default value.
  // _numberOfIntegers has no default value.
  // _numberOfFloats has no default value.
  // _numberOfBooleans has no default value.
  // _childNode has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _requiredTime has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iComm;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmp8 = mmc_unbox_integer(tmpMeta7);
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmp10 = mmc_unbox_real(tmpMeta9);
  _numberOfVars = tmp3  /* pattern as ty=Integer */;
  _integerVars = tmpMeta4;
  _floatVars = tmpMeta5;
  _booleanVars = tmpMeta6;
  _childNode = tmp8  /* pattern as ty=Integer */;
  _requiredTime = tmp10  /* pattern as ty=Real */;

  _numberOfIntegers = listLength(_integerVars);

  _numberOfFloats = listLength(_floatVars);

  _numberOfBooleans = listLength(_booleanVars);

  tmpMeta11 = stringAppend(_OMC_LIT107,intString(_childNode));
  tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT108);
  tmpMeta13 = stringAppend(tmpMeta12,intString(_numberOfIntegers));
  tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT109);
  tmpMeta15 = stringAppend(tmpMeta14,intString(_numberOfFloats));
  tmpMeta16 = stringAppend(tmpMeta15,_OMC_LIT110);
  tmpMeta17 = stringAppend(tmpMeta16,intString(_numberOfBooleans));
  tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT111);
  tmpMeta19 = stringAppend(tmpMeta18,realString(_requiredTime));
  tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT112);
  tmpMeta21 = stringAppend(tmpMeta20,intString(_numberOfVars));
  tmpMeta22 = stringAppend(tmpMeta21,_OMC_LIT113);
  _oCommString = tmpMeta22;
  _return: OMC_LABEL_UNUSED
  return _oCommString;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCommCosts(threadData_t *threadData, modelica_metatype _iCommCosts)
{
  modelica_integer _nodeIdx;
  modelica_metatype _nodeComms = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodeIdx has no default value.
  // _nodeComms has no default value.
  tmp5 = ((modelica_integer) 1); tmp6 = 1; tmp7 = arrayLength(_iCommCosts);
  if(!(((tmp6 > 0) && (tmp5 > tmp7)) || ((tmp6 < 0) && (tmp5 < tmp7))))
  {
    modelica_integer _nodeIdx;
    for(_nodeIdx = ((modelica_integer) 1); in_range_integer(_nodeIdx, tmp5, tmp7); _nodeIdx += tmp6)
    {
      _nodeComms = arrayGet(_iCommCosts, _nodeIdx);

      tmpMeta1 = stringAppend(_OMC_LIT114,intString(_nodeIdx));
      tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT115);
      tmpMeta3 = stringAppend(tmpMeta2,stringDelimitList(omc_List_map(threadData, _nodeComms, boxvar_HpcOmTaskGraph_printCommCost), _OMC_LIT116));
      tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta4),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printExeCosts(threadData_t *threadData, modelica_metatype _iExeCosts)
{
  modelica_integer _compIdx;
  modelica_integer _opCount;
  modelica_real _execTime;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_real tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_integer tmp12;
  modelica_integer tmp13;
  modelica_integer tmp14;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compIdx has no default value.
  // _opCount has no default value.
  // _execTime has no default value.
  tmp12 = ((modelica_integer) 1); tmp13 = 1; tmp14 = arrayLength(_iExeCosts);
  if(!(((tmp13 > 0) && (tmp12 > tmp14)) || ((tmp13 < 0) && (tmp12 < tmp14))))
  {
    modelica_integer _compIdx;
    for(_compIdx = ((modelica_integer) 1); in_range_integer(_compIdx, tmp12, tmp14); _compIdx += tmp13)
    {
      /* Pattern-matching assignment */
      tmpMeta1 = arrayGet(_iExeCosts, _compIdx);
      tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
      tmp3 = mmc_unbox_integer(tmpMeta2);
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
      tmp5 = mmc_unbox_real(tmpMeta4);
      _opCount = tmp3  /* pattern as ty=Integer */;
      _execTime = tmp5  /* pattern as ty=Real */;

      tmpMeta6 = stringAppend(_OMC_LIT99,intString(_compIdx));
      tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT117);
      tmpMeta8 = stringAppend(tmpMeta7,intString(_opCount));
      tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT31);
      tmpMeta10 = stringAppend(tmpMeta9,realString(_execTime));
      tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT118);
      fputs(MMC_STRINGDATA(tmpMeta11),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCompDescs(threadData_t *threadData, modelica_metatype _iCompDescs)
{
  modelica_integer _compIdx;
  modelica_string _compDesc = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compIdx has no default value.
  // _compDesc has no default value.
  tmp5 = ((modelica_integer) 1); tmp6 = 1; tmp7 = arrayLength(_iCompDescs);
  if(!(((tmp6 > 0) && (tmp5 > tmp7)) || ((tmp6 < 0) && (tmp5 < tmp7))))
  {
    modelica_integer _compIdx;
    for(_compIdx = ((modelica_integer) 1); in_range_integer(_compIdx, tmp5, tmp7); _compIdx += tmp6)
    {
      _compDesc = arrayGet(_iCompDescs, _compIdx);

      tmpMeta1 = stringAppend(_OMC_LIT99,intString(_compIdx));
      tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT119);
      tmpMeta3 = stringAppend(tmpMeta2,_compDesc);
      tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta4),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printComponentNames(threadData_t *threadData, modelica_metatype _iCompNames)
{
  modelica_integer _compIdx;
  modelica_string _compName = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compIdx has no default value.
  // _compName has no default value.
  tmp5 = ((modelica_integer) 1); tmp6 = 1; tmp7 = arrayLength(_iCompNames);
  if(!(((tmp6 > 0) && (tmp5 > tmp7)) || ((tmp6 < 0) && (tmp5 < tmp7))))
  {
    modelica_integer _compIdx;
    for(_compIdx = ((modelica_integer) 1); in_range_integer(_compIdx, tmp5, tmp7); _compIdx += tmp6)
    {
      _compName = arrayGet(_iCompNames, _compIdx);

      tmpMeta1 = stringAppend(_OMC_LIT99,intString(_compIdx));
      tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT120);
      tmpMeta3 = stringAppend(tmpMeta2,_compName);
      tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta4),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printCompParamMapping(threadData_t *threadData, modelica_metatype _iCompParamMapping)
{
  modelica_integer _compIdx;
  modelica_metatype _params = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compIdx has no default value.
  // _params has no default value.
  tmp5 = ((modelica_integer) 1); tmp6 = 1; tmp7 = arrayLength(_iCompParamMapping);
  if(!(((tmp6 > 0) && (tmp5 > tmp7)) || ((tmp6 < 0) && (tmp5 < tmp7))))
  {
    modelica_integer _compIdx;
    for(_compIdx = ((modelica_integer) 1); in_range_integer(_compIdx, tmp5, tmp7); _compIdx += tmp6)
    {
      _params = arrayGet(_iCompParamMapping, _compIdx);

      tmpMeta1 = stringAppend(_OMC_LIT99,intString(_compIdx));
      tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT121);
      tmpMeta3 = stringAppend(tmpMeta2,stringDelimitList(omc_List_map(threadData, _params, boxvar_intString), _OMC_LIT31));
      tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta4),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printEqCompMapping(threadData_t *threadData, modelica_metatype _iEqCompMapping)
{
  modelica_integer _eqIdx;
  modelica_integer _comp;
  modelica_integer _eqSysIdx;
  modelica_integer _eqOffset;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_integer tmp16;
  modelica_integer tmp17;
  modelica_integer tmp18;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eqIdx has no default value.
  // _comp has no default value.
  // _eqSysIdx has no default value.
  // _eqOffset has no default value.
  tmp16 = ((modelica_integer) 1); tmp17 = 1; tmp18 = arrayLength(_iEqCompMapping);
  if(!(((tmp17 > 0) && (tmp16 > tmp18)) || ((tmp17 < 0) && (tmp16 < tmp18))))
  {
    modelica_integer _eqIdx;
    for(_eqIdx = ((modelica_integer) 1); in_range_integer(_eqIdx, tmp16, tmp18); _eqIdx += tmp17)
    {
      /* Pattern-matching assignment */
      tmpMeta1 = arrayGet(_iEqCompMapping, _eqIdx);
      tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
      tmp3 = mmc_unbox_integer(tmpMeta2);
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
      tmp5 = mmc_unbox_integer(tmpMeta4);
      tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
      tmp7 = mmc_unbox_integer(tmpMeta6);
      _comp = tmp3  /* pattern as ty=Integer */;
      _eqSysIdx = tmp5  /* pattern as ty=Integer */;
      _eqOffset = tmp7  /* pattern as ty=Integer */;

      tmpMeta8 = stringAppend(_OMC_LIT122,intString(_eqIdx));
      tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT123);
      tmpMeta10 = stringAppend(tmpMeta9,intString(_eqOffset));
      tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT124);
      tmpMeta12 = stringAppend(tmpMeta11,intString(_eqSysIdx));
      tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT125);
      tmpMeta14 = stringAppend(tmpMeta13,intString(_comp));
      tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta15),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printVarCompMapping(threadData_t *threadData, modelica_metatype _iVarCompMapping)
{
  modelica_integer _varIdx;
  modelica_integer _comp;
  modelica_integer _eqSysIdx;
  modelica_integer _varOffset;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_integer tmp16;
  modelica_integer tmp17;
  modelica_integer tmp18;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _varIdx has no default value.
  // _comp has no default value.
  // _eqSysIdx has no default value.
  // _varOffset has no default value.
  tmp16 = ((modelica_integer) 1); tmp17 = 1; tmp18 = arrayLength(_iVarCompMapping);
  if(!(((tmp17 > 0) && (tmp16 > tmp18)) || ((tmp17 < 0) && (tmp16 < tmp18))))
  {
    modelica_integer _varIdx;
    for(_varIdx = ((modelica_integer) 1); in_range_integer(_varIdx, tmp16, tmp18); _varIdx += tmp17)
    {
      /* Pattern-matching assignment */
      tmpMeta1 = arrayGet(_iVarCompMapping, _varIdx);
      tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
      tmp3 = mmc_unbox_integer(tmpMeta2);
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
      tmp5 = mmc_unbox_integer(tmpMeta4);
      tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
      tmp7 = mmc_unbox_integer(tmpMeta6);
      _comp = tmp3  /* pattern as ty=Integer */;
      _eqSysIdx = tmp5  /* pattern as ty=Integer */;
      _varOffset = tmp7  /* pattern as ty=Integer */;

      tmpMeta8 = stringAppend(_OMC_LIT126,intString(_varIdx - _varOffset));
      tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT123);
      tmpMeta10 = stringAppend(tmpMeta9,intString(_varOffset));
      tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT124);
      tmpMeta12 = stringAppend(tmpMeta11,intString(_eqSysIdx));
      tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT127);
      tmpMeta14 = stringAppend(tmpMeta13,intString(_comp));
      tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta15),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_printInComps(threadData_t *threadData, modelica_metatype _iInComps)
{
  modelica_integer _nodeIdx;
  modelica_metatype _compRow = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_integer tmp6;
  modelica_integer tmp7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodeIdx has no default value.
  // _compRow has no default value.
  tmp5 = ((modelica_integer) 1); tmp6 = 1; tmp7 = arrayLength(_iInComps);
  if(!(((tmp6 > 0) && (tmp5 > tmp7)) || ((tmp6 < 0) && (tmp5 < tmp7))))
  {
    modelica_integer _nodeIdx;
    for(_nodeIdx = ((modelica_integer) 1); in_range_integer(_nodeIdx, tmp5, tmp7); _nodeIdx += tmp6)
    {
      _compRow = arrayGet(_iInComps, _nodeIdx);

      tmpMeta1 = stringAppend(_OMC_LIT128,intString(_nodeIdx));
      tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT129);
      tmpMeta3 = stringAppend(tmpMeta2,stringDelimitList(omc_List_map(threadData, _compRow, boxvar_intString), _OMC_LIT116));
      tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT5);
      fputs(MMC_STRINGDATA(tmpMeta4),stdout);
    }
  }

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_HpcOmTaskGraph_printTaskGraphMeta(threadData_t *threadData, modelica_metatype _metaDataIn)
{
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _nodeMark has no default value.
  // _compParamMapping has no default value.
  // _compInformations has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _metaDataIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
  _inComps = tmpMeta2;
  _varCompMapping = tmpMeta3;
  _eqCompMapping = tmpMeta4;
  _compParamMapping = tmpMeta5;
  _compNames = tmpMeta6;
  _compDescs = tmpMeta7;
  _exeCosts = tmpMeta8;
  _commCosts = tmpMeta9;
  _nodeMark = tmpMeta10;
  _compInformations = tmpMeta11;

  fputs(MMC_STRINGDATA(_OMC_LIT5),stdout);

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);

  fputs(MMC_STRINGDATA(_OMC_LIT130),stdout);

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);

  tmpMeta12 = stringAppend(intString(arrayLength(_inComps)),_OMC_LIT131);
  fputs(MMC_STRINGDATA(tmpMeta12),stdout);

  omc_HpcOmTaskGraph_printInComps(threadData, _inComps);

  tmpMeta13 = stringAppend(intString(arrayLength(_varCompMapping)),_OMC_LIT132);
  fputs(MMC_STRINGDATA(tmpMeta13),stdout);

  omc_HpcOmTaskGraph_printVarCompMapping(threadData, _varCompMapping);

  tmpMeta14 = stringAppend(intString(arrayLength(_eqCompMapping)),_OMC_LIT133);
  fputs(MMC_STRINGDATA(tmpMeta14),stdout);

  omc_HpcOmTaskGraph_printEqCompMapping(threadData, _eqCompMapping);

  tmpMeta15 = stringAppend(intString(arrayLength(_compParamMapping)),_OMC_LIT134);
  fputs(MMC_STRINGDATA(tmpMeta15),stdout);

  omc_HpcOmTaskGraph_printCompParamMapping(threadData, _compParamMapping);

  fputs(MMC_STRINGDATA(_OMC_LIT135),stdout);

  omc_HpcOmTaskGraph_printComponentNames(threadData, _compNames);

  fputs(MMC_STRINGDATA(_OMC_LIT136),stdout);

  omc_HpcOmTaskGraph_printCompDescs(threadData, _compDescs);

  fputs(MMC_STRINGDATA(_OMC_LIT137),stdout);

  omc_HpcOmTaskGraph_printExeCosts(threadData, _exeCosts);

  fputs(MMC_STRINGDATA(_OMC_LIT138),stdout);

  omc_HpcOmTaskGraph_printCommCosts(threadData, _commCosts);

  fputs(MMC_STRINGDATA(_OMC_LIT139),stdout);

  omc_HpcOmTaskGraph_printNodeMarks(threadData, _nodeMark);

  fputs(MMC_STRINGDATA(_OMC_LIT140),stdout);

  omc_HpcOmTaskGraph_printComponentInformations(threadData, _compInformations);

  fputs(MMC_STRINGDATA(_OMC_LIT5),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_dumpAdjacencyRow(threadData_t *threadData, modelica_metatype _inIntegerLst)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _inIntegerLst;
    {
      modelica_string _s = NULL;
      modelica_integer _x;
      modelica_metatype _xs = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _s has no default value.
      // _x has no default value.
      // _xs has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT5),stdout);
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta5 = MMC_CAR(tmp3_1);
          tmpMeta6 = MMC_CDR(tmp3_1);
          tmp7 = mmc_unbox_integer(tmpMeta5);
          _x = tmp7  /* pattern as ty=Integer */;
          _xs = tmpMeta6;
          /* Pattern matching succeeded */
          _s = intString(_x);

          fputs(MMC_STRINGDATA(_s),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT0),stdout);

          /* Tail recursive call */
          _inIntegerLst = _xs;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          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_HpcOmTaskGraph_dumpAdjacencyLst(threadData_t *threadData, modelica_metatype _inIntegerLstLst, modelica_integer _rowIndex)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _inIntegerLstLst;
    {
      modelica_metatype _row = NULL;
      modelica_metatype _rows = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _row has no default value.
      // _rows has no default value.
      tmp3 = 0;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta5 = MMC_CAR(tmp3_1);
          tmpMeta6 = MMC_CDR(tmp3_1);
          _row = tmpMeta5;
          _rows = tmpMeta6;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(intString(_rowIndex)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT33),stdout);

          omc_HpcOmTaskGraph_dumpAdjacencyRow(threadData, _row);

          /* Tail recursive call */
          _inIntegerLstLst = _rows;
          _rowIndex = ((modelica_integer) 1) + _rowIndex;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      goto_1:;
      MMC_THROW_INTERNAL();
      goto tmp2_done;
      tmp2_done:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  return;
}
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_dumpAdjacencyLst(threadData_t *threadData, modelica_metatype _inIntegerLstLst, modelica_metatype _rowIndex)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_rowIndex);
  omc_HpcOmTaskGraph_dumpAdjacencyLst(threadData, _inIntegerLstLst, tmp1);
  return;
}

DLLDirection
void omc_HpcOmTaskGraph_printTaskGraph(threadData_t *threadData, modelica_metatype _graphIn)
{
  modelica_metatype _graphLst = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphLst has no default value.
  fputs(MMC_STRINGDATA(_OMC_LIT5),stdout);

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);

  fputs(MMC_STRINGDATA(_OMC_LIT141),stdout);

  fputs(MMC_STRINGDATA(_OMC_LIT88),stdout);

  _graphLst = arrayList(_graphIn);

  omc_HpcOmTaskGraph_dumpAdjacencyLst(threadData, _graphLst, ((modelica_integer) 1));

  fputs(MMC_STRINGDATA(_OMC_LIT5),stdout);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodeMembershipByComponents(threadData_t *threadData, modelica_metatype _iNodeComponents, modelica_metatype _iCompInformations)
{
  modelica_metatype _oMembership = NULL;
  modelica_boolean _isPartOfODESystem;
  modelica_boolean _isPartOfZeroFuncSystem;
  modelica_boolean _isRemovedComponent;
  modelica_integer _compIdx;
  modelica_metatype _tmpComponentInformation = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_integer tmp9;
  modelica_metatype tmpMeta10;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMembership has no default value.
  // _isPartOfODESystem has no default value.
  // _isPartOfZeroFuncSystem has no default value.
  // _isRemovedComponent has no default value.
  // _compIdx has no default value.
  // _tmpComponentInformation has no default value.
  _tmpComponentInformation = _OMC_LIT142;

  {
    modelica_metatype _compIdx;
    for (tmpMeta1 = _iNodeComponents; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _compIdx = MMC_CAR(tmpMeta1);
      _tmpComponentInformation = omc_HpcOmTaskGraph_combineComponentInformations(threadData, arrayGet(_iCompInformations, mmc_unbox_integer(_compIdx)), _tmpComponentInformation);
    }
  }

  /* Pattern-matching assignment */
  tmpMeta3 = _tmpComponentInformation;
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 3));
  tmp7 = mmc_unbox_integer(tmpMeta6);
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 4));
  tmp9 = mmc_unbox_integer(tmpMeta8);
  _isPartOfODESystem = tmp5  /* pattern as ty=Boolean */;
  _isPartOfZeroFuncSystem = tmp7  /* pattern as ty=Boolean */;
  _isRemovedComponent = tmp9  /* pattern as ty=Boolean */;

  tmpMeta10 = mmc_mk_box3(0, mmc_mk_boolean(_isPartOfODESystem), mmc_mk_boolean(_isPartOfZeroFuncSystem), mmc_mk_boolean(_isRemovedComponent));
  _oMembership = tmpMeta10;
  _return: OMC_LABEL_UNUSED
  return _oMembership;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addDepToGraph(threadData_t *threadData, modelica_integer _childIdx, modelica_integer _parentIdx, modelica_metatype _tGraphDataIn, modelica_metatype _iCommAttIdc, modelica_metatype _iCriticalPathEdges, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph)
{
  modelica_metatype _oGraph = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_integer _commCostAttIdx;
  modelica_integer _commVarsAttIdx;
  modelica_integer _commVarsAttIntIdx;
  modelica_integer _commVarsAttFloatIdx;
  modelica_integer _commVarsAttBoolIdx;
  modelica_integer _numOfCommVars;
  modelica_integer _numOfCommVarsInt;
  modelica_integer _numOfCommVarsFloat;
  modelica_integer _numOfCommVarsBool;
  modelica_integer _primalCompParent;
  modelica_integer _primalCompChild;
  modelica_real _commCost;
  modelica_string _refSccCountStr = NULL;
  modelica_string _commCostString = NULL;
  modelica_string _numOfCommVarsString = NULL;
  modelica_string _numOfCommVarsIntString = NULL;
  modelica_string _numOfCommVarsFloatString = NULL;
  modelica_string _numOfCommVarsBoolString = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _components = NULL;
  modelica_metatype _tmpGraph = NULL;
  modelica_metatype _criticalPathEdges = NULL;
  modelica_metatype _criticalPathEdgesWoC = NULL;
  modelica_string _edgeColor = NULL;
  modelica_boolean _visualizeCriticalPath;
  modelica_boolean _visualizeCommTime;
  modelica_metatype _edgeLabels = NULL;
  modelica_real _lineWidth;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_integer tmp9;
  modelica_metatype tmpMeta10;
  modelica_integer tmp11;
  modelica_metatype tmpMeta12;
  modelica_integer tmp13;
  modelica_metatype tmpMeta14;
  modelica_integer tmp15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  modelica_integer tmp21;
  modelica_metatype tmpMeta22;
  modelica_integer tmp23;
  modelica_metatype tmpMeta24;
  modelica_metatype tmpMeta25;
  modelica_metatype tmpMeta26;
  modelica_integer tmp27;
  modelica_metatype tmpMeta28;
  modelica_metatype tmpMeta29;
  modelica_metatype tmpMeta30;
  modelica_metatype tmpMeta31;
  modelica_real tmp32;
  modelica_metatype tmpMeta33;
  modelica_metatype tmpMeta34;
  modelica_metatype tmpMeta35;
  modelica_boolean tmp36;
  modelica_metatype tmpMeta37;
  modelica_metatype tmpMeta38;
  modelica_metatype tmpMeta39;
  modelica_metatype tmpMeta40;
  modelica_metatype tmpMeta41;
  modelica_metatype tmpMeta42;
  modelica_metatype tmpMeta43;
  modelica_metatype tmpMeta44;
  modelica_metatype tmpMeta45;
  modelica_metatype tmpMeta46;
  modelica_metatype tmpMeta47;
  modelica_metatype tmpMeta48;
  modelica_metatype tmpMeta49;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oGraph has no default value.
  // _commCosts has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _commCostAttIdx has no default value.
  // _commVarsAttIdx has no default value.
  // _commVarsAttIntIdx has no default value.
  // _commVarsAttFloatIdx has no default value.
  // _commVarsAttBoolIdx has no default value.
  // _numOfCommVars has no default value.
  // _numOfCommVarsInt has no default value.
  // _numOfCommVarsFloat has no default value.
  // _numOfCommVarsBool has no default value.
  // _primalCompParent has no default value.
  // _primalCompChild has no default value.
  // _commCost has no default value.
  // _refSccCountStr has no default value.
  // _commCostString has no default value.
  // _numOfCommVarsString has no default value.
  // _numOfCommVarsIntString has no default value.
  // _numOfCommVarsFloatString has no default value.
  // _numOfCommVarsBoolString has no default value.
  // _inComps has no default value.
  // _nodeMark has no default value.
  // _components has no default value.
  // _tmpGraph has no default value.
  // _criticalPathEdges has no default value.
  // _criticalPathEdgesWoC has no default value.
  _edgeColor = _OMC_LIT143;
  // _visualizeCriticalPath has no default value.
  // _visualizeCommTime has no default value.
  // _edgeLabels has no default value.
  // _lineWidth has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _tGraphDataIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  _inComps = tmpMeta2;
  _commCosts = tmpMeta3;
  _nodeMark = tmpMeta4;

  /* Pattern-matching assignment */
  tmpMeta5 = _iCommAttIdc;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
  tmp7 = mmc_unbox_integer(tmpMeta6);
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
  tmp9 = mmc_unbox_integer(tmpMeta8);
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 3));
  tmp11 = mmc_unbox_integer(tmpMeta10);
  tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 4));
  tmp13 = mmc_unbox_integer(tmpMeta12);
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 5));
  tmp15 = mmc_unbox_integer(tmpMeta14);
  _commCostAttIdx = tmp7  /* pattern as ty=Integer */;
  _commVarsAttIdx = tmp9  /* pattern as ty=Integer */;
  _commVarsAttIntIdx = tmp11  /* pattern as ty=Integer */;
  _commVarsAttFloatIdx = tmp13  /* pattern as ty=Integer */;
  _commVarsAttBoolIdx = tmp15  /* pattern as ty=Integer */;

  /* Pattern-matching assignment */
  tmpMeta16 = _iCriticalPathEdges;
  tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 1));
  tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 2));
  _criticalPathEdges = tmpMeta17;
  _criticalPathEdgesWoC = tmpMeta18;

  /* Pattern-matching assignment */
  tmpMeta19 = _iGraphDumpOptions;
  tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 2));
  tmp21 = mmc_unbox_integer(tmpMeta20);
  tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta19), 5));
  tmp23 = mmc_unbox_integer(tmpMeta22);
  _visualizeCriticalPath = tmp21  /* pattern as ty=Boolean */;
  _visualizeCommTime = tmp23  /* pattern as ty=Boolean */;

  tmpMeta24 = mmc_mk_box2(0, mmc_mk_integer(_parentIdx), mmc_mk_integer(_childIdx));
  if(omc_List_exist1(threadData, _criticalPathEdges, boxvar_HpcOmTaskGraph_compareIntTuple2, tmpMeta24))
  {
    _lineWidth = 4.0;

    _edgeColor = (_visualizeCriticalPath?_OMC_LIT144:_edgeColor);
  }
  else
  {
    _lineWidth = 2.0;
  }

  /* Pattern-matching assignment */
  tmpMeta25 = omc_HpcOmTaskGraph_getCommCostBetweenNodes(threadData, _parentIdx, _childIdx, _tGraphDataIn);
  tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 2));
  tmp27 = mmc_unbox_integer(tmpMeta26);
  tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 3));
  tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 4));
  tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 5));
  tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 8));
  tmp32 = mmc_unbox_real(tmpMeta31);
  _numOfCommVars = tmp27  /* pattern as ty=Integer */;
  _integerVars = tmpMeta28;
  _floatVars = tmpMeta29;
  _booleanVars = tmpMeta30;
  _commCost = tmp32  /* pattern as ty=Real */;

  _numOfCommVarsString = intString(_numOfCommVars);

  _numOfCommVarsIntString = intString(listLength(_integerVars));

  _numOfCommVarsFloatString = intString(listLength(_floatVars));

  _numOfCommVarsBoolString = intString(listLength(_booleanVars));

  _commCostString = omc_System_snprintff(threadData, _OMC_LIT145, ((modelica_integer) 25), _commCost);

  tmp36 = (modelica_boolean)_visualizeCommTime;
  if(tmp36)
  {
    tmpMeta34 = mmc_mk_box4(3, &GraphML_EdgeLabel_EDGELABEL__desc, _commCostString, mmc_mk_some(_edgeColor), mmc_mk_integer(((modelica_integer) 12)));
    tmpMeta33 = mmc_mk_cons(tmpMeta34, MMC_REFSTRUCTLIT(mmc_nil));
    tmpMeta37 = tmpMeta33;
  }
  else
  {
    tmpMeta35 = MMC_REFSTRUCTLIT(mmc_nil);
    tmpMeta37 = tmpMeta35;
  }
  _edgeLabels = tmpMeta37;

  /* Pattern-matching tuple assignment */
  tmpMeta39 = stringAppend(_OMC_LIT146,intString(_parentIdx));
  tmpMeta40 = stringAppend(tmpMeta39,intString(_childIdx));
  tmpMeta41 = stringAppend(_OMC_LIT147,intString(_childIdx));
  tmpMeta42 = stringAppend(_OMC_LIT147,intString(_parentIdx));
  tmpMeta44 = mmc_mk_box2(0, mmc_mk_integer(_commCostAttIdx), _commCostString);
  tmpMeta45 = mmc_mk_box2(0, mmc_mk_integer(_commVarsAttIdx), _numOfCommVarsString);
  tmpMeta46 = mmc_mk_box2(0, mmc_mk_integer(_commVarsAttIntIdx), _numOfCommVarsIntString);
  tmpMeta47 = mmc_mk_box2(0, mmc_mk_integer(_commVarsAttFloatIdx), _numOfCommVarsFloatString);
  tmpMeta48 = mmc_mk_box2(0, mmc_mk_integer(_commVarsAttBoolIdx), _numOfCommVarsBoolString);
  tmpMeta43 = mmc_mk_cons(tmpMeta44, mmc_mk_cons(tmpMeta45, mmc_mk_cons(tmpMeta46, mmc_mk_cons(tmpMeta47, mmc_mk_cons(tmpMeta48, MMC_REFSTRUCTLIT(mmc_nil))))));
  tmpMeta49 = omc_GraphML_addEdge(threadData, tmpMeta40, tmpMeta41, tmpMeta42, _edgeColor, _OMC_LIT148, _lineWidth, 0 /* false */, _edgeLabels, _OMC_LIT151, tmpMeta43, _iGraph, &tmpMeta38);
  _tmpGraph = tmpMeta49;
  

  _oGraph = _tmpGraph;
  _return: OMC_LABEL_UNUSED
  return _oGraph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addDepToGraph(threadData_t *threadData, modelica_metatype _childIdx, modelica_metatype _parentIdx, modelica_metatype _tGraphDataIn, modelica_metatype _iCommAttIdc, modelica_metatype _iCriticalPathEdges, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _oGraph = NULL;
  tmp1 = mmc_unbox_integer(_childIdx);
  tmp2 = mmc_unbox_integer(_parentIdx);
  _oGraph = omc_HpcOmTaskGraph_addDepToGraph(threadData, tmp1, tmp2, _tGraphDataIn, _iCommAttIdc, _iCriticalPathEdges, _iGraphDumpOptions, _iGraph);
  /* skip box _oGraph; GraphML.GraphInfo */
  return _oGraph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addNodeToGraphML1(threadData_t *threadData, modelica_integer _compIdx, modelica_metatype _exeCosts, modelica_metatype _exeCostsIn)
{
  modelica_metatype _exeCostsOut = NULL;
  modelica_integer _opCount;
  modelica_integer _opCountIn;
  modelica_real _exeTimeIn;
  modelica_real _exeTime;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_real tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_real tmp10;
  modelica_metatype tmpMeta11;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _exeCostsOut has no default value.
  // _opCount has no default value.
  // _opCountIn has no default value.
  // _exeTimeIn has no default value.
  // _exeTime has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _exeCostsIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_real(tmpMeta4);
  _opCountIn = tmp3  /* pattern as ty=Integer */;
  _exeTimeIn = tmp5  /* pattern as ty=Real */;

  /* Pattern-matching assignment */
  tmpMeta6 = arrayGet(_exeCosts, _compIdx);
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
  tmp8 = mmc_unbox_integer(tmpMeta7);
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
  tmp10 = mmc_unbox_real(tmpMeta9);
  _opCount = tmp8  /* pattern as ty=Integer */;
  _exeTime = tmp10  /* pattern as ty=Real */;

  tmpMeta11 = mmc_mk_box2(0, mmc_mk_integer(_opCountIn + _opCount), mmc_mk_real(_exeTimeIn + _exeTime));
  _exeCostsOut = tmpMeta11;
  _return: OMC_LABEL_UNUSED
  return _exeCostsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addNodeToGraphML1(threadData_t *threadData, modelica_metatype _compIdx, modelica_metatype _exeCosts, modelica_metatype _exeCostsIn)
{
  modelica_integer tmp1;
  modelica_metatype _exeCostsOut = NULL;
  tmp1 = mmc_unbox_integer(_compIdx);
  _exeCostsOut = omc_HpcOmTaskGraph_addNodeToGraphML1(threadData, tmp1, _exeCosts, _exeCostsIn);
  /* skip box _exeCostsOut; tuple<#Integer, #Real> */
  return _exeCostsOut;
}

static modelica_metatype closure18_HpcOmTaskGraph_addDepToGraph(threadData_t *thData, modelica_metatype closure, modelica_metatype childIdx, modelica_metatype iGraph)
{
  modelica_metatype parentIdx = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype tGraphDataIn = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype iCommAttIdc = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype iCriticalPathEdges = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  modelica_metatype iGraphDumpOptions = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),5));
  return boxptr_HpcOmTaskGraph_addDepToGraph(thData, childIdx, parentIdx, tGraphDataIn, iCommAttIdc, iCriticalPathEdges, iGraphDumpOptions, iGraph);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_addNodeToGraphML(threadData_t *threadData, modelica_integer _nodeIdx, modelica_metatype _tGraphDataTuple, modelica_metatype _attIdc, modelica_metatype _sccSimEqMapping, modelica_metatype _iSchedulerInfoCritPath, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph)
{
  modelica_metatype _oGraph = NULL;
  modelica_metatype _tGraphIn = NULL;
  modelica_metatype _tGraphDataIn = NULL;
  modelica_metatype _tmpGraph = NULL;
  modelica_integer _graphIdx;
  modelica_integer _opCount;
  modelica_integer _nameAttIdx;
  modelica_integer _calcTimeAttIdx;
  modelica_integer _opCountAttIdx;
  modelica_integer _taskIdAttIdx;
  modelica_integer _compsIdAttIdx;
  modelica_integer _yCoordAttIdx;
  modelica_integer _commCostAttIdx;
  modelica_integer _commVarsAttIdx;
  modelica_integer _commVarsAttIntIdx;
  modelica_integer _commVarsAttFloatIdx;
  modelica_integer _commVarsAttBoolIdx;
  modelica_integer _yCoord;
  modelica_integer _simCodeEqAttIdx;
  modelica_integer _threadIdAttIdx;
  modelica_integer _taskNumberAttIdx;
  modelica_integer _annotationAttIdx;
  modelica_integer _partOfEventAttIdx;
  modelica_integer _partOfOdeAttIdx;
  modelica_integer _removedCompAttIdx;
  modelica_real _calcTime;
  modelica_real _taskFinishTime;
  modelica_real _taskStartTime;
  modelica_integer _primalComp;
  modelica_metatype _childNodes = NULL;
  modelica_metatype _components = NULL;
  modelica_metatype _simCodeEqs = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _annotationInfo = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_string _calcTimeString = NULL;
  modelica_string _opCountString = NULL;
  modelica_string _yCoordString = NULL;
  modelica_string _taskFinishTimeString = NULL;
  modelica_string _taskStartTimeString = NULL;
  modelica_string _compText = NULL;
  modelica_string _compsText = NULL;
  modelica_string _description = NULL;
  modelica_string _nodeDesc = NULL;
  modelica_string _componentsString = NULL;
  modelica_string _simCodeEqString = NULL;
  modelica_string _threadIdxString = NULL;
  modelica_string _taskNumberString = NULL;
  modelica_string _annotationString = NULL;
  modelica_integer _schedulerThreadId;
  modelica_integer _schedulerTaskNumber;
  modelica_metatype _nodeLabels = NULL;
  modelica_metatype _schedulerInfo = NULL;
  modelica_metatype _criticalPath = NULL;
  modelica_metatype _criticalPathWoC = NULL;
  modelica_boolean _visualizeTaskStartAndFinishTime;
  modelica_boolean _visualizeTaskCalcTime;
  modelica_boolean _isPartOfODESystem;
  modelica_boolean _isPartOfZeroFuncSystem;
  modelica_boolean _isRemovedComponent;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_integer tmp4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_integer tmp17;
  modelica_metatype tmpMeta18;
  modelica_integer tmp19;
  modelica_metatype tmpMeta20;
  modelica_integer tmp21;
  modelica_metatype tmpMeta22;
  modelica_integer tmp23;
  modelica_metatype tmpMeta24;
  modelica_integer tmp25;
  modelica_metatype tmpMeta26;
  modelica_integer tmp27;
  modelica_metatype tmpMeta28;
  modelica_integer tmp29;
  modelica_metatype tmpMeta30;
  modelica_integer tmp31;
  modelica_metatype tmpMeta32;
  modelica_integer tmp33;
  modelica_metatype tmpMeta34;
  modelica_integer tmp35;
  modelica_metatype tmpMeta36;
  modelica_integer tmp37;
  modelica_metatype tmpMeta38;
  modelica_integer tmp39;
  modelica_metatype tmpMeta40;
  modelica_integer tmp41;
  modelica_metatype tmpMeta42;
  modelica_integer tmp43;
  modelica_metatype tmpMeta44;
  modelica_integer tmp45;
  modelica_metatype tmpMeta46;
  modelica_integer tmp47;
  modelica_metatype tmpMeta48;
  modelica_integer tmp49;
  modelica_metatype tmpMeta50;
  modelica_integer tmp51;
  modelica_metatype tmpMeta52;
  modelica_metatype tmpMeta53;
  modelica_metatype tmpMeta54;
  modelica_metatype tmpMeta55;
  modelica_metatype tmpMeta56;
  modelica_metatype tmpMeta57;
  modelica_metatype tmpMeta58;
  modelica_integer tmp59;
  modelica_metatype tmpMeta60;
  modelica_integer tmp61;
  modelica_metatype tmpMeta62;
  modelica_metatype tmpMeta63;
  modelica_integer tmp64;
  modelica_metatype tmpMeta65;
  modelica_integer tmp66;
  modelica_metatype tmpMeta67;
  modelica_integer tmp68;
  modelica_metatype tmpMeta69;
  modelica_metatype tmpMeta70;
  modelica_integer tmp71;
  modelica_metatype tmpMeta72;
  modelica_real tmp73;
  modelica_metatype tmpMeta74;
  modelica_metatype tmpMeta75;
  modelica_real tmp76;
  modelica_metatype tmpMeta77;
  modelica_metatype tmpMeta78;
  modelica_integer tmp79;
  modelica_metatype tmpMeta80;
  modelica_real tmp81;
  modelica_metatype tmpMeta82;
  modelica_metatype tmpMeta83;
  modelica_metatype tmpMeta84;
  modelica_metatype tmpMeta85;
  modelica_metatype tmpMeta86;
  modelica_metatype tmpMeta87;
  modelica_integer tmp88;
  modelica_metatype tmpMeta89;
  modelica_integer tmp90;
  modelica_metatype tmpMeta91;
  modelica_real tmp92;
  modelica_metatype tmpMeta93;
  modelica_metatype tmpMeta94;
  modelica_metatype tmpMeta95;
  modelica_metatype tmpMeta96;
  modelica_metatype tmpMeta97;
  modelica_boolean tmp98;
  modelica_metatype tmpMeta99;
  modelica_metatype tmpMeta100;
  modelica_metatype tmpMeta101;
  modelica_metatype tmpMeta102;
  modelica_boolean tmp103;
  modelica_metatype tmpMeta104;
  modelica_metatype tmpMeta105;
  modelica_metatype tmpMeta106;
  modelica_metatype tmpMeta107;
  modelica_metatype tmpMeta108;
  modelica_metatype tmpMeta109;
  modelica_metatype tmpMeta110;
  modelica_metatype tmpMeta111;
  modelica_metatype tmpMeta112;
  modelica_metatype tmpMeta113;
  modelica_metatype tmpMeta114;
  modelica_metatype tmpMeta115;
  modelica_metatype tmpMeta116;
  modelica_metatype tmpMeta117;
  modelica_metatype tmpMeta118;
  modelica_metatype tmpMeta119;
  modelica_metatype tmpMeta120;
  modelica_metatype tmpMeta121;
  modelica_metatype tmpMeta122;
  modelica_metatype tmpMeta123;
  modelica_metatype tmpMeta124;
  modelica_metatype tmpMeta125;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oGraph has no default value.
  // _tGraphIn has no default value.
  // _tGraphDataIn has no default value.
  // _tmpGraph has no default value.
  // _graphIdx has no default value.
  // _opCount has no default value.
  // _nameAttIdx has no default value.
  // _calcTimeAttIdx has no default value.
  // _opCountAttIdx has no default value.
  // _taskIdAttIdx has no default value.
  // _compsIdAttIdx has no default value.
  // _yCoordAttIdx has no default value.
  // _commCostAttIdx has no default value.
  // _commVarsAttIdx has no default value.
  // _commVarsAttIntIdx has no default value.
  // _commVarsAttFloatIdx has no default value.
  // _commVarsAttBoolIdx has no default value.
  // _yCoord has no default value.
  // _simCodeEqAttIdx has no default value.
  // _threadIdAttIdx has no default value.
  // _taskNumberAttIdx has no default value.
  // _annotationAttIdx has no default value.
  // _partOfEventAttIdx has no default value.
  // _partOfOdeAttIdx has no default value.
  // _removedCompAttIdx has no default value.
  // _calcTime has no default value.
  // _taskFinishTime has no default value.
  // _taskStartTime has no default value.
  // _primalComp has no default value.
  // _childNodes has no default value.
  // _components has no default value.
  // _simCodeEqs has no default value.
  // _eqCompMapping has no default value.
  // _exeCosts has no default value.
  // _nodeMark has no default value.
  // _inComps has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _annotationInfo has no default value.
  // _commCosts has no default value.
  // _calcTimeString has no default value.
  // _opCountString has no default value.
  // _yCoordString has no default value.
  // _taskFinishTimeString has no default value.
  // _taskStartTimeString has no default value.
  // _compText has no default value.
  // _compsText has no default value.
  // _description has no default value.
  // _nodeDesc has no default value.
  // _componentsString has no default value.
  // _simCodeEqString has no default value.
  // _threadIdxString has no default value.
  // _taskNumberString has no default value.
  // _annotationString has no default value.
  // _schedulerThreadId has no default value.
  // _schedulerTaskNumber has no default value.
  // _nodeLabels has no default value.
  // _schedulerInfo has no default value.
  // _criticalPath has no default value.
  // _criticalPathWoC has no default value.
  // _visualizeTaskStartAndFinishTime has no default value.
  // _visualizeTaskCalcTime has no default value.
  // _isPartOfODESystem has no default value.
  // _isPartOfZeroFuncSystem has no default value.
  // _isRemovedComponent has no default value.
  // _compInformations has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iGraph;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp4 = mmc_unbox_integer(tmpMeta3);
  _tmpGraph = tmpMeta2;
  _graphIdx = tmp4  /* pattern as ty=Integer */;

  if((_nodeIdx > ((modelica_integer) 0)))
  {
    /* Pattern-matching assignment */
    tmpMeta5 = _tGraphDataTuple;
    tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
    tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
    _tGraphIn = tmpMeta6;
    _tGraphDataIn = tmpMeta7;

    /* Pattern-matching assignment */
    tmpMeta8 = _tGraphDataIn;
    tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
    tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 6));
    tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 7));
    tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 8));
    tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 10));
    tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 11));
    _inComps = tmpMeta9;
    _compNames = tmpMeta10;
    _compDescs = tmpMeta11;
    _exeCosts = tmpMeta12;
    _nodeMark = tmpMeta13;
    _compInformations = tmpMeta14;

    /* Pattern-matching assignment */
    tmpMeta15 = _attIdc;
    tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 1));
    tmp17 = mmc_unbox_integer(tmpMeta16);
    tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
    tmp19 = mmc_unbox_integer(tmpMeta18);
    tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
    tmp21 = mmc_unbox_integer(tmpMeta20);
    tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 4));
    tmp23 = mmc_unbox_integer(tmpMeta22);
    tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 5));
    tmp25 = mmc_unbox_integer(tmpMeta24);
    tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 6));
    tmp27 = mmc_unbox_integer(tmpMeta26);
    tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 7));
    tmp29 = mmc_unbox_integer(tmpMeta28);
    tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 8));
    tmp31 = mmc_unbox_integer(tmpMeta30);
    tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 9));
    tmp33 = mmc_unbox_integer(tmpMeta32);
    tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 10));
    tmp35 = mmc_unbox_integer(tmpMeta34);
    tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 11));
    tmp37 = mmc_unbox_integer(tmpMeta36);
    tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 12));
    tmp39 = mmc_unbox_integer(tmpMeta38);
    tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 13));
    tmp41 = mmc_unbox_integer(tmpMeta40);
    tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 14));
    tmp43 = mmc_unbox_integer(tmpMeta42);
    tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 15));
    tmp45 = mmc_unbox_integer(tmpMeta44);
    tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 16));
    tmp47 = mmc_unbox_integer(tmpMeta46);
    tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 17));
    tmp49 = mmc_unbox_integer(tmpMeta48);
    tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 18));
    tmp51 = mmc_unbox_integer(tmpMeta50);
    _nameAttIdx = tmp17  /* pattern as ty=Integer */;
    _opCountAttIdx = tmp19  /* pattern as ty=Integer */;
    _calcTimeAttIdx = tmp21  /* pattern as ty=Integer */;
    _taskIdAttIdx = tmp23  /* pattern as ty=Integer */;
    _compsIdAttIdx = tmp25  /* pattern as ty=Integer */;
    _yCoordAttIdx = tmp27  /* pattern as ty=Integer */;
    _commCostAttIdx = tmp29  /* pattern as ty=Integer */;
    _commVarsAttIdx = tmp31  /* pattern as ty=Integer */;
    _commVarsAttIntIdx = tmp33  /* pattern as ty=Integer */;
    _commVarsAttFloatIdx = tmp35  /* pattern as ty=Integer */;
    _commVarsAttBoolIdx = tmp37  /* pattern as ty=Integer */;
    _simCodeEqAttIdx = tmp39  /* pattern as ty=Integer */;
    _threadIdAttIdx = tmp41  /* pattern as ty=Integer */;
    _taskNumberAttIdx = tmp43  /* pattern as ty=Integer */;
    _annotationAttIdx = tmp45  /* pattern as ty=Integer */;
    _partOfEventAttIdx = tmp47  /* pattern as ty=Integer */;
    _partOfOdeAttIdx = tmp49  /* pattern as ty=Integer */;
    _removedCompAttIdx = tmp51  /* pattern as ty=Integer */;

    /* Pattern-matching assignment */
    tmpMeta52 = _iSchedulerInfoCritPath;
    tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 1));
    tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 2));
    tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 3));
    tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta52), 4));
    _criticalPath = tmpMeta53;
    _criticalPathWoC = tmpMeta54;
    _schedulerInfo = tmpMeta55;
    _annotationInfo = tmpMeta56;

    /* Pattern-matching assignment */
    tmpMeta57 = _iGraphDumpOptions;
    tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta57), 3));
    tmp59 = mmc_unbox_integer(tmpMeta58);
    tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta57), 4));
    tmp61 = mmc_unbox_integer(tmpMeta60);
    _visualizeTaskStartAndFinishTime = tmp59  /* pattern as ty=Boolean */;
    _visualizeTaskCalcTime = tmp61  /* pattern as ty=Boolean */;

    _components = arrayGet(_inComps, _nodeIdx);

    /* Pattern-matching assignment */
    tmpMeta62 = omc_HpcOmTaskGraph_getNodeMembershipByComponents(threadData, _components, _compInformations);
    tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta62), 1));
    tmp64 = mmc_unbox_integer(tmpMeta63);
    tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta62), 2));
    tmp66 = mmc_unbox_integer(tmpMeta65);
    tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta62), 3));
    tmp68 = mmc_unbox_integer(tmpMeta67);
    _isPartOfODESystem = tmp64  /* pattern as ty=Boolean */;
    _isPartOfZeroFuncSystem = tmp66  /* pattern as ty=Boolean */;
    _isRemovedComponent = tmp68  /* pattern as ty=Boolean */;

    if((listLength(_components) != ((modelica_integer) 1)))
    {
      _primalComp = mmc_unbox_integer(omc_List_last(threadData, _components));

      _simCodeEqs = omc_List_flatten(threadData, omc_List_map1(threadData, _components, boxvar_Array_getIndexFirst, _sccSimEqMapping));

      _nodeDesc = stringDelimitList(omc_List_map1(threadData, _components, boxvar_Array_getIndexFirst, _compDescs), _OMC_LIT5);

      /* Pattern-matching assignment */
      tmpMeta69 = omc_List_fold1(threadData, _components, boxvar_HpcOmTaskGraph_addNodeToGraphML1, _exeCosts, _OMC_LIT42);
      tmpMeta70 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta69), 1));
      tmp71 = mmc_unbox_integer(tmpMeta70);
      tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta69), 2));
      tmp73 = mmc_unbox_real(tmpMeta72);
      _opCount = tmp71  /* pattern as ty=Integer */;
      _calcTime = tmp73  /* pattern as ty=Real */;
    }
    else
    {
      _primalComp = mmc_unbox_integer(listGet(_components, ((modelica_integer) 1)));

      _simCodeEqs = arrayGet(_sccSimEqMapping, _primalComp);

      _nodeDesc = arrayGet(_compDescs, _primalComp);

      /* Pattern-matching assignment */
      tmpMeta74 = arrayGet(_exeCosts, _primalComp);
      tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta74), 2));
      tmp76 = mmc_unbox_real(tmpMeta75);
      _calcTime = tmp76  /* pattern as ty=Real */;

      /* Pattern-matching assignment */
      tmpMeta77 = arrayGet(_exeCosts, _primalComp);
      tmpMeta78 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta77), 1));
      tmp79 = mmc_unbox_integer(tmpMeta78);
      tmpMeta80 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta77), 2));
      tmp81 = mmc_unbox_real(tmpMeta80);
      _opCount = tmp79  /* pattern as ty=Integer */;
      _calcTime = tmp81  /* pattern as ty=Real */;
    }

    _compText = arrayGet(_compNames, _primalComp);

    tmpMeta82 = stringAppend(_OMC_LIT159,stringDelimitList(omc_List_map(threadData, _components, boxvar_intString), _OMC_LIT31));
    tmpMeta83 = stringAppend(tmpMeta82,_OMC_LIT3);
    _compsText = tmpMeta83;

    _annotationString = arrayGet(_annotationInfo, _nodeIdx);

    _calcTimeString = realString(_calcTime);

    _yCoord = (((modelica_integer) 100)) * (mmc_unbox_integer(arrayGet(_nodeMark, _nodeIdx)));

    _opCountString = intString(_opCount);

    _yCoordString = intString(_yCoord);

    _childNodes = arrayGet(_tGraphIn, _nodeIdx);

    _simCodeEqString = stringDelimitList(omc_List_map(threadData, _simCodeEqs, boxvar_intString), _OMC_LIT116);

    tmpMeta84 = stringAppend(_OMC_LIT0,intString(_nodeIdx));
    tmpMeta85 = stringAppend(tmpMeta84,_OMC_LIT0);
    _componentsString = tmpMeta85;

    /* Pattern-matching assignment */
    tmpMeta86 = arrayGet(_schedulerInfo, _nodeIdx);
    tmpMeta87 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta86), 1));
    tmp88 = mmc_unbox_integer(tmpMeta87);
    tmpMeta89 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta86), 2));
    tmp90 = mmc_unbox_integer(tmpMeta89);
    tmpMeta91 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta86), 3));
    tmp92 = mmc_unbox_real(tmpMeta91);
    _schedulerThreadId = tmp88  /* pattern as ty=Integer */;
    _schedulerTaskNumber = tmp90  /* pattern as ty=Integer */;
    _taskFinishTime = tmp92  /* pattern as ty=Real */;

    _taskStartTime = _taskFinishTime - _calcTime;

    tmpMeta93 = stringAppend(_OMC_LIT160,intString(_schedulerThreadId));
    _threadIdxString = tmpMeta93;

    _taskNumberString = intString(_schedulerTaskNumber);

    _calcTimeString = omc_System_snprintff(threadData, _OMC_LIT145, ((modelica_integer) 25), _calcTime);

    _taskFinishTimeString = omc_System_snprintff(threadData, _OMC_LIT145, ((modelica_integer) 25), _taskFinishTime);

    _taskStartTimeString = omc_System_snprintff(threadData, _OMC_LIT145, ((modelica_integer) 25), _taskStartTime);

    tmpMeta95 = mmc_mk_box4(3, &GraphML_NodeLabel_NODELABEL__INTERNAL__desc, _componentsString, mmc_mk_none(), _OMC_LIT161);
    tmpMeta94 = mmc_mk_cons(tmpMeta95, MMC_REFSTRUCTLIT(mmc_nil));
    _nodeLabels = tmpMeta94;

    tmp98 = (modelica_boolean)_visualizeTaskCalcTime;
    if(tmp98)
    {
      tmpMeta97 = mmc_mk_box5(4, &GraphML_NodeLabel_NODELABEL__CORNER__desc, _calcTimeString, _OMC_LIT163, _OMC_LIT164, _OMC_LIT165);
      tmpMeta96 = mmc_mk_cons(tmpMeta97, _nodeLabels);
      tmpMeta99 = tmpMeta96;
    }
    else
    {
      tmpMeta99 = _nodeLabels;
    }
    _nodeLabels = tmpMeta99;

    tmp103 = (modelica_boolean)_visualizeTaskStartAndFinishTime;
    if(tmp103)
    {
      tmpMeta101 = mmc_mk_box5(4, &GraphML_NodeLabel_NODELABEL__CORNER__desc, _taskStartTimeString, _OMC_LIT167, _OMC_LIT164, _OMC_LIT168);
      tmpMeta102 = mmc_mk_box5(4, &GraphML_NodeLabel_NODELABEL__CORNER__desc, _taskFinishTimeString, _OMC_LIT170, _OMC_LIT164, _OMC_LIT171);
      tmpMeta100 = mmc_mk_cons(tmpMeta101, mmc_mk_cons(tmpMeta102, MMC_REFSTRUCTLIT(mmc_nil)));
      tmpMeta104 = listAppend(_nodeLabels, tmpMeta100);
    }
    else
    {
      tmpMeta104 = _nodeLabels;
    }
    _nodeLabels = tmpMeta104;

    /* Pattern-matching tuple assignment */
    tmpMeta106 = stringAppend(_OMC_LIT147,intString(_nodeIdx));
    tmpMeta108 = mmc_mk_box2(0, mmc_mk_integer(_nameAttIdx), _compText);
    tmpMeta109 = mmc_mk_box2(0, mmc_mk_integer(_calcTimeAttIdx), _calcTimeString);
    tmpMeta110 = mmc_mk_box2(0, mmc_mk_integer(_opCountAttIdx), _opCountString);
    tmpMeta111 = mmc_mk_box2(0, mmc_mk_integer(_taskIdAttIdx), _componentsString);
    tmpMeta112 = mmc_mk_box2(0, mmc_mk_integer(_compsIdAttIdx), _compsText);
    tmpMeta113 = mmc_mk_box2(0, mmc_mk_integer(_yCoordAttIdx), _yCoordString);
    tmpMeta114 = mmc_mk_box2(0, mmc_mk_integer(_simCodeEqAttIdx), _simCodeEqString);
    tmpMeta115 = mmc_mk_box2(0, mmc_mk_integer(_threadIdAttIdx), _threadIdxString);
    tmpMeta116 = mmc_mk_box2(0, mmc_mk_integer(_taskNumberAttIdx), _taskNumberString);
    tmpMeta117 = mmc_mk_box2(0, mmc_mk_integer(_annotationAttIdx), _annotationString);
    tmpMeta118 = mmc_mk_box2(0, mmc_mk_integer(_partOfEventAttIdx), (_isPartOfODESystem?_OMC_LIT102:_OMC_LIT103));
    tmpMeta119 = mmc_mk_box2(0, mmc_mk_integer(_partOfOdeAttIdx), (_isPartOfZeroFuncSystem?_OMC_LIT102:_OMC_LIT103));
    tmpMeta120 = mmc_mk_box2(0, mmc_mk_integer(_removedCompAttIdx), (_isRemovedComponent?_OMC_LIT102:_OMC_LIT103));
    tmpMeta107 = mmc_mk_cons(tmpMeta108, mmc_mk_cons(tmpMeta109, mmc_mk_cons(tmpMeta110, mmc_mk_cons(tmpMeta111, mmc_mk_cons(tmpMeta112, mmc_mk_cons(tmpMeta113, mmc_mk_cons(tmpMeta114, mmc_mk_cons(tmpMeta115, mmc_mk_cons(tmpMeta116, mmc_mk_cons(tmpMeta117, mmc_mk_cons(tmpMeta118, mmc_mk_cons(tmpMeta119, mmc_mk_cons(tmpMeta120, MMC_REFSTRUCTLIT(mmc_nil))))))))))))));
    tmpMeta121 = omc_GraphML_addNode(threadData, tmpMeta106, _OMC_LIT172, 1.0, _nodeLabels, _OMC_LIT173, mmc_mk_some(_nodeDesc), tmpMeta107, _graphIdx, _tmpGraph, &tmpMeta105);
    _tmpGraph = tmpMeta121;
    

    tmpMeta123 = mmc_mk_box5(0, mmc_mk_integer(_commCostAttIdx), mmc_mk_integer(_commVarsAttIdx), mmc_mk_integer(_commVarsAttIntIdx), mmc_mk_integer(_commVarsAttFloatIdx), mmc_mk_integer(_commVarsAttBoolIdx));
    tmpMeta124 = mmc_mk_box2(0, _criticalPath, _criticalPathWoC);
    tmpMeta122 = mmc_mk_box5(0, mmc_mk_integer(_nodeIdx), _tGraphDataIn, tmpMeta123, tmpMeta124, _iGraphDumpOptions);
    _tmpGraph = omc_List_fold(threadData, _childNodes, (modelica_fnptr) mmc_mk_box2(0,closure18_HpcOmTaskGraph_addDepToGraph,tmpMeta122), _tmpGraph);
  }
  else
  {
    omc_Error_addMessage(threadData, _OMC_LIT156, _OMC_LIT158);
  }

  tmpMeta125 = mmc_mk_box2(0, _tmpGraph, mmc_mk_integer(_graphIdx));
  _oGraph = tmpMeta125;
  _return: OMC_LABEL_UNUSED
  return _oGraph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_addNodeToGraphML(threadData_t *threadData, modelica_metatype _nodeIdx, modelica_metatype _tGraphDataTuple, modelica_metatype _attIdc, modelica_metatype _sccSimEqMapping, modelica_metatype _iSchedulerInfoCritPath, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraph)
{
  modelica_integer tmp1;
  modelica_metatype _oGraph = NULL;
  tmp1 = mmc_unbox_integer(_nodeIdx);
  _oGraph = omc_HpcOmTaskGraph_addNodeToGraphML(threadData, tmp1, _tGraphDataTuple, _attIdc, _sccSimEqMapping, _iSchedulerInfoCritPath, _iGraphDumpOptions, _iGraph);
  /* skip box _oGraph; tuple<GraphML.GraphInfo, #Integer> */
  return _oGraph;
}

static modelica_metatype closure19_HpcOmTaskGraph_addNodeToGraphML(threadData_t *thData, modelica_metatype closure, modelica_metatype nodeIdx, modelica_metatype iGraph)
{
  modelica_metatype tGraphDataTuple = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype attIdc = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype sccSimEqMapping = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype iSchedulerInfoCritPath = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  modelica_metatype iGraphDumpOptions = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),5));
  return boxptr_HpcOmTaskGraph_addNodeToGraphML(thData, nodeIdx, tGraphDataTuple, attIdc, sccSimEqMapping, iSchedulerInfoCritPath, iGraphDumpOptions, iGraph);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_convertToGraphMLSccLevelSubgraph(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_string _iCriticalPathInfo, modelica_metatype _iCriticalPath, modelica_metatype _iCriticalPathWoC, modelica_metatype _iSccSimEqMapping, modelica_metatype _iSchedulerInfo, modelica_metatype _iAnnotationInfo, modelica_integer _iGraphIdx, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraphInfo)
{
  modelica_metatype _oGraphInfo = NULL;
  modelica_metatype _graphInfo = NULL;
  modelica_integer _nameAttIdx;
  modelica_integer _calcTimeAttIdx;
  modelica_integer _opCountAttIdx;
  modelica_integer _yCoordAttIdx;
  modelica_integer _taskIdAttIdx;
  modelica_integer _commCostAttIdx;
  modelica_integer _commVarsAttIdx;
  modelica_integer _commVarsIntAttIdx;
  modelica_integer _commVarsFloatAttIdx;
  modelica_integer _commVarsBoolAttIdx;
  modelica_integer _critPathAttIdx;
  modelica_integer _simCodeEqAttIdx;
  modelica_integer _threadIdAttIdx;
  modelica_integer _taskNumberAttIdx;
  modelica_integer _annotAttIdx;
  modelica_integer _compsIdAttIdx;
  modelica_integer _partOfEventAttIdx;
  modelica_integer _partOfOdeAttIdx;
  modelica_integer _removedCompAttIdx;
  modelica_metatype _nodeIdc = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oGraphInfo has no default value.
  // _graphInfo has no default value.
  // _nameAttIdx has no default value.
  // _calcTimeAttIdx has no default value.
  // _opCountAttIdx has no default value.
  // _yCoordAttIdx has no default value.
  // _taskIdAttIdx has no default value.
  // _commCostAttIdx has no default value.
  // _commVarsAttIdx has no default value.
  // _commVarsIntAttIdx has no default value.
  // _commVarsFloatAttIdx has no default value.
  // _commVarsBoolAttIdx has no default value.
  // _critPathAttIdx has no default value.
  // _simCodeEqAttIdx has no default value.
  // _threadIdAttIdx has no default value.
  // _taskNumberAttIdx has no default value.
  // _annotAttIdx has no default value.
  // _compsIdAttIdx has no default value.
  // _partOfEventAttIdx has no default value.
  // _partOfOdeAttIdx has no default value.
  // _removedCompAttIdx has no default value.
  // _nodeIdc has no default value.
  { /* match expression */
    {
      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_integer tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_integer tmp16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_integer tmp24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_integer tmp28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_integer tmp32;
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          modelica_integer tmp36;
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta38;
          modelica_metatype tmpMeta39;
          modelica_integer tmp40;
          modelica_metatype tmpMeta41;
          modelica_metatype tmpMeta42;
          modelica_metatype tmpMeta43;
          modelica_integer tmp44;
          modelica_metatype tmpMeta45;
          modelica_metatype tmpMeta46;
          modelica_metatype tmpMeta47;
          modelica_integer tmp48;
          modelica_metatype tmpMeta49;
          modelica_metatype tmpMeta50;
          modelica_metatype tmpMeta51;
          modelica_integer tmp52;
          modelica_metatype tmpMeta53;
          modelica_metatype tmpMeta54;
          modelica_metatype tmpMeta55;
          modelica_integer tmp56;
          modelica_metatype tmpMeta57;
          modelica_metatype tmpMeta58;
          modelica_metatype tmpMeta59;
          modelica_integer tmp60;
          modelica_metatype tmpMeta61;
          modelica_metatype tmpMeta62;
          modelica_metatype tmpMeta63;
          modelica_integer tmp64;
          modelica_metatype tmpMeta65;
          modelica_metatype tmpMeta66;
          modelica_metatype tmpMeta67;
          modelica_integer tmp68;
          modelica_metatype tmpMeta69;
          modelica_metatype tmpMeta70;
          modelica_metatype tmpMeta71;
          modelica_integer tmp72;
          modelica_metatype tmpMeta73;
          modelica_metatype tmpMeta74;
          modelica_metatype tmpMeta75;
          modelica_integer tmp76;
          modelica_metatype tmpMeta77;
          modelica_metatype tmpMeta78;
          modelica_metatype tmpMeta79;
          modelica_integer tmp80;
          modelica_metatype tmpMeta81;
          modelica_metatype tmpMeta82;
          modelica_metatype tmpMeta83;
          modelica_metatype tmpMeta84;
          modelica_metatype tmpMeta85;
          modelica_metatype tmpMeta86;
          modelica_metatype tmpMeta87;
          modelica_metatype tmpMeta88;
          modelica_metatype tmpMeta89;
          /* Pattern matching succeeded */
          /* Pattern-matching tuple assignment */
          tmpMeta9 = omc_GraphML_addAttribute(threadData, _OMC_LIT93, _OMC_LIT174, _OMC_LIT175, _OMC_LIT176, _iGraphInfo, &tmpMeta6);
          _graphInfo = tmpMeta9;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          _nameAttIdx = tmp8  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta13 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT178, _OMC_LIT179, _OMC_LIT176, _graphInfo, &tmpMeta10);
          _graphInfo = tmpMeta13;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
          tmp12 = mmc_unbox_integer(tmpMeta11);
          _opCountAttIdx = tmp12  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta17 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT180, _OMC_LIT181, _OMC_LIT176, _graphInfo, &tmpMeta14);
          _graphInfo = tmpMeta17;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta14), 2));
          tmp16 = mmc_unbox_integer(tmpMeta15);
          _calcTimeAttIdx = tmp16  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta21 = omc_GraphML_addAttribute(threadData, _OMC_LIT93, _OMC_LIT182, _OMC_LIT175, _OMC_LIT176, _graphInfo, &tmpMeta18);
          _graphInfo = tmpMeta21;
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 2));
          tmp20 = mmc_unbox_integer(tmpMeta19);
          _taskIdAttIdx = tmp20  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta25 = omc_GraphML_addAttribute(threadData, _OMC_LIT93, _OMC_LIT183, _OMC_LIT175, _OMC_LIT176, _graphInfo, &tmpMeta22);
          _graphInfo = tmpMeta25;
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
          tmp24 = mmc_unbox_integer(tmpMeta23);
          _compsIdAttIdx = tmp24  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta29 = omc_GraphML_addAttribute(threadData, _OMC_LIT184, _OMC_LIT185, _OMC_LIT179, _OMC_LIT176, _graphInfo, &tmpMeta26);
          _graphInfo = tmpMeta29;
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
          tmp28 = mmc_unbox_integer(tmpMeta27);
          _yCoordAttIdx = tmp28  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta33 = omc_GraphML_addAttribute(threadData, _OMC_LIT93, _OMC_LIT186, _OMC_LIT175, _OMC_LIT176, _graphInfo, &tmpMeta30);
          _graphInfo = tmpMeta33;
          tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta30), 2));
          tmp32 = mmc_unbox_integer(tmpMeta31);
          _simCodeEqAttIdx = tmp32  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta37 = omc_GraphML_addAttribute(threadData, _OMC_LIT93, _OMC_LIT187, _OMC_LIT175, _OMC_LIT176, _graphInfo, &tmpMeta34);
          _graphInfo = tmpMeta37;
          tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 2));
          tmp36 = mmc_unbox_integer(tmpMeta35);
          _threadIdAttIdx = tmp36  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta41 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT188, _OMC_LIT179, _OMC_LIT176, _graphInfo, &tmpMeta38);
          _graphInfo = tmpMeta41;
          tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta38), 2));
          tmp40 = mmc_unbox_integer(tmpMeta39);
          _taskNumberAttIdx = tmp40  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta45 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT189, _OMC_LIT181, _OMC_LIT190, _graphInfo, &tmpMeta42);
          _graphInfo = tmpMeta45;
          tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 2));
          tmp44 = mmc_unbox_integer(tmpMeta43);
          _commCostAttIdx = tmp44  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta49 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT191, _OMC_LIT179, _OMC_LIT190, _graphInfo, &tmpMeta46);
          _graphInfo = tmpMeta49;
          tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 2));
          tmp48 = mmc_unbox_integer(tmpMeta47);
          _commVarsAttIdx = tmp48  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta53 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT192, _OMC_LIT179, _OMC_LIT190, _graphInfo, &tmpMeta50);
          _graphInfo = tmpMeta53;
          tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta50), 2));
          tmp52 = mmc_unbox_integer(tmpMeta51);
          _commVarsIntAttIdx = tmp52  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta57 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT193, _OMC_LIT179, _OMC_LIT190, _graphInfo, &tmpMeta54);
          _graphInfo = tmpMeta57;
          tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 2));
          tmp56 = mmc_unbox_integer(tmpMeta55);
          _commVarsFloatAttIdx = tmp56  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta61 = omc_GraphML_addAttribute(threadData, _OMC_LIT177, _OMC_LIT194, _OMC_LIT179, _OMC_LIT190, _graphInfo, &tmpMeta58);
          _graphInfo = tmpMeta61;
          tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta58), 2));
          tmp60 = mmc_unbox_integer(tmpMeta59);
          _commVarsBoolAttIdx = tmp60  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta65 = omc_GraphML_addAttribute(threadData, _OMC_LIT195, _OMC_LIT196, _OMC_LIT175, _OMC_LIT176, _graphInfo, &tmpMeta62);
          _graphInfo = tmpMeta65;
          tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta62), 2));
          tmp64 = mmc_unbox_integer(tmpMeta63);
          _annotAttIdx = tmp64  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta69 = omc_GraphML_addAttribute(threadData, _OMC_LIT93, _OMC_LIT197, _OMC_LIT175, _OMC_LIT198, _graphInfo, &tmpMeta66);
          _graphInfo = tmpMeta69;
          tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta66), 2));
          tmp68 = mmc_unbox_integer(tmpMeta67);
          _critPathAttIdx = tmp68  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta73 = omc_GraphML_addAttribute(threadData, _OMC_LIT103, _OMC_LIT199, _OMC_LIT200, _OMC_LIT176, _graphInfo, &tmpMeta70);
          _graphInfo = tmpMeta73;
          tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta70), 2));
          tmp72 = mmc_unbox_integer(tmpMeta71);
          _partOfEventAttIdx = tmp72  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta77 = omc_GraphML_addAttribute(threadData, _OMC_LIT103, _OMC_LIT201, _OMC_LIT200, _OMC_LIT176, _graphInfo, &tmpMeta74);
          _graphInfo = tmpMeta77;
          tmpMeta75 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta74), 2));
          tmp76 = mmc_unbox_integer(tmpMeta75);
          _partOfOdeAttIdx = tmp76  /* pattern as ty=Integer */;

          /* Pattern-matching tuple assignment */
          tmpMeta81 = omc_GraphML_addAttribute(threadData, _OMC_LIT103, _OMC_LIT202, _OMC_LIT200, _OMC_LIT176, _graphInfo, &tmpMeta78);
          _graphInfo = tmpMeta81;
          tmpMeta79 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta78), 2));
          tmp80 = mmc_unbox_integer(tmpMeta79);
          _removedCompAttIdx = tmp80  /* pattern as ty=Integer */;

          tmpMeta82 = mmc_mk_box2(0, mmc_mk_integer(_critPathAttIdx), _iCriticalPathInfo);
          _graphInfo = omc_GraphML_addGraphAttributeValue(threadData, tmpMeta82, _iGraphIdx, _graphInfo);

          _nodeIdc = omc_List_intRange(threadData, arrayLength(_iGraph));

          /* Pattern-matching assignment */
          tmpMeta84 = mmc_mk_box2(0, _iGraph, _iGraphData);
          tmpMeta85 = mmc_mk_box18(0, mmc_mk_integer(_nameAttIdx), mmc_mk_integer(_opCountAttIdx), mmc_mk_integer(_calcTimeAttIdx), mmc_mk_integer(_taskIdAttIdx), mmc_mk_integer(_compsIdAttIdx), mmc_mk_integer(_yCoordAttIdx), mmc_mk_integer(_commCostAttIdx), mmc_mk_integer(_commVarsAttIdx), mmc_mk_integer(_commVarsIntAttIdx), mmc_mk_integer(_commVarsFloatAttIdx), mmc_mk_integer(_commVarsBoolAttIdx), mmc_mk_integer(_simCodeEqAttIdx), mmc_mk_integer(_threadIdAttIdx), mmc_mk_integer(_taskNumberAttIdx), mmc_mk_integer(_annotAttIdx), mmc_mk_integer(_partOfEventAttIdx), mmc_mk_integer(_partOfOdeAttIdx), mmc_mk_integer(_removedCompAttIdx));
          tmpMeta86 = mmc_mk_box4(0, _iCriticalPath, _iCriticalPathWoC, _iSchedulerInfo, _iAnnotationInfo);
          tmpMeta83 = mmc_mk_box5(0, tmpMeta84, tmpMeta85, _iSccSimEqMapping, tmpMeta86, _iGraphDumpOptions);
          tmpMeta87 = mmc_mk_box2(0, _graphInfo, mmc_mk_integer(_iGraphIdx));
          tmpMeta88 = omc_List_fold(threadData, _nodeIdc, (modelica_fnptr) mmc_mk_box2(0,closure19_HpcOmTaskGraph_addNodeToGraphML,tmpMeta83), tmpMeta87);
          tmpMeta89 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta88), 1));
          _graphInfo = tmpMeta89;
          tmpMeta1 = _graphInfo;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oGraphInfo = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oGraphInfo;
}
modelica_metatype boxptr_HpcOmTaskGraph_convertToGraphMLSccLevelSubgraph(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_metatype _iCriticalPathInfo, modelica_metatype _iCriticalPath, modelica_metatype _iCriticalPathWoC, modelica_metatype _iSccSimEqMapping, modelica_metatype _iSchedulerInfo, modelica_metatype _iAnnotationInfo, modelica_metatype _iGraphIdx, modelica_metatype _iGraphDumpOptions, modelica_metatype _iGraphInfo)
{
  modelica_integer tmp1;
  modelica_metatype _oGraphInfo = NULL;
  tmp1 = mmc_unbox_integer(_iGraphIdx);
  _oGraphInfo = omc_HpcOmTaskGraph_convertToGraphMLSccLevelSubgraph(threadData, _iGraph, _iGraphData, _iCriticalPathInfo, _iCriticalPath, _iCriticalPathWoC, _iSccSimEqMapping, _iSchedulerInfo, _iAnnotationInfo, tmp1, _iGraphDumpOptions, _iGraphInfo);
  /* skip box _oGraphInfo; GraphML.GraphInfo */
  return _oGraphInfo;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_convertToGraphMLSccLevel(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_string _iCriticalPathInfo, modelica_metatype _iCriticalPath, modelica_metatype _iCriticalPathWoC, modelica_metatype _iSccSimEqMapping, modelica_metatype _iSchedulerInfo, modelica_metatype _iGraphDumpOptions)
{
  modelica_metatype _oGraphInfo = NULL;
  modelica_integer _graphIdx;
  modelica_metatype _annotationInfo = NULL;
  modelica_metatype _graphInfo = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oGraphInfo has no default value.
  // _graphIdx has no default value.
  // _annotationInfo has no default value.
  // _graphInfo has no default value.
  _graphInfo = omc_GraphML_createGraphInfo(threadData);

  /* Pattern-matching tuple assignment */
  tmpMeta4 = omc_GraphML_addGraph(threadData, _OMC_LIT203, 1 /* true */, _graphInfo, &tmpMeta1);
  _graphInfo = tmpMeta4;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  _graphIdx = tmp3  /* pattern as ty=Integer */;

  _annotationInfo = arrayCreate(arrayLength(_iGraph), _OMC_LIT204);

  _oGraphInfo = omc_HpcOmTaskGraph_convertToGraphMLSccLevelSubgraph(threadData, _iGraph, _iGraphData, _iCriticalPathInfo, _iCriticalPath, _iCriticalPathWoC, _iSccSimEqMapping, _iSchedulerInfo, _annotationInfo, _graphIdx, _iGraphDumpOptions, _graphInfo);
  _return: OMC_LABEL_UNUSED
  return _oGraphInfo;
}

DLLDirection
void omc_HpcOmTaskGraph_dumpAsGraphMLSccLevel(threadData_t *threadData, modelica_metatype _iGraph, modelica_metatype _iGraphData, modelica_string _iFileName, modelica_string _iCriticalPathInfo, modelica_metatype _iCriticalPath, modelica_metatype _iCriticalPathWoC, modelica_metatype _iSccSimEqMapping, modelica_metatype _iSchedulerInfo, modelica_metatype _iGraphDumpOptions)
{
  modelica_metatype _graphInfo = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphInfo has no default value.
  _graphInfo = omc_HpcOmTaskGraph_convertToGraphMLSccLevel(threadData, _iGraph, _iGraphData, _iCriticalPathInfo, _iCriticalPath, _iCriticalPathWoC, _iSccSimEqMapping, _iSchedulerInfo, _iGraphDumpOptions);

  omc_GraphML_dumpGraph(threadData, _graphInfo, _iFileName);
  _return: OMC_LABEL_UNUSED
  return;
}

DLLDirection
void omc_HpcOmTaskGraph_dumpTaskGraph(threadData_t *threadData, modelica_metatype _dae, modelica_string _fileName)
{
  modelica_string _name = NULL;
  modelica_metatype _taskGraph = NULL;
  modelica_metatype _taskGraphData = NULL;
  modelica_metatype _schedulerInfo = NULL;
  modelica_metatype _sccSimEqMapping = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _name has no default value.
  // _taskGraph has no default value.
  // _taskGraphData has no default value.
  // _schedulerInfo has no default value.
  // _sccSimEqMapping has no default value.
  _taskGraph = omc_HpcOmTaskGraph_createTaskGraph(threadData, _dae, 0 /* false */ ,&_taskGraphData);

  tmpMeta1 = stringAppend(_OMC_LIT205,_fileName);
  tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT206);
  _name = tmpMeta2;

  _schedulerInfo = arrayCreate(arrayLength(_taskGraph), _OMC_LIT207);

  _sccSimEqMapping = arrayCreate(arrayLength(_taskGraph), _OMC_LIT208);

  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
  omc_HpcOmTaskGraph_dumpAsGraphMLSccLevel(threadData, _taskGraph, _taskGraphData, _name, _OMC_LIT93, tmpMeta3, tmpMeta4, _sccSimEqMapping, _schedulerInfo, _OMC_LIT209);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_solvesDiscreteValue(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _iOrderedVars, modelica_integer *out_oFirstEqIdx)
{
  modelica_boolean _oSolvesDiscreteValue;
  modelica_integer _oFirstEqIdx;
  modelica_boolean tmp1_c0 __attribute__((unused)) = 0;
  modelica_integer tmp1_c1 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSolvesDiscreteValue has no default value.
  // _oFirstEqIdx has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _inComp;
    {
      modelica_integer _eqn;
      modelica_integer _var;
      modelica_metatype _vars = NULL;
      modelica_metatype _eqns = NULL;
      modelica_metatype _backendVars = NULL;
      modelica_metatype _backendVar = NULL;
      modelica_boolean _solvesDiscreteValue;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _eqn has no default value.
      // _var has no default value.
      // _vars has no default value.
      // _eqns has no default value.
      // _backendVars has no default value.
      // _backendVar has no default value.
      // _solvesDiscreteValue has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 8; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          _eqn = tmp7  /* pattern as ty=Integer */;
          _var = tmp9  /* pattern as ty=Integer */;
          tmp4 += 6; /* Pattern matching succeeded; we may skip some cases if we fail */
          _backendVar = omc_BackendVariable_getVarAt(threadData, _iOrderedVars, _var);

          _solvesDiscreteValue = omc_BackendVariable_isVarDiscrete(threadData, _backendVar);
          tmp1_c0 = _solvesDiscreteValue;
          tmp1_c1 = _eqn;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,5) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _eqns = tmpMeta10;
          _vars = tmpMeta11;
          tmp4 += 5; /* Pattern matching succeeded; we may skip some cases if we fail */
          _backendVars = omc_List_map1r(threadData, _vars, boxvar_BackendVariable_getVarAt, _iOrderedVars);

          _solvesDiscreteValue = omc_BackendVariable_hasDiscreteVar(threadData, _backendVars);

          _eqn = mmc_unbox_integer(listHead(_eqns));
          tmp1_c0 = _solvesDiscreteValue;
          tmp1_c1 = _eqn;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _eqn = tmp13  /* pattern as ty=Integer */;
          _vars = tmpMeta14;
          tmp4 += 4; /* Pattern matching succeeded; we may skip some cases if we fail */
          _backendVars = omc_List_map1r(threadData, _vars, boxvar_BackendVariable_getVarAt, _iOrderedVars);

          _solvesDiscreteValue = omc_BackendVariable_hasDiscreteVar(threadData, _backendVars);
          tmp1_c0 = _solvesDiscreteValue;
          tmp1_c1 = _eqn;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta15;
          modelica_integer tmp16;
          modelica_metatype tmpMeta17;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp16 = mmc_unbox_integer(tmpMeta15);
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _eqn = tmp16  /* pattern as ty=Integer */;
          _vars = tmpMeta17;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          _backendVars = omc_List_map1r(threadData, _vars, boxvar_BackendVariable_getVarAt, _iOrderedVars);

          _solvesDiscreteValue = omc_BackendVariable_hasDiscreteVar(threadData, _backendVars);
          tmp1_c0 = _solvesDiscreteValue;
          tmp1_c1 = _eqn;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_metatype tmpMeta20;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,2) == 0) goto tmp3_end;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp19 = mmc_unbox_integer(tmpMeta18);
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _eqn = tmp19  /* pattern as ty=Integer */;
          _vars = tmpMeta20;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          _backendVars = omc_List_map1r(threadData, _vars, boxvar_BackendVariable_getVarAt, _iOrderedVars);

          _solvesDiscreteValue = omc_BackendVariable_hasDiscreteVar(threadData, _backendVars);
          tmp1_c0 = _solvesDiscreteValue;
          tmp1_c1 = _eqn;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta21;
          modelica_integer tmp22;
          modelica_metatype tmpMeta23;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp22 = mmc_unbox_integer(tmpMeta21);
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _eqn = tmp22  /* pattern as ty=Integer */;
          _vars = tmpMeta23;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          _backendVars = omc_List_map1r(threadData, _vars, boxvar_BackendVariable_getVarAt, _iOrderedVars);

          _solvesDiscreteValue = omc_BackendVariable_hasDiscreteVar(threadData, _backendVars);
          tmp1_c0 = _solvesDiscreteValue;
          tmp1_c1 = _eqn;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta24;
          modelica_integer tmp25;
          modelica_metatype tmpMeta26;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp25 = mmc_unbox_integer(tmpMeta24);
          tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _eqn = tmp25  /* pattern as ty=Integer */;
          _vars = tmpMeta26;
          /* Pattern matching succeeded */
          _backendVars = omc_List_map1r(threadData, _vars, boxvar_BackendVariable_getVarAt, _iOrderedVars);

          _solvesDiscreteValue = omc_BackendVariable_hasDiscreteVar(threadData, _backendVars);
          tmp1_c0 = _solvesDiscreteValue;
          tmp1_c1 = _eqn;
          goto tmp3_done;
        }
        case 7: {
          
          /* Pattern matching succeeded */
          tmp1_c0 = 0 /* false */;
          tmp1_c1 = ((modelica_integer) -1);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 8) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oSolvesDiscreteValue = tmp1_c0;
  _oFirstEqIdx = tmp1_c1;
  _return: OMC_LABEL_UNUSED
  if (out_oFirstEqIdx) { *out_oFirstEqIdx = _oFirstEqIdx; }
  return _oSolvesDiscreteValue;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_solvesDiscreteValue(threadData_t *threadData, modelica_metatype _inComp, modelica_metatype _iOrderedVars, modelica_metatype *out_oFirstEqIdx)
{
  modelica_integer _oFirstEqIdx;
  modelica_boolean _oSolvesDiscreteValue;
  modelica_metatype out_oSolvesDiscreteValue;
  _oSolvesDiscreteValue = omc_HpcOmTaskGraph_solvesDiscreteValue(threadData, _inComp, _iOrderedVars, &_oFirstEqIdx);
  out_oSolvesDiscreteValue = mmc_mk_icon(_oSolvesDiscreteValue);
  if (out_oFirstEqIdx) { *out_oFirstEqIdx = mmc_mk_icon(_oFirstEqIdx); }
  return out_oSolvesDiscreteValue;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_integer _offset, modelica_metatype _iOrderedVars, modelica_metatype _discreteEqsIn)
{
  modelica_metatype _discreteEqsOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _discreteEqsOut has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _comps;
    {
      modelica_integer _eqn;
      modelica_metatype _rest = NULL;
      modelica_metatype _head = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _eqn has no default value.
      // _rest has no default value.
      // _head has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_boolean tmp9;
          modelica_metatype tmpMeta10;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          _head = tmpMeta6;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching tuple assignment */
          tmp9 = omc_HpcOmTaskGraph_solvesDiscreteValue(threadData, _head, _iOrderedVars, &tmp8);
          if (1 /* true */ != tmp9) goto goto_2;
          _eqn = tmp8;

          _eqn = _eqn + _offset;
          tmpMeta10 = mmc_mk_cons(mmc_mk_integer(_eqn), _discreteEqsIn);
          tmpMeta1 = omc_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData, _rest, _offset, _iOrderedVars, tmpMeta10);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta11 = MMC_CAR(tmp4_1);
          tmpMeta12 = MMC_CDR(tmp4_1);
          _rest = tmpMeta12;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta1 = omc_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData, _rest, _offset, _iOrderedVars, _discreteEqsIn);
          goto tmp3_done;
        }
        case 2: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = _discreteEqsIn;
          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:;
    }
  }
  _discreteEqsOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _discreteEqsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_metatype _offset, modelica_metatype _iOrderedVars, modelica_metatype _discreteEqsIn)
{
  modelica_integer tmp1;
  modelica_metatype _discreteEqsOut = NULL;
  tmp1 = mmc_unbox_integer(_offset);
  _discreteEqsOut = omc_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData, _comps, tmp1, _iOrderedVars, _discreteEqsIn);
  /* skip box _discreteEqsOut; list<#Integer> */
  return _discreteEqsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getDiscreteNodesEqs(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eventInfoIn)
{
  modelica_metatype _eventInfoOut = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _orderedVars = NULL;
  modelica_metatype _matching = NULL;
  modelica_metatype _orderedEqs = NULL;
  modelica_metatype _eventEqs = NULL;
  modelica_metatype _eventEqsIn = NULL;
  modelica_integer _numOfEqs;
  modelica_integer _offset;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eventInfoOut has no default value.
  // _comps has no default value.
  // _orderedVars has no default value.
  // _matching has no default value.
  // _orderedEqs has no default value.
  // _eventEqs has no default value.
  // _eventEqsIn has no default value.
  // _numOfEqs has no default value.
  // _offset has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _systIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  _orderedVars = tmpMeta2;
  _orderedEqs = tmpMeta3;
  _matching = tmpMeta4;

  _comps = omc_BackendDAEUtil_getCompsOfMatching(threadData, _matching);

  /* Pattern-matching assignment */
  tmpMeta5 = _eventInfoIn;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
  tmp8 = mmc_unbox_integer(tmpMeta7);
  _eventEqsIn = tmpMeta6;
  _offset = tmp8  /* pattern as ty=Integer */;

  tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
  _eventEqs = omc_HpcOmTaskGraph_getDiscreteNodesEqs1(threadData, _comps, _offset, _orderedVars, tmpMeta9);

  _offset = _offset + omc_ExpandableArray_getNumberOfElements(threadData, _orderedEqs);

  tmpMeta10 = mmc_mk_box2(0, listAppend(_eventEqs, _eventEqsIn), mmc_mk_integer(_offset));
  _eventInfoOut = tmpMeta10;
  _return: OMC_LABEL_UNUSED
  return _eventInfoOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getDiscreteNodes(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eqCompMapping)
{
  modelica_metatype _eventNodes = NULL;
  modelica_metatype _eqLst = NULL;
  modelica_metatype _tplLst = NULL;
  modelica_metatype _systemsIn = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eventNodes has no default value.
  // _eqLst has no default value.
  // _tplLst has no default value.
  // _systemsIn has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _systIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _systemsIn = tmpMeta2;

  /* Pattern-matching assignment */
  tmpMeta3 = omc_List_fold(threadData, _systemsIn, boxvar_HpcOmTaskGraph_getDiscreteNodesEqs, _OMC_LIT210);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 1));
  _eqLst = tmpMeta4;

  _eventNodes = omc_HpcOmTaskGraph_getArrayTuple31(threadData, _eqLst, _eqCompMapping);
  _return: OMC_LABEL_UNUSED
  return _eventNodes;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_getComponentsIncludingTime2(threadData_t *threadData, modelica_metatype _iRef, modelica_boolean _iIncludingTime)
{
  modelica_boolean _oIncludingTime;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oIncludingTime has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iRef;
    {
      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,3) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (4 != MMC_STRLEN(tmpMeta6) || strcmp(MMC_STRINGDATA(_OMC_LIT211), MMC_STRINGDATA(tmpMeta6)) != 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmp1 = _iIncludingTime;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oIncludingTime = tmp1;
  _return: OMC_LABEL_UNUSED
  return _oIncludingTime;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getComponentsIncludingTime2(threadData_t *threadData, modelica_metatype _iRef, modelica_metatype _iIncludingTime)
{
  modelica_integer tmp1;
  modelica_boolean _oIncludingTime;
  modelica_metatype out_oIncludingTime;
  tmp1 = mmc_unbox_integer(_iIncludingTime);
  _oIncludingTime = omc_HpcOmTaskGraph_getComponentsIncludingTime2(threadData, _iRef, tmp1);
  out_oIncludingTime = mmc_mk_icon(_oIncludingTime);
  return out_oIncludingTime;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsIncludingTime1(threadData_t *threadData, modelica_metatype _inExp, modelica_boolean _inB, modelica_boolean *out_res)
{
  modelica_metatype _e = NULL;
  modelica_boolean _res;
  modelica_boolean tmp1_c1 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _e has no default value.
  // _res has no default value.
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_boolean tmp4_2;
    tmp4_1 = _inExp;
    tmp4_2 = _inB;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 /* false */ != tmp4_2) goto tmp3_end;
          
          _e = tmp4_1;
          /* Pattern matching succeeded */
          _res = mmc_unbox_boolean(omc_Expression_traverseCrefsFromExp(threadData, _e, boxvar_HpcOmTaskGraph_getComponentsIncludingTime2, mmc_mk_boolean(0 /* false */)));
          tmpMeta[0+0] = _e;
          tmp1_c1 = _res;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _inExp;
          tmp1_c1 = _inB;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _e = tmpMeta[0+0];
  _res = tmp1_c1;
  _return: OMC_LABEL_UNUSED
  if (out_res) { *out_res = _res; }
  return _e;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getComponentsIncludingTime1(threadData_t *threadData, modelica_metatype _inExp, modelica_metatype _inB, modelica_metatype *out_res)
{
  modelica_integer tmp1;
  modelica_boolean _res;
  modelica_metatype _e = NULL;
  tmp1 = mmc_unbox_integer(_inB);
  _e = omc_HpcOmTaskGraph_getComponentsIncludingTime1(threadData, _inExp, tmp1, &_res);
  /* skip box _e; DAE.Exp */
  if (out_res) { *out_res = mmc_mk_icon(_res); }
  return _e;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsIncludingTime0(threadData_t *threadData, modelica_metatype _inEq, modelica_metatype _iOffsetResList, modelica_metatype *out_oOffsetResList)
{
  modelica_metatype _outEq = NULL;
  modelica_metatype _oOffsetResList = NULL;
  modelica_metatype _eq = NULL;
  modelica_integer _offset;
  modelica_integer _eqIdx;
  modelica_integer _sccIdx;
  modelica_metatype _resultList = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_boolean _timeIsPartOfEquation;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outEq has no default value.
  // _oOffsetResList has no default value.
  // _eq has no default value.
  // _offset has no default value.
  // _eqIdx has no default value.
  // _sccIdx has no default value.
  // _resultList has no default value.
  // _eqCompMapping has no default value.
  // _timeIsPartOfEquation has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _inEq;
    tmp4_2 = _iOffsetResList;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_metatype tmpMeta15;
          modelica_integer tmp16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          _eq = tmp4_1;
          _offset = tmp7  /* pattern as ty=Integer */;
          _resultList = tmpMeta8;
          _eqCompMapping = tmpMeta9;
          _eqIdx = tmp11  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta12 = arrayGet(_eqCompMapping, _eqIdx + _offset);
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          _sccIdx = tmp14  /* pattern as ty=Integer */;

          /* Pattern-matching assignment */
          tmpMeta15 = omc_BackendDAEUtil_traverseBackendDAEExpsOptEqn(threadData, mmc_mk_some(_eq), boxvar_HpcOmTaskGraph_getComponentsIncludingTime1, mmc_mk_boolean(0 /* false */));
          tmp16 = mmc_unbox_integer(tmpMeta15);
          if (1 /* true */ != tmp16) goto goto_2;

          tmpMeta17 = mmc_mk_cons(mmc_mk_integer(_sccIdx), _resultList);
          _resultList = tmpMeta17;
          tmpMeta18 = mmc_mk_box4(0, mmc_mk_integer(_offset), _resultList, _eqCompMapping, mmc_mk_integer(((modelica_integer) 1) + _eqIdx));
          tmpMeta[0+0] = _eq;
          tmpMeta[0+1] = tmpMeta18;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_integer tmp24;
          modelica_metatype tmpMeta25;
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp20 = mmc_unbox_integer(tmpMeta19);
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          tmp24 = mmc_unbox_integer(tmpMeta23);
          _eq = tmp4_1;
          _offset = tmp20  /* pattern as ty=Integer */;
          _resultList = tmpMeta21;
          _eqCompMapping = tmpMeta22;
          _eqIdx = tmp24  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta25 = mmc_mk_box4(0, mmc_mk_integer(_offset), _resultList, _eqCompMapping, mmc_mk_integer(((modelica_integer) 1) + _eqIdx));
          tmpMeta[0+0] = _eq;
          tmpMeta[0+1] = 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 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outEq = tmpMeta[0+0];
  _oOffsetResList = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_oOffsetResList) { *out_oOffsetResList = _oOffsetResList; }
  return _outEq;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsIncludingTime(threadData_t *threadData, modelica_metatype _iSystem, modelica_metatype _iEqCompMapping, modelica_metatype _iOffsetResList)
{
  modelica_metatype _oOffsetResList = NULL;
  modelica_metatype _orderedEqs = NULL;
  modelica_integer _offset;
  modelica_metatype _resultList = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_integer tmp10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oOffsetResList has no default value.
  // _orderedEqs has no default value.
  // _offset has no default value.
  // _resultList has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iSystem;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  _orderedEqs = tmpMeta2;

  /* Pattern-matching assignment */
  tmpMeta3 = _iOffsetResList;
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 1));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
  _offset = tmp5  /* pattern as ty=Integer */;
  _resultList = tmpMeta6;

  /* Pattern-matching assignment */
  tmpMeta7 = mmc_mk_box4(0, mmc_mk_integer(_offset), _resultList, _iEqCompMapping, mmc_mk_integer(((modelica_integer) 1)));
  tmpMeta8 = omc_BackendEquation_traverseEquationArray(threadData, _orderedEqs, boxvar_HpcOmTaskGraph_getComponentsIncludingTime0, tmpMeta7);
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 1));
  tmp10 = mmc_unbox_integer(tmpMeta9);
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
  _offset = tmp10  /* pattern as ty=Integer */;
  _resultList = tmpMeta11;

  tmpMeta12 = mmc_mk_box2(0, mmc_mk_integer(_offset), _resultList);
  _oOffsetResList = tmpMeta12;
  _return: OMC_LABEL_UNUSED
  return _oOffsetResList;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getComponentsOfZeroCrossing(threadData_t *threadData, modelica_metatype _iZeroCrossing, modelica_metatype _iSimCodeEqCompMapping)
{
  modelica_metatype _oCompIdc = NULL;
  modelica_metatype _occurEquLst = NULL;
  modelica_metatype _tmpCompIdc = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCompIdc has no default value.
  // _occurEquLst has no default value.
  // _tmpCompIdc has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iZeroCrossing;
    {
      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;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _occurEquLst = tmpMeta6;
          /* Pattern matching succeeded */
          _occurEquLst = omc_List_filter1OnTrue(threadData, _occurEquLst, boxvar_intGt, mmc_mk_integer(((modelica_integer) 0)));

          tmpMeta7 = stringAppend(_OMC_LIT212,stringDelimitList(omc_List_map(threadData, _occurEquLst, boxvar_intString), _OMC_LIT31));
          tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT5);
          fputs(MMC_STRINGDATA(tmpMeta8),stdout);

          _tmpCompIdc = omc_List_map1(threadData, _occurEquLst, boxvar_Array_getIndexFirst, _iSimCodeEqCompMapping);

          _tmpCompIdc = omc_List_filter1OnTrue(threadData, _tmpCompIdc, boxvar_intGt, mmc_mk_integer(((modelica_integer) 0)));

          tmpMeta9 = stringAppend(_OMC_LIT213,stringDelimitList(omc_List_map(threadData, _tmpCompIdc, boxvar_intString), _OMC_LIT31));
          tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT5);
          fputs(MMC_STRINGDATA(tmpMeta10),stdout);
          tmpMeta1 = _tmpCompIdc;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          
          /* Pattern matching succeeded */
          tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta11;
          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:;
    }
  }
  _oCompIdc = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oCompIdc;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventSystem(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _iSyst, modelica_metatype _iZeroCrossings, modelica_metatype _iSimCodeEqCompMapping, modelica_metatype *out_oTaskGraphMeta)
{
  modelica_metatype _oTaskGraph = NULL;
  modelica_metatype _oTaskGraphMeta = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _discreteNodes = NULL;
  modelica_metatype _cutNodes = NULL;
  modelica_metatype _cutNodeChildren = NULL;
  modelica_metatype _zeroCrossingNodes = NULL;
  modelica_metatype _sccsContainingTime = NULL;
  modelica_metatype _systs = NULL;
  modelica_metatype _shared = NULL;
  modelica_metatype _graphTmp = NULL;
  modelica_metatype _graphDataTmp = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraph has no default value.
  // _oTaskGraphMeta has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _inComps has no default value.
  // _discreteNodes has no default value.
  // _cutNodes has no default value.
  // _cutNodeChildren has no default value.
  // _zeroCrossingNodes has no default value.
  // _sccsContainingTime has no default value.
  // _systs has no default value.
  // _shared has no default value.
  // _graphTmp has no default value.
  // _graphDataTmp has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iTaskGraphMeta;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  _inComps = tmpMeta2;
  _varCompMapping = tmpMeta3;
  _eqCompMapping = tmpMeta4;

  /* Pattern-matching assignment */
  tmpMeta5 = _iSyst;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 3));
  _systs = tmpMeta6;
  _shared = tmpMeta7;

  _discreteNodes = omc_HpcOmTaskGraph_getDiscreteNodes(threadData, _iSyst, _eqCompMapping);

  _zeroCrossingNodes = omc_List_flatten(threadData, omc_List_map1(threadData, _iZeroCrossings, boxvar_HpcOmTaskGraph_getComponentsOfZeroCrossing, _iSimCodeEqCompMapping));

  tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
  _sccsContainingTime = tmpMeta8;

  tmpMeta9 = mmc_mk_cons(_discreteNodes, mmc_mk_cons(_sccsContainingTime, mmc_mk_cons(_zeroCrossingNodes, MMC_REFSTRUCTLIT(mmc_nil))));
  _discreteNodes = omc_List_flatten(threadData, tmpMeta9);

  _graphTmp = _iTaskGraph;

  tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
  _graphTmp = omc_HpcOmTaskGraph_cutTaskGraph(threadData, _graphTmp, _discreteNodes, tmpMeta10 ,&_cutNodes);

  _cutNodeChildren = omc_List_flatten(threadData, omc_List_map1(threadData, _cutNodes, boxvar_Array_getIndexFirst, _iTaskGraph));

  omc_List_intersection1OnTrue(threadData, _cutNodeChildren, _cutNodes, boxvar_intEq ,&_cutNodeChildren ,NULL);

  _oTaskGraphMeta = omc_HpcOmTaskGraph_cutSystemData(threadData, _iTaskGraphMeta, _cutNodes, _cutNodeChildren);

  _oTaskGraph = _graphTmp;
  _return: OMC_LABEL_UNUSED
  if (out_oTaskGraphMeta) { *out_oTaskGraphMeta = _oTaskGraphMeta; }
  return _oTaskGraph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_mapIntegers(threadData_t *threadData, modelica_metatype _iTpl)
{
  modelica_metatype _oTpl = NULL;
  modelica_metatype _map = NULL;
  modelica_metatype _iLst = NULL;
  modelica_metatype _oLst = 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
  // _oTpl has no default value.
  // _map has no default value.
  // _iLst has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _oLst = tmpMeta1;
  /* Pattern-matching assignment */
  tmpMeta2 = _iTpl;
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 1));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
  _iLst = tmpMeta3;
  _map = tmpMeta4;

  {
    modelica_metatype _i;
    for (tmpMeta5 = _iLst; !listEmpty(tmpMeta5); tmpMeta5=MMC_CDR(tmpMeta5))
    {
      _i = MMC_CAR(tmpMeta5);
      tmpMeta6 = mmc_mk_cons(arrayGet(_map, mmc_unbox_integer(_i)), _oLst);
      _oLst = tmpMeta6;
    }
  }

  _oLst = listReverse(_oLst);

  tmpMeta8 = mmc_mk_box2(0, _oLst, _map);
  _oTpl = tmpMeta8;
  _return: OMC_LABEL_UNUSED
  return _oTpl;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_reverseTaskGraphIndices(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype *out_oTaskGraphMeta)
{
  modelica_metatype _oTaskGraph = NULL;
  modelica_metatype _oTaskGraphMeta = NULL;
  modelica_integer _nTasks;
  modelica_metatype _idxMap = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_integer tmp12;
  modelica_integer tmp13;
  modelica_integer tmp14;
  modelica_metatype tmpMeta15;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraph has no default value.
  // _oTaskGraphMeta has no default value.
  // _nTasks has no default value.
  // _idxMap has no default value.
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compParamMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _nodeMark has no default value.
  // _compInformations has no default value.
  _nTasks = arrayLength(_iTaskGraph);

  _idxMap = arrayCreate(_nTasks, mmc_mk_integer(((modelica_integer) -1)));

  /* Pattern-matching assignment */
  tmpMeta1 = _iTaskGraphMeta;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
  _inComps = tmpMeta2;
  _varCompMapping = tmpMeta3;
  _eqCompMapping = tmpMeta4;
  _compParamMapping = tmpMeta5;
  _compNames = tmpMeta6;
  _compDescs = tmpMeta7;
  _exeCosts = tmpMeta8;
  _commCosts = tmpMeta9;
  _nodeMark = tmpMeta10;
  _compInformations = tmpMeta11;

  tmp12 = ((modelica_integer) 1); tmp13 = 1; tmp14 = _nTasks;
  if(!(((tmp13 > 0) && (tmp12 > tmp14)) || ((tmp13 < 0) && (tmp12 < tmp14))))
  {
    modelica_integer _i;
    for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp12, tmp14); _i += tmp13)
    {
      _idxMap = arrayUpdate(_idxMap, _i, mmc_mk_integer(((modelica_integer) 1) + _nTasks - _i));
    }
  }

  _oTaskGraph = omc_Array_mapNoCopy__1(threadData, _iTaskGraph, boxvar_HpcOmTaskGraph_mapIntegers, _idxMap, NULL);

  _oTaskGraph = omc_Array_reverse(threadData, _oTaskGraph);

  _inComps = omc_Array_reverse(threadData, _inComps);

  tmpMeta15 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _oTaskGraphMeta = tmpMeta15;
  _return: OMC_LABEL_UNUSED
  if (out_oTaskGraphMeta) { *out_oTaskGraphMeta = _oTaskGraphMeta; }
  return _oTaskGraph;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getZeroFuncsSystem(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _iBackendDAE, modelica_integer _iNumberOfSccs, modelica_metatype _iZeroCrossingEquationIdc, modelica_metatype _iSimCodeEqCompMapping, modelica_metatype *out_oTaskGraphMeta)
{
  modelica_metatype _oTaskGraph = NULL;
  modelica_metatype _oTaskGraphMeta = NULL;
  modelica_metatype _zeroCrossingNodes = NULL;
  modelica_metatype _nodeList = NULL;
  modelica_metatype _newNodeList = NULL;
  modelica_metatype _predecessors = NULL;
  modelica_metatype _successors = NULL;
  modelica_metatype _successorsTmp = NULL;
  modelica_metatype _predecessorsTmp = NULL;
  modelica_metatype _zeroFuncNodeMarks = NULL;
  modelica_metatype _sccNodeMapping = NULL;
  modelica_metatype _handledNodes = NULL;
  modelica_metatype _whenNodeMarks = NULL;
  modelica_metatype _iTaskGraphTCopy = NULL;
  modelica_metatype _iTaskGraphCopy = NULL;
  modelica_metatype _zeroFuncTaskGraph = NULL;
  modelica_metatype _zeroFuncTaskGraphMeta = NULL;
  modelica_metatype _whenNodes = NULL;
  modelica_integer _inCompsEntry;
  modelica_metatype _zeroFuncInComps = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_integer _eqIdx;
  modelica_integer _compIdx;
  modelica_integer _nodeIdx;
  modelica_integer _successor;
  modelica_integer _predecessor;
  modelica_integer _zeroFuncNodeMark;
  modelica_integer _successorMark;
  modelica_integer _zeroFuncNodeCount;
  modelica_integer _zeroFuncNodeIdx;
  modelica_metatype _nodeToZeroFuncNodeMapping = NULL;
  modelica_boolean _stop;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_integer tmp17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  modelica_metatype tmpMeta21;
  modelica_metatype tmpMeta22;
  modelica_metatype tmpMeta23;
  modelica_metatype tmpMeta24;
  modelica_integer tmp25;
  modelica_metatype tmpMeta26;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oTaskGraph has no default value.
  // _oTaskGraphMeta has no default value.
  // _zeroCrossingNodes has no default value.
  // _nodeList has no default value.
  // _newNodeList has no default value.
  // _predecessors has no default value.
  // _successors has no default value.
  // _successorsTmp has no default value.
  // _predecessorsTmp has no default value.
  // _zeroFuncNodeMarks has no default value.
  // _sccNodeMapping has no default value.
  // _handledNodes has no default value.
  // _whenNodeMarks has no default value.
  // _iTaskGraphTCopy has no default value.
  // _iTaskGraphCopy has no default value.
  // _zeroFuncTaskGraph has no default value.
  // _zeroFuncTaskGraphMeta has no default value.
  // _whenNodes has no default value.
  // _inCompsEntry has no default value.
  // _zeroFuncInComps has no default value.
  // _inComps has no default value.
  // _eqCompMapping has no default value.
  // _eqIdx has no default value.
  // _compIdx has no default value.
  // _nodeIdx has no default value.
  // _successor has no default value.
  // _predecessor has no default value.
  // _zeroFuncNodeMark has no default value.
  // _successorMark has no default value.
  // _zeroFuncNodeCount has no default value.
  // _zeroFuncNodeIdx has no default value.
  // _nodeToZeroFuncNodeMapping has no default value.
  // _stop has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iTaskGraphMeta;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  _inComps = tmpMeta2;
  _eqCompMapping = tmpMeta3;

  _zeroFuncNodeMarks = arrayCreate(arrayLength(_iTaskGraph), mmc_mk_integer(((modelica_integer) 0)));

  _handledNodes = arrayCreate(arrayLength(_iTaskGraph), mmc_mk_boolean(0 /* false */));

  _nodeToZeroFuncNodeMapping = arrayCreate(arrayLength(_iTaskGraph), mmc_mk_integer(((modelica_integer) -1)));

  _whenNodes = omc_HpcOmTaskGraph_getEventNodes(threadData, _iBackendDAE, _eqCompMapping);

  _whenNodeMarks = arrayCreate(arrayLength(_iTaskGraph), mmc_mk_boolean(0 /* false */));

  _sccNodeMapping = omc_HpcOmTaskGraph_getSccNodeMapping(threadData, _iNumberOfSccs, _iTaskGraphMeta);

  _iTaskGraphCopy = arrayCopy(_iTaskGraph);

  _iTaskGraphTCopy = omc_AdjacencyMatrix_transposeAdjacencyMatrix(threadData, _iTaskGraph, arrayLength(_iTaskGraph));

  {
    modelica_metatype _eqIdx;
    for (tmpMeta4 = _iZeroCrossingEquationIdc; !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
    {
      _eqIdx = MMC_CAR(tmpMeta4);
      _compIdx = mmc_unbox_integer(arrayGet(_iSimCodeEqCompMapping, mmc_unbox_integer(_eqIdx)));

      _nodeIdx = mmc_unbox_integer(arrayGet(_sccNodeMapping, _compIdx));

      _zeroFuncNodeMarks = arrayUpdate(_zeroFuncNodeMarks, _nodeIdx, mmc_mk_integer(((modelica_integer) 1)));
    }
  }

  {
    modelica_metatype _nodeIdx;
    for (tmpMeta6 = _whenNodes; !listEmpty(tmpMeta6); tmpMeta6=MMC_CDR(tmpMeta6))
    {
      _nodeIdx = MMC_CAR(tmpMeta6);
      _whenNodeMarks = arrayUpdate(_whenNodeMarks, mmc_unbox_integer(_nodeIdx), mmc_mk_boolean(1 /* true */));
    }
  }

  _nodeList = omc_HpcOmTaskGraph_getRootNodes(threadData, _iTaskGraphTCopy);

  _zeroFuncNodeCount = ((modelica_integer) 0);

  _zeroFuncNodeIdx = ((modelica_integer) 1);

  while(1)
  {
    if(!(!listEmpty(_nodeList))) break;
    tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
    _newNodeList = tmpMeta8;

    {
      modelica_metatype _nodeIdx;
      for (tmpMeta9 = _nodeList; !listEmpty(tmpMeta9); tmpMeta9=MMC_CDR(tmpMeta9))
      {
        _nodeIdx = MMC_CAR(tmpMeta9);
        if((!mmc_unbox_boolean(arrayGet(_handledNodes, mmc_unbox_integer(_nodeIdx)))))
        {
          _handledNodes = arrayUpdate(_handledNodes, mmc_unbox_integer(_nodeIdx), mmc_mk_boolean(1 /* true */));

          _predecessors = arrayGet(_iTaskGraphTCopy, mmc_unbox_integer(_nodeIdx));

          _successors = arrayGet(_iTaskGraphCopy, mmc_unbox_integer(_nodeIdx));

          _zeroFuncNodeMark = ((modelica_integer) -1);

          if(mmc_unbox_boolean(arrayGet(_whenNodeMarks, mmc_unbox_integer(_nodeIdx))))
          {
            {
              modelica_metatype _predecessor;
              for (tmpMeta10 = _predecessors; !listEmpty(tmpMeta10); tmpMeta10=MMC_CDR(tmpMeta10))
              {
                _predecessor = MMC_CAR(tmpMeta10);
                _successorsTmp = arrayGet(_iTaskGraphCopy, mmc_unbox_integer(_predecessor));

                arrayUpdate(_iTaskGraphCopy, mmc_unbox_integer(_predecessor), listAppend(_successorsTmp, _successors));
              }
            }

            {
              modelica_metatype _successor;
              for (tmpMeta12 = _successors; !listEmpty(tmpMeta12); tmpMeta12=MMC_CDR(tmpMeta12))
              {
                _successor = MMC_CAR(tmpMeta12);
                _predecessorsTmp = arrayGet(_iTaskGraphTCopy, mmc_unbox_integer(_successor));

                arrayUpdate(_iTaskGraphTCopy, mmc_unbox_integer(_successor), listAppend(_predecessorsTmp, _predecessors));
              }
            }
          }
          else
          {
            if((mmc_unbox_integer(arrayGet(_zeroFuncNodeMarks, mmc_unbox_integer(_nodeIdx))) > ((modelica_integer) 0)))
            {
              _zeroFuncNodeMark = _zeroFuncNodeIdx;
            }
            else
            {
              _stop = 0 /* false */;

              while(1)
              {
                if(!((!_stop) && (!listEmpty(_successors)))) break;
                /* Pattern-matching assignment */
                tmpMeta14 = _successors;
                if (listEmpty(tmpMeta14)) MMC_THROW_INTERNAL();
                tmpMeta15 = MMC_CAR(tmpMeta14);
                tmpMeta16 = MMC_CDR(tmpMeta14);
                tmp17 = mmc_unbox_integer(tmpMeta15);
                _successor = tmp17  /* pattern as ty=Integer */;
                _successors = tmpMeta16;

                _successorMark = mmc_unbox_integer(arrayGet(_zeroFuncNodeMarks, _successor));

                if((_successorMark > ((modelica_integer) 0)))
                {
                  _zeroFuncNodeMark = _zeroFuncNodeIdx;

                  _stop = 1 /* true */;
                }
              }
            }

            if((_zeroFuncNodeMark > ((modelica_integer) 0)))
            {
              _zeroFuncNodeCount = ((modelica_integer) 1) + _zeroFuncNodeCount;

              _nodeToZeroFuncNodeMapping = arrayUpdate(_nodeToZeroFuncNodeMapping, mmc_unbox_integer(_nodeIdx), mmc_mk_integer(_zeroFuncNodeCount));

              _zeroFuncNodeIdx = ((modelica_integer) 1) + _zeroFuncNodeIdx;
            }
          }

          _zeroFuncNodeMarks = arrayUpdate(_zeroFuncNodeMarks, mmc_unbox_integer(_nodeIdx), mmc_mk_integer(_zeroFuncNodeMark));

          _newNodeList = omc_List_append__reverse(threadData, _predecessors, _newNodeList);
        }
      }
    }

    _nodeList = listReverse(_newNodeList);
  }

  tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
  _zeroFuncTaskGraph = arrayCreate(_zeroFuncNodeCount, tmpMeta19);

  tmpMeta20 = MMC_REFSTRUCTLIT(mmc_nil);
  _zeroFuncInComps = arrayCreate(_zeroFuncNodeCount, tmpMeta20);

  _nodeIdx = arrayLength(_zeroFuncNodeMarks);

  while(1)
  {
    if(!(_nodeIdx > ((modelica_integer) 0))) break;
    _zeroFuncNodeIdx = mmc_unbox_integer(arrayGet(_zeroFuncNodeMarks, _nodeIdx));

    if((_zeroFuncNodeIdx > ((modelica_integer) 0)))
    {
      _successors = arrayGet(_iTaskGraphCopy, _nodeIdx);

      _zeroFuncInComps = arrayUpdate(_zeroFuncInComps, _zeroFuncNodeIdx, arrayGet(_inComps, _nodeIdx));

      tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
      _newNodeList = tmpMeta21;

      while(1)
      {
        if(!(!listEmpty(_successors))) break;
        /* Pattern-matching assignment */
        tmpMeta22 = _successors;
        if (listEmpty(tmpMeta22)) MMC_THROW_INTERNAL();
        tmpMeta23 = MMC_CAR(tmpMeta22);
        tmpMeta24 = MMC_CDR(tmpMeta22);
        tmp25 = mmc_unbox_integer(tmpMeta23);
        _successor = tmp25  /* pattern as ty=Integer */;
        _successors = tmpMeta24;

        _successor = mmc_unbox_integer(arrayGet(_zeroFuncNodeMarks, _successor));

        if((_successor > ((modelica_integer) 0)))
        {
          tmpMeta26 = mmc_mk_cons(mmc_mk_integer(_successor), _newNodeList);
          _newNodeList = tmpMeta26;
        }
      }

      _newNodeList = omc_List_sort(threadData, _newNodeList, boxvar_intGt);

      _newNodeList = omc_List_sortedUnique(threadData, _newNodeList, boxvar_intEq);

      _zeroFuncTaskGraph = arrayUpdate(_zeroFuncTaskGraph, _zeroFuncNodeIdx, _newNodeList);
    }

    _nodeIdx = ((modelica_integer) -1) + _nodeIdx;
  }

  _zeroFuncTaskGraphMeta = omc_HpcOmTaskGraph_copyTaskGraphMeta(threadData, _iTaskGraphMeta);

  _zeroFuncTaskGraphMeta = omc_HpcOmTaskGraph_setInCompsInMeta(threadData, _zeroFuncInComps, _zeroFuncTaskGraphMeta);

  _oTaskGraph = omc_HpcOmTaskGraph_reverseTaskGraphIndices(threadData, _zeroFuncTaskGraph, _zeroFuncTaskGraphMeta ,&_oTaskGraphMeta);
  _return: OMC_LABEL_UNUSED
  if (out_oTaskGraphMeta) { *out_oTaskGraphMeta = _oTaskGraphMeta; }
  return _oTaskGraph;
}
modelica_metatype boxptr_HpcOmTaskGraph_getZeroFuncsSystem(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iTaskGraphMeta, modelica_metatype _iBackendDAE, modelica_metatype _iNumberOfSccs, modelica_metatype _iZeroCrossingEquationIdc, modelica_metatype _iSimCodeEqCompMapping, modelica_metatype *out_oTaskGraphMeta)
{
  modelica_integer tmp1;
  modelica_metatype _oTaskGraph = NULL;
  tmp1 = mmc_unbox_integer(_iNumberOfSccs);
  _oTaskGraph = omc_HpcOmTaskGraph_getZeroFuncsSystem(threadData, _iTaskGraph, _iTaskGraphMeta, _iBackendDAE, tmp1, _iZeroCrossingEquationIdc, _iSimCodeEqCompMapping, out_oTaskGraphMeta);
  /* skip box _oTaskGraph; array<list<#Integer>> */
  /* skip box _oTaskGraphMeta; HpcOmTaskGraph.TaskGraphMeta */
  return _oTaskGraph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodesWithRefCountZero0(threadData_t *threadData, modelica_integer _iRefCount, modelica_metatype _iZeroIdc)
{
  modelica_metatype _oZeroIdc = NULL;
  modelica_metatype _resultList = NULL;
  modelica_integer _currentNodeIdx;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oZeroIdc has no default value.
  // _resultList has no default value.
  // _currentNodeIdx has no default value.
  { /* match expression */
    modelica_integer tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _iRefCount;
    tmp4_2 = _iZeroIdc;
    {
      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 (0 != tmp4_1) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          _resultList = tmpMeta6;
          _currentNodeIdx = tmp8  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta9 = mmc_mk_cons(mmc_mk_integer(_currentNodeIdx), _resultList);
          _resultList = tmpMeta9;
          tmpMeta10 = mmc_mk_box2(0, _resultList, mmc_mk_integer(((modelica_integer) 1) + _currentNodeIdx));
          tmpMeta1 = tmpMeta10;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          _resultList = tmpMeta11;
          _currentNodeIdx = tmp13  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta14 = mmc_mk_box2(0, _resultList, mmc_mk_integer(((modelica_integer) 1) + _currentNodeIdx));
          tmpMeta1 = tmpMeta14;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oZeroIdc = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oZeroIdc;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNodesWithRefCountZero0(threadData_t *threadData, modelica_metatype _iRefCount, modelica_metatype _iZeroIdc)
{
  modelica_integer tmp1;
  modelica_metatype _oZeroIdc = NULL;
  tmp1 = mmc_unbox_integer(_iRefCount);
  _oZeroIdc = omc_HpcOmTaskGraph_getNodesWithRefCountZero0(threadData, tmp1, _iZeroIdc);
  /* skip box _oZeroIdc; tuple<list<#Integer>, #Integer> */
  return _oZeroIdc;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getNodesWithRefCountZero(threadData_t *threadData, modelica_metatype _iRefCounter)
{
  modelica_metatype _oZeroIdc = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oZeroIdc has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = omc_Array_fold(threadData, _iRefCounter, boxvar_HpcOmTaskGraph_getNodesWithRefCountZero0, _OMC_LIT214);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  _oZeroIdc = tmpMeta2;
  _return: OMC_LABEL_UNUSED
  return _oZeroIdc;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createRefCounter0(threadData_t *threadData, modelica_metatype _iChildNodes, modelica_metatype _iRefCounter)
{
  modelica_metatype _oRefCounter = NULL;
  modelica_metatype _tmpRefCounter = NULL;
  modelica_integer _counter;
  modelica_integer _head;
  modelica_metatype _tail = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oRefCounter has no default value.
  // _tmpRefCounter has no default value.
  // _counter has no default value.
  // _head has no default value.
  // _tail has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iChildNodes;
    {
      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;
          /* Pattern matching succeeded */
          tmpMeta1 = _iRefCounter;
          goto tmp3_done;
        }
        case 1: {
          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);
          _head = tmp8  /* pattern as ty=Integer */;
          _tail = tmpMeta7;
          /* Pattern matching succeeded */
          _counter = ((modelica_integer) 1) + mmc_unbox_integer(arrayGet(_iRefCounter, _head));

          _tmpRefCounter = arrayUpdate(_iRefCounter, _head, mmc_mk_integer(_counter));
          /* Tail recursive call */
          _iChildNodes = _tail;
          _iRefCounter = _tmpRefCounter;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oRefCounter = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oRefCounter;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createRefCounter(threadData_t *threadData, modelica_metatype _iTaskGraph)
{
  modelica_metatype _oRefCounter = NULL;
  modelica_metatype _tmpRefCounter = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oRefCounter has no default value.
  // _tmpRefCounter has no default value.
  _tmpRefCounter = arrayCreate(arrayLength(_iTaskGraph), mmc_mk_integer(((modelica_integer) 0)));

  _tmpRefCounter = omc_Array_fold(threadData, _iTaskGraph, boxvar_HpcOmTaskGraph_createRefCounter0, _tmpRefCounter);

  _oRefCounter = _tmpRefCounter;
  _return: OMC_LABEL_UNUSED
  return _oRefCounter;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getLevelNodes2(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero)
{
  modelica_metatype _oNodesWithRefZero = NULL;
  modelica_metatype _tmpNodesWithRefZero = NULL;
  modelica_integer _refCounter;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNodesWithRefZero has no default value.
  // _tmpNodesWithRefZero has no default value.
  // _refCounter has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iNodesWithRefZero;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          
          _tmpNodesWithRefZero = tmp4_1;
          /* Pattern matching succeeded */
          _refCounter = ((modelica_integer) -1) + mmc_unbox_integer(arrayGet(_iRefCounter, _iNodeIdx));

          arrayUpdate(_iRefCounter, _iNodeIdx, mmc_mk_integer(_refCounter));

          /* Pattern-matching assignment */
          tmp6 = (_refCounter == ((modelica_integer) 0));
          if (1 /* true */ != tmp6) goto goto_2;
          tmpMeta7 = mmc_mk_cons(mmc_mk_integer(_iNodeIdx), _tmpNodesWithRefZero);
          tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _iNodesWithRefZero;
          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:;
    }
  }
  _oNodesWithRefZero = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oNodesWithRefZero;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getLevelNodes2(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero)
{
  modelica_integer tmp1;
  modelica_metatype _oNodesWithRefZero = NULL;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  _oNodesWithRefZero = omc_HpcOmTaskGraph_getLevelNodes2(threadData, tmp1, _iRefCounter, _iNodesWithRefZero);
  /* skip box _oNodesWithRefZero; list<#Integer> */
  return _oNodesWithRefZero;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getLevelNodes1(threadData_t *threadData, modelica_integer _iNodeIdx, modelica_metatype _iTaskGraph, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero)
{
  modelica_metatype _oNodesWithRefZero = NULL;
  modelica_metatype _childNodes = NULL;
  modelica_metatype _tmpNodesWithRefZero = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNodesWithRefZero has no default value.
  // _childNodes has no default value.
  // _tmpNodesWithRefZero has no default value.
  _childNodes = arrayGet(_iTaskGraph, _iNodeIdx);

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _tmpNodesWithRefZero = omc_List_fold1(threadData, _childNodes, boxvar_HpcOmTaskGraph_getLevelNodes2, _iRefCounter, tmpMeta1);

  _oNodesWithRefZero = listAppend(_tmpNodesWithRefZero, _iNodesWithRefZero);
  _return: OMC_LABEL_UNUSED
  return _oNodesWithRefZero;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getLevelNodes1(threadData_t *threadData, modelica_metatype _iNodeIdx, modelica_metatype _iTaskGraph, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero)
{
  modelica_integer tmp1;
  modelica_metatype _oNodesWithRefZero = NULL;
  tmp1 = mmc_unbox_integer(_iNodeIdx);
  _oNodesWithRefZero = omc_HpcOmTaskGraph_getLevelNodes1(threadData, tmp1, _iTaskGraph, _iRefCounter, _iNodesWithRefZero);
  /* skip box _oNodesWithRefZero; list<#Integer> */
  return _oNodesWithRefZero;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getLevelNodes0(threadData_t *threadData, modelica_metatype _iTaskGraph, modelica_metatype _iRefCounter, modelica_metatype _iNodesWithRefZero, modelica_metatype _iLevelNodes)
{
  modelica_metatype _oLevelNodes = NULL;
  modelica_metatype _tmpLevelNodes = NULL;
  modelica_metatype _zeroRefNodes = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oLevelNodes has no default value.
  // _tmpLevelNodes has no default value.
  // _zeroRefNodes has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iNodesWithRefZero;
    {
      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;
          /* Pattern matching succeeded */
          tmpMeta1 = listReverse(_iLevelNodes);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          
          _zeroRefNodes = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta6 = mmc_mk_cons(_zeroRefNodes, _iLevelNodes);
          _tmpLevelNodes = tmpMeta6;

          tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
          _zeroRefNodes = omc_List_fold2(threadData, _zeroRefNodes, boxvar_HpcOmTaskGraph_getLevelNodes1, _iTaskGraph, _iRefCounter, tmpMeta7);
          /* Tail recursive call */
          _iNodesWithRefZero = _zeroRefNodes;
          _iLevelNodes = _tmpLevelNodes;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oLevelNodes = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oLevelNodes;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getLevelNodes(threadData_t *threadData, modelica_metatype _iTaskGraph)
{
  modelica_metatype _oLevelNodes = NULL;
  modelica_metatype _refCounter = NULL;
  modelica_metatype _roots = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oLevelNodes has no default value.
  // _refCounter has no default value.
  // _roots has no default value.
  _refCounter = omc_HpcOmTaskGraph_createRefCounter(threadData, _iTaskGraph);

  _roots = omc_HpcOmTaskGraph_getNodesWithRefCountZero(threadData, _refCounter);

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _oLevelNodes = omc_HpcOmTaskGraph_getLevelNodes0(threadData, _iTaskGraph, _refCounter, _roots, tmpMeta1);
  _return: OMC_LABEL_UNUSED
  return _oLevelNodes;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getLeafNodes(threadData_t *threadData, modelica_metatype _iTaskGraph)
{
  modelica_metatype _oLeafNodes = NULL;
  modelica_metatype _tmpLeafNodes = NULL;
  modelica_metatype _nodeSuccessors = NULL;
  modelica_integer _nodeIdx;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_integer tmp4;
  modelica_integer tmp5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oLeafNodes has no default value.
  // _tmpLeafNodes has no default value.
  // _nodeSuccessors has no default value.
  // _nodeIdx has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _tmpLeafNodes = tmpMeta1;

  tmp3 = ((modelica_integer) 1); tmp4 = 1; tmp5 = arrayLength(_iTaskGraph);
  if(!(((tmp4 > 0) && (tmp3 > tmp5)) || ((tmp4 < 0) && (tmp3 < tmp5))))
  {
    modelica_integer _nodeIdx;
    for(_nodeIdx = ((modelica_integer) 1); in_range_integer(_nodeIdx, tmp3, tmp5); _nodeIdx += tmp4)
    {
      _nodeSuccessors = arrayGet(_iTaskGraph, _nodeIdx);

      if(listEmpty(_nodeSuccessors))
      {
        tmpMeta2 = mmc_mk_cons(mmc_mk_integer(_nodeIdx), _tmpLeafNodes);
        _tmpLeafNodes = tmpMeta2;
      }
    }
  }

  _oLeafNodes = _tmpLeafNodes;
  _return: OMC_LABEL_UNUSED
  return _oLeafNodes;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getRootNodes(threadData_t *threadData, modelica_metatype _iTaskGraph)
{
  modelica_metatype _rootsOut = NULL;
  modelica_integer _size;
  modelica_metatype _taskGraphT = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _rootsOut has no default value.
  // _size has no default value.
  // _taskGraphT has no default value.
  _size = arrayLength(_iTaskGraph);

  _taskGraphT = omc_AdjacencyMatrix_transposeAdjacencyMatrix(threadData, _iTaskGraph, _size);

  _rootsOut = omc_HpcOmTaskGraph_getLeafNodes(threadData, _taskGraphT);
  _return: OMC_LABEL_UNUSED
  return _rootsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_arrayCopyRows(threadData_t *threadData, modelica_metatype _inArray, modelica_metatype _newArray, modelica_metatype _copiedRows, modelica_integer _Idx)
{
  modelica_metatype _outArray = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outArray has no default value.
  { /* matchcontinue expression */
    {
      modelica_integer _copyRow;
      modelica_metatype _row = NULL;
      modelica_metatype _arrayTmp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _copyRow has no default value.
      // _row has no default value.
      // _arrayTmp has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (listLength(_copiedRows) >= _Idx);
          if (1 /* true */ != tmp6) goto goto_2;

          _copyRow = mmc_unbox_integer(listGet(_copiedRows, _Idx));

          _row = arrayGet(_inArray, _copyRow);

          _arrayTmp = omc_Array_replaceAtWithFill(threadData, _Idx, _row, _OMC_LIT216, _newArray);
          tmpMeta1 = omc_HpcOmTaskGraph_arrayCopyRows(threadData, _inArray, _arrayTmp, _copiedRows, ((modelica_integer) 1) + _Idx);
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmpMeta1 = _newArray;
          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:;
    }
  }
  _outArray = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outArray;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_arrayCopyRows(threadData_t *threadData, modelica_metatype _inArray, modelica_metatype _newArray, modelica_metatype _copiedRows, modelica_metatype _Idx)
{
  modelica_integer tmp1;
  modelica_metatype _outArray = NULL;
  tmp1 = mmc_unbox_integer(_Idx);
  _outArray = omc_HpcOmTaskGraph_arrayCopyRows(threadData, _inArray, _newArray, _copiedRows, tmp1);
  /* skip box _outArray; array<list<#Integer>> */
  return _outArray;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_deleteRowInAdjLst(threadData_t *threadData, modelica_metatype _adjacencyLstIn, modelica_metatype _rowsDel, modelica_metatype *out_odeMapping)
{
  modelica_metatype _adjacencyLstOut = NULL;
  modelica_metatype _odeMapping = NULL;
  modelica_metatype _adjLst = NULL;
  modelica_metatype _copiedRows = NULL;
  modelica_integer _size;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _adjacencyLstOut has no default value.
  // _odeMapping has no default value.
  // _adjLst has no default value.
  // _copiedRows has no default value.
  // _size has no default value.
  _size = arrayLength(_adjacencyLstIn) - listLength(_rowsDel);

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _adjLst = arrayCreate(_size, tmpMeta1);

  _copiedRows = omc_List_intRange(threadData, arrayLength(_adjacencyLstIn));

  _copiedRows = omc_List_deletePositions(threadData, _copiedRows, _rowsDel, 0 /* false */);

  _adjacencyLstOut = omc_HpcOmTaskGraph_arrayCopyRows(threadData, _adjacencyLstIn, _adjLst, _copiedRows, ((modelica_integer) 1));

  _odeMapping = _copiedRows;
  _return: OMC_LABEL_UNUSED
  if (out_odeMapping) { *out_odeMapping = _odeMapping; }
  return _adjacencyLstOut;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_removeContinuousEntries1(threadData_t *threadData, modelica_integer _entryIn, modelica_metatype _deleteEntriesIn)
{
  modelica_integer _entryOut;
  modelica_integer _eqSysIdx;
  modelica_integer _entryOffset;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _entryOut has no default value.
  // _eqSysIdx has no default value.
  // _entryOffset has no default value.
  { /* matchcontinue expression */
    {
      modelica_integer _offset;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _offset has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          /* Pattern matching succeeded */
          _offset = mmc_unbox_integer(arrayGet(_deleteEntriesIn, _entryIn));
          tmp1 = _entryIn - _offset;
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT217),stdout);
          tmp1 = _entryIn;
          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:;
    }
  }
  _entryOut = tmp1;
  _return: OMC_LABEL_UNUSED
  return _entryOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_removeContinuousEntries1(threadData_t *threadData, modelica_metatype _entryIn, modelica_metatype _deleteEntriesIn)
{
  modelica_integer tmp1;
  modelica_integer _entryOut;
  modelica_metatype out_entryOut;
  tmp1 = mmc_unbox_integer(_entryIn);
  _entryOut = omc_HpcOmTaskGraph_removeContinuousEntries1(threadData, tmp1, _deleteEntriesIn);
  out_entryOut = mmc_mk_icon(_entryOut);
  return out_entryOut;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_setDeleteArr(threadData_t *threadData, modelica_integer _entryIn, modelica_integer _offsetIn, modelica_integer *out_offsetOut)
{
  modelica_integer _entryOut;
  modelica_integer _offsetOut;
  modelica_integer tmp1_c0 __attribute__((unused)) = 0;
  modelica_integer tmp1_c1 __attribute__((unused)) = 0;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _entryOut has no default value.
  // _offsetOut has no default value.
  
  
  { /* match expression */
    modelica_integer tmp4_1;
    tmp4_1 = _entryIn;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_1) goto tmp3_end;
          /* Pattern matching succeeded */
          tmp1_c0 = _offsetIn;
          tmp1_c1 = _offsetIn;
          goto tmp3_done;
        }
        case 1: {
          if (1 != tmp4_1) goto tmp3_end;
          /* Pattern matching succeeded */
          tmp1_c0 = ((modelica_integer) 1) + _offsetIn;
          tmp1_c1 = ((modelica_integer) 1) + _offsetIn;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _entryOut = tmp1_c0;
  _offsetOut = tmp1_c1;
  _return: OMC_LABEL_UNUSED
  if (out_offsetOut) { *out_offsetOut = _offsetOut; }
  return _entryOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_setDeleteArr(threadData_t *threadData, modelica_metatype _entryIn, modelica_metatype _offsetIn, modelica_metatype *out_offsetOut)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer _offsetOut;
  modelica_integer _entryOut;
  modelica_metatype out_entryOut;
  tmp1 = mmc_unbox_integer(_entryIn);
  tmp2 = mmc_unbox_integer(_offsetIn);
  _entryOut = omc_HpcOmTaskGraph_setDeleteArr(threadData, tmp1, tmp2, &_offsetOut);
  out_entryOut = mmc_mk_icon(_entryOut);
  if (out_offsetOut) { *out_offsetOut = mmc_mk_icon(_offsetOut); }
  return out_entryOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_updateContinuousEntriesInList(threadData_t *threadData, modelica_metatype _lstIn, modelica_metatype _deleteEntriesIn)
{
  modelica_metatype _lstOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _lstOut has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _lstIn;
    tmp4_2 = _deleteEntriesIn;
    {
      modelica_integer _start;
      modelica_metatype _rest = NULL;
      modelica_metatype _deleteArr = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _start has no default value.
      // _rest has no default value.
      // _deleteArr has no default value.
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          if (!listEmpty(tmp4_2)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = _lstIn;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_CAR(tmp4_1);
          tmpMeta8 = MMC_CDR(tmp4_1);
          tmp9 = mmc_unbox_integer(tmpMeta7);
          
          _start = tmp9  /* pattern as ty=Integer */;
          _rest = tmpMeta8;
          /* Pattern matching succeeded */
          _deleteArr = arrayCreate(mmc_unbox_integer(omc_List_fold(threadData, listAppend(_rest, _deleteEntriesIn), boxvar_intMax, mmc_mk_integer(_start))), mmc_mk_integer(((modelica_integer) 0)));

          omc_List_map2__0(threadData, _deleteEntriesIn, boxvar_Array_updateIndexFirst, mmc_mk_integer(((modelica_integer) 1)), _deleteArr);

          _deleteArr = omc_Array_mapFold(threadData, _deleteArr, boxvar_HpcOmTaskGraph_setDeleteArr, mmc_mk_integer(((modelica_integer) 0)), NULL);
          tmpMeta1 = omc_List_map1(threadData, _lstIn, boxvar_HpcOmTaskGraph_removeContinuousEntries1, _deleteArr);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _lstOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _lstOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getChildNodes(threadData_t *threadData, modelica_metatype _adjacencyLstIn, modelica_metatype _parents, modelica_metatype _childLstTmp, modelica_integer _Idx)
{
  modelica_metatype _childLsts = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _childLsts has no default value.
  { /* matchcontinue expression */
    {
      modelica_integer _parent;
      modelica_metatype _row = NULL;
      modelica_metatype _childLst = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _parent has no default value.
      // _row has no default value.
      // _childLst has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (listLength(_parents) >= _Idx);
          if (1 /* true */ != tmp6) goto goto_2;

          _parent = mmc_unbox_integer(listGet(_parents, _Idx));

          _row = arrayGet(_adjacencyLstIn, _parent);

          _childLst = listAppend(_childLstTmp, _row);
          tmpMeta1 = omc_HpcOmTaskGraph_getChildNodes(threadData, _adjacencyLstIn, _parents, _childLst, ((modelica_integer) 1) + _Idx);
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmpMeta1 = _childLstTmp;
          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:;
    }
  }
  _childLsts = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _childLsts;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getChildNodes(threadData_t *threadData, modelica_metatype _adjacencyLstIn, modelica_metatype _parents, modelica_metatype _childLstTmp, modelica_metatype _Idx)
{
  modelica_integer tmp1;
  modelica_metatype _childLsts = NULL;
  tmp1 = mmc_unbox_integer(_Idx);
  _childLsts = omc_HpcOmTaskGraph_getChildNodes(threadData, _adjacencyLstIn, _parents, _childLstTmp, tmp1);
  /* skip box _childLsts; list<#Integer> */
  return _childLsts;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getAllSuccessors2(threadData_t *threadData, modelica_metatype _nodes, modelica_metatype _graph, modelica_metatype _alreadyVisited, modelica_metatype _successorsIn)
{
  modelica_metatype _successorsOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _successorsOut has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _nodes;
    {
      modelica_metatype _check = NULL;
      modelica_metatype _successors1 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _check has no default value.
      // _successors1 has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_List_unique(threadData, _successorsIn);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          _successors1 = omc_List_flatten(threadData, omc_List_map1(threadData, _nodes, boxvar_Array_getIndexFirst, _graph));

          _check = omc_List_map1(threadData, _successors1, boxvar_Array_getIndexFirst, _alreadyVisited);

          omc_List_filterOnTrueSync(threadData, _check, boxvar_boolNot, _successors1 ,&_successors1);

          _successors1 = omc_List_unique(threadData, _successors1);

          omc_List_map2__0(threadData, _successors1, boxvar_Array_updateIndexFirst, mmc_mk_boolean(1 /* true */), _alreadyVisited);
          /* Tail recursive call */
          _nodes = _successors1;
          _successorsIn = listAppend(_successors1, _successorsIn);
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _successorsOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _successorsOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getAllSuccessors(threadData_t *threadData, modelica_metatype _nodes, modelica_metatype _graph)
{
  modelica_metatype _successors = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _successors has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _alreadyVisited = NULL;
      modelica_metatype _check = NULL;
      modelica_metatype _successors1 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _alreadyVisited has no default value.
      // _check has no default value.
      // _successors1 has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          /* Pattern matching succeeded */
          _alreadyVisited = arrayCreate(arrayLength(_graph), mmc_mk_boolean(0 /* false */));

          omc_List_map2__0(threadData, _nodes, boxvar_Array_updateIndexFirst, mmc_mk_boolean(1 /* true */), _alreadyVisited);

          _successors1 = omc_List_flatten(threadData, omc_List_map1(threadData, _nodes, boxvar_Array_getIndexFirst, _graph));

          _check = omc_List_map1(threadData, _successors1, boxvar_Array_getIndexFirst, _alreadyVisited);

          omc_List_filterOnTrueSync(threadData, _check, boxvar_boolNot, _successors1 ,&_successors1);

          _successors1 = omc_List_unique(threadData, _successors1);
          tmpMeta1 = omc_HpcOmTaskGraph_getAllSuccessors2(threadData, _successors1, _graph, _alreadyVisited, _successors1);
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT218),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _successors = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _successors;
}

DLLDirection
modelica_integer omc_HpcOmTaskGraph_getCompInComps(threadData_t *threadData, modelica_integer _compIn, modelica_integer _compIdx, modelica_metatype _inComps, modelica_metatype _nodeMark)
{
  modelica_integer _compOut;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _compOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _mergedComp = NULL;
      modelica_integer _nodeMarkEntry;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _mergedComp has no default value.
      // _nodeMarkEntry has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_boolean tmp7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (arrayLength(_inComps) >= _compIdx);
          if (1 /* true */ != tmp6) goto goto_2;

          _mergedComp = arrayGet(_inComps, _compIdx);

          /* Pattern-matching assignment */
          tmp7 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_compIn), _mergedComp, boxvar_intEq);
          if (0 /* false */ != tmp7) goto goto_2;
          tmp1 = omc_HpcOmTaskGraph_getCompInComps(threadData, _compIn, ((modelica_integer) 1) + _compIdx, _inComps, _nodeMark);
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp8;
          modelica_boolean tmp9;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = (arrayLength(_inComps) >= _compIdx);
          if (1 /* true */ != tmp8) goto goto_2;

          _mergedComp = arrayGet(_inComps, _compIdx);

          /* Pattern-matching assignment */
          tmp9 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_compIn), _mergedComp, boxvar_intEq);
          if (1 /* true */ != tmp9) goto goto_2;
          tmp1 = _compIdx;
          goto tmp3_done;
        }
        case 2: {
          modelica_boolean tmp10;
          /* Pattern matching succeeded */
          _nodeMarkEntry = mmc_unbox_integer(arrayGet(_nodeMark, _compIn));

          /* Pattern-matching assignment */
          tmp10 = (_nodeMarkEntry < ((modelica_integer) 0));
          if (1 /* true */ != tmp10) goto goto_2;
          tmp1 = ((modelica_integer) -1);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          /* Pattern matching succeeded */
          tmpMeta11 = stringAppend(_OMC_LIT219,intString(_compIn));
          tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT220);
          tmpMeta13 = stringAppend(tmpMeta12,intString(arrayLength(_inComps)));
          tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT5);
          fputs(MMC_STRINGDATA(tmpMeta14),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 4) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _compOut = tmp1;
  _return: OMC_LABEL_UNUSED
  return _compOut;
}
modelica_metatype boxptr_HpcOmTaskGraph_getCompInComps(threadData_t *threadData, modelica_metatype _compIn, modelica_metatype _compIdx, modelica_metatype _inComps, modelica_metatype _nodeMark)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer _compOut;
  modelica_metatype out_compOut;
  tmp1 = mmc_unbox_integer(_compIn);
  tmp2 = mmc_unbox_integer(_compIdx);
  _compOut = omc_HpcOmTaskGraph_getCompInComps(threadData, tmp1, tmp2, _inComps, _nodeMark);
  out_compOut = mmc_mk_icon(_compOut);
  return out_compOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_markRemovedNodes(threadData_t *threadData, modelica_integer _nodeMarkIdx, modelica_metatype _removedNodes, modelica_metatype _nodeMarkIn)
{
  modelica_metatype _nodeMarkOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodeMarkOut has no default value.
  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (((modelica_integer) -2) == mmc_unbox_integer(arrayGet(_nodeMarkIn, _nodeMarkIdx)));
          if (1 /* true */ != tmp6) goto goto_2;
          tmpMeta1 = _nodeMarkIn;
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp7 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_nodeMarkIdx), _removedNodes, boxvar_intEq);
          if (0 /* false */ != tmp7) goto goto_2;
          tmpMeta1 = _nodeMarkIn;
          goto tmp3_done;
        }
        case 2: {
          modelica_boolean tmp8;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_nodeMarkIdx), _removedNodes, boxvar_intEq);
          if (1 /* true */ != tmp8) goto goto_2;
          tmpMeta1 = omc_Array_replaceAtWithFill(threadData, _nodeMarkIdx, mmc_mk_integer(((modelica_integer) -1)), mmc_mk_integer(((modelica_integer) 999)), _nodeMarkIn);
          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:;
    }
  }
  _nodeMarkOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _nodeMarkOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_markRemovedNodes(threadData_t *threadData, modelica_metatype _nodeMarkIdx, modelica_metatype _removedNodes, modelica_metatype _nodeMarkIn)
{
  modelica_integer tmp1;
  modelica_metatype _nodeMarkOut = NULL;
  tmp1 = mmc_unbox_integer(_nodeMarkIdx);
  _nodeMarkOut = omc_HpcOmTaskGraph_markRemovedNodes(threadData, tmp1, _removedNodes, _nodeMarkIn);
  /* skip box _nodeMarkOut; array<#Integer> */
  return _nodeMarkOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_cutSystemData(threadData_t *threadData, modelica_metatype _graphDataIn, modelica_metatype _cutNodes, modelica_metatype _cutNodeChildren)
{
  modelica_metatype _graphDataOut = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _rangeLst = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphDataOut has no default value.
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _nodeMark has no default value.
  // _rangeLst has no default value.
  // _compParamMapping has no default value.
  // _compInformations has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _graphDataIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
  _inComps = tmpMeta2;
  _varCompMapping = tmpMeta3;
  _eqCompMapping = tmpMeta4;
  _compParamMapping = tmpMeta5;
  _compNames = tmpMeta6;
  _compDescs = tmpMeta7;
  _exeCosts = tmpMeta8;
  _commCosts = tmpMeta9;
  _nodeMark = tmpMeta10;
  _compInformations = tmpMeta11;

  _inComps = listArray(omc_List_deletePositions(threadData, arrayList(_inComps), _cutNodes, 0 /* false */));

  _rangeLst = omc_List_intRange(threadData, arrayLength(_nodeMark));

  _nodeMark = omc_List_fold1(threadData, _rangeLst, boxvar_HpcOmTaskGraph_markRemovedNodes, _cutNodes, _nodeMark);

  tmpMeta12 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _graphDataOut = tmpMeta12;
  _return: OMC_LABEL_UNUSED
  return _graphDataOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_cutTaskGraph2(threadData_t *threadData, modelica_metatype _daeNodes, modelica_metatype _graphODE, modelica_metatype _cutNodesIn, modelica_metatype _graphDAE, modelica_metatype _odeMap, modelica_metatype *out_cutNodesOut)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _cutNodesOut = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _cutNodesOut has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _daeNodes;
    {
      modelica_integer _daeIdx;
      modelica_integer _odeIdx;
      modelica_metatype _rest = NULL;
      modelica_metatype _row = NULL;
      modelica_metatype _cutNodes = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _daeIdx has no default value.
      // _odeIdx has no default value.
      // _rest has no default value.
      // _row has no default value.
      // _cutNodes has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_boolean tmp9;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmp8 = mmc_unbox_integer(tmpMeta6);
          _daeIdx = tmp8  /* pattern as ty=Integer */;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          _odeIdx = mmc_unbox_integer(arrayGet(_odeMap, _daeIdx));

          /* Pattern-matching assignment */
          tmp9 = (_odeIdx > ((modelica_integer) 0));
          if (1 /* true */ != tmp9) goto goto_2;

          _row = arrayGet(_graphDAE, _daeIdx);

          _row = omc_List_map1(threadData, _row, boxvar_Array_getIndexFirst, _odeMap);

          _row = omc_List_filter1OnTrue(threadData, _row, boxvar_intGt, mmc_mk_integer(((modelica_integer) 0)));

          arrayUpdate(_graphODE, _odeIdx, _row);

          omc_HpcOmTaskGraph_cutTaskGraph2(threadData, _rest, _graphODE, _cutNodesIn, _graphDAE, _odeMap ,&_cutNodes);
          tmpMeta[0+0] = _graphODE;
          tmpMeta[0+1] = _cutNodes;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_integer tmp12;
          modelica_boolean tmp13;
          modelica_metatype tmpMeta14;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta10 = MMC_CAR(tmp4_1);
          tmpMeta11 = MMC_CDR(tmp4_1);
          tmp12 = mmc_unbox_integer(tmpMeta10);
          _daeIdx = tmp12  /* pattern as ty=Integer */;
          _rest = tmpMeta11;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          _odeIdx = mmc_unbox_integer(arrayGet(_odeMap, _daeIdx));

          /* Pattern-matching assignment */
          tmp13 = (_odeIdx == ((modelica_integer) -1));
          if (1 /* true */ != tmp13) goto goto_2;

          tmpMeta14 = mmc_mk_cons(mmc_mk_integer(_daeIdx), _cutNodesIn);
          omc_HpcOmTaskGraph_cutTaskGraph2(threadData, _rest, _graphODE, tmpMeta14, _graphDAE, _odeMap ,&_cutNodes);
          tmpMeta[0+0] = _graphODE;
          tmpMeta[0+1] = _cutNodes;
          goto tmp3_done;
        }
        case 2: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _graphODE;
          tmpMeta[0+1] = _cutNodesIn;
          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:;
    }
  }
  _graphOut = tmpMeta[0+0];
  _cutNodesOut = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_cutNodesOut) { *out_cutNodesOut = _cutNodesOut; }
  return _graphOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_cutTaskGraph(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _exceptNodes, modelica_metatype _whenNodes, modelica_metatype *out_cutNodesOut)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _cutNodesOut = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _cutNodesOut has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _exceptNodes;
    {
      modelica_integer _sizeDAE;
      modelica_integer _sizeODE;
      modelica_metatype _graphT = NULL;
      modelica_metatype _graphODE = NULL;
      modelica_metatype _odeNodes = NULL;
      modelica_metatype _odeMap = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _sizeDAE has no default value.
      // _sizeODE has no default value.
      // _graphT has no default value.
      // _graphODE has no default value.
      // _odeNodes has no default value.
      // _odeMap has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmp8 = mmc_unbox_integer(tmpMeta6);
          if (-1 != tmp8) goto tmp3_end;
          if (!listEmpty(tmpMeta7)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta9 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = _graphIn;
          tmpMeta[0+1] = tmpMeta9;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          
          /* Pattern matching succeeded */
          _sizeDAE = arrayLength(_graphIn);

          _graphT = omc_AdjacencyMatrix_transposeAdjacencyMatrix(threadData, _graphIn, _sizeDAE);

          _odeNodes = listAppend(_exceptNodes, omc_HpcOmTaskGraph_getAllSuccessors(threadData, _exceptNodes, _graphT));

          omc_List_intersection1OnTrue(threadData, _odeNodes, _whenNodes, boxvar_intEq ,&_odeNodes ,NULL);

          _odeNodes = omc_List_intersection1OnTrue(threadData, omc_List_intRange(threadData, _sizeDAE), _odeNodes, boxvar_intEq, NULL, NULL);

          _odeNodes = omc_List_sort(threadData, _odeNodes, boxvar_intGt);

          _sizeODE = listLength(_odeNodes);

          _odeMap = arrayCreate(_sizeDAE, mmc_mk_integer(((modelica_integer) -1)));

          omc_List_threadMap1__0(threadData, _odeNodes, omc_List_intRange(threadData, _sizeODE), boxvar_Array_updateIndexFirst, _odeMap);

          tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
          _graphODE = arrayCreate(_sizeODE, tmpMeta10);
          tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = omc_HpcOmTaskGraph_cutTaskGraph2(threadData, omc_List_intRange(threadData, _sizeDAE), _graphODE, tmpMeta11, _graphIn, _odeMap, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT221),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _graphOut = tmpMeta[0+0];
  _cutNodesOut = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_cutNodesOut) { *out_cutNodesOut = _cutNodesOut; }
  return _graphOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getStates(threadData_t *threadData, modelica_metatype _inVarLst, modelica_metatype _stateVarsIn, modelica_integer _Idx)
{
  modelica_metatype _stateVarsOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _stateVarsOut has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _inVarLst;
    {
      modelica_metatype _head = NULL;
      modelica_metatype _rest = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _head has no default value.
      // _rest has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_boolean tmp8;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          _head = tmpMeta6;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = omc_BackendVariable_isStateVar(threadData, _head);
          if (0 /* false */ != tmp8) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_getStates(threadData, _rest, _stateVarsIn, ((modelica_integer) 1) + _Idx);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_boolean tmp11;
          modelica_metatype tmpMeta12;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta9 = MMC_CAR(tmp4_1);
          tmpMeta10 = MMC_CDR(tmp4_1);
          _head = tmpMeta9;
          _rest = tmpMeta10;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          /* Pattern-matching assignment */
          tmp11 = omc_BackendVariable_isStateVar(threadData, _head);
          if (1 /* true */ != tmp11) goto goto_2;
          tmpMeta12 = mmc_mk_cons(mmc_mk_integer(_Idx), _stateVarsIn);
          tmpMeta1 = omc_HpcOmTaskGraph_getStates(threadData, _rest, tmpMeta12, ((modelica_integer) 1) + _Idx);
          goto tmp3_done;
        }
        case 2: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = _stateVarsIn;
          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:;
    }
  }
  _stateVarsOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _stateVarsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getStates(threadData_t *threadData, modelica_metatype _inVarLst, modelica_metatype _stateVarsIn, modelica_metatype _Idx)
{
  modelica_integer tmp1;
  modelica_metatype _stateVarsOut = NULL;
  tmp1 = mmc_unbox_integer(_Idx);
  _stateVarsOut = omc_HpcOmTaskGraph_getStates(threadData, _inVarLst, _stateVarsIn, tmp1);
  /* skip box _stateVarsOut; list<#Integer> */
  return _stateVarsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getAllStateNodes(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _varCompMapping, modelica_metatype _inComps, modelica_metatype _stateInfoIn)
{
  modelica_metatype _stateInfoOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _stateInfoOut has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _stateInfoIn;
    {
      modelica_metatype _stateNodes = NULL;
      modelica_metatype _stateNodesIn = NULL;
      modelica_metatype _stateVars = NULL;
      modelica_integer _varOffset;
      modelica_integer _varOffsetNew;
      modelica_metatype _orderedVars = NULL;
      modelica_metatype _varLst = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _stateNodes has no default value.
      // _stateNodesIn has no default value.
      // _stateVars has no default value.
      // _varOffset has no default value.
      // _varOffsetNew has no default value.
      // _orderedVars has no default value.
      // _varLst has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_boolean tmp12;
          modelica_metatype tmpMeta13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          _stateNodesIn = tmpMeta6;
          _varOffset = tmp8  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta9 = _systIn;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
          _orderedVars = tmpMeta10;

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
          _stateVars = omc_HpcOmTaskGraph_getStates(threadData, _varLst, tmpMeta11, ((modelica_integer) 1));

          /* Pattern-matching assignment */
          tmp12 = listEmpty(_stateVars);
          if (0 /* false */ != tmp12) goto goto_2;

          _stateVars = omc_List_map1(threadData, _stateVars, boxvar_intAdd, mmc_mk_integer(_varOffset));

          _stateNodes = omc_HpcOmTaskGraph_getArrayTuple31(threadData, _stateVars, _varCompMapping);

          _stateNodes = omc_List_map3(threadData, _stateNodes, boxvar_HpcOmTaskGraph_getCompInComps, mmc_mk_integer(((modelica_integer) 1)), _inComps, arrayCreate(arrayLength(_inComps), mmc_mk_integer(((modelica_integer) 0))));

          _stateNodes = listAppend(_stateNodesIn, _stateNodes);

          _varOffsetNew = listLength(_varLst) + _varOffset;
          tmpMeta13 = mmc_mk_box2(0, _stateNodes, mmc_mk_integer(_varOffsetNew));
          tmpMeta1 = tmpMeta13;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_integer tmp16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_boolean tmp20;
          modelica_metatype tmpMeta21;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp16 = mmc_unbox_integer(tmpMeta15);
          _stateNodesIn = tmpMeta14;
          _varOffset = tmp16  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta17 = _systIn;
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
          _orderedVars = tmpMeta18;

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta19 = MMC_REFSTRUCTLIT(mmc_nil);
          _stateVars = omc_HpcOmTaskGraph_getStates(threadData, _varLst, tmpMeta19, ((modelica_integer) 1));

          /* Pattern-matching assignment */
          tmp20 = listEmpty(_stateVars);
          if (1 /* true */ != tmp20) goto goto_2;

          _varOffsetNew = listLength(_varLst) + _varOffset;
          tmpMeta21 = mmc_mk_box2(0, _stateNodesIn, mmc_mk_integer(_varOffsetNew));
          tmpMeta1 = tmpMeta21;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta22 = _systIn;
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta22), 2));
          _orderedVars = tmpMeta23;

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
          _stateVars = omc_HpcOmTaskGraph_getStates(threadData, _varLst, tmpMeta24, ((modelica_integer) 1));

          tmpMeta25 = stringAppend(_OMC_LIT222,intString(listLength(_stateVars)));
          tmpMeta26 = stringAppend(tmpMeta25,_OMC_LIT5);
          fputs(MMC_STRINGDATA(tmpMeta26),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 3) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _stateInfoOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _stateInfoOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getOdeSystem(threadData_t *threadData, modelica_metatype _graphIn, modelica_metatype _graphDataIn, modelica_metatype _systIn, modelica_metatype *out_graphDataOdeOut)
{
  modelica_metatype _graphOdeOut = NULL;
  modelica_metatype _graphDataOdeOut = NULL;
  modelica_metatype _stateNodes = NULL;
  modelica_metatype _whenNodes = NULL;
  modelica_metatype _cutNodes = NULL;
  modelica_metatype _cutNodeChildren = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _systs = NULL;
  modelica_metatype _graphTmp = NULL;
  modelica_metatype _graphDataTmp = 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
  // _graphOdeOut has no default value.
  // _graphDataOdeOut has no default value.
  // _stateNodes has no default value.
  // _whenNodes has no default value.
  // _cutNodes has no default value.
  // _cutNodeChildren has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _inComps has no default value.
  // _systs has no default value.
  // _graphTmp has no default value.
  // _graphDataTmp has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _graphDataIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  _inComps = tmpMeta2;
  _varCompMapping = tmpMeta3;
  _eqCompMapping = tmpMeta4;

  /* Pattern-matching assignment */
  tmpMeta5 = _systIn;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
  _systs = tmpMeta6;

  /* Pattern-matching assignment */
  tmpMeta7 = omc_List_fold2(threadData, _systs, boxvar_HpcOmTaskGraph_getAllStateNodes, _varCompMapping, _inComps, _OMC_LIT210);
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
  _stateNodes = tmpMeta8;

  _whenNodes = omc_HpcOmTaskGraph_getEventNodes(threadData, _systIn, _eqCompMapping);

  _graphTmp = arrayCopy(_graphIn);

  _graphOdeOut = omc_HpcOmTaskGraph_cutTaskGraph(threadData, _graphTmp, _stateNodes, _whenNodes ,&_cutNodes);

  _cutNodeChildren = omc_List_flatten(threadData, omc_List_map1(threadData, listAppend(_cutNodes, _whenNodes), boxvar_Array_getIndexFirst, _graphIn));

  omc_List_intersection1OnTrue(threadData, _cutNodeChildren, _cutNodes, boxvar_intEq ,&_cutNodeChildren ,NULL);

  _graphDataOdeOut = omc_HpcOmTaskGraph_cutSystemData(threadData, _graphDataIn, _cutNodes, _cutNodeChildren);
  _return: OMC_LABEL_UNUSED
  if (out_graphDataOdeOut) { *out_graphDataOdeOut = _graphDataOdeOut; }
  return _graphOdeOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateMappingTuple(threadData_t *threadData, modelica_integer _varIdx, modelica_integer _sccIdx, modelica_integer _iEqSysIdx, modelica_integer _iVarOffset, modelica_metatype _iMapping)
{
  modelica_metatype _oMapping = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  tmpMeta1 = mmc_mk_box3(0, mmc_mk_integer(_sccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset));
  _oMapping = arrayUpdate(_iMapping, _varIdx + _iVarOffset, tmpMeta1);
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateMappingTuple(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _sccIdx, modelica_metatype _iEqSysIdx, modelica_metatype _iVarOffset, modelica_metatype _iMapping)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_integer tmp4;
  modelica_metatype _oMapping = NULL;
  tmp1 = mmc_unbox_integer(_varIdx);
  tmp2 = mmc_unbox_integer(_sccIdx);
  tmp3 = mmc_unbox_integer(_iEqSysIdx);
  tmp4 = mmc_unbox_integer(_iVarOffset);
  _oMapping = omc_HpcOmTaskGraph_updateMappingTuple(threadData, tmp1, tmp2, tmp3, tmp4, _iMapping);
  /* skip box _oMapping; array<tuple<#Integer, #Integer, #Integer>> */
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateMapping(threadData_t *threadData, modelica_integer _varIdx, modelica_integer _sccIdx, modelica_metatype _iMapping)
{
  modelica_metatype _oMapping = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  _oMapping = arrayUpdate(_iMapping, _varIdx, mmc_mk_integer(_sccIdx));
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateMapping(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _sccIdx, modelica_metatype _iMapping)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _oMapping = NULL;
  tmp1 = mmc_unbox_integer(_varIdx);
  tmp2 = mmc_unbox_integer(_sccIdx);
  _oMapping = omc_HpcOmTaskGraph_updateMapping(threadData, tmp1, tmp2, _iMapping);
  /* skip box _oMapping; array<#Integer> */
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_othersInTearComp(threadData_t *threadData, modelica_metatype _otherEqnVarTpl, modelica_metatype _othersIn)
{
  modelica_metatype _othersOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _othersOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_integer _eq;
      modelica_metatype _eqLst = NULL;
      modelica_metatype _varTplLst = NULL;
      modelica_metatype _varLst = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _eq has no default value.
      // _eqLst has no default value.
      // _varTplLst has no default value.
      // _varLst has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta6 = _otherEqnVarTpl;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          _eq = tmp8  /* pattern as ty=Integer */;
          _varTplLst = tmpMeta9;

          listGet(_varTplLst, ((modelica_integer) 1));

          /* Pattern-matching assignment */
          tmpMeta10 = _othersIn;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 1));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
          _eqLst = tmpMeta11;
          _varLst = tmpMeta12;

          _varLst = listAppend(_varTplLst, _varLst);

          tmpMeta13 = mmc_mk_cons(mmc_mk_integer(_eq), _eqLst);
          _eqLst = tmpMeta13;
          tmpMeta14 = mmc_mk_box2(0, _eqLst, _varLst);
          tmpMeta1 = tmpMeta14;
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT223),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _othersOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _othersOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSccNodeMapping1(threadData_t *threadData, modelica_integer _iCompIdx, modelica_metatype _iNodeMark, modelica_metatype _iArrayNodeIdx)
{
  modelica_metatype _oArrayNodeIdx = NULL;
  modelica_integer _iNodeIdx;
  modelica_integer _offset;
  modelica_integer _nodeMark;
  modelica_metatype _iMappingArray = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oArrayNodeIdx has no default value.
  // _iNodeIdx has no default value.
  // _offset has no default value.
  // _nodeMark has no default value.
  // _iMappingArray has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iArrayNodeIdx;
    {
      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_boolean tmp9;
          modelica_metatype tmpMeta10;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          _iMappingArray = tmpMeta6;
          _iNodeIdx = tmp8  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          _nodeMark = mmc_unbox_integer(arrayGet(_iNodeMark, _iCompIdx));

          /* Pattern-matching assignment */
          tmp9 = (((modelica_integer) -1) != _nodeMark);
          if (1 /* true */ != tmp9) goto goto_2;

          _iMappingArray = arrayUpdate(_iMappingArray, _iCompIdx, mmc_mk_integer(_iNodeIdx));
          tmpMeta10 = mmc_mk_box2(0, _iMappingArray, mmc_mk_integer(_iNodeIdx));
          tmpMeta1 = tmpMeta10;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          _iMappingArray = tmpMeta11;
          _iNodeIdx = tmp13  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta14 = mmc_mk_box2(0, _iMappingArray, mmc_mk_integer(_iNodeIdx));
          tmpMeta1 = tmpMeta14;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oArrayNodeIdx = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oArrayNodeIdx;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSccNodeMapping1(threadData_t *threadData, modelica_metatype _iCompIdx, modelica_metatype _iNodeMark, modelica_metatype _iArrayNodeIdx)
{
  modelica_integer tmp1;
  modelica_metatype _oArrayNodeIdx = NULL;
  tmp1 = mmc_unbox_integer(_iCompIdx);
  _oArrayNodeIdx = omc_HpcOmTaskGraph_getSccNodeMapping1(threadData, tmp1, _iNodeMark, _iArrayNodeIdx);
  /* skip box _oArrayNodeIdx; tuple<array<#Integer>, #Integer> */
  return _oArrayNodeIdx;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSccNodeMapping0(threadData_t *threadData, modelica_metatype _iCompsOfNode, modelica_metatype _iNodeMarks, modelica_metatype _iArrayNodeIdx)
{
  modelica_metatype _oArrayNodeIdx = NULL;
  modelica_metatype _tmpMappingArray = NULL;
  modelica_integer _nodeIdx;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_integer tmp4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oArrayNodeIdx has no default value.
  // _tmpMappingArray has no default value.
  // _nodeIdx has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = omc_List_fold1(threadData, _iCompsOfNode, boxvar_HpcOmTaskGraph_getSccNodeMapping1, _iNodeMarks, _iArrayNodeIdx);
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp4 = mmc_unbox_integer(tmpMeta3);
  _tmpMappingArray = tmpMeta2;
  _nodeIdx = tmp4  /* pattern as ty=Integer */;

  tmpMeta5 = mmc_mk_box2(0, _tmpMappingArray, mmc_mk_integer(((modelica_integer) 1) + _nodeIdx));
  _oArrayNodeIdx = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _oArrayNodeIdx;
}

static modelica_metatype closure20_HpcOmTaskGraph_getSccNodeMapping0(threadData_t *thData, modelica_metatype closure, modelica_metatype iCompsOfNode, modelica_metatype iArrayNodeIdx)
{
  modelica_metatype iNodeMarks = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_HpcOmTaskGraph_getSccNodeMapping0(thData, iCompsOfNode, iNodeMarks, iArrayNodeIdx);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getSccNodeMapping(threadData_t *threadData, modelica_integer _iNumberOfSccs, modelica_metatype _iTaskGraphMeta)
{
  modelica_metatype _oMapping = NULL;
  modelica_metatype _tmpMappingArray = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _nodeMark = 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
  // _oMapping has no default value.
  // _tmpMappingArray has no default value.
  // _inComps has no default value.
  // _nodeMark has no default value.
  _tmpMappingArray = arrayCreate(_iNumberOfSccs, mmc_mk_integer(((modelica_integer) -1)));

  /* Pattern-matching assignment */
  tmpMeta1 = _iTaskGraphMeta;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  _inComps = tmpMeta2;
  _nodeMark = tmpMeta3;

  /* Pattern-matching assignment */
  tmpMeta4 = mmc_mk_box1(0, _nodeMark);
  tmpMeta5 = mmc_mk_box2(0, _tmpMappingArray, mmc_mk_integer(((modelica_integer) 1)));
  tmpMeta6 = omc_Array_fold(threadData, _inComps, (modelica_fnptr) mmc_mk_box2(0,closure20_HpcOmTaskGraph_getSccNodeMapping0,tmpMeta4), tmpMeta5);
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
  _oMapping = tmpMeta7;
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}
modelica_metatype boxptr_HpcOmTaskGraph_getSccNodeMapping(threadData_t *threadData, modelica_metatype _iNumberOfSccs, modelica_metatype _iTaskGraphMeta)
{
  modelica_integer tmp1;
  modelica_metatype _oMapping = NULL;
  tmp1 = mmc_unbox_integer(_iNumberOfSccs);
  _oMapping = omc_HpcOmTaskGraph_getSccNodeMapping(threadData, tmp1, _iTaskGraphMeta);
  /* skip box _oMapping; array<#Integer> */
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getVarEqCompMapping0(threadData_t *threadData, modelica_metatype _component, modelica_metatype _varCompMapping, modelica_metatype _eqCompMapping, modelica_integer _iEqSysIdx, modelica_metatype _iVarEqOffset, modelica_integer _iSccIdx)
{
  modelica_integer _oSccIdx;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSccIdx has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _component;
    tmp4_2 = _iVarEqOffset;
    {
      modelica_integer _compVarIdx;
      modelica_integer _iVarOffset;
      modelica_integer _iEqOffset;
      modelica_integer _eq;
      modelica_metatype _compVarIdc = NULL;
      modelica_metatype _eqns = NULL;
      modelica_metatype _residuals = NULL;
      modelica_metatype _othereqs = NULL;
      modelica_metatype _othervars = NULL;
      modelica_metatype _othervarsLst = NULL;
      modelica_metatype _innerEquations = NULL;
      modelica_string _helperStr = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _compVarIdx has no default value.
      // _iVarOffset has no default value.
      // _iEqOffset has no default value.
      // _eq has no default value.
      // _compVarIdc has no default value.
      // _eqns has no default value.
      // _residuals has no default value.
      // _othereqs has no default value.
      // _othervars has no default value.
      // _othervarsLst has no default value.
      // _innerEquations has no default value.
      // _helperStr has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 9; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          _eq = tmp7  /* pattern as ty=Integer */;
          _compVarIdx = tmp9  /* pattern as ty=Integer */;
          _iVarOffset = tmp11  /* pattern as ty=Integer */;
          _iEqOffset = tmp13  /* pattern as ty=Integer */;
          tmp4 += 7; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta14 = mmc_mk_box3(0, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset));
          arrayUpdate(_varCompMapping, _compVarIdx + _iVarOffset, tmpMeta14);

          tmpMeta15 = mmc_mk_box3(0, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset));
          arrayUpdate(_eqCompMapping, _eq + _iEqOffset, tmpMeta15);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_metatype tmpMeta20;
          modelica_integer tmp21;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,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));
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp19 = mmc_unbox_integer(tmpMeta18);
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp21 = mmc_unbox_integer(tmpMeta20);
          _eqns = tmpMeta16;
          _compVarIdc = tmpMeta17;
          _iVarOffset = tmp19  /* pattern as ty=Integer */;
          _iEqOffset = tmp21  /* pattern as ty=Integer */;
          tmp4 += 6; /* Pattern matching succeeded; we may skip some cases if we fail */
          omc_List_fold3(threadData, _compVarIdc, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset), _varCompMapping);

          omc_List_fold3(threadData, _eqns, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset), _eqCompMapping);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta22;
          modelica_integer tmp23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_integer tmp26;
          modelica_metatype tmpMeta27;
          modelica_integer tmp28;
          modelica_metatype tmpMeta29;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp23 = mmc_unbox_integer(tmpMeta22);
          tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp26 = mmc_unbox_integer(tmpMeta25);
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp28 = mmc_unbox_integer(tmpMeta27);
          _eq = tmp23  /* pattern as ty=Integer */;
          _compVarIdc = tmpMeta24;
          _iVarOffset = tmp26  /* pattern as ty=Integer */;
          _iEqOffset = tmp28  /* pattern as ty=Integer */;
          tmp4 += 5; /* Pattern matching succeeded; we may skip some cases if we fail */
          omc_List_fold3(threadData, _compVarIdc, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset), _varCompMapping);

          tmpMeta29 = mmc_mk_box3(0, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset));
          arrayUpdate(_eqCompMapping, _eq + _iEqOffset, tmpMeta29);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta30;
          modelica_integer tmp31;
          modelica_metatype tmpMeta32;
          modelica_metatype tmpMeta33;
          modelica_integer tmp34;
          modelica_metatype tmpMeta35;
          modelica_integer tmp36;
          modelica_metatype tmpMeta37;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
          tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp31 = mmc_unbox_integer(tmpMeta30);
          tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp34 = mmc_unbox_integer(tmpMeta33);
          tmpMeta35 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp36 = mmc_unbox_integer(tmpMeta35);
          _eq = tmp31  /* pattern as ty=Integer */;
          _compVarIdc = tmpMeta32;
          _iVarOffset = tmp34  /* pattern as ty=Integer */;
          _iEqOffset = tmp36  /* pattern as ty=Integer */;
          tmp4 += 4; /* Pattern matching succeeded; we may skip some cases if we fail */
          omc_List_fold3(threadData, _compVarIdc, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset), _varCompMapping);

          tmpMeta37 = mmc_mk_box3(0, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset));
          arrayUpdate(_eqCompMapping, _eq + _iEqOffset, tmpMeta37);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta38;
          modelica_integer tmp39;
          modelica_metatype tmpMeta40;
          modelica_metatype tmpMeta41;
          modelica_integer tmp42;
          modelica_metatype tmpMeta43;
          modelica_integer tmp44;
          modelica_metatype tmpMeta45;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
          tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp39 = mmc_unbox_integer(tmpMeta38);
          tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp42 = mmc_unbox_integer(tmpMeta41);
          tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp44 = mmc_unbox_integer(tmpMeta43);
          _eq = tmp39  /* pattern as ty=Integer */;
          _compVarIdc = tmpMeta40;
          _iVarOffset = tmp42  /* pattern as ty=Integer */;
          _iEqOffset = tmp44  /* pattern as ty=Integer */;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          omc_List_fold3(threadData, _compVarIdc, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset), _varCompMapping);

          tmpMeta45 = mmc_mk_box3(0, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset));
          arrayUpdate(_eqCompMapping, _eq + _iEqOffset, tmpMeta45);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta46;
          modelica_integer tmp47;
          modelica_metatype tmpMeta48;
          modelica_metatype tmpMeta49;
          modelica_integer tmp50;
          modelica_metatype tmpMeta51;
          modelica_integer tmp52;
          modelica_metatype tmpMeta53;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,2) == 0) goto tmp3_end;
          tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp47 = mmc_unbox_integer(tmpMeta46);
          tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp50 = mmc_unbox_integer(tmpMeta49);
          tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp52 = mmc_unbox_integer(tmpMeta51);
          _eq = tmp47  /* pattern as ty=Integer */;
          _compVarIdc = tmpMeta48;
          _iVarOffset = tmp50  /* pattern as ty=Integer */;
          _iEqOffset = tmp52  /* pattern as ty=Integer */;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          omc_List_fold3(threadData, _compVarIdc, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset), _varCompMapping);

          tmpMeta53 = mmc_mk_box3(0, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset));
          arrayUpdate(_eqCompMapping, _eq + _iEqOffset, tmpMeta53);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta54;
          modelica_metatype tmpMeta55;
          modelica_metatype tmpMeta56;
          modelica_metatype tmpMeta57;
          modelica_metatype tmpMeta58;
          modelica_integer tmp59;
          modelica_metatype tmpMeta60;
          modelica_integer tmp61;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,4) == 0) goto tmp3_end;
          tmpMeta54 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta55 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 2));
          tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 3));
          tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta54), 4));
          tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp59 = mmc_unbox_integer(tmpMeta58);
          tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp61 = mmc_unbox_integer(tmpMeta60);
          _compVarIdc = tmpMeta55;
          _residuals = tmpMeta56;
          _innerEquations = tmpMeta57;
          _iVarOffset = tmp59  /* pattern as ty=Integer */;
          _iEqOffset = tmp61  /* pattern as ty=Integer */;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          _othereqs = omc_List_map__3(threadData, _innerEquations, boxvar_BackendDAEUtil_getEqnAndVarsFromInnerEquation ,&_othervarsLst ,NULL);

          _othervars = omc_List_flatten(threadData, _othervarsLst);

          _compVarIdc = listAppend(_othervars, _compVarIdc);

          _eqns = listAppend(_othereqs, _residuals);

          omc_List_fold3(threadData, _compVarIdc, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset), _varCompMapping);

          omc_List_fold3(threadData, _eqns, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset), _eqCompMapping);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta62;
          modelica_integer tmp63;
          modelica_metatype tmpMeta64;
          modelica_metatype tmpMeta65;
          modelica_integer tmp66;
          modelica_metatype tmpMeta67;
          modelica_integer tmp68;
          modelica_metatype tmpMeta69;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp63 = mmc_unbox_integer(tmpMeta62);
          tmpMeta64 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta65 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp66 = mmc_unbox_integer(tmpMeta65);
          tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp68 = mmc_unbox_integer(tmpMeta67);
          _eq = tmp63  /* pattern as ty=Integer */;
          _compVarIdc = tmpMeta64;
          _iVarOffset = tmp66  /* pattern as ty=Integer */;
          _iEqOffset = tmp68  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          omc_List_fold3(threadData, _compVarIdc, boxvar_HpcOmTaskGraph_updateMappingTuple, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iVarOffset), _varCompMapping);

          tmpMeta69 = mmc_mk_box3(0, mmc_mk_integer(_iSccIdx), mmc_mk_integer(_iEqSysIdx), mmc_mk_integer(_iEqOffset));
          arrayUpdate(_eqCompMapping, _eq + _iEqOffset, tmpMeta69);
          tmp1 = ((modelica_integer) 1) + _iSccIdx;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta70;
          modelica_metatype tmpMeta71;
          
          /* Pattern matching succeeded */
          _helperStr = omc_BackendDump_strongComponentString(threadData, _component);

          tmpMeta70 = stringAppend(_OMC_LIT224,_helperStr);
          tmpMeta71 = stringAppend(tmpMeta70,_OMC_LIT5);
          fputs(MMC_STRINGDATA(tmpMeta71),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 9) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oSccIdx = tmp1;
  _return: OMC_LABEL_UNUSED
  return _oSccIdx;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarEqCompMapping0(threadData_t *threadData, modelica_metatype _component, modelica_metatype _varCompMapping, modelica_metatype _eqCompMapping, modelica_metatype _iEqSysIdx, modelica_metatype _iVarEqOffset, modelica_metatype _iSccIdx)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer _oSccIdx;
  modelica_metatype out_oSccIdx;
  tmp1 = mmc_unbox_integer(_iEqSysIdx);
  tmp2 = mmc_unbox_integer(_iSccIdx);
  _oSccIdx = omc_HpcOmTaskGraph_getVarEqCompMapping0(threadData, _component, _varCompMapping, _eqCompMapping, tmp1, _iVarEqOffset, tmp2);
  out_oSccIdx = mmc_mk_icon(_oSccIdx);
  return out_oSccIdx;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarEqCompMapping(threadData_t *threadData, modelica_metatype _components, modelica_integer _iEqSysIdx, modelica_integer _iVarIdxOffset, modelica_integer _iEqIdxOffset, modelica_metatype _ivarCompMapping, modelica_metatype _ieqCompMapping, modelica_metatype *out_oeqCompMapping)
{
  modelica_metatype _ovarCompMapping = NULL;
  modelica_metatype _oeqCompMapping = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ovarCompMapping has no default value.
  // _oeqCompMapping has no default value.
  tmpMeta1 = mmc_mk_box2(0, mmc_mk_integer(_iVarIdxOffset), mmc_mk_integer(_iEqIdxOffset));
  omc_List_fold4(threadData, _components, boxvar_HpcOmTaskGraph_getVarEqCompMapping0, _ivarCompMapping, _ieqCompMapping, mmc_mk_integer(_iEqSysIdx), tmpMeta1, mmc_mk_integer(((modelica_integer) 1)));

  _ovarCompMapping = _ivarCompMapping;

  _oeqCompMapping = _ieqCompMapping;
  _return: OMC_LABEL_UNUSED
  if (out_oeqCompMapping) { *out_oeqCompMapping = _oeqCompMapping; }
  return _ovarCompMapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarEqCompMapping(threadData_t *threadData, modelica_metatype _components, modelica_metatype _iEqSysIdx, modelica_metatype _iVarIdxOffset, modelica_metatype _iEqIdxOffset, modelica_metatype _ivarCompMapping, modelica_metatype _ieqCompMapping, modelica_metatype *out_oeqCompMapping)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_metatype _ovarCompMapping = NULL;
  tmp1 = mmc_unbox_integer(_iEqSysIdx);
  tmp2 = mmc_unbox_integer(_iVarIdxOffset);
  tmp3 = mmc_unbox_integer(_iEqIdxOffset);
  _ovarCompMapping = omc_HpcOmTaskGraph_getVarEqCompMapping(threadData, _components, tmp1, tmp2, tmp3, _ivarCompMapping, _ieqCompMapping, out_oeqCompMapping);
  /* skip box _ovarCompMapping; array<tuple<#Integer, #Integer, #Integer>> */
  /* skip box _oeqCompMapping; array<tuple<#Integer, #Integer, #Integer>> */
  return _ovarCompMapping;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareIntTuple2(threadData_t *threadData, modelica_metatype _tuple1, modelica_metatype _tuple2)
{
  modelica_boolean _equals;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _equals has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _tuple1;
    tmp4_2 = _tuple2;
    {
      modelica_integer _int1;
      modelica_integer _int2;
      modelica_integer _int3;
      modelica_integer _int4;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _int1 has no default value.
      // _int2 has no default value.
      // _int3 has no default value.
      // _int4 has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          _int1 = tmp7  /* pattern as ty=Integer */;
          _int2 = tmp9  /* pattern as ty=Integer */;
          _int3 = tmp11  /* pattern as ty=Integer */;
          _int4 = tmp13  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          equality(mmc_mk_integer(_int1), mmc_mk_integer(_int3));

          equality(mmc_mk_integer(_int2), mmc_mk_integer(_int4));
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          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:;
    }
  }
  _equals = tmp1;
  _return: OMC_LABEL_UNUSED
  return _equals;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareIntTuple2(threadData_t *threadData, modelica_metatype _tuple1, modelica_metatype _tuple2)
{
  modelica_boolean _equals;
  modelica_metatype out_equals;
  _equals = omc_HpcOmTaskGraph_compareIntTuple2(threadData, _tuple1, _tuple2);
  out_equals = mmc_mk_icon(_equals);
  return out_equals;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarTuple(threadData_t *threadData, modelica_integer _varIdx)
{
  modelica_metatype _outIdx = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outIdx has no default value.
  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (((modelica_integer) 0) <= _varIdx);
          if (1 /* true */ != tmp6) goto goto_2;
          tmpMeta7 = mmc_mk_box2(0, mmc_mk_integer(_varIdx), mmc_mk_integer(((modelica_integer) 1)));
          tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          /* Pattern matching succeeded */
          tmpMeta8 = mmc_mk_box2(0, mmc_mk_integer((-_varIdx)), mmc_mk_integer(((modelica_integer) 0)));
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _outIdx = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outIdx;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarTuple(threadData_t *threadData, modelica_metatype _varIdx)
{
  modelica_integer tmp1;
  modelica_metatype _outIdx = NULL;
  tmp1 = mmc_unbox_integer(_varIdx);
  _outIdx = omc_HpcOmTaskGraph_getVarTuple(threadData, tmp1);
  /* skip box _outIdx; tuple<#Integer, #Integer> */
  return _outIdx;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarsByEqns(threadData_t *threadData, modelica_metatype _iEqnIdc, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_metatype _oAdjacencyVars = NULL;
  modelica_metatype _oParamVars = NULL;
  modelica_metatype _adjacencyVars = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _paramVars = NULL;
  modelica_metatype tmpMeta2;
  modelica_metatype _eqs = NULL;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oAdjacencyVars has no default value.
  // _oParamVars has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _adjacencyVars = tmpMeta1;
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _paramVars = tmpMeta2;
  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  _eqs = tmpMeta3;
  {
    modelica_metatype _eqIdx;
    for (tmpMeta4 = _iEqnIdc; !listEmpty(tmpMeta4); tmpMeta4=MMC_CDR(tmpMeta4))
    {
      _eqIdx = MMC_CAR(tmpMeta4);
      _adjacencyVars = listAppend(arrayGet(_iAdjacencyMatrix, mmc_unbox_integer(_eqIdx)), _adjacencyVars);

      tmpMeta5 = mmc_mk_cons(omc_BackendEquation_get(threadData, _iOrderedEquations, mmc_unbox_integer(_eqIdx)), _eqs);
      _eqs = tmpMeta5;
    }
  }

  _oAdjacencyVars = omc_List_map(threadData, _adjacencyVars, boxvar_HpcOmTaskGraph_getVarTuple);

  if(_iAnalyzeParameters)
  {
    _paramVars = omc_BackendEquation_equationsParams(threadData, _eqs, _iKnownVars ,&_oParamVars);
  }
  else
  {
    tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
    _oParamVars = tmpMeta7;
  }
  _return: OMC_LABEL_UNUSED
  if (out_oParamVars) { *out_oParamVars = _oParamVars; }
  return _oAdjacencyVars;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarsByEqns(threadData_t *threadData, modelica_metatype _iEqnIdc, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_integer tmp1;
  modelica_metatype _oAdjacencyVars = NULL;
  tmp1 = mmc_unbox_integer(_iAnalyzeParameters);
  _oAdjacencyVars = omc_HpcOmTaskGraph_getVarsByEqns(threadData, _iEqnIdc, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, tmp1, out_oParamVars);
  /* skip box _oAdjacencyVars; list<tuple<#Integer, #Integer>> */
  /* skip box _oParamVars; list<#Integer> */
  return _oAdjacencyVars;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_tuple3ToString(threadData_t *threadData, modelica_metatype _inTuple)
{
  modelica_string _result = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _result has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inTuple;
    {
      modelica_integer _int1;
      modelica_integer _int2;
      modelica_integer _int3;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _int1 has no default value.
      // _int2 has no default value.
      // _int3 has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          _int1 = tmp7  /* pattern as ty=Integer */;
          _int2 = tmp9  /* pattern as ty=Integer */;
          _int3 = tmp11  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta12 = stringAppend(_OMC_LIT30,intString(_int1));
          tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT31);
          tmpMeta14 = stringAppend(tmpMeta13,intString(_int2));
          tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT31);
          tmpMeta16 = stringAppend(tmpMeta15,intString(_int3));
          tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT32);
          tmp1 = tmpMeta17;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _result = tmp1;
  _return: OMC_LABEL_UNUSED
  return _result;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_HpcOmTaskGraph_tupleToString(threadData_t *threadData, modelica_metatype _inTuple)
{
  modelica_string _result = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _result has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inTuple;
    {
      modelica_integer _int1;
      modelica_integer _int2;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _int1 has no default value.
      // _int2 has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          _int1 = tmp7  /* pattern as ty=Integer */;
          _int2 = tmp9  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta10 = stringAppend(_OMC_LIT30,intString(_int1));
          tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT31);
          tmpMeta12 = stringAppend(tmpMeta11,intString(_int2));
          tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT32);
          tmp1 = tmpMeta13;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _result = tmp1;
  _return: OMC_LABEL_UNUSED
  return _result;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_metatype _oVars = NULL;
  modelica_metatype _oParamVars = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oVars has no default value.
  // _oParamVars has no default value.
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iComponent;
    {
      modelica_integer _eqnIdx;
      modelica_metatype _eqns = NULL;
      modelica_metatype _resEqns = NULL;
      modelica_metatype _eqnVars = NULL;
      modelica_metatype _paramVars = NULL;
      modelica_metatype _innerEquations = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _eqnIdx has no default value.
      // _eqns has no default value.
      // _resEqns has no default value.
      // _eqnVars has no default value.
      // _paramVars has no default value.
      // _innerEquations has no default value.
      tmp4 = 0;
      for (; tmp4 < 9; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          
          _eqnIdx = tmp7  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta8 = mmc_mk_cons(mmc_mk_integer(_eqnIdx), MMC_REFSTRUCTLIT(mmc_nil));
          _eqnVars = omc_HpcOmTaskGraph_getVarsByEqns(threadData, tmpMeta8, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters ,&_paramVars);

          omc_List_toString(threadData, _eqnVars, boxvar_HpcOmTaskGraph_tupleToString, _OMC_LIT93, _OMC_LIT159, _OMC_LIT225, _OMC_LIT3, 1 /* true */, ((modelica_integer) 0));
          tmpMeta[0+0] = _eqnVars;
          tmpMeta[0+1] = _paramVars;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,5) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _eqns = tmpMeta9;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getVarsByEqns(threadData, _eqns, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          
          _eqnIdx = tmp11  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta12 = mmc_mk_cons(mmc_mk_integer(_eqnIdx), MMC_REFSTRUCTLIT(mmc_nil));
          _eqnVars = omc_HpcOmTaskGraph_getVarsByEqns(threadData, tmpMeta12, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters ,&_paramVars);

          omc_List_toString(threadData, _eqnVars, boxvar_HpcOmTaskGraph_tupleToString, _OMC_LIT93, _OMC_LIT159, _OMC_LIT225, _OMC_LIT3, 1 /* true */, ((modelica_integer) 0));
          tmpMeta[0+0] = _eqnVars;
          tmpMeta[0+1] = _paramVars;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_metatype tmpMeta15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          
          _eqnIdx = tmp14  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta15 = mmc_mk_cons(mmc_mk_integer(_eqnIdx), MMC_REFSTRUCTLIT(mmc_nil));
          _eqnVars = omc_HpcOmTaskGraph_getVarsByEqns(threadData, tmpMeta15, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters ,&_paramVars);

          omc_List_toString(threadData, _eqnVars, boxvar_HpcOmTaskGraph_tupleToString, _OMC_LIT93, _OMC_LIT159, _OMC_LIT225, _OMC_LIT3, 1 /* true */, ((modelica_integer) 0));
          tmpMeta[0+0] = _eqnVars;
          tmpMeta[0+1] = _paramVars;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta16;
          modelica_integer tmp17;
          modelica_metatype tmpMeta18;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,2) == 0) goto tmp3_end;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp17 = mmc_unbox_integer(tmpMeta16);
          
          _eqnIdx = tmp17  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta18 = mmc_mk_cons(mmc_mk_integer(_eqnIdx), MMC_REFSTRUCTLIT(mmc_nil));
          _eqnVars = omc_HpcOmTaskGraph_getVarsByEqns(threadData, tmpMeta18, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters ,&_paramVars);

          omc_List_toString(threadData, _eqnVars, boxvar_HpcOmTaskGraph_tupleToString, _OMC_LIT93, _OMC_LIT159, _OMC_LIT225, _OMC_LIT3, 1 /* true */, ((modelica_integer) 0));
          tmpMeta[0+0] = _eqnVars;
          tmpMeta[0+1] = _paramVars;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta19;
          modelica_integer tmp20;
          modelica_metatype tmpMeta21;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp20 = mmc_unbox_integer(tmpMeta19);
          
          _eqnIdx = tmp20  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta21 = mmc_mk_cons(mmc_mk_integer(_eqnIdx), MMC_REFSTRUCTLIT(mmc_nil));
          _eqnVars = omc_HpcOmTaskGraph_getVarsByEqns(threadData, tmpMeta21, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters ,&_paramVars);

          omc_List_toString(threadData, _eqnVars, boxvar_HpcOmTaskGraph_tupleToString, _OMC_LIT93, _OMC_LIT159, _OMC_LIT225, _OMC_LIT3, 1 /* true */, ((modelica_integer) 0));
          tmpMeta[0+0] = _eqnVars;
          tmpMeta[0+1] = _paramVars;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta22;
          modelica_integer tmp23;
          modelica_metatype tmpMeta24;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp23 = mmc_unbox_integer(tmpMeta22);
          
          _eqnIdx = tmp23  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          tmpMeta24 = mmc_mk_cons(mmc_mk_integer(_eqnIdx), MMC_REFSTRUCTLIT(mmc_nil));
          _eqnVars = omc_HpcOmTaskGraph_getVarsByEqns(threadData, tmpMeta24, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters ,&_paramVars);

          omc_List_toString(threadData, _eqnVars, boxvar_HpcOmTaskGraph_tupleToString, _OMC_LIT93, _OMC_LIT159, _OMC_LIT225, _OMC_LIT3, 1 /* true */, ((modelica_integer) 0));
          tmpMeta[0+0] = _eqnVars;
          tmpMeta[0+1] = _paramVars;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,4) == 0) goto tmp3_end;
          tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 3));
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta25), 4));
          
          _resEqns = tmpMeta26;
          _innerEquations = tmpMeta27;
          /* Pattern matching succeeded */
          _eqns = omc_List_map__3(threadData, _innerEquations, boxvar_BackendDAEUtil_getEqnAndVarsFromInnerEquation, NULL, NULL);
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getVarsByEqns(threadData, listAppend(_resEqns, _eqns), _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 8: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT226),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oVars = tmpMeta[0+0];
  _oParamVars = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_oParamVars) { *out_oParamVars = _oParamVars; }
  return _oVars;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_integer tmp1;
  modelica_metatype _oVars = NULL;
  tmp1 = mmc_unbox_integer(_iAnalyzeParameters);
  _oVars = omc_HpcOmTaskGraph_getVarsBySCC(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, tmp1, out_oParamVars);
  /* skip box _oVars; list<tuple<#Integer, #Integer>> */
  /* skip box _oParamVars; list<#Integer> */
  return _oVars;
}

DLLDirection
modelica_boolean omc_HpcOmTaskGraph_compareTasksByExecTime(threadData_t *threadData, modelica_integer _iTask1, modelica_integer _iTask2, modelica_metatype _iTaskComps, modelica_metatype _iExeCosts, modelica_boolean _iDescending)
{
  modelica_boolean _oResult;
  modelica_real _exeCosts1;
  modelica_real _exeCosts2;
  modelica_metatype _taskComps1 = NULL;
  modelica_metatype _taskComps2 = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oResult has no default value.
  // _exeCosts1 has no default value.
  // _exeCosts2 has no default value.
  // _taskComps1 has no default value.
  // _taskComps2 has no default value.
  _taskComps1 = arrayGet(_iTaskComps, _iTask1);

  _taskComps2 = arrayGet(_iTaskComps, _iTask2);

  _exeCosts1 = omc_HpcOmTaskGraph_addUpExeCostsForNode(threadData, _taskComps1, _iExeCosts, 0.0);

  _exeCosts2 = omc_HpcOmTaskGraph_addUpExeCostsForNode(threadData, _taskComps2, _iExeCosts, 0.0);

  if(_iDescending)
  {
    _oResult = (_exeCosts1 < _exeCosts2);
  }
  else
  {
    _oResult = (_exeCosts1 > _exeCosts2);
  }
  _return: OMC_LABEL_UNUSED
  return _oResult;
}
modelica_metatype boxptr_HpcOmTaskGraph_compareTasksByExecTime(threadData_t *threadData, modelica_metatype _iTask1, modelica_metatype _iTask2, modelica_metatype _iTaskComps, modelica_metatype _iExeCosts, modelica_metatype _iDescending)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_boolean _oResult;
  modelica_metatype out_oResult;
  tmp1 = mmc_unbox_integer(_iTask1);
  tmp2 = mmc_unbox_integer(_iTask2);
  tmp3 = mmc_unbox_integer(_iDescending);
  _oResult = omc_HpcOmTaskGraph_compareTasksByExecTime(threadData, tmp1, tmp2, _iTaskComps, _iExeCosts, tmp3);
  out_oResult = mmc_mk_icon(_oResult);
  return out_oResult;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_compareTupleByVarIdx(threadData_t *threadData, modelica_integer _varIdx, modelica_metatype _var2Idx)
{
  modelica_boolean _equal;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _equal has no default value.
  _equal = (mmc_unbox_integer(omc_Util_tuple21(threadData, _var2Idx)) == _varIdx);
  _return: OMC_LABEL_UNUSED
  return _equal;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_compareTupleByVarIdx(threadData_t *threadData, modelica_metatype _varIdx, modelica_metatype _var2Idx)
{
  modelica_integer tmp1;
  modelica_boolean _equal;
  modelica_metatype out_equal;
  tmp1 = mmc_unbox_integer(_varIdx);
  _equal = omc_HpcOmTaskGraph_compareTupleByVarIdx(threadData, tmp1, _var2Idx);
  out_equal = mmc_mk_icon(_equal);
  return out_equal;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_isTupleMember(threadData_t *threadData, modelica_metatype _inTuple, modelica_metatype _varIdc)
{
  modelica_boolean _isNotMember;
  modelica_integer _varIdx;
  modelica_integer _varState;
  modelica_boolean _returnValue;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _isNotMember has no default value.
  // _varIdx has no default value.
  // _varState has no default value.
  // _returnValue has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _inTuple;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_boolean tmp10;
          modelica_boolean tmp11;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          _varIdx = tmp7  /* pattern as ty=Integer */;
          _varState = tmp9  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp10 = (_varIdx > ((modelica_integer) 0));
          if (1 /* true */ != tmp10) goto goto_2;

          /* Pattern-matching assignment */
          tmp11 = (_varState == ((modelica_integer) 1));
          if (1 /* true */ != tmp11) goto goto_2;

          _returnValue = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_varIdx), _varIdc, boxvar_intEq);
          tmp1 = (!_returnValue);
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmp1 = 1 /* true */;
          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:;
    }
  }
  _isNotMember = tmp1;
  _return: OMC_LABEL_UNUSED
  return _isNotMember;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_isTupleMember(threadData_t *threadData, modelica_metatype _inTuple, modelica_metatype _varIdc)
{
  modelica_boolean _isNotMember;
  modelica_metatype out_isNotMember;
  _isNotMember = omc_HpcOmTaskGraph_isTupleMember(threadData, _inTuple, _varIdc);
  out_isNotMember = mmc_mk_icon(_isNotMember);
  return out_isNotMember;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_removeEventVars(threadData_t *threadData, modelica_metatype _eventVarLst, modelica_metatype _varLstIn, modelica_integer _varIdx)
{
  modelica_metatype _varLstOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _varLstOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _varTpl = NULL;
      modelica_metatype _varLst = NULL;
      modelica_integer _var;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _varTpl has no default value.
      // _varLst has no default value.
      // _var has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_boolean tmp10;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (_varIdx <= listLength(_varLstIn));
          if (1 /* true */ != tmp6) goto goto_2;

          _varTpl = listGet(_varLstIn, _varIdx);

          /* Pattern-matching assignment */
          tmpMeta7 = _varTpl;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          _var = tmp9  /* pattern as ty=Integer */;

          /* Pattern-matching assignment */
          tmp10 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_var), _eventVarLst, boxvar_intEq);
          if (1 /* true */ != tmp10) goto goto_2;

          _varLst = listDelete(_varLstIn, _varIdx);
          tmpMeta1 = omc_HpcOmTaskGraph_removeEventVars(threadData, _eventVarLst, _varLst, _varIdx);
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          modelica_boolean tmp15;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp11 = (_varIdx <= listLength(_varLstIn));
          if (1 /* true */ != tmp11) goto goto_2;

          _varTpl = listGet(_varLstIn, _varIdx);

          /* Pattern-matching assignment */
          tmpMeta12 = _varTpl;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 1));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          _var = tmp14  /* pattern as ty=Integer */;

          /* Pattern-matching assignment */
          tmp15 = omc_List_isMemberOnTrue(threadData, mmc_mk_integer(_var), _eventVarLst, boxvar_intEq);
          if (0 /* false */ != tmp15) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_removeEventVars(threadData, _eventVarLst, _varLstIn, ((modelica_integer) 1) + _varIdx);
          goto tmp3_done;
        }
        case 2: {
          /* Pattern matching succeeded */
          tmpMeta1 = _varLstIn;
          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:;
    }
  }
  _varLstOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _varLstOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_removeEventVars(threadData_t *threadData, modelica_metatype _eventVarLst, modelica_metatype _varLstIn, modelica_metatype _varIdx)
{
  modelica_integer tmp1;
  modelica_metatype _varLstOut = NULL;
  tmp1 = mmc_unbox_integer(_varIdx);
  _varLstOut = omc_HpcOmTaskGraph_removeEventVars(threadData, _eventVarLst, _varLstIn, tmp1);
  /* skip box _varLstOut; list<tuple<#Integer, #Integer>> */
  return _varLstOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC2(threadData_t *threadData, modelica_metatype _iVarType, modelica_metatype _iVarIdx, modelica_metatype _iUnsolvedVars)
{
  modelica_metatype _oUnsolvedVars = NULL;
  modelica_metatype _intVarIdc = NULL;
  modelica_metatype _boolVarIdc = NULL;
  modelica_metatype _stringVarIdc = NULL;
  modelica_metatype _realVarIdc = NULL;
  modelica_integer _varIdx;
  modelica_integer _derived;
  modelica_metatype _ty = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oUnsolvedVars has no default value.
  // _intVarIdc has no default value.
  // _boolVarIdc has no default value.
  // _stringVarIdc has no default value.
  // _realVarIdc has no default value.
  // _varIdx has no default value.
  // _derived has no default value.
  // _ty has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
    tmp4_1 = _iVarType;
    tmp4_2 = _iVarIdx;
    tmp4_3 = _iUnsolvedVars;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 7; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
          _varIdx = tmp7  /* pattern as ty=Integer */;
          _derived = tmp9  /* pattern as ty=Integer */;
          _intVarIdc = tmpMeta10;
          _realVarIdc = tmpMeta11;
          _boolVarIdc = tmpMeta12;
          _stringVarIdc = tmpMeta13;
          /* Pattern matching succeeded */
          tmpMeta14 = mmc_mk_cons(mmc_mk_integer(_varIdx), _intVarIdc);
          _intVarIdc = tmpMeta14;
          tmpMeta15 = mmc_mk_box4(0, _intVarIdc, _realVarIdc, _boolVarIdc, _stringVarIdc);
          tmpMeta1 = tmpMeta15;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta16;
          modelica_integer tmp17;
          modelica_metatype tmpMeta18;
          modelica_integer tmp19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp17 = mmc_unbox_integer(tmpMeta16);
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp19 = mmc_unbox_integer(tmpMeta18);
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
          _varIdx = tmp17  /* pattern as ty=Integer */;
          _derived = tmp19  /* pattern as ty=Integer */;
          _intVarIdc = tmpMeta20;
          _realVarIdc = tmpMeta21;
          _boolVarIdc = tmpMeta22;
          _stringVarIdc = tmpMeta23;
          /* Pattern matching succeeded */
          tmpMeta25 = mmc_mk_box2(0, mmc_mk_integer(_varIdx), mmc_mk_integer(_derived));
          tmpMeta24 = mmc_mk_cons(tmpMeta25, _realVarIdc);
          _realVarIdc = tmpMeta24;
          tmpMeta26 = mmc_mk_box4(0, _intVarIdc, _realVarIdc, _boolVarIdc, _stringVarIdc);
          tmpMeta1 = tmpMeta26;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta27;
          modelica_integer tmp28;
          modelica_metatype tmpMeta29;
          modelica_integer tmp30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          modelica_metatype tmpMeta36;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,1) == 0) goto tmp3_end;
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp28 = mmc_unbox_integer(tmpMeta27);
          tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp30 = mmc_unbox_integer(tmpMeta29);
          tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
          tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
          tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
          tmpMeta34 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
          _varIdx = tmp28  /* pattern as ty=Integer */;
          _derived = tmp30  /* pattern as ty=Integer */;
          _intVarIdc = tmpMeta31;
          _realVarIdc = tmpMeta32;
          _boolVarIdc = tmpMeta33;
          _stringVarIdc = tmpMeta34;
          /* Pattern matching succeeded */
          tmpMeta35 = mmc_mk_cons(mmc_mk_integer(_varIdx), _boolVarIdc);
          _boolVarIdc = tmpMeta35;
          tmpMeta36 = mmc_mk_box4(0, _intVarIdc, _realVarIdc, _boolVarIdc, _stringVarIdc);
          tmpMeta1 = tmpMeta36;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta37;
          modelica_metatype tmpMeta38;
          modelica_integer tmp39;
          modelica_metatype tmpMeta40;
          modelica_integer tmp41;
          modelica_metatype tmpMeta42;
          modelica_metatype tmpMeta43;
          modelica_metatype tmpMeta44;
          modelica_metatype tmpMeta45;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta38 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp39 = mmc_unbox_integer(tmpMeta38);
          tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp41 = mmc_unbox_integer(tmpMeta40);
          tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
          tmpMeta43 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
          tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
          tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
          _ty = tmpMeta37;
          _varIdx = tmp39  /* pattern as ty=Integer */;
          _derived = tmp41  /* pattern as ty=Integer */;
          _intVarIdc = tmpMeta42;
          _realVarIdc = tmpMeta43;
          _boolVarIdc = tmpMeta44;
          _stringVarIdc = tmpMeta45;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _iVarType = _ty;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta46;
          modelica_integer tmp47;
          modelica_metatype tmpMeta48;
          modelica_integer tmp49;
          modelica_metatype tmpMeta50;
          modelica_metatype tmpMeta51;
          modelica_metatype tmpMeta52;
          modelica_metatype tmpMeta53;
          modelica_metatype tmpMeta54;
          modelica_metatype tmpMeta55;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,5) == 0) goto tmp3_end;
          tmpMeta46 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp47 = mmc_unbox_integer(tmpMeta46);
          tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp49 = mmc_unbox_integer(tmpMeta48);
          tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
          tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
          tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
          tmpMeta53 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
          _varIdx = tmp47  /* pattern as ty=Integer */;
          _derived = tmp49  /* pattern as ty=Integer */;
          _intVarIdc = tmpMeta50;
          _realVarIdc = tmpMeta51;
          _boolVarIdc = tmpMeta52;
          _stringVarIdc = tmpMeta53;
          /* Pattern matching succeeded */
          tmpMeta54 = mmc_mk_cons(mmc_mk_integer(_varIdx), _stringVarIdc);
          _stringVarIdc = tmpMeta54;
          tmpMeta55 = mmc_mk_box4(0, _intVarIdc, _realVarIdc, _boolVarIdc, _stringVarIdc);
          tmpMeta1 = tmpMeta55;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta56;
          modelica_integer tmp57;
          modelica_metatype tmpMeta58;
          modelica_integer tmp59;
          modelica_metatype tmpMeta60;
          modelica_metatype tmpMeta61;
          modelica_metatype tmpMeta62;
          modelica_metatype tmpMeta63;
          modelica_metatype tmpMeta64;
          modelica_metatype tmpMeta65;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,1) == 0) goto tmp3_end;
          tmpMeta56 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmp57 = mmc_unbox_integer(tmpMeta56);
          tmpMeta58 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp59 = mmc_unbox_integer(tmpMeta58);
          tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 1));
          tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 2));
          tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 3));
          tmpMeta63 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_3), 4));
          _varIdx = tmp57  /* pattern as ty=Integer */;
          _derived = tmp59  /* pattern as ty=Integer */;
          _intVarIdc = tmpMeta60;
          _realVarIdc = tmpMeta61;
          _boolVarIdc = tmpMeta62;
          _stringVarIdc = tmpMeta63;
          /* Pattern matching succeeded */
          tmpMeta64 = mmc_mk_cons(mmc_mk_integer(_varIdx), _stringVarIdc);
          _stringVarIdc = tmpMeta64;
          tmpMeta65 = mmc_mk_box4(0, _intVarIdc, _realVarIdc, _boolVarIdc, _stringVarIdc);
          tmpMeta1 = tmpMeta65;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta66;
          modelica_metatype tmpMeta67;
          
          /* Pattern matching succeeded */
          tmpMeta66 = stringAppend(_OMC_LIT227,intString(mmc_unbox_integer(omc_Util_tuple21(threadData, _iVarIdx))));
          tmpMeta67 = stringAppend(tmpMeta66,_OMC_LIT228);
          fputs(MMC_STRINGDATA(tmpMeta67),stdout);
          tmpMeta1 = _iUnsolvedVars;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oUnsolvedVars = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oUnsolvedVars;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC1(threadData_t *threadData, modelica_metatype _iVarIdx, modelica_metatype _orderedVars, modelica_metatype _iUnsolvedVars)
{
  modelica_metatype _oUnsolvedVars = NULL;
  modelica_metatype _var = NULL;
  modelica_metatype _varType = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oUnsolvedVars has no default value.
  // _var has no default value.
  // _varType has no default value.
  _var = omc_BackendVariable_getVarAt(threadData, _orderedVars, mmc_unbox_integer(omc_Util_tuple21(threadData, _iVarIdx)));

  _varType = omc_BackendVariable_getVarType(threadData, _var);

  _oUnsolvedVars = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC2(threadData, _varType, _iVarIdx, _iUnsolvedVars);
  _return: OMC_LABEL_UNUSED
  return _oUnsolvedVars;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iVarIdc, modelica_metatype _iEventVarLst, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_metatype _oUnsolvedVars = NULL;
  modelica_metatype _oParamVars = NULL;
  modelica_metatype _tmpVars = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oUnsolvedVars has no default value.
  // _oParamVars has no default value.
  // _tmpVars has no default value.
  _tmpVars = omc_HpcOmTaskGraph_getVarsBySCC(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iAnalyzeParameters ,&_oParamVars);

  _tmpVars = omc_List_filter1OnTrue(threadData, _tmpVars, boxvar_HpcOmTaskGraph_isTupleMember, _iVarIdc);

  _tmpVars = omc_HpcOmTaskGraph_removeEventVars(threadData, _iEventVarLst, _tmpVars, ((modelica_integer) 1));

  _oUnsolvedVars = omc_List_fold1(threadData, _tmpVars, boxvar_HpcOmTaskGraph_getUnsolvedVarsBySCC1, _iOrderedVars, _OMC_LIT229);
  _return: OMC_LABEL_UNUSED
  if (out_oParamVars) { *out_oParamVars = _oParamVars; }
  return _oUnsolvedVars;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iVarIdc, modelica_metatype _iEventVarLst, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_integer tmp1;
  modelica_metatype _oUnsolvedVars = NULL;
  tmp1 = mmc_unbox_integer(_iAnalyzeParameters);
  _oUnsolvedVars = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iVarIdc, _iEventVarLst, tmp1, out_oParamVars);
  /* skip box _oUnsolvedVars; tuple<list<#Integer>, list<tuple<#Integer, #Integer>>, list<#Integer>, list<#Integer>> */
  /* skip box _oParamVars; list<#Integer> */
  return _oUnsolvedVars;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getUnsolvedVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iEventVarLst, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_metatype _oUnsolvedVars = NULL;
  modelica_metatype _oParamVars = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oUnsolvedVars has no default value.
  // _oParamVars has no default value.
  
  
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _iComponent;
    {
      modelica_integer _varIdx;
      modelica_metatype _varIdc = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _varIdx has no default value.
      // _varIdc has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 9; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          _varIdx = tmp7  /* pattern as ty=Integer */;
          tmp4 += 7; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta8 = mmc_mk_cons(mmc_mk_integer(_varIdx), MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, tmpMeta8, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,5) == 0) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _varIdc = tmpMeta9;
          tmp4 += 6; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _varIdc, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta10;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _varIdc = tmpMeta10;
          tmp4 += 5; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _varIdc, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _varIdc = tmpMeta11;
          tmp4 += 4; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _varIdc, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta12;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,2) == 0) goto tmp3_end;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _varIdc = tmpMeta12;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _varIdc, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta13;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _varIdc = tmpMeta13;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _varIdc, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          _varIdc = tmpMeta14;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _varIdc, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,4) == 0) goto tmp3_end;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 2));
          
          _varIdc = tmpMeta16;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC0(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _varIdc, _iEventVarLst, _iAnalyzeParameters, &tmpMeta[0+1]);
          goto tmp3_done;
        }
        case 8: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT230),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 9) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oUnsolvedVars = tmpMeta[0+0];
  _oParamVars = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_oParamVars) { *out_oParamVars = _oParamVars; }
  return _oUnsolvedVars;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getUnsolvedVarsBySCC(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iAdjacencyMatrix, modelica_metatype _iOrderedVars, modelica_metatype _iKnownVars, modelica_metatype _iOrderedEquations, modelica_metatype _iEventVarLst, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oParamVars)
{
  modelica_integer tmp1;
  modelica_metatype _oUnsolvedVars = NULL;
  tmp1 = mmc_unbox_integer(_iAnalyzeParameters);
  _oUnsolvedVars = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC(threadData, _iComponent, _iAdjacencyMatrix, _iOrderedVars, _iKnownVars, _iOrderedEquations, _iEventVarLst, tmp1, out_oParamVars);
  /* skip box _oUnsolvedVars; tuple<list<#Integer>, list<tuple<#Integer, #Integer>>, list<#Integer>, list<#Integer>> */
  /* skip box _oParamVars; list<#Integer> */
  return _oUnsolvedVars;
}

PROTECTED_FUNCTION_STATIC void omc_HpcOmTaskGraph_fillRequiredSccs(threadData_t *threadData, modelica_metatype _var, modelica_integer _varType, modelica_metatype _varMapping, modelica_metatype _requiredSccs)
{
  modelica_integer _var_idx;
  modelica_integer _scc_idx;
  modelica_integer _not_derived;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_metatype _stringVars = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta21;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _var_idx has no default value.
  // _scc_idx has no default value.
  // _not_derived has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _stringVars has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _var;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  _var_idx = tmp3  /* pattern as ty=Integer */;
  _not_derived = tmp5  /* pattern as ty=Integer */;

  if((_not_derived == ((modelica_integer) 1)))
  {
    /* Pattern-matching assignment */
    tmpMeta6 = arrayGet(_varMapping,_var_idx) /* DAE.ASUB */;
    tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
    tmp8 = mmc_unbox_integer(tmpMeta7);
    _scc_idx = tmp8  /* pattern as ty=Integer */;

    /* Pattern-matching assignment */
    tmpMeta9 = omc_UnorderedMap_getOrDefault(threadData, mmc_mk_integer(_scc_idx), _requiredSccs, _OMC_LIT229);
    tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
    tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
    tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 3));
    tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 4));
    _integerVars = tmpMeta10;
    _floatVars = tmpMeta11;
    _booleanVars = tmpMeta12;
    _stringVars = tmpMeta13;

    { /* match expression */
      modelica_integer tmp16_1;
      tmp16_1 = (modelica_integer)_varType;
      {
        int tmp16;
        {
          switch (MMC_SWITCH_CAST(tmp16_1)) {
          case 1: {
            modelica_metatype tmpMeta17;
            if (1 != tmp16_1) goto tmp15_end;
            /* Pattern matching succeeded */
            tmpMeta17 = mmc_mk_cons(mmc_mk_integer(_var_idx), _integerVars);
            _integerVars = tmpMeta17;
            goto tmp15_done;
          }
          case 2: {
            modelica_metatype tmpMeta18;
            if (2 != tmp16_1) goto tmp15_end;
            /* Pattern matching succeeded */
            tmpMeta18 = mmc_mk_cons(mmc_mk_integer(_var_idx), _floatVars);
            _floatVars = tmpMeta18;
            goto tmp15_done;
          }
          case 3: {
            modelica_metatype tmpMeta19;
            if (3 != tmp16_1) goto tmp15_end;
            /* Pattern matching succeeded */
            tmpMeta19 = mmc_mk_cons(mmc_mk_integer(_var_idx), _booleanVars);
            _booleanVars = tmpMeta19;
            goto tmp15_done;
          }
          case 4: {
            modelica_metatype tmpMeta20;
            if (4 != tmp16_1) goto tmp15_end;
            /* Pattern matching succeeded */
            tmpMeta20 = mmc_mk_cons(mmc_mk_integer(_var_idx), _stringVars);
            _stringVars = tmpMeta20;
            goto tmp15_done;
          }
          }
          goto tmp15_end;
          tmp15_end: ;
        }
        goto goto_14;
        goto_14:;
        MMC_THROW_INTERNAL();
        goto tmp15_done;
        tmp15_done:;
      }
    }
    ;

    tmpMeta21 = mmc_mk_box4(0, _integerVars, _floatVars, _booleanVars, _stringVars);
    omc_UnorderedMap_add(threadData, mmc_mk_integer(_scc_idx), tmpMeta21, _requiredSccs);
  }
  _return: OMC_LABEL_UNUSED
  return;
}
PROTECTED_FUNCTION_STATIC void boxptr_HpcOmTaskGraph_fillRequiredSccs(threadData_t *threadData, modelica_metatype _var, modelica_metatype _varType, modelica_metatype _varMapping, modelica_metatype _requiredSccs)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_varType);
  omc_HpcOmTaskGraph_fillRequiredSccs(threadData, _var, tmp1, _varMapping, _requiredSccs);
  return;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_HpcOmTaskGraph_isWhenEquation(threadData_t *threadData, modelica_metatype _inComp)
{
  modelica_boolean _isWhenEq;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _isWhenEq has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _inComp;
    {
      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 (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmp1 = 0 /* false */;
          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:;
    }
  }
  _isWhenEq = tmp1;
  _return: OMC_LABEL_UNUSED
  return _isWhenEq;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_isWhenEquation(threadData_t *threadData, modelica_metatype _inComp)
{
  modelica_boolean _isWhenEq;
  modelica_metatype out_isWhenEq;
  _isWhenEq = omc_HpcOmTaskGraph_isWhenEquation(threadData, _inComp);
  out_isWhenEq = mmc_mk_icon(_isWhenEq);
  return out_isWhenEq;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getArrayTuple31(threadData_t *threadData, modelica_metatype _list1, modelica_metatype _assign)
{
  modelica_metatype _list2Out = NULL;
  modelica_metatype _tplLst = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _list2Out has no default value.
  // _tplLst has no default value.
  _tplLst = omc_List_map1(threadData, _list1, boxvar_Array_getIndexFirst, _assign);

  _list2Out = omc_List_map(threadData, _tplLst, boxvar_Util_tuple31);
  _return: OMC_LABEL_UNUSED
  return _list2Out;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventNodeEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_integer _offset, modelica_metatype _eventEqsIn)
{
  modelica_metatype _eventEqsOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eventEqsOut has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _comps;
    {
      modelica_integer _eqn;
      modelica_metatype _rest = NULL;
      modelica_metatype _head = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _eqn has no default value.
      // _rest has no default value.
      // _head has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_boolean tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          _head = tmpMeta6;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp8 = omc_HpcOmTaskGraph_isWhenEquation(threadData, _head);
          if (1 /* true */ != tmp8) goto goto_2;

          /* Pattern-matching assignment */
          tmpMeta9 = _head;
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,5,2) == 0) goto goto_2;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 2));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          _eqn = tmp11  /* pattern as ty=Integer */;

          _eqn = _eqn + _offset;
          tmpMeta12 = mmc_mk_cons(mmc_mk_integer(_eqn), _eventEqsIn);
          tmpMeta1 = omc_HpcOmTaskGraph_getEventNodeEqs1(threadData, _rest, _offset, tmpMeta12);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_boolean tmp15;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta13 = MMC_CAR(tmp4_1);
          tmpMeta14 = MMC_CDR(tmp4_1);
          _head = tmpMeta13;
          _rest = tmpMeta14;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          /* Pattern-matching assignment */
          tmp15 = omc_HpcOmTaskGraph_isWhenEquation(threadData, _head);
          if (0 /* false */ != tmp15) goto goto_2;
          tmpMeta1 = omc_HpcOmTaskGraph_getEventNodeEqs1(threadData, _rest, _offset, _eventEqsIn);
          goto tmp3_done;
        }
        case 2: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta1 = _eventEqsIn;
          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:;
    }
  }
  _eventEqsOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _eventEqsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getEventNodeEqs1(threadData_t *threadData, modelica_metatype _comps, modelica_metatype _offset, modelica_metatype _eventEqsIn)
{
  modelica_integer tmp1;
  modelica_metatype _eventEqsOut = NULL;
  tmp1 = mmc_unbox_integer(_offset);
  _eventEqsOut = omc_HpcOmTaskGraph_getEventNodeEqs1(threadData, _comps, tmp1, _eventEqsIn);
  /* skip box _eventEqsOut; list<#Integer> */
  return _eventEqsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventNodeEqs(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eventInfoIn)
{
  modelica_metatype _eventInfoOut = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _matching = NULL;
  modelica_metatype _orderedEqs = NULL;
  modelica_metatype _eventEqs = NULL;
  modelica_metatype _eventEqsIn = NULL;
  modelica_integer _offset;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eventInfoOut has no default value.
  // _comps has no default value.
  // _matching has no default value.
  // _orderedEqs has no default value.
  // _eventEqs has no default value.
  // _eventEqsIn has no default value.
  // _offset has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _systIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  _orderedEqs = tmpMeta2;
  _matching = tmpMeta3;

  _comps = omc_BackendDAEUtil_getCompsOfMatching(threadData, _matching);

  /* Pattern-matching assignment */
  tmpMeta4 = _eventInfoIn;
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 1));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta4), 2));
  tmp7 = mmc_unbox_integer(tmpMeta6);
  _eventEqsIn = tmpMeta5;
  _offset = tmp7  /* pattern as ty=Integer */;

  tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
  _eventEqs = omc_HpcOmTaskGraph_getEventNodeEqs1(threadData, _comps, _offset, tmpMeta8);

  _offset = _offset + omc_ExpandableArray_getNumberOfElements(threadData, _orderedEqs);

  tmpMeta9 = mmc_mk_box2(0, listAppend(_eventEqs, _eventEqsIn), mmc_mk_integer(_offset));
  _eventInfoOut = tmpMeta9;
  _return: OMC_LABEL_UNUSED
  return _eventInfoOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEventNodes(threadData_t *threadData, modelica_metatype _systIn, modelica_metatype _eqCompMapping)
{
  modelica_metatype _eventNodes = NULL;
  modelica_metatype _eqLst = NULL;
  modelica_metatype _tplLst = NULL;
  modelica_metatype _systemsIn = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eventNodes has no default value.
  // _eqLst has no default value.
  // _tplLst has no default value.
  // _systemsIn has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _systIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _systemsIn = tmpMeta2;

  /* Pattern-matching assignment */
  tmpMeta3 = omc_List_fold(threadData, _systemsIn, boxvar_HpcOmTaskGraph_getEventNodeEqs, _OMC_LIT210);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 1));
  _eqLst = tmpMeta4;

  _eventNodes = omc_HpcOmTaskGraph_getArrayTuple31(threadData, _eqLst, _eqCompMapping);
  _return: OMC_LABEL_UNUSED
  return _eventNodes;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_shortenVarString(threadData_t *threadData, modelica_metatype _iString)
{
  modelica_metatype _oString = NULL;
  modelica_integer _pos;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oString has no default value.
  // _pos has no default value.
  _pos = ((modelica_integer) -1) + omc_List_position(threadData, _OMC_LIT33, _iString);

  _oString = omc_List_split(threadData, _iString, _pos, NULL);
  _return: OMC_LABEL_UNUSED
  return _oString;
}

DLLDirection
modelica_string omc_HpcOmTaskGraph_getVarString(threadData_t *threadData, modelica_metatype _inVar)
{
  modelica_string _varString = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _varString has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _varDescLst = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _varDescLst has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = omc_BackendVariable_isNonStateVar(threadData, _inVar);
          if (1 /* true */ != tmp6) goto goto_2;

          _varString = omc_BackendDump_varString(threadData, _inVar);

          _varDescLst = stringListStringChar(_varString);

          _varDescLst = omc_HpcOmTaskGraph_shortenVarString(threadData, _varDescLst);
          tmp1 = stringAppendList(_varDescLst);
          goto tmp3_done;
        }
        case 1: {
          modelica_boolean tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp7 = omc_BackendVariable_isNonStateVar(threadData, _inVar);
          if (0 /* false */ != tmp7) goto goto_2;

          _varString = omc_BackendDump_varString(threadData, _inVar);

          _varDescLst = stringListStringChar(_varString);

          _varDescLst = omc_HpcOmTaskGraph_shortenVarString(threadData, _varDescLst);

          _varString = stringAppendList(_varDescLst);
          tmpMeta8 = stringAppend(_OMC_LIT231,_varString);
          tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT32);
          tmp1 = tmpMeta9;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 2) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _varString = tmp1;
  _return: OMC_LABEL_UNUSED
  return _varString;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEquationStrings2(threadData_t *threadData, modelica_metatype _comp, modelica_metatype _iEqSystem, modelica_metatype _iEqDesc)
{
  modelica_metatype _oEqDesc = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oEqDesc has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _comp;
    tmp4_2 = _iEqSystem;
    {
      modelica_integer _i;
      modelica_integer _v;
      modelica_metatype _varLst = NULL;
      modelica_metatype _vs = NULL;
      modelica_string _eqString = NULL;
      modelica_string _varString = NULL;
      modelica_string _desc = NULL;
      modelica_metatype _orderedEqs = NULL;
      modelica_metatype _orderedVars = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _i has no default value.
      // _v has no default value.
      // _varLst has no default value.
      // _vs has no default value.
      // _eqString has no default value.
      // _varString has no default value.
      // _desc has no default value.
      // _orderedEqs has no default value.
      // _orderedVars has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 10; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          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));
          
          _i = tmp7  /* pattern as ty=Integer */;
          _v = tmp9  /* pattern as ty=Integer */;
          _orderedVars = tmpMeta10;
          _orderedEqs = tmpMeta11;
          tmp4 += 8; /* Pattern matching succeeded; we may skip some cases if we fail */
          _eqString = omc_BackendDump_equationString(threadData, omc_BackendEquation_get(threadData, _orderedEqs, _i));

          _varString = omc_HpcOmTaskGraph_getVarString(threadData, omc_BackendVariable_getVarAt(threadData, _orderedVars, _v));

          tmpMeta12 = stringAppend(_eqString,_OMC_LIT232);
          tmpMeta13 = stringAppend(tmpMeta12,_varString);
          _desc = tmpMeta13;
          tmpMeta14 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta14;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,5) == 0) goto tmp3_end;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,0,1) == 0) goto tmp3_end;
          
          tmp4 += 7; /* Pattern matching succeeded; we may skip some cases if we fail */
          _desc = _OMC_LIT233;
          tmpMeta16 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta16;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta17;
          modelica_integer tmp18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,2,2) == 0) goto tmp3_end;
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp18 = mmc_unbox_integer(tmpMeta17);
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta22,1,3) == 0) goto tmp3_end;
          
          _i = tmp18  /* pattern as ty=Integer */;
          _vs = tmpMeta19;
          _orderedVars = tmpMeta20;
          _orderedEqs = tmpMeta21;
          tmp4 += 6; /* Pattern matching succeeded; we may skip some cases if we fail */
          _eqString = omc_BackendDump_equationString(threadData, omc_BackendEquation_get(threadData, _orderedEqs, _i));

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta23 = stringAppend(_OMC_LIT234,_eqString);
          tmpMeta24 = stringAppend(tmpMeta23,_OMC_LIT235);
          tmpMeta25 = stringAppend(tmpMeta24,stringDelimitList(omc_List_map1(threadData, _vs, boxvar_List_getIndexFirst, omc_List_map(threadData, _varLst, boxvar_HpcOmTaskGraph_getVarString)), _OMC_LIT236));
          _desc = tmpMeta25;
          tmpMeta26 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta26;
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta27;
          modelica_integer tmp28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          modelica_metatype tmpMeta32;
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          modelica_metatype tmpMeta35;
          modelica_metatype tmpMeta36;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,3,2) == 0) goto tmp3_end;
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp28 = mmc_unbox_integer(tmpMeta27);
          tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta32,1,3) == 0) goto tmp3_end;
          
          _i = tmp28  /* pattern as ty=Integer */;
          _vs = tmpMeta29;
          _orderedVars = tmpMeta30;
          _orderedEqs = tmpMeta31;
          tmp4 += 5; /* Pattern matching succeeded; we may skip some cases if we fail */
          _eqString = omc_BackendDump_equationString(threadData, omc_BackendEquation_get(threadData, _orderedEqs, _i));

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta33 = stringAppend(_OMC_LIT237,_eqString);
          tmpMeta34 = stringAppend(tmpMeta33,_OMC_LIT235);
          tmpMeta35 = stringAppend(tmpMeta34,stringDelimitList(omc_List_map1(threadData, _vs, boxvar_List_getIndexFirst, omc_List_map(threadData, _varLst, boxvar_HpcOmTaskGraph_getVarString)), _OMC_LIT236));
          _desc = tmpMeta35;
          tmpMeta36 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta36;
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta37;
          modelica_integer tmp38;
          modelica_metatype tmpMeta39;
          modelica_metatype tmpMeta40;
          modelica_metatype tmpMeta41;
          modelica_metatype tmpMeta42;
          modelica_metatype tmpMeta43;
          modelica_metatype tmpMeta44;
          modelica_metatype tmpMeta45;
          modelica_metatype tmpMeta46;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,4,2) == 0) goto tmp3_end;
          tmpMeta37 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp38 = mmc_unbox_integer(tmpMeta37);
          tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta40 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta41 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta42 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta42,1,3) == 0) goto tmp3_end;
          
          _i = tmp38  /* pattern as ty=Integer */;
          _vs = tmpMeta39;
          _orderedVars = tmpMeta40;
          _orderedEqs = tmpMeta41;
          tmp4 += 4; /* Pattern matching succeeded; we may skip some cases if we fail */
          _eqString = omc_BackendDump_equationString(threadData, omc_BackendEquation_get(threadData, _orderedEqs, _i));

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta43 = stringAppend(_OMC_LIT238,_eqString);
          tmpMeta44 = stringAppend(tmpMeta43,_OMC_LIT235);
          tmpMeta45 = stringAppend(tmpMeta44,stringDelimitList(omc_List_map1(threadData, _vs, boxvar_List_getIndexFirst, omc_List_map(threadData, _varLst, boxvar_HpcOmTaskGraph_getVarString)), _OMC_LIT236));
          _desc = tmpMeta45;
          tmpMeta46 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta46;
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta47;
          modelica_integer tmp48;
          modelica_metatype tmpMeta49;
          modelica_metatype tmpMeta50;
          modelica_metatype tmpMeta51;
          modelica_metatype tmpMeta52;
          modelica_metatype tmpMeta53;
          modelica_metatype tmpMeta54;
          modelica_metatype tmpMeta55;
          modelica_metatype tmpMeta56;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,5,2) == 0) goto tmp3_end;
          tmpMeta47 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp48 = mmc_unbox_integer(tmpMeta47);
          tmpMeta49 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta50 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta51 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta52 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta52,1,3) == 0) goto tmp3_end;
          
          _i = tmp48  /* pattern as ty=Integer */;
          _vs = tmpMeta49;
          _orderedVars = tmpMeta50;
          _orderedEqs = tmpMeta51;
          tmp4 += 3; /* Pattern matching succeeded; we may skip some cases if we fail */
          _eqString = omc_BackendDump_equationString(threadData, omc_BackendEquation_get(threadData, _orderedEqs, _i));

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta53 = stringAppend(_OMC_LIT239,_eqString);
          tmpMeta54 = stringAppend(tmpMeta53,_OMC_LIT235);
          tmpMeta55 = stringAppend(tmpMeta54,stringDelimitList(omc_List_map1(threadData, _vs, boxvar_List_getIndexFirst, omc_List_map(threadData, _varLst, boxvar_HpcOmTaskGraph_getVarString)), _OMC_LIT236));
          _desc = tmpMeta55;
          tmpMeta56 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta56;
          goto tmp3_done;
        }
        case 6: {
          modelica_metatype tmpMeta57;
          modelica_integer tmp58;
          modelica_metatype tmpMeta59;
          modelica_metatype tmpMeta60;
          modelica_metatype tmpMeta61;
          modelica_metatype tmpMeta62;
          modelica_metatype tmpMeta63;
          modelica_metatype tmpMeta64;
          modelica_metatype tmpMeta65;
          modelica_metatype tmpMeta66;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,6,2) == 0) goto tmp3_end;
          tmpMeta57 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp58 = mmc_unbox_integer(tmpMeta57);
          tmpMeta59 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta60 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta61 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta62 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta62,1,3) == 0) goto tmp3_end;
          
          _i = tmp58  /* pattern as ty=Integer */;
          _vs = tmpMeta59;
          _orderedVars = tmpMeta60;
          _orderedEqs = tmpMeta61;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          _eqString = omc_BackendDump_equationString(threadData, omc_BackendEquation_get(threadData, _orderedEqs, _i));

          _varLst = omc_BackendVariable_varList(threadData, _orderedVars);

          tmpMeta63 = stringAppend(_OMC_LIT240,_eqString);
          tmpMeta64 = stringAppend(tmpMeta63,_OMC_LIT235);
          tmpMeta65 = stringAppend(tmpMeta64,stringDelimitList(omc_List_map1(threadData, _vs, boxvar_List_getIndexFirst, omc_List_map(threadData, _varLst, boxvar_HpcOmTaskGraph_getVarString)), _OMC_LIT236));
          _desc = tmpMeta65;
          tmpMeta66 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta66;
          goto tmp3_done;
        }
        case 7: {
          modelica_metatype tmpMeta67;
          modelica_metatype tmpMeta68;
          modelica_integer tmp69;
          modelica_metatype tmpMeta70;
          tmpMeta67 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta67,1,3) == 0) goto tmp3_end;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,4) == 0) goto tmp3_end;
          tmpMeta68 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmp69 = mmc_unbox_integer(tmpMeta68);
          if (1 /* true */ != tmp69) goto tmp3_end;
          
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          _desc = _OMC_LIT241;
          tmpMeta70 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta70;
          goto tmp3_done;
        }
        case 8: {
          modelica_metatype tmpMeta71;
          modelica_metatype tmpMeta72;
          modelica_integer tmp73;
          modelica_metatype tmpMeta74;
          tmpMeta71 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta71,1,3) == 0) goto tmp3_end;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,7,4) == 0) goto tmp3_end;
          tmpMeta72 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmp73 = mmc_unbox_integer(tmpMeta72);
          if (0 /* false */ != tmp73) goto tmp3_end;
          
          /* Pattern matching succeeded */
          _desc = _OMC_LIT242;
          tmpMeta74 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta74;
          goto tmp3_done;
        }
        case 9: {
          modelica_metatype tmpMeta75;
          
          /* Pattern matching succeeded */
          _desc = _OMC_LIT243;
          tmpMeta75 = mmc_mk_cons(_desc, _iEqDesc);
          tmpMeta1 = tmpMeta75;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      tmp3_done:
      (void)tmp4;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp3_done2;
      goto_2:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp4 < 10) {
        goto tmp3_top;
      }
      MMC_THROW_INTERNAL();
      tmp3_done2:;
    }
  }
  _oEqDesc = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oEqDesc;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getEquationStrings(threadData_t *threadData, modelica_metatype _iComps, modelica_metatype _iEqSystem)
{
  modelica_metatype _eqDescsOut = NULL;
  modelica_metatype _eqDescs = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _eqDescsOut has no default value.
  // _eqDescs has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _eqDescs = omc_List_fold1(threadData, _iComps, boxvar_HpcOmTaskGraph_getEquationStrings2, _iEqSystem, tmpMeta1);

  _eqDescs = listReverse(_eqDescs);

  _eqDescsOut = listArray(_eqDescs);
  _return: OMC_LABEL_UNUSED
  return _eqDescsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_fillAdjacencyList(threadData_t *threadData, modelica_metatype _adjLstIn, modelica_integer _childNode, modelica_metatype _parentLst, modelica_integer _Idx)
{
  modelica_metatype _adjLstOut = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _adjLstOut has no default value.
  { /* matchcontinue expression */
    {
      modelica_metatype _parentNode = NULL;
      modelica_metatype _parentRow = NULL;
      modelica_metatype _adjLst = NULL;
      modelica_integer _parentNodeIdx;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _parentNode has no default value.
      // _parentRow has no default value.
      // _adjLst has no default value.
      // _parentNodeIdx has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_boolean tmp6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp6 = (listLength(_parentLst) >= _Idx);
          if (1 /* true */ != tmp6) goto goto_2;

          _parentNode = listGet(_parentLst, _Idx);

          /* Pattern-matching assignment */
          tmpMeta7 = _parentNode;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 7));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          _parentNodeIdx = tmp9  /* pattern as ty=Integer */;

          _parentRow = arrayGet(_adjLstIn, _parentNodeIdx);

          tmpMeta10 = mmc_mk_cons(mmc_mk_integer(_childNode), _parentRow);
          _parentRow = tmpMeta10;

          _parentRow = omc_List_removeOnTrue(threadData, mmc_mk_integer(_parentNodeIdx), boxvar_intEq, _parentRow);

          _adjLst = arrayUpdate(_adjLstIn, _parentNodeIdx, _parentRow);
          tmpMeta1 = omc_HpcOmTaskGraph_fillAdjacencyList(threadData, _adjLst, _childNode, _parentLst, ((modelica_integer) 1) + _Idx);
          goto tmp3_done;
        }
        case 1: {
          /* Pattern matching succeeded */
          tmpMeta1 = _adjLstIn;
          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:;
    }
  }
  _adjLstOut = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _adjLstOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_fillAdjacencyList(threadData_t *threadData, modelica_metatype _adjLstIn, modelica_metatype _childNode, modelica_metatype _parentLst, modelica_metatype _Idx)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _adjLstOut = NULL;
  tmp1 = mmc_unbox_integer(_childNode);
  tmp2 = mmc_unbox_integer(_Idx);
  _adjLstOut = omc_HpcOmTaskGraph_fillAdjacencyList(threadData, _adjLstIn, tmp1, _parentLst, tmp2);
  /* skip box _adjLstOut; array<list<#Integer>> */
  return _adjLstOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCostBySccRef1(threadData_t *threadData, modelica_metatype _iEdgeSource, modelica_integer _iEdgeTarget, modelica_metatype _iCommCosts)
{
  modelica_metatype _oCommCosts = NULL;
  modelica_metatype _oldComms = NULL;
  modelica_integer _sourceSccIdx;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_metatype _stringVars = NULL;
  modelica_integer _numberOfVars;
  modelica_real _requiredTime;
  modelica_metatype _tmpComm = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_integer tmp9;
  modelica_metatype tmpMeta10;
  modelica_real tmp11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommCosts has no default value.
  // _oldComms has no default value.
  // _sourceSccIdx has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _stringVars has no default value.
  // _numberOfVars has no default value.
  // _requiredTime has no default value.
  // _tmpComm has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iEdgeSource;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmp9 = mmc_unbox_integer(tmpMeta8);
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmp11 = mmc_unbox_real(tmpMeta10);
  _numberOfVars = tmp3  /* pattern as ty=Integer */;
  _integerVars = tmpMeta4;
  _floatVars = tmpMeta5;
  _booleanVars = tmpMeta6;
  _stringVars = tmpMeta7;
  _sourceSccIdx = tmp9  /* pattern as ty=Integer */;
  _requiredTime = tmp11  /* pattern as ty=Real */;

  _oldComms = arrayGet(_iCommCosts, _sourceSccIdx);

  tmpMeta12 = mmc_mk_box8(3, &HpcOmTaskGraph_Communication_COMMUNICATION__desc, mmc_mk_integer(_numberOfVars), _integerVars, _floatVars, _booleanVars, _stringVars, mmc_mk_integer(_iEdgeTarget), mmc_mk_real(_requiredTime));
  _tmpComm = tmpMeta12;

  tmpMeta13 = mmc_mk_cons(_tmpComm, _oldComms);
  _oCommCosts = arrayUpdate(_iCommCosts, _sourceSccIdx, tmpMeta13);
  _return: OMC_LABEL_UNUSED
  return _oCommCosts;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCostBySccRef1(threadData_t *threadData, modelica_metatype _iEdgeSource, modelica_metatype _iEdgeTarget, modelica_metatype _iCommCosts)
{
  modelica_integer tmp1;
  modelica_metatype _oCommCosts = NULL;
  tmp1 = mmc_unbox_integer(_iEdgeTarget);
  _oCommCosts = omc_HpcOmTaskGraph_updateCommCostBySccRef1(threadData, _iEdgeSource, tmp1, _iCommCosts);
  /* skip box _oCommCosts; array<list<HpcOmTaskGraph.Communication>> */
  return _oCommCosts;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createCommunicationObject(threadData_t *threadData, modelica_metatype _iTuple, modelica_real _requiredTime)
{
  modelica_metatype _oComm = NULL;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_metatype _stringVars = NULL;
  modelica_integer _sccIdx;
  modelica_integer _refCountSum;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oComm has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _stringVars has no default value.
  // _sccIdx has no default value.
  // _refCountSum has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iTuple;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  _sccIdx = tmp3  /* pattern as ty=Integer */;
  _integerVars = tmpMeta4;
  _floatVars = tmpMeta5;
  _booleanVars = tmpMeta6;
  _stringVars = tmpMeta7;

  _refCountSum = listLength(_integerVars) + listLength(_floatVars) + listLength(_booleanVars) + listLength(_stringVars);

  tmpMeta8 = mmc_mk_box8(3, &HpcOmTaskGraph_Communication_COMMUNICATION__desc, mmc_mk_integer(_refCountSum), _integerVars, _floatVars, _booleanVars, _stringVars, mmc_mk_integer(_sccIdx), mmc_mk_real(_requiredTime));
  _oComm = tmpMeta8;
  _return: OMC_LABEL_UNUSED
  return _oComm;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createCommunicationObject(threadData_t *threadData, modelica_metatype _iTuple, modelica_metatype _requiredTime)
{
  modelica_real tmp1;
  modelica_metatype _oComm = NULL;
  tmp1 = mmc_unbox_real(_requiredTime);
  _oComm = omc_HpcOmTaskGraph_createCommunicationObject(threadData, _iTuple, tmp1);
  /* skip box _oComm; HpcOmTaskGraph.Communication */
  return _oComm;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCostBySccRef(threadData_t *threadData, modelica_metatype _requiredSccs_RefCount, modelica_integer _nodeIdx, modelica_metatype _iCommCosts, modelica_metatype *out_oNodeComms)
{
  modelica_metatype _oCommCosts = NULL;
  modelica_metatype _oNodeComms = NULL;
  modelica_metatype _tmpComms = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oCommCosts has no default value.
  // _oNodeComms has no default value.
  // _tmpComms has no default value.
  _tmpComms = omc_List_map1(threadData, _requiredSccs_RefCount, boxvar_HpcOmTaskGraph_createCommunicationObject, _OMC_LIT43);

  _oCommCosts = omc_List_fold1(threadData, _tmpComms, boxvar_HpcOmTaskGraph_updateCommCostBySccRef1, mmc_mk_integer(_nodeIdx), _iCommCosts);

  _oNodeComms = _tmpComms;
  _return: OMC_LABEL_UNUSED
  if (out_oNodeComms) { *out_oNodeComms = _oNodeComms; }
  return _oCommCosts;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCostBySccRef(threadData_t *threadData, modelica_metatype _requiredSccs_RefCount, modelica_metatype _nodeIdx, modelica_metatype _iCommCosts, modelica_metatype *out_oNodeComms)
{
  modelica_integer tmp1;
  modelica_metatype _oCommCosts = NULL;
  tmp1 = mmc_unbox_integer(_nodeIdx);
  _oCommCosts = omc_HpcOmTaskGraph_updateCommCostBySccRef(threadData, _requiredSccs_RefCount, tmp1, _iCommCosts, out_oNodeComms);
  /* skip box _oCommCosts; array<list<HpcOmTaskGraph.Communication>> */
  /* skip box _oNodeComms; list<HpcOmTaskGraph.Communication> */
  return _oCommCosts;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createRequiredSccsRefCount(threadData_t *threadData, modelica_metatype _requiredSccs)
{
  modelica_metatype _requiredSccsRefCount = NULL;
  modelica_metatype tmpMeta1;
  modelica_integer _scc_idx;
  modelica_metatype _int_vars = NULL;
  modelica_metatype _float_vars = NULL;
  modelica_metatype _bool_vars = NULL;
  modelica_metatype _string_vars = NULL;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _requiredSccsRefCount = tmpMeta1;
  // _scc_idx has no default value.
  // _int_vars has no default value.
  // _float_vars has no default value.
  // _bool_vars has no default value.
  // _string_vars has no default value.
  {
    modelica_metatype _e;
    for (tmpMeta2 = omc_UnorderedMap_toList(threadData, _requiredSccs); !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
    {
      _e = MMC_CAR(tmpMeta2);
      /* Pattern-matching assignment */
      tmpMeta3 = _e;
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 1));
      tmp5 = mmc_unbox_integer(tmpMeta4);
      tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
      tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
      tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
      tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 3));
      tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 4));
      _scc_idx = tmp5  /* pattern as ty=Integer */;
      _int_vars = tmpMeta7;
      _float_vars = tmpMeta8;
      _bool_vars = tmpMeta9;
      _string_vars = tmpMeta10;

      tmpMeta12 = mmc_mk_box5(0, mmc_mk_integer(_scc_idx), _int_vars, _float_vars, _bool_vars, _string_vars);
      tmpMeta11 = mmc_mk_cons(tmpMeta12, _requiredSccsRefCount);
      _requiredSccsRefCount = tmpMeta11;
    }
  }
  _return: OMC_LABEL_UNUSED
  return _requiredSccsRefCount;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_createTaskGraph1(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iSystInfo, modelica_metatype _iVarInfo, modelica_boolean _iAnalyzeParameters, modelica_metatype _graphInfoIn)
{
  modelica_metatype _graphInfoOut = NULL;
  modelica_metatype _adjacencyMatrix = NULL;
  modelica_metatype _isyst = NULL;
  modelica_metatype _ishared = NULL;
  modelica_metatype _orderedVars = NULL;
  modelica_metatype _globalKnownVars = NULL;
  modelica_metatype _localKnownVars = NULL;
  modelica_metatype _knownVars = NULL;
  modelica_metatype _orderedEqs = NULL;
  modelica_metatype _graphIn = NULL;
  modelica_metatype _graphTmp = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _commCostsOfNode = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _unsolvedVars = NULL;
  modelica_metatype _eventVarLst = NULL;
  modelica_integer _componentIndex;
  modelica_integer _numberOfComps;
  modelica_metatype _requiredSccs_RefCount = NULL;
  modelica_string _compName = NULL;
  modelica_metatype _paramVars = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _requiredSccs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_integer tmp6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  modelica_metatype tmpMeta21;
  modelica_metatype tmpMeta22;
  modelica_metatype tmpMeta23;
  modelica_metatype tmpMeta24;
  modelica_integer tmp25;
  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;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphInfoOut has no default value.
  // _adjacencyMatrix has no default value.
  // _isyst has no default value.
  // _ishared has no default value.
  // _orderedVars has no default value.
  // _globalKnownVars has no default value.
  // _localKnownVars has no default value.
  // _knownVars has no default value.
  // _orderedEqs has no default value.
  // _graphIn has no default value.
  // _graphTmp has no default value.
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _commCosts has no default value.
  // _commCostsOfNode has no default value.
  // _nodeMark has no default value.
  // _unsolvedVars has no default value.
  // _eventVarLst has no default value.
  // _componentIndex has no default value.
  // _numberOfComps has no default value.
  // _requiredSccs_RefCount has no default value.
  // _compName has no default value.
  // _paramVars has no default value.
  // _compParamMapping has no default value.
  // _requiredSccs has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iSystInfo;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmp6 = mmc_unbox_integer(tmpMeta5);
  _adjacencyMatrix = tmpMeta2;
  _isyst = tmpMeta3;
  _ishared = tmpMeta4;
  _numberOfComps = tmp6  /* pattern as ty=Integer */;

  /* Pattern-matching assignment */
  tmpMeta7 = _ishared;
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
  _globalKnownVars = tmpMeta8;
  _localKnownVars = tmpMeta9;

  /* Pattern-matching assignment */
  tmpMeta10 = _isyst;
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
  tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
  _orderedVars = tmpMeta11;
  _orderedEqs = tmpMeta12;

  /* Pattern-matching assignment */
  tmpMeta13 = _iVarInfo;
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 1));
  tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 2));
  tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
  _varCompMapping = tmpMeta14;
  _eqCompMapping = tmpMeta15;
  _eventVarLst = tmpMeta16;

  /* Pattern-matching assignment */
  tmpMeta17 = _graphInfoIn;
  tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 1));
  tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 2));
  tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 3));
  tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 4));
  tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 5));
  tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 6));
  tmpMeta24 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta17), 7));
  tmp25 = mmc_unbox_integer(tmpMeta24);
  _graphIn = tmpMeta18;
  _inComps = tmpMeta19;
  _compParamMapping = tmpMeta20;
  _commCosts = tmpMeta21;
  _compNames = tmpMeta22;
  _nodeMark = tmpMeta23;
  _componentIndex = tmp25  /* pattern as ty=Integer */;

  tmpMeta26 = mmc_mk_cons(mmc_mk_integer(_componentIndex), MMC_REFSTRUCTLIT(mmc_nil));
  _inComps = arrayUpdate(_inComps, _componentIndex, tmpMeta26);

  _compName = omc_BackendDump_strongComponentString(threadData, _iComponent);

  _compNames = arrayUpdate(_compNames, _componentIndex, _compName);

  omc_HpcOmBenchmark_benchSystem(threadData);

  if(_iAnalyzeParameters)
  {
    _knownVars = omc_BackendVariable_addVariables(threadData, _globalKnownVars, _localKnownVars);
  }
  else
  {
    _knownVars = _globalKnownVars;
  }

  _unsolvedVars = omc_HpcOmTaskGraph_getUnsolvedVarsBySCC(threadData, _iComponent, _adjacencyMatrix, _orderedVars, _knownVars, _orderedEqs, _eventVarLst, _iAnalyzeParameters ,&_paramVars);

  _compParamMapping = arrayUpdate(_compParamMapping, _componentIndex, _paramVars);

  _requiredSccs = omc_UnorderedMap_new(threadData, boxvar_Util_id, boxvar_intEq, ((modelica_integer) 1));

  {
    modelica_metatype _intVar;
    for (tmpMeta27 = omc_Util_tuple41(threadData, _unsolvedVars); !listEmpty(tmpMeta27); tmpMeta27=MMC_CDR(tmpMeta27))
    {
      _intVar = MMC_CAR(tmpMeta27);
      tmpMeta28 = mmc_mk_box2(0, _intVar, mmc_mk_integer(((modelica_integer) 1)));
      omc_HpcOmTaskGraph_fillRequiredSccs(threadData, tmpMeta28, 1, _varCompMapping, _requiredSccs);
    }
  }

  {
    modelica_metatype _floatVar;
    for (tmpMeta30 = omc_Util_tuple42(threadData, _unsolvedVars); !listEmpty(tmpMeta30); tmpMeta30=MMC_CDR(tmpMeta30))
    {
      _floatVar = MMC_CAR(tmpMeta30);
      omc_HpcOmTaskGraph_fillRequiredSccs(threadData, _floatVar, 2, _varCompMapping, _requiredSccs);
    }
  }

  {
    modelica_metatype _boolVar;
    for (tmpMeta32 = omc_Util_tuple43(threadData, _unsolvedVars); !listEmpty(tmpMeta32); tmpMeta32=MMC_CDR(tmpMeta32))
    {
      _boolVar = MMC_CAR(tmpMeta32);
      tmpMeta33 = mmc_mk_box2(0, _boolVar, mmc_mk_integer(((modelica_integer) 1)));
      omc_HpcOmTaskGraph_fillRequiredSccs(threadData, tmpMeta33, 3, _varCompMapping, _requiredSccs);
    }
  }

  {
    modelica_metatype _stringVar;
    for (tmpMeta35 = omc_Util_tuple44(threadData, _unsolvedVars); !listEmpty(tmpMeta35); tmpMeta35=MMC_CDR(tmpMeta35))
    {
      _stringVar = MMC_CAR(tmpMeta35);
      tmpMeta36 = mmc_mk_box2(0, _stringVar, mmc_mk_integer(((modelica_integer) 1)));
      omc_HpcOmTaskGraph_fillRequiredSccs(threadData, tmpMeta36, 4, _varCompMapping, _requiredSccs);
    }
  }

  _requiredSccs_RefCount = omc_HpcOmTaskGraph_createRequiredSccsRefCount(threadData, _requiredSccs);

  _commCosts = omc_HpcOmTaskGraph_updateCommCostBySccRef(threadData, _requiredSccs_RefCount, _componentIndex, _commCosts ,&_commCostsOfNode);

  _graphTmp = omc_HpcOmTaskGraph_fillAdjacencyList(threadData, _graphIn, _componentIndex, _commCostsOfNode, ((modelica_integer) 1));

  tmpMeta38 = mmc_mk_box7(0, _graphTmp, _inComps, _compParamMapping, _commCosts, _compNames, _nodeMark, mmc_mk_integer(((modelica_integer) 1) + _componentIndex));
  _graphInfoOut = tmpMeta38;
  _return: OMC_LABEL_UNUSED
  return _graphInfoOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_createTaskGraph1(threadData_t *threadData, modelica_metatype _iComponent, modelica_metatype _iSystInfo, modelica_metatype _iVarInfo, modelica_metatype _iAnalyzeParameters, modelica_metatype _graphInfoIn)
{
  modelica_integer tmp1;
  modelica_metatype _graphInfoOut = NULL;
  tmp1 = mmc_unbox_integer(_iAnalyzeParameters);
  _graphInfoOut = omc_HpcOmTaskGraph_createTaskGraph1(threadData, _iComponent, _iSystInfo, _iVarInfo, tmp1, _graphInfoIn);
  /* skip box _graphInfoOut; tuple<array<list<#Integer>>, array<list<#Integer>>, array<list<#Integer>>, array<list<HpcOmTaskGraph.Communication>>, array<String>, array<#Integer>, #Integer> */
  return _graphInfoOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateTaskGraphSystem(threadData_t *threadData, modelica_metatype _graphRowIn, modelica_integer _idxOffset)
{
  modelica_metatype _graphRowOut = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphRowOut has no default value.
  _graphRowOut = omc_List_map1(threadData, _graphRowIn, boxvar_intAdd, mmc_mk_integer(_idxOffset));
  _return: OMC_LABEL_UNUSED
  return _graphRowOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateTaskGraphSystem(threadData_t *threadData, modelica_metatype _graphRowIn, modelica_metatype _idxOffset)
{
  modelica_integer tmp1;
  modelica_metatype _graphRowOut = NULL;
  tmp1 = mmc_unbox_integer(_idxOffset);
  _graphRowOut = omc_HpcOmTaskGraph_updateTaskGraphSystem(threadData, _graphRowIn, tmp1);
  /* skip box _graphRowOut; list<#Integer> */
  return _graphRowOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCosts1(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_integer _idxOffset)
{
  modelica_metatype _commCostsOut = NULL;
  modelica_integer _numberOfVars;
  modelica_integer _childNode;
  modelica_metatype _integerVars = NULL;
  modelica_metatype _floatVars = NULL;
  modelica_metatype _booleanVars = NULL;
  modelica_metatype _stringVars = NULL;
  modelica_real _requiredTime;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_integer tmp9;
  modelica_metatype tmpMeta10;
  modelica_real tmp11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _commCostsOut has no default value.
  // _numberOfVars has no default value.
  // _childNode has no default value.
  // _integerVars has no default value.
  // _floatVars has no default value.
  // _booleanVars has no default value.
  // _stringVars has no default value.
  // _requiredTime has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _commCostsIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmp9 = mmc_unbox_integer(tmpMeta8);
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmp11 = mmc_unbox_real(tmpMeta10);
  _numberOfVars = tmp3  /* pattern as ty=Integer */;
  _integerVars = tmpMeta4;
  _floatVars = tmpMeta5;
  _booleanVars = tmpMeta6;
  _stringVars = tmpMeta7;
  _childNode = tmp9  /* pattern as ty=Integer */;
  _requiredTime = tmp11  /* pattern as ty=Real */;

  _childNode = _childNode + _idxOffset;

  tmpMeta12 = mmc_mk_box8(3, &HpcOmTaskGraph_Communication_COMMUNICATION__desc, mmc_mk_integer(_numberOfVars), _integerVars, _floatVars, _booleanVars, _stringVars, mmc_mk_integer(_childNode), mmc_mk_real(_requiredTime));
  _commCostsOut = tmpMeta12;
  _return: OMC_LABEL_UNUSED
  return _commCostsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCosts1(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_metatype _idxOffset)
{
  modelica_integer tmp1;
  modelica_metatype _commCostsOut = NULL;
  tmp1 = mmc_unbox_integer(_idxOffset);
  _commCostsOut = omc_HpcOmTaskGraph_updateCommCosts1(threadData, _commCostsIn, tmp1);
  /* skip box _commCostsOut; HpcOmTaskGraph.Communication */
  return _commCostsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_updateCommCosts(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_integer _idxOffset)
{
  modelica_metatype _commCostsOut = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _commCostsOut has no default value.
  _commCostsOut = omc_List_map1(threadData, _commCostsIn, boxvar_HpcOmTaskGraph_updateCommCosts1, mmc_mk_integer(_idxOffset));
  _return: OMC_LABEL_UNUSED
  return _commCostsOut;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_updateCommCosts(threadData_t *threadData, modelica_metatype _commCostsIn, modelica_metatype _idxOffset)
{
  modelica_integer tmp1;
  modelica_metatype _commCostsOut = NULL;
  tmp1 = mmc_unbox_integer(_idxOffset);
  _commCostsOut = omc_HpcOmTaskGraph_updateCommCosts(threadData, _commCostsIn, tmp1);
  /* skip box _commCostsOut; list<HpcOmTaskGraph.Communication> */
  return _commCostsOut;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_modifyMapping(threadData_t *threadData, modelica_metatype _iMappingTuple, modelica_integer _iOffset)
{
  modelica_metatype _oMappingTuple = NULL;
  modelica_integer _i1;
  modelica_integer _i2;
  modelica_integer _i3;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_integer tmp7;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMappingTuple has no default value.
  // _i1 has no default value.
  // _i2 has no default value.
  // _i3 has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iMappingTuple;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmp3 = mmc_unbox_integer(tmpMeta2);
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmp7 = mmc_unbox_integer(tmpMeta6);
  _i1 = tmp3  /* pattern as ty=Integer */;
  _i2 = tmp5  /* pattern as ty=Integer */;
  _i3 = tmp7  /* pattern as ty=Integer */;

  tmpMeta8 = mmc_mk_box3(0, mmc_mk_integer(_i1 + _iOffset), mmc_mk_integer(_i2), mmc_mk_integer(_iOffset));
  _oMappingTuple = tmpMeta8;
  _return: OMC_LABEL_UNUSED
  return _oMappingTuple;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_modifyMapping(threadData_t *threadData, modelica_metatype _iMappingTuple, modelica_metatype _iOffset)
{
  modelica_integer tmp1;
  modelica_metatype _oMappingTuple = NULL;
  tmp1 = mmc_unbox_integer(_iOffset);
  _oMappingTuple = omc_HpcOmTaskGraph_modifyMapping(threadData, _iMappingTuple, tmp1);
  /* skip box _oMappingTuple; tuple<#Integer, #Integer, #Integer> */
  return _oMappingTuple;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_taskGraphAppend(threadData_t *threadData, modelica_metatype _graph1In, modelica_metatype _graphData1In, modelica_metatype _graph2In, modelica_metatype _graphData2In, modelica_metatype *out_graphDataOut)
{
  modelica_metatype _graphOut = NULL;
  modelica_metatype _graphDataOut = NULL;
  modelica_integer _eqOffset;
  modelica_integer _idxOffset;
  modelica_integer _varOffset;
  modelica_metatype _commCosts1 = NULL;
  modelica_metatype _commCosts2 = NULL;
  modelica_metatype _inComps1 = NULL;
  modelica_metatype _inComps2 = NULL;
  modelica_metatype _eqCompMapping1 = NULL;
  modelica_metatype _eqCompMapping2 = NULL;
  modelica_metatype _exeCosts1 = NULL;
  modelica_metatype _exeCosts2 = NULL;
  modelica_metatype _nodeMark1 = NULL;
  modelica_metatype _nodeMark2 = NULL;
  modelica_metatype _compParamMapping1 = NULL;
  modelica_metatype _compParamMapping2 = NULL;
  modelica_metatype _varCompMapping1 = NULL;
  modelica_metatype _varCompMapping2 = NULL;
  modelica_metatype _compNames1 = NULL;
  modelica_metatype _compNames2 = NULL;
  modelica_metatype _compDescs1 = NULL;
  modelica_metatype _compDescs2 = NULL;
  modelica_metatype _compInformations1 = NULL;
  modelica_metatype _compInformations2 = NULL;
  modelica_metatype _graph2 = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  modelica_metatype tmpMeta20;
  modelica_metatype tmpMeta21;
  modelica_metatype tmpMeta22;
  modelica_metatype tmpMeta23;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphOut has no default value.
  // _graphDataOut has no default value.
  // _eqOffset has no default value.
  // _idxOffset has no default value.
  // _varOffset has no default value.
  // _commCosts1 has no default value.
  // _commCosts2 has no default value.
  // _inComps1 has no default value.
  // _inComps2 has no default value.
  // _eqCompMapping1 has no default value.
  // _eqCompMapping2 has no default value.
  // _exeCosts1 has no default value.
  // _exeCosts2 has no default value.
  // _nodeMark1 has no default value.
  // _nodeMark2 has no default value.
  // _compParamMapping1 has no default value.
  // _compParamMapping2 has no default value.
  // _varCompMapping1 has no default value.
  // _varCompMapping2 has no default value.
  // _compNames1 has no default value.
  // _compNames2 has no default value.
  // _compDescs1 has no default value.
  // _compDescs2 has no default value.
  // _compInformations1 has no default value.
  // _compInformations2 has no default value.
  // _graph2 has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _graphData1In;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
  _inComps1 = tmpMeta2;
  _varCompMapping1 = tmpMeta3;
  _eqCompMapping1 = tmpMeta4;
  _compParamMapping1 = tmpMeta5;
  _compNames1 = tmpMeta6;
  _compDescs1 = tmpMeta7;
  _exeCosts1 = tmpMeta8;
  _commCosts1 = tmpMeta9;
  _nodeMark1 = tmpMeta10;
  _compInformations1 = tmpMeta11;

  /* Pattern-matching assignment */
  tmpMeta12 = _graphData2In;
  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
  tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 4));
  tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 5));
  tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 6));
  tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 7));
  tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 8));
  tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 9));
  tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 10));
  tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 11));
  _inComps2 = tmpMeta13;
  _varCompMapping2 = tmpMeta14;
  _eqCompMapping2 = tmpMeta15;
  _compParamMapping2 = tmpMeta16;
  _compNames2 = tmpMeta17;
  _compDescs2 = tmpMeta18;
  _exeCosts2 = tmpMeta19;
  _commCosts2 = tmpMeta20;
  _nodeMark2 = tmpMeta21;
  _compInformations2 = tmpMeta22;

  _eqOffset = arrayLength(_eqCompMapping1);

  _idxOffset = arrayLength(_graph1In);

  _varOffset = arrayLength(_varCompMapping1);

  _eqOffset = arrayLength(_eqCompMapping1);

  _graph2 = omc_Array_map1(threadData, _graph2In, boxvar_HpcOmTaskGraph_updateTaskGraphSystem, mmc_mk_integer(_idxOffset));

  _graphOut = arrayAppend(_graph1In, _graph2);

  _inComps2 = omc_Array_map1(threadData, _inComps2, boxvar_HpcOmTaskGraph_updateTaskGraphSystem, mmc_mk_integer(_idxOffset));

  _inComps2 = arrayAppend(_inComps1, _inComps2);

  _varCompMapping2 = omc_Array_map1(threadData, _varCompMapping2, boxvar_HpcOmTaskGraph_modifyMapping, mmc_mk_integer(_idxOffset));

  _varCompMapping2 = arrayAppend(_varCompMapping1, _varCompMapping2);

  _eqCompMapping2 = omc_Array_map1(threadData, _eqCompMapping2, boxvar_HpcOmTaskGraph_modifyMapping, mmc_mk_integer(_idxOffset));

  _eqCompMapping2 = arrayAppend(_eqCompMapping1, _eqCompMapping2);

  _compParamMapping2 = arrayAppend(_compParamMapping1, _compParamMapping2);

  _compNames2 = omc_Array_map1(threadData, _compNames2, boxvar_stringAppend, _OMC_LIT244);

  _compNames2 = arrayAppend(_compNames1, _compNames2);

  _compDescs2 = arrayAppend(_compDescs1, _compDescs2);

  _exeCosts2 = arrayAppend(_exeCosts1, _exeCosts2);

  _commCosts2 = omc_Array_map1(threadData, _commCosts2, boxvar_HpcOmTaskGraph_updateCommCosts, mmc_mk_integer(_idxOffset));

  _commCosts2 = arrayAppend(_commCosts1, _commCosts2);

  _nodeMark2 = arrayAppend(_nodeMark1, _nodeMark2);

  _compInformations2 = arrayAppend(_compInformations1, _compInformations2);

  tmpMeta23 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps2, _varCompMapping2, _eqCompMapping2, _compParamMapping2, _compNames2, _compDescs2, _exeCosts2, _commCosts2, _nodeMark2, _compInformations2);
  _graphDataOut = tmpMeta23;
  _return: OMC_LABEL_UNUSED
  if (out_graphDataOut) { *out_graphDataOut = _graphDataOut; }
  return _graphOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_copyTaskGraphMeta(threadData_t *threadData, modelica_metatype _graphDataIn)
{
  modelica_metatype _graphDataOut = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _inComps1 = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _varCompMapping1 = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _eqCompMapping1 = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _compParamMapping1 = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compNames1 = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _compDescs1 = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _exeCosts1 = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _commCosts1 = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _nodeMark1 = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype _compInformations1 = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graphDataOut has no default value.
  // _inComps has no default value.
  // _inComps1 has no default value.
  // _varCompMapping has no default value.
  // _varCompMapping1 has no default value.
  // _eqCompMapping has no default value.
  // _eqCompMapping1 has no default value.
  // _compParamMapping has no default value.
  // _compParamMapping1 has no default value.
  // _compNames has no default value.
  // _compNames1 has no default value.
  // _compDescs has no default value.
  // _compDescs1 has no default value.
  // _exeCosts has no default value.
  // _exeCosts1 has no default value.
  // _commCosts has no default value.
  // _commCosts1 has no default value.
  // _nodeMark has no default value.
  // _nodeMark1 has no default value.
  // _compInformations has no default value.
  // _compInformations1 has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _graphDataIn;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 4));
  tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 5));
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 6));
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 8));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 9));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 10));
  tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 11));
  _inComps = tmpMeta2;
  _varCompMapping = tmpMeta3;
  _eqCompMapping = tmpMeta4;
  _compParamMapping = tmpMeta5;
  _compNames = tmpMeta6;
  _compDescs = tmpMeta7;
  _exeCosts = tmpMeta8;
  _commCosts = tmpMeta9;
  _nodeMark = tmpMeta10;
  _compInformations = tmpMeta11;

  _inComps1 = arrayCopy(_inComps);

  _varCompMapping1 = arrayCopy(_varCompMapping);

  _eqCompMapping1 = arrayCopy(_eqCompMapping);

  _compParamMapping1 = arrayCopy(_compParamMapping);

  _compNames1 = arrayCopy(_compNames);

  _compDescs1 = arrayCopy(_compDescs);

  _exeCosts1 = arrayCopy(_exeCosts);

  _commCosts1 = arrayCopy(_commCosts);

  _nodeMark1 = arrayCopy(_nodeMark);

  _compInformations1 = arrayCopy(_compInformations);

  tmpMeta12 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps1, _varCompMapping1, _eqCompMapping1, _compParamMapping1, _compNames1, _compDescs1, _exeCosts1, _commCosts1, _nodeMark1, _compInformations1);
  _graphDataOut = tmpMeta12;
  _return: OMC_LABEL_UNUSED
  return _graphDataOut;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getEmptyTaskGraph(threadData_t *threadData, modelica_integer _numComps, modelica_integer _numVars, modelica_integer _numEqs, modelica_metatype *out_graphData)
{
  modelica_metatype _graph = NULL;
  modelica_metatype _graphData = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _compInformations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _graph has no default value.
  // _graphData has no default value.
  // _inComps has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _exeCosts has no default value.
  // _commCosts has no default value.
  // _compParamMapping has no default value.
  // _nodeMark has no default value.
  // _compInformations has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _graph = arrayCreate(_numComps, tmpMeta1);

  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _inComps = arrayCreate(_numComps, tmpMeta2);

  tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
  _compParamMapping = arrayCreate(_numComps, tmpMeta3);

  _varCompMapping = arrayCreate(_numVars, _OMC_LIT245);

  _eqCompMapping = arrayCreate(_numEqs, _OMC_LIT245);

  _compNames = arrayCreate(_numComps, _OMC_LIT93);

  _compDescs = arrayCreate(_numComps, _OMC_LIT93);

  _exeCosts = arrayCreate(_numComps, _OMC_LIT72);

  tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
  _commCosts = arrayCreate(_numComps, tmpMeta4);

  _nodeMark = arrayCreate(_numComps, mmc_mk_integer(((modelica_integer) 0)));

  _compInformations = arrayCreate(_numComps, _OMC_LIT142);

  tmpMeta5 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _graphData = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  if (out_graphData) { *out_graphData = _graphData; }
  return _graph;
}
modelica_metatype boxptr_HpcOmTaskGraph_getEmptyTaskGraph(threadData_t *threadData, modelica_metatype _numComps, modelica_metatype _numVars, modelica_metatype _numEqs, modelica_metatype *out_graphData)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_metatype _graph = NULL;
  tmp1 = mmc_unbox_integer(_numComps);
  tmp2 = mmc_unbox_integer(_numVars);
  tmp3 = mmc_unbox_integer(_numEqs);
  _graph = omc_HpcOmTaskGraph_getEmptyTaskGraph(threadData, tmp1, tmp2, tmp3, out_graphData);
  /* skip box _graph; array<list<#Integer>> */
  /* skip box _graphData; HpcOmTaskGraph.TaskGraphMeta */
  return _graph;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNumberOfEqSystemComponents(threadData_t *threadData, modelica_metatype _iEqSystem, modelica_integer _iNumOfComps)
{
  modelica_integer _oNumOfComps;
  modelica_metatype _comps = NULL;
  modelica_metatype _matching = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNumOfComps has no default value.
  // _comps has no default value.
  // _matching has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iEqSystem;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  _matching = tmpMeta2;

  _comps = omc_BackendDAEUtil_getCompsOfMatching(threadData, _matching);

  _oNumOfComps = _iNumOfComps + listLength(_comps);
  _return: OMC_LABEL_UNUSED
  return _oNumOfComps;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNumberOfEqSystemComponents(threadData_t *threadData, modelica_metatype _iEqSystem, modelica_metatype _iNumOfComps)
{
  modelica_integer tmp1;
  modelica_integer _oNumOfComps;
  modelica_metatype out_oNumOfComps;
  tmp1 = mmc_unbox_integer(_iNumOfComps);
  _oNumOfComps = omc_HpcOmTaskGraph_getNumberOfEqSystemComponents(threadData, _iEqSystem, tmp1);
  out_oNumOfComps = mmc_mk_icon(_oNumOfComps);
  return out_oNumOfComps;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_HpcOmTaskGraph_getNumberOfSystemComponents(threadData_t *threadData, modelica_metatype _iDae)
{
  modelica_integer _oNumOfComps;
  modelica_metatype _eqs = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oNumOfComps has no default value.
  // _eqs has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iDae;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _eqs = tmpMeta2;

  _oNumOfComps = mmc_unbox_integer(omc_List_fold(threadData, _eqs, boxvar_HpcOmTaskGraph_getNumberOfEqSystemComponents, mmc_mk_integer(((modelica_integer) 0))));
  _return: OMC_LABEL_UNUSED
  return _oNumOfComps;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getNumberOfSystemComponents(threadData_t *threadData, modelica_metatype _iDae)
{
  modelica_integer _oNumOfComps;
  modelica_metatype out_oNumOfComps;
  _oNumOfComps = omc_HpcOmTaskGraph_getNumberOfSystemComponents(threadData, _iDae);
  out_oNumOfComps = mmc_mk_icon(_oNumOfComps);
  return out_oNumOfComps;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSystemComponents1(threadData_t *threadData, modelica_metatype _icomp, modelica_metatype _isyst, modelica_integer _isystIdx, modelica_metatype _iMapping)
{
  modelica_metatype _oMapping = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oMapping has no default value.
  tmpMeta2 = mmc_mk_box2(0, _isyst, mmc_mk_integer(_isystIdx));
  tmpMeta1 = mmc_mk_cons(tmpMeta2, MMC_REFSTRUCTLIT(mmc_nil));
  _oMapping = listAppend(_iMapping, tmpMeta1);
  _return: OMC_LABEL_UNUSED
  return _oMapping;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_HpcOmTaskGraph_getSystemComponents1(threadData_t *threadData, modelica_metatype _icomp, modelica_metatype _isyst, modelica_metatype _isystIdx, modelica_metatype _iMapping)
{
  modelica_integer tmp1;
  modelica_metatype _oMapping = NULL;
  tmp1 = mmc_unbox_integer(_isystIdx);
  _oMapping = omc_HpcOmTaskGraph_getSystemComponents1(threadData, _icomp, _isyst, tmp1, _iMapping);
  /* skip box _oMapping; list<tuple<BackendDAE.EqSystem, #Integer>> */
  return _oMapping;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_HpcOmTaskGraph_getSystemComponents0(threadData_t *threadData, modelica_metatype _iSyst, modelica_metatype _iSystMapping)
{
  modelica_metatype _oSystMapping = NULL;
  modelica_metatype _tmpComps = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _matching = NULL;
  modelica_metatype _tmpSystMapping = NULL;
  modelica_integer _currentIdx;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oSystMapping has no default value.
  // _tmpComps has no default value.
  // _comps has no default value.
  // _matching has no default value.
  // _tmpSystMapping has no default value.
  // _currentIdx has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _iSyst;
    tmp4_2 = _iSystMapping;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_integer tmp10;
          modelica_metatype tmpMeta11;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmp10 = mmc_unbox_integer(tmpMeta9);
          _matching = tmpMeta6;
          _tmpComps = tmpMeta7;
          _tmpSystMapping = tmpMeta8;
          _currentIdx = tmp10  /* pattern as ty=Integer */;
          /* Pattern matching succeeded */
          _comps = omc_BackendDAEUtil_getCompsOfMatching(threadData, _matching);

          _tmpSystMapping = omc_List_fold2(threadData, _comps, boxvar_HpcOmTaskGraph_getSystemComponents1, _iSyst, mmc_mk_integer(_currentIdx), _tmpSystMapping);

          _comps = listAppend(_tmpComps, _comps);
          tmpMeta11 = mmc_mk_box3(0, _comps, _tmpSystMapping, mmc_mk_integer(((modelica_integer) 1) + _currentIdx));
          tmpMeta1 = tmpMeta11;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT246),stdout);
          goto goto_2;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oSystMapping = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _oSystMapping;
}

DLLDirection
modelica_metatype omc_HpcOmTaskGraph_getSystemComponents(threadData_t *threadData, modelica_metatype _iDae, modelica_metatype *out_oMapping)
{
  modelica_metatype _oComps = NULL;
  modelica_metatype _oMapping = NULL;
  modelica_metatype _systs = NULL;
  modelica_metatype _tmpSystems = NULL;
  modelica_metatype _tmpComps = NULL;
  modelica_metatype tmpMeta[2] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oComps has no default value.
  // _oMapping has no default value.
  // _systs has no default value.
  // _tmpSystems has no default value.
  // _tmpComps has no default value.
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _iDae;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          
          _systs = tmpMeta6;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmpMeta7 = omc_List_fold(threadData, _systs, boxvar_HpcOmTaskGraph_getSystemComponents0, _OMC_LIT247);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
          _tmpComps = tmpMeta8;
          _tmpSystems = tmpMeta9;
          tmpMeta[0+0] = _tmpComps;
          tmpMeta[0+1] = listArray(_tmpSystems);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _oComps = tmpMeta[0+0];
  _oMapping = tmpMeta[0+1];
  _return: OMC_LABEL_UNUSED
  if (out_oMapping) { *out_oMapping = _oMapping; }
  return _oComps;
}

static modelica_metatype closure21_HpcOmTaskGraph_createTaskGraph1(threadData_t *thData, modelica_metatype closure, modelica_metatype iComponent, modelica_metatype graphInfoIn)
{
  modelica_metatype iSystInfo = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype iVarInfo = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype iAnalyzeParameters = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  return boxptr_HpcOmTaskGraph_createTaskGraph1(thData, iComponent, iSystInfo, iVarInfo, iAnalyzeParameters, graphInfoIn);
}static modelica_metatype closure22_List_sort(threadData_t *thData, modelica_metatype closure, modelica_metatype inList)
{
  modelica_fnptr inCompFunc = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_List_sort(thData, inList, inCompFunc);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_createTaskGraph0(threadData_t *threadData, modelica_metatype _iSyst, modelica_metatype _iShared, modelica_boolean _iAnalyzeParameters, modelica_metatype _iGraphInfo)
{
  modelica_metatype _oGrapInfo = NULL;
  modelica_metatype _comps = NULL;
  modelica_metatype _vars = NULL;
  modelica_metatype _orderedEqs = NULL;
  modelica_metatype _sharedFuncs = NULL;
  modelica_metatype _iGraphData = NULL;
  modelica_metatype _tmpGraphData = NULL;
  modelica_metatype _iGraph = NULL;
  modelica_metatype _tmpGraph = NULL;
  modelica_metatype _commCosts = NULL;
  modelica_metatype _inComps = NULL;
  modelica_metatype _compParamMapping = NULL;
  modelica_metatype _exeCosts = NULL;
  modelica_metatype _nodeMark = NULL;
  modelica_metatype _varCompMapping = NULL;
  modelica_metatype _eqCompMapping = NULL;
  modelica_metatype _compNames = NULL;
  modelica_metatype _compDescs = NULL;
  modelica_metatype _eventEqLst = NULL;
  modelica_metatype _eventVarLst = NULL;
  modelica_metatype _rootVars = NULL;
  modelica_integer _numberOfVars;
  modelica_metatype _compInformations = NULL;
  modelica_integer _eqSysIdx;
  modelica_metatype _tplOut = NULL;
  modelica_metatype _syst = NULL;
  modelica_metatype _matching = NULL;
  modelica_metatype _adjacencyMatrix = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  modelica_metatype tmpMeta9;
  modelica_metatype tmpMeta10;
  modelica_integer tmp11;
  modelica_metatype tmpMeta12;
  modelica_metatype tmpMeta13;
  modelica_metatype tmpMeta14;
  modelica_metatype tmpMeta15;
  modelica_metatype tmpMeta16;
  modelica_metatype tmpMeta17;
  modelica_metatype tmpMeta18;
  modelica_metatype tmpMeta19;
  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;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _oGrapInfo has no default value.
  // _comps has no default value.
  // _vars has no default value.
  // _orderedEqs has no default value.
  // _sharedFuncs has no default value.
  // _iGraphData has no default value.
  // _tmpGraphData has no default value.
  // _iGraph has no default value.
  // _tmpGraph has no default value.
  // _commCosts has no default value.
  // _inComps has no default value.
  // _compParamMapping has no default value.
  // _exeCosts has no default value.
  // _nodeMark has no default value.
  // _varCompMapping has no default value.
  // _eqCompMapping has no default value.
  // _compNames has no default value.
  // _compDescs has no default value.
  // _eventEqLst has no default value.
  // _eventVarLst has no default value.
  // _rootVars has no default value.
  // _numberOfVars has no default value.
  // _compInformations has no default value.
  // _eqSysIdx has no default value.
  // _tplOut has no default value.
  // _syst has no default value.
  // _matching has no default value.
  // _adjacencyMatrix has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iSyst;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 7));
  _vars = tmpMeta2;
  _orderedEqs = tmpMeta3;
  _matching = tmpMeta4;

  _comps = omc_BackendDAEUtil_getCompsOfMatching(threadData, _matching);

  /* Pattern-matching assignment */
  tmpMeta5 = _iShared;
  tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 12));
  _sharedFuncs = tmpMeta6;

  /* Pattern-matching assignment */
  tmpMeta7 = _iGraphInfo;
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 1));
  tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
  tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 3));
  tmp11 = mmc_unbox_integer(tmpMeta10);
  _iGraph = tmpMeta8;
  _iGraphData = tmpMeta9;
  _eqSysIdx = tmp11  /* pattern as ty=Integer */;

  omc_BackendDAEUtil_getAdjacencyMatrix(threadData, _iSyst, _OMC_LIT248, mmc_mk_some(_sharedFuncs), omc_BackendDAEUtil_isInitializationDAE(threadData, _iShared) ,&_adjacencyMatrix ,NULL);

  _numberOfVars = omc_BackendVariable_varsSize(threadData, _vars);

  _tmpGraph = omc_HpcOmTaskGraph_getEmptyTaskGraph(threadData, listLength(_comps), _numberOfVars, omc_ExpandableArray_getNumberOfElements(threadData, _orderedEqs) ,&_tmpGraphData);

  /* Pattern-matching assignment */
  tmpMeta12 = _tmpGraphData;
  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 2));
  tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 3));
  tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 4));
  tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 5));
  tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 6));
  tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 8));
  tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 9));
  tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 10));
  tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta12), 11));
  _inComps = tmpMeta13;
  _varCompMapping = tmpMeta14;
  _eqCompMapping = tmpMeta15;
  _compParamMapping = tmpMeta16;
  _compNames = tmpMeta17;
  _exeCosts = tmpMeta18;
  _commCosts = tmpMeta19;
  _nodeMark = tmpMeta20;
  _compInformations = tmpMeta21;

  _varCompMapping = omc_HpcOmTaskGraph_getVarEqCompMapping(threadData, _comps, _eqSysIdx, ((modelica_integer) 0), ((modelica_integer) 0), _varCompMapping, _eqCompMapping ,&_eqCompMapping);

  _compDescs = omc_HpcOmTaskGraph_getEquationStrings(threadData, _comps, _iSyst);

  /* Pattern-matching assignment */
  tmpMeta23 = mmc_mk_box4(0, _adjacencyMatrix, _iSyst, _iShared, mmc_mk_integer(listLength(_comps)));
  tmpMeta24 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta25 = mmc_mk_box3(0, _varCompMapping, _eqCompMapping, tmpMeta24);
  tmpMeta22 = mmc_mk_box3(0, tmpMeta23, tmpMeta25, mmc_mk_boolean(_iAnalyzeParameters));
  tmpMeta26 = mmc_mk_box7(0, _tmpGraph, _inComps, _compParamMapping, _commCosts, _compNames, _nodeMark, mmc_mk_integer(((modelica_integer) 1)));
  tmpMeta27 = omc_List_fold(threadData, _comps, (modelica_fnptr) mmc_mk_box2(0,closure21_HpcOmTaskGraph_createTaskGraph1,tmpMeta22), tmpMeta26);
  tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 1));
  tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 2));
  tmpMeta30 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 3));
  tmpMeta31 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 4));
  tmpMeta32 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 5));
  tmpMeta33 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta27), 6));
  _tmpGraph = tmpMeta28;
  _inComps = tmpMeta29;
  _compParamMapping = tmpMeta30;
  _commCosts = tmpMeta31;
  _compNames = tmpMeta32;
  _nodeMark = tmpMeta33;

  tmpMeta34 = mmc_mk_box1(0, boxvar_intGt);
  _tmpGraph = omc_Array_mapNoCopy(threadData, _tmpGraph, (modelica_fnptr) mmc_mk_box2(0,closure22_List_sort,tmpMeta34));

  tmpMeta35 = mmc_mk_box11(3, &HpcOmTaskGraph_TaskGraphMeta_TASKGRAPHMETA__desc, _inComps, _varCompMapping, _eqCompMapping, _compParamMapping, _compNames, _compDescs, _exeCosts, _commCosts, _nodeMark, _compInformations);
  _tmpGraphData = tmpMeta35;

  if((_eqSysIdx > ((modelica_integer) 1)))
  {
    _tmpGraph = omc_HpcOmTaskGraph_taskGraphAppend(threadData, _iGraph, _iGraphData, _tmpGraph, _tmpGraphData ,&_tmpGraphData);
  }

  tmpMeta36 = mmc_mk_box3(0, _tmpGraph, _tmpGraphData, mmc_mk_integer(((modelica_integer) 1) + _eqSysIdx));
  _oGrapInfo = tmpMeta36;
  _return: OMC_LABEL_UNUSED
  return _oGrapInfo;
}
modelica_metatype boxptr_HpcOmTaskGraph_createTaskGraph0(threadData_t *threadData, modelica_metatype _iSyst, modelica_metatype _iShared, modelica_metatype _iAnalyzeParameters, modelica_metatype _iGraphInfo)
{
  modelica_integer tmp1;
  modelica_metatype _oGrapInfo = NULL;
  tmp1 = mmc_unbox_integer(_iAnalyzeParameters);
  _oGrapInfo = omc_HpcOmTaskGraph_createTaskGraph0(threadData, _iSyst, _iShared, tmp1, _iGraphInfo);
  /* skip box _oGrapInfo; tuple<array<list<#Integer>>, HpcOmTaskGraph.TaskGraphMeta, #Integer> */
  return _oGrapInfo;
}

static modelica_metatype closure23_HpcOmTaskGraph_createTaskGraph0(threadData_t *thData, modelica_metatype closure, modelica_metatype iSyst, modelica_metatype iGraphInfo)
{
  modelica_metatype iShared = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype iAnalyzeParameters = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  return boxptr_HpcOmTaskGraph_createTaskGraph0(thData, iSyst, iShared, iAnalyzeParameters, iGraphInfo);
}
DLLDirection
modelica_metatype omc_HpcOmTaskGraph_createTaskGraph(threadData_t *threadData, modelica_metatype _iDAE, modelica_boolean _iAnalyzeParameters, modelica_metatype *out_oGraphData)
{
  modelica_metatype _oGraph = NULL;
  modelica_metatype _oGraphData = NULL;
  modelica_metatype _systs = NULL;
  modelica_metatype _shared = NULL;
  modelica_metatype _graph = NULL;
  modelica_metatype _graphData = 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
  // _oGraph has no default value.
  // _oGraphData has no default value.
  // _systs has no default value.
  // _shared has no default value.
  // _graph has no default value.
  // _graphData has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _iDAE;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 3));
  _systs = tmpMeta2;
  _shared = tmpMeta3;

  _graph = omc_HpcOmTaskGraph_getEmptyTaskGraph(threadData, ((modelica_integer) 0), ((modelica_integer) 0), ((modelica_integer) 0) ,&_graphData);

  /* Pattern-matching assignment */
  tmpMeta4 = mmc_mk_box2(0, _shared, mmc_mk_boolean(_iAnalyzeParameters));
  tmpMeta5 = mmc_mk_box3(0, _graph, _graphData, mmc_mk_integer(((modelica_integer) 1)));
  tmpMeta6 = omc_List_fold(threadData, _systs, (modelica_fnptr) mmc_mk_box2(0,closure23_HpcOmTaskGraph_createTaskGraph0,tmpMeta4), tmpMeta5);
  tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
  tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
  _oGraph = tmpMeta7;
  _oGraphData = tmpMeta8;
  _return: OMC_LABEL_UNUSED
  if (out_oGraphData) { *out_oGraphData = _oGraphData; }
  return _oGraph;
}
modelica_metatype boxptr_HpcOmTaskGraph_createTaskGraph(threadData_t *threadData, modelica_metatype _iDAE, modelica_metatype _iAnalyzeParameters, modelica_metatype *out_oGraphData)
{
  modelica_integer tmp1;
  modelica_metatype _oGraph = NULL;
  tmp1 = mmc_unbox_integer(_iAnalyzeParameters);
  _oGraph = omc_HpcOmTaskGraph_createTaskGraph(threadData, _iDAE, tmp1, out_oGraphData);
  /* skip box _oGraph; array<list<#Integer>> */
  /* skip box _oGraphData; HpcOmTaskGraph.TaskGraphMeta */
  return _oGraph;
}

