#include "omc_simulation_settings.h"
#include "NFOCConnectionGraph.h"
#define _OMC_LIT0_data "branch"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,6,_OMC_LIT0_data);
#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
#define _OMC_LIT1_data "root"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,4,_OMC_LIT1_data);
#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
#define _OMC_LIT2_data "potentialRoot"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,13,_OMC_LIT2_data);
#define _OMC_LIT2 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)
#define _OMC_LIT3_data "isRoot"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT3,6,_OMC_LIT3_data);
#define _OMC_LIT3 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT3)
#define _OMC_LIT4_data "rooted"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT4,6,_OMC_LIT4_data);
#define _OMC_LIT4 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT4)
#define _OMC_LIT5_data "uniqueRoot"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,10,_OMC_LIT5_data);
#define _OMC_LIT5 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)
#define _OMC_LIT6_data "uniqueRootIndices"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,17,_OMC_LIT6_data);
#define _OMC_LIT6 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT6)
#define _OMC_LIT7_data "Connections"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT7,11,_OMC_LIT7_data);
#define _OMC_LIT7 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT7)
#define _OMC_LIT8_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT8,0,_OMC_LIT8_data);
#define _OMC_LIT8 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data "connect("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,8,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
#define _OMC_LIT10_data ", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT10,2,_OMC_LIT10_data);
#define _OMC_LIT10 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT10)
#define _OMC_LIT11_data ")\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT11,2,_OMC_LIT11_data);
#define _OMC_LIT11 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT11)
#define _OMC_LIT12_data "- NFOCConnectionGraph.removeBrokenConnects:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT12,44,_OMC_LIT12_data);
#define _OMC_LIT12 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT12)
#define _OMC_LIT13_data "\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT13,1,_OMC_LIT13_data);
#define _OMC_LIT13 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT13)
#define _OMC_LIT14_data "cgraph"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT14,6,_OMC_LIT14_data);
#define _OMC_LIT14 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT14)
#define _OMC_LIT15_data "Prints out connection graph information."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT15,40,_OMC_LIT15_data);
#define _OMC_LIT15 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT15)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT16,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(61)),_OMC_LIT14,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT15}};
#define _OMC_LIT16 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT16)
#define _OMC_LIT17_data "cgraphGraphVizShow"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT17,18,_OMC_LIT17_data);
#define _OMC_LIT17 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT17)
#define _OMC_LIT18_data "Displays the connection graph with the GraphViz lefty tool."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT18,59,_OMC_LIT18_data);
#define _OMC_LIT18 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT18)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT19,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(12)),_OMC_LIT17,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT18}};
#define _OMC_LIT19 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT19)
#define _OMC_LIT20_data "_removed_connections.txt"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT20,24,_OMC_LIT20_data);
#define _OMC_LIT20 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT20)
#define _OMC_LIT21_data "Tyring to start GraphViz *lefty* to visualize the graph. You need to have lefty in your PATH variable\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT21,102,_OMC_LIT21_data);
#define _OMC_LIT21 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT21)
#define _OMC_LIT22_data "Make sure you quit GraphViz *lefty* via Right Click->quit to be sure the process will be exited.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT22,97,_OMC_LIT22_data);
#define _OMC_LIT22 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT22)
#define _OMC_LIT23_data "If you quit the GraphViz *lefty* window via X, please kill the process in task manager to continue.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT23,100,_OMC_LIT23_data);
#define _OMC_LIT23 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT23)
#define _OMC_LIT24_data "\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT24,1,_OMC_LIT24_data);
#define _OMC_LIT24 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT24)
#define _OMC_LIT25_data "load('"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT25,6,_OMC_LIT25_data);
#define _OMC_LIT25 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT25)
#define _OMC_LIT26_data "/share/omc/scripts/openmodelica.lefty');"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT26,40,_OMC_LIT26_data);
#define _OMC_LIT26 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT26)
#define _OMC_LIT27_data "openmodelica.init();openmodelica.createviewandgraph('"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT27,53,_OMC_LIT27_data);
#define _OMC_LIT27 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT27)
#define _OMC_LIT28_data "','file',null,null);txtview('off');"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT28,35,_OMC_LIT28_data);
#define _OMC_LIT28 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT28)
#define _OMC_LIT29_data "Running command: lefty -e "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT29,26,_OMC_LIT29_data);
#define _OMC_LIT29 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT29)
#define _OMC_LIT30_data " > "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT30,3,_OMC_LIT30_data);
#define _OMC_LIT30 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT30)
#define _OMC_LIT31_data "lefty -e "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT31,9,_OMC_LIT31_data);
#define _OMC_LIT31 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT31)
#define _OMC_LIT32_data "GraphViz *lefty* exited with status:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT32,36,_OMC_LIT32_data);
#define _OMC_LIT32 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT32)
#define _OMC_LIT33_data "GraphViz OpenModelica assistant returned the following broken connects: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT33,72,_OMC_LIT33_data);
#define _OMC_LIT33 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT33)
#define _OMC_LIT34_data "cgraphGraphVizFile"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT34,18,_OMC_LIT34_data);
#define _OMC_LIT34 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT34)
#define _OMC_LIT35_data "Generates a graphviz file of the connection graph."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT35,50,_OMC_LIT35_data);
#define _OMC_LIT35 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT35)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT36,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(11)),_OMC_LIT34,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT35}};
#define _OMC_LIT36 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT36)
#define _OMC_LIT37_data "	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT37,1,_OMC_LIT37_data);
#define _OMC_LIT37 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT37)
#define _OMC_LIT38_data ".gv"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT38,3,_OMC_LIT38_data);
#define _OMC_LIT38 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT38)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT39,1,4) {&IOStream_IOStreamType_LIST__desc,}};
#define _OMC_LIT39 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT39)
#define _OMC_LIT40_data "// Generated by OpenModelica.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT40,30,_OMC_LIT40_data);
#define _OMC_LIT40 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT40)
#define _OMC_LIT41_data "// Overconstrained connection graph for model:\n//    "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT41,53,_OMC_LIT41_data);
#define _OMC_LIT41 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT41)
#define _OMC_LIT42_data "//\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT42,3,_OMC_LIT42_data);
#define _OMC_LIT42 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT42)
#define _OMC_LIT43_data "// Summary:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT43,12,_OMC_LIT43_data);
#define _OMC_LIT43 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT43)
#define _OMC_LIT44_data "//   Roots:              "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT44,25,_OMC_LIT44_data);
#define _OMC_LIT44 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT44)
#define _OMC_LIT45_data "//   Potential Roots:    "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT45,25,_OMC_LIT45_data);
#define _OMC_LIT45 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT45)
#define _OMC_LIT46_data "//   Unique Roots:       "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT46,25,_OMC_LIT46_data);
#define _OMC_LIT46 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT46)
#define _OMC_LIT47_data "//   Branches:           "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT47,25,_OMC_LIT47_data);
#define _OMC_LIT47 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT47)
#define _OMC_LIT48_data "//   Connections:        "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT48,25,_OMC_LIT48_data);
#define _OMC_LIT48 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT48)
#define _OMC_LIT49_data "//   Final Roots:        "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT49,25,_OMC_LIT49_data);
#define _OMC_LIT49 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT49)
#define _OMC_LIT50_data "//   Broken Connections: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT50,25,_OMC_LIT50_data);
#define _OMC_LIT50 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT50)
#define _OMC_LIT51_data "\\l"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT51,2,_OMC_LIT51_data);
#define _OMC_LIT51 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data " "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,1,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
#define _OMC_LIT53_data "/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT53,1,_OMC_LIT53_data);
#define _OMC_LIT53 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT53)
#define _OMC_LIT54_data "\n\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT54,2,_OMC_LIT54_data);
#define _OMC_LIT54 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT54)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT55,2,1) {_OMC_LIT54,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT55 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT55)
#define _OMC_LIT56_data "graph \""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT56,7,_OMC_LIT56_data);
#define _OMC_LIT56 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT56)
#define _OMC_LIT57_data "\"\n{\n\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,5,_OMC_LIT57_data);
#define _OMC_LIT57 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT57)
#define _OMC_LIT58_data "overlap=false;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT58,15,_OMC_LIT58_data);
#define _OMC_LIT58 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT58)
#define _OMC_LIT59_data "layout=dot;\n\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT59,13,_OMC_LIT59_data);
#define _OMC_LIT59 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT59)
#define _OMC_LIT60_data "node ["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT60,6,_OMC_LIT60_data);
#define _OMC_LIT60 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT60)
#define _OMC_LIT61_data "fillcolor = \"lightsteelblue1\", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT61,31,_OMC_LIT61_data);
#define _OMC_LIT61 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT61)
#define _OMC_LIT62_data "shape = box, "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT62,13,_OMC_LIT62_data);
#define _OMC_LIT62 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT62)
#define _OMC_LIT63_data "style = \"bold, filled\", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT63,24,_OMC_LIT63_data);
#define _OMC_LIT63 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT63)
#define _OMC_LIT64_data "rank = \"max\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT64,12,_OMC_LIT64_data);
#define _OMC_LIT64 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT64)
#define _OMC_LIT65_data "]\n\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT65,3,_OMC_LIT65_data);
#define _OMC_LIT65 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT65)
#define _OMC_LIT66_data "edge ["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT66,6,_OMC_LIT66_data);
#define _OMC_LIT66 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT66)
#define _OMC_LIT67_data "color = \"black\", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT67,17,_OMC_LIT67_data);
#define _OMC_LIT67 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT67)
#define _OMC_LIT68_data "style = bold"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT68,12,_OMC_LIT68_data);
#define _OMC_LIT68 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT68)
#define _OMC_LIT69_data "graph [fontsize=20, fontname = \"Courier Bold\" label= \"\\n\\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT69,58,_OMC_LIT69_data);
#define _OMC_LIT69 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT69)
#define _OMC_LIT70_data "\", size=\"6,6\"];\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT70,16,_OMC_LIT70_data);
#define _OMC_LIT70 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT70)
#define _OMC_LIT71_data "// Definite Roots (Connections.root)"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT71,36,_OMC_LIT71_data);
#define _OMC_LIT71 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT71)
#define _OMC_LIT72_data "// Potential Roots (Connections.potentialRoot)"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT72,46,_OMC_LIT72_data);
#define _OMC_LIT72 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT72)
#define _OMC_LIT73_data "// Branches (Connections.branch)"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT73,32,_OMC_LIT73_data);
#define _OMC_LIT73 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT73)
#define _OMC_LIT74_data "// Connections (connect)"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT74,24,_OMC_LIT74_data);
#define _OMC_LIT74 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT74)
#define _OMC_LIT75_data "\n}\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT75,3,_OMC_LIT75_data);
#define _OMC_LIT75 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT75)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT76,2,1) {_OMC_LIT75,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT76 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT76)
#define _OMC_LIT77_data "\n\n\n// graph generation took: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT77,29,_OMC_LIT77_data);
#define _OMC_LIT77 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT77)
#define _OMC_LIT78_data " seconds\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT78,9,_OMC_LIT78_data);
#define _OMC_LIT78 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT78)
#define _OMC_LIT79_data "GraphViz with connection graph for model: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT79,42,_OMC_LIT79_data);
#define _OMC_LIT79 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT79)
#define _OMC_LIT80_data " was writen to file: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT80,21,_OMC_LIT80_data);
#define _OMC_LIT80 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT80)
#define _OMC_LIT81_data " [fillcolor = orangered, rank = \"min\" label = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT81,46,_OMC_LIT81_data);
#define _OMC_LIT81 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT81)
#define _OMC_LIT82_data "\\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT82,2,_OMC_LIT82_data);
#define _OMC_LIT82 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT82)
#define _OMC_LIT83_data "\", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT83,3,_OMC_LIT83_data);
#define _OMC_LIT83 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT83)
#define _OMC_LIT84_data "shape=ploygon, sides=7, distortion=\"0.265084\", orientation=26, skew=\"0.403659\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT84,78,_OMC_LIT84_data);
#define _OMC_LIT84 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT84)
#define _OMC_LIT85_data "shape=box"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT85,9,_OMC_LIT85_data);
#define _OMC_LIT85 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT85)
#define _OMC_LIT86_data "];\n	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT86,4,_OMC_LIT86_data);
#define _OMC_LIT86 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT86)
#define _OMC_LIT87_data " [fillcolor = red, rank = \"source\", label = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT87,44,_OMC_LIT87_data);
#define _OMC_LIT87 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT87)
#define _OMC_LIT88_data "shape=polygon, sides=8, distortion=\"0.265084\", orientation=26, skew=\"0.403659\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT88,78,_OMC_LIT88_data);
#define _OMC_LIT88 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT88)
#define _OMC_LIT89_data "[[broken connect]]"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT89,18,_OMC_LIT89_data);
#define _OMC_LIT89 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT89)
#define _OMC_LIT90_data "connect"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT90,7,_OMC_LIT90_data);
#define _OMC_LIT90 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT90)
#define _OMC_LIT91_data "red"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT91,3,_OMC_LIT91_data);
#define _OMC_LIT91 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT91)
#define _OMC_LIT92_data "green"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT92,5,_OMC_LIT92_data);
#define _OMC_LIT92 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT92)
#define _OMC_LIT93_data "\"bold, dashed\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT93,14,_OMC_LIT93_data);
#define _OMC_LIT93 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT93)
#define _OMC_LIT94_data "solid"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT94,5,_OMC_LIT94_data);
#define _OMC_LIT94 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT94)
#define _OMC_LIT95_data "true"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT95,4,_OMC_LIT95_data);
#define _OMC_LIT95 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT95)
#define _OMC_LIT96_data "false"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT96,5,_OMC_LIT96_data);
#define _OMC_LIT96 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT96)
#define _OMC_LIT97_data "labelfontsize = 20.0, "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT97,22,_OMC_LIT97_data);
#define _OMC_LIT97 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT97)
#define _OMC_LIT98_data "\" -- \""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT98,6,_OMC_LIT98_data);
#define _OMC_LIT98 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT98)
#define _OMC_LIT99_data "\" [dir = \"none\", style = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT99,25,_OMC_LIT99_data);
#define _OMC_LIT99 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT99)
#define _OMC_LIT100_data ", decorate = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT100,13,_OMC_LIT100_data);
#define _OMC_LIT100 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT100)
#define _OMC_LIT101_data ", color = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT101,10,_OMC_LIT101_data);
#define _OMC_LIT101 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT101)
#define _OMC_LIT102_data "fontcolor = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT102,12,_OMC_LIT102_data);
#define _OMC_LIT102 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data ", label = \""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,11,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
#define _OMC_LIT104_data "\"];\n	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT104,5,_OMC_LIT104_data);
#define _OMC_LIT104 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT104)
#define _OMC_LIT105_data " [color = blue, dir = \"none\", fontcolor=blue, label = \"branch\"];\n	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT105,66,_OMC_LIT105_data);
#define _OMC_LIT105 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT105)
#define _OMC_LIT106_data "- NFOCConnectionGraph.merge()\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT106,30,_OMC_LIT106_data);
#define _OMC_LIT106 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT106)
#define _OMC_LIT107_data "Connections:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT107,13,_OMC_LIT107_data);
#define _OMC_LIT107 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT107)
#define _OMC_LIT108_data "Branches:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT108,10,_OMC_LIT108_data);
#define _OMC_LIT108 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT108)
#define _OMC_LIT109_data "    "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT109,4,_OMC_LIT109_data);
#define _OMC_LIT109 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT109)
#define _OMC_LIT110_data " -- "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT110,4,_OMC_LIT110_data);
#define _OMC_LIT110 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT110)
#define _OMC_LIT111_data "("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT111,1,_OMC_LIT111_data);
#define _OMC_LIT111 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT111)
#define _OMC_LIT112_data ")"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT112,1,_OMC_LIT112_data);
#define _OMC_LIT112 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT112)
#define _OMC_LIT113_data "- NFOCConnectionGraph.evalConnectionsOperatorsHelper: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT113,54,_OMC_LIT113_data);
#define _OMC_LIT113 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT113)
#define _OMC_LIT114_data " = false\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT114,9,_OMC_LIT114_data);
#define _OMC_LIT114 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT114)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT115,2,6) {&NFExpression_BOOLEAN__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT115 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT115)
#define _OMC_LIT116_data "- NFOCConnectionGraph.evalConnectionsOperatorsHelper: Found Branche Partner "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT116,76,_OMC_LIT116_data);
#define _OMC_LIT116 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT116)
#define _OMC_LIT117_data " = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT117,3,_OMC_LIT117_data);
#define _OMC_LIT117 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,1,5) {&ErrorTypes_MessageType_TRANSLATION__desc,}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT119,1,5) {&ErrorTypes_Severity_WARNING__desc,}};
#define _OMC_LIT119 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT119)
#define _OMC_LIT120_data "Connections.rooted(%s) needs exactly one statement Connections.branch(%s, B.R) involving %s but we found none in the graph. Run with -d=cgraphGraphVizFile to debug"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT120,163,_OMC_LIT120_data);
#define _OMC_LIT120 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT120)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT121,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(595)),_OMC_LIT118,_OMC_LIT119,_OMC_LIT120}};
#define _OMC_LIT121 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT121)
#define _OMC_LIT122_data "- NFOCConnectionGraph.evalConnectionsOperatorsHelper: Connections.uniqueRootsIndices("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT122,85,_OMC_LIT122_data);
#define _OMC_LIT122 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT122)
#define _OMC_LIT123_data ","
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT123,1,_OMC_LIT123_data);
#define _OMC_LIT123 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT123)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT124,1,4) {&ErrorTypes_Severity_ERROR__desc,}};
#define _OMC_LIT124 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT124)
#define _OMC_LIT125_data "Dimensions must be parameter or constant expression (in %s)."
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT125,60,_OMC_LIT125_data);
#define _OMC_LIT125 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT125)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT126,5,3) {&ErrorTypes_Message_MESSAGE__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(23)),_OMC_LIT118,_OMC_LIT124,_OMC_LIT125}};
#define _OMC_LIT126 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT126)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT127,2,3) {&NFExpression_INTEGER__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT127 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT127)
#define _OMC_LIT128_data "The following output from GraphViz OpenModelica assistant cannot be parsed:"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT128,75,_OMC_LIT128_data);
#define _OMC_LIT128 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT128)
#define _OMC_LIT129_data "\nExpected format from GrapViz: cref1|cref2#cref3|cref4#. Ignoring malformed input.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT129,83,_OMC_LIT129_data);
#define _OMC_LIT129 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT129)
#define _OMC_LIT130_data "Ordered Potential Roots: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT130,25,_OMC_LIT130_data);
#define _OMC_LIT130 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT130)
#define _OMC_LIT131_data "time"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT131,4,_OMC_LIT131_data);
#define _OMC_LIT131 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT131)
#define _OMC_LIT132_data "Real"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT132,4,_OMC_LIT132_data);
#define _OMC_LIT132 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT132)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT133,1,3) {&SCode_Visibility_PUBLIC__desc,}};
#define _OMC_LIT133 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT133)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT134,1,4) {&SCode_Redeclare_NOT__REDECLARE__desc,}};
#define _OMC_LIT134 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT134)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT135,1,4) {&SCode_Final_NOT__FINAL__desc,}};
#define _OMC_LIT135 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT135)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT136,1,6) {&Absyn_InnerOuter_NOT__INNER__OUTER__desc,}};
#define _OMC_LIT136 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT136)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT137,1,4) {&SCode_Replaceable_NOT__REPLACEABLE__desc,}};
#define _OMC_LIT137 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT137)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT138,6,3) {&SCode_Prefixes_PREFIXES__desc,_OMC_LIT133,_OMC_LIT134,_OMC_LIT135,_OMC_LIT136,_OMC_LIT137}};
#define _OMC_LIT138 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT138)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT139,1,4) {&SCode_Encapsulated_NOT__ENCAPSULATED__desc,}};
#define _OMC_LIT139 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT139)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT140,1,4) {&SCode_Partial_NOT__PARTIAL__desc,}};
#define _OMC_LIT140 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT140)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT141,1,10) {&SCode_Restriction_R__TYPE__desc,}};
#define _OMC_LIT141 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT141)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT142,9,3) {&SCode_ClassDef_PARTS__desc,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT142 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT142)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT143,3,3) {&SCode_Comment_COMMENT__desc,MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT143 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT143)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT144,0.0);
#define _OMC_LIT144 MMC_REFREALLIT(_OMC_LIT_STRUCT144)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT145,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT8,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT144}};
#define _OMC_LIT145 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT145)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT146,9,5) {&SCode_Element_CLASS__desc,_OMC_LIT132,_OMC_LIT138,_OMC_LIT139,_OMC_LIT140,_OMC_LIT141,_OMC_LIT142,_OMC_LIT143,_OMC_LIT145}};
#define _OMC_LIT146 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT146)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT147,1,4) {&NFType_REAL__desc,}};
#define _OMC_LIT147 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT147)
#define _OMC_LIT148_data "quantity"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT148,8,_OMC_LIT148_data);
#define _OMC_LIT148 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT148)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT149,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1))}};
#define _OMC_LIT149 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT149)
#define _OMC_LIT150_data "max"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT150,3,_OMC_LIT150_data);
#define _OMC_LIT150 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT150)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT151,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(5))}};
#define _OMC_LIT151 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT151)
#define _OMC_LIT152_data "displayUnit"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT152,11,_OMC_LIT152_data);
#define _OMC_LIT152 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(3))}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT154,1,5) {&NFLookupTree_Tree_EMPTY__desc,}};
#define _OMC_LIT154 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT154)
#define _OMC_LIT155_data "fixed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT155,5,_OMC_LIT155_data);
#define _OMC_LIT155 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT155)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT156,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(7))}};
#define _OMC_LIT156 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT156)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT157,3,4) {&NFLookupTree_Tree_LEAF__desc,_OMC_LIT155,_OMC_LIT156}};
#define _OMC_LIT157 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT157)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT158,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT152,_OMC_LIT153,MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),_OMC_LIT154,_OMC_LIT157}};
#define _OMC_LIT158 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT158)
#define _OMC_LIT159_data "min"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT159,3,_OMC_LIT159_data);
#define _OMC_LIT159 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT159)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT160,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(4))}};
#define _OMC_LIT160 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT160)
#define _OMC_LIT161_data "nominal"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT161,7,_OMC_LIT161_data);
#define _OMC_LIT161 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT161)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT162,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(8))}};
#define _OMC_LIT162 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT162)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT163,3,4) {&NFLookupTree_Tree_LEAF__desc,_OMC_LIT161,_OMC_LIT162}};
#define _OMC_LIT163 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT163)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT164,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT159,_OMC_LIT160,MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),_OMC_LIT154,_OMC_LIT163}};
#define _OMC_LIT164 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT164)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT165,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT150,_OMC_LIT151,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),_OMC_LIT158,_OMC_LIT164}};
#define _OMC_LIT165 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT165)
#define _OMC_LIT166_data "unbounded"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT166,9,_OMC_LIT166_data);
#define _OMC_LIT166 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT166)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT167,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(9))}};
#define _OMC_LIT167 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT167)
#define _OMC_LIT168_data "start"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT168,5,_OMC_LIT168_data);
#define _OMC_LIT168 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT168)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT169,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(6))}};
#define _OMC_LIT169 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT169)
#define _OMC_LIT170_data "stateSelect"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT170,11,_OMC_LIT170_data);
#define _OMC_LIT170 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT170)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT171,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(10))}};
#define _OMC_LIT171 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT171)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT172,3,4) {&NFLookupTree_Tree_LEAF__desc,_OMC_LIT170,_OMC_LIT171}};
#define _OMC_LIT172 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT172)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT173,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT168,_OMC_LIT169,MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),_OMC_LIT154,_OMC_LIT172}};
#define _OMC_LIT173 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT173)
#define _OMC_LIT174_data "unit"
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,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2))}};
#define _OMC_LIT175 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT175)
#define _OMC_LIT176_data "uncertain"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT176,9,_OMC_LIT176_data);
#define _OMC_LIT176 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT176)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT177,2,4) {&NFLookupTree_Entry_COMPONENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(11))}};
#define _OMC_LIT177 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT177)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT178,3,4) {&NFLookupTree_Tree_LEAF__desc,_OMC_LIT176,_OMC_LIT177}};
#define _OMC_LIT178 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT178)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT179,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT174,_OMC_LIT175,MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),_OMC_LIT178,_OMC_LIT154}};
#define _OMC_LIT179 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT179)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT180,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT166,_OMC_LIT167,MMC_IMMEDIATE(MMC_TAGFIXNUM(3)),_OMC_LIT173,_OMC_LIT179}};
#define _OMC_LIT180 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT180)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT181,6,3) {&NFLookupTree_Tree_NODE__desc,_OMC_LIT148,_OMC_LIT149,MMC_IMMEDIATE(MMC_TAGFIXNUM(4)),_OMC_LIT165,_OMC_LIT180}};
#define _OMC_LIT181 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT181)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT182,1,5) {&NFType_STRING__desc,}};
#define _OMC_LIT182 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT182)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT183,1,5) {&NFModifier_Modifier_NOMOD__desc,}};
#define _OMC_LIT183 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT183)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT184,3,7) {&NFComponent_TYPE__ATTRIBUTE__desc,_OMC_LIT182,_OMC_LIT183}};
#define _OMC_LIT184 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT184)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT185,1,1) {_OMC_LIT184}};
#define _OMC_LIT185 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT185)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT186,1,11) {&NFInstNode_InstNode_EMPTY__NODE__desc,}};
#define _OMC_LIT186 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT186)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT187,1,9) {&NFInstNode_InstNodeType_NORMAL__COMP__desc,}};
#define _OMC_LIT187 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT187)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT188,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT148,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT185,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT188 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT188)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT189,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT174,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT185,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT189 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT189)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT190,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT152,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT185,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT190 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT190)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT191,3,7) {&NFComponent_TYPE__ATTRIBUTE__desc,_OMC_LIT147,_OMC_LIT183}};
#define _OMC_LIT191 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT191)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT192,1,1) {_OMC_LIT191}};
#define _OMC_LIT192 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT192)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT193,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT159,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT192,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT193 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT193)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT194,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT150,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT192,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT194 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT194)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT195,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT168,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT192,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT195 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT195)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT196,1,6) {&NFType_BOOLEAN__desc,}};
#define _OMC_LIT196 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT196)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT197,3,7) {&NFComponent_TYPE__ATTRIBUTE__desc,_OMC_LIT196,_OMC_LIT183}};
#define _OMC_LIT197 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT197)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT198,1,1) {_OMC_LIT197}};
#define _OMC_LIT198 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT198)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT199,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT155,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT198,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT199 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT199)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT200,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT161,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT192,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT200 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT200)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT201,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT166,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT198,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT201 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT201)
#define _OMC_LIT202_data "StateSelect"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT202,11,_OMC_LIT202_data);
#define _OMC_LIT202 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT202)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT203,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT202}};
#define _OMC_LIT203 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT203)
#define _OMC_LIT204_data "never"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT204,5,_OMC_LIT204_data);
#define _OMC_LIT204 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT204)
#define _OMC_LIT205_data "avoid"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT205,5,_OMC_LIT205_data);
#define _OMC_LIT205 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT205)
#define _OMC_LIT206_data "default"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT206,7,_OMC_LIT206_data);
#define _OMC_LIT206 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT206)
#define _OMC_LIT207_data "prefer"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT207,6,_OMC_LIT207_data);
#define _OMC_LIT207 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT207)
#define _OMC_LIT208_data "always"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT208,6,_OMC_LIT208_data);
#define _OMC_LIT208 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT208)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT209,2,1) {_OMC_LIT208,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT209 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT209)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT210,2,1) {_OMC_LIT207,_OMC_LIT209}};
#define _OMC_LIT210 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT210)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT211,2,1) {_OMC_LIT206,_OMC_LIT210}};
#define _OMC_LIT211 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT211)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT212,2,1) {_OMC_LIT205,_OMC_LIT211}};
#define _OMC_LIT212 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT212)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT213,2,1) {_OMC_LIT204,_OMC_LIT212}};
#define _OMC_LIT213 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT213)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT214,3,8) {&NFType_ENUMERATION__desc,_OMC_LIT203,_OMC_LIT213}};
#define _OMC_LIT214 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT214)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT215,3,7) {&NFComponent_TYPE__ATTRIBUTE__desc,_OMC_LIT214,_OMC_LIT183}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT216,1,1) {_OMC_LIT215}};
#define _OMC_LIT216 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT216)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT217,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT170,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT216,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT217 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT217)
#define _OMC_LIT218_data "Uncertainty"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT218,11,_OMC_LIT218_data);
#define _OMC_LIT218 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT218)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT219,2,4) {&Absyn_Path_IDENT__desc,_OMC_LIT218}};
#define _OMC_LIT219 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT219)
#define _OMC_LIT220_data "given"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT220,5,_OMC_LIT220_data);
#define _OMC_LIT220 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT220)
#define _OMC_LIT221_data "sought"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT221,6,_OMC_LIT221_data);
#define _OMC_LIT221 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT221)
#define _OMC_LIT222_data "refine"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT222,6,_OMC_LIT222_data);
#define _OMC_LIT222 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT222)
#define _OMC_LIT223_data "propagate"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT223,9,_OMC_LIT223_data);
#define _OMC_LIT223 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT223)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT224,2,1) {_OMC_LIT223,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT224 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT224)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT225,2,1) {_OMC_LIT222,_OMC_LIT224}};
#define _OMC_LIT225 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT225)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT226,2,1) {_OMC_LIT221,_OMC_LIT225}};
#define _OMC_LIT226 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT226)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT227,2,1) {_OMC_LIT220,_OMC_LIT226}};
#define _OMC_LIT227 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT227)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT228,3,8) {&NFType_ENUMERATION__desc,_OMC_LIT219,_OMC_LIT227}};
#define _OMC_LIT228 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT228)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT229,3,7) {&NFComponent_TYPE__ATTRIBUTE__desc,_OMC_LIT228,_OMC_LIT183}};
#define _OMC_LIT229 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT229)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT230,1,1) {_OMC_LIT229}};
#define _OMC_LIT230 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT230)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT231,7,4) {&NFInstNode_InstNode_COMPONENT__NODE__desc,_OMC_LIT176,MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT230,_OMC_LIT186,_OMC_LIT187}};
#define _OMC_LIT231 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT231)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT232,2,1) {_OMC_LIT231,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT232 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT232)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT233,2,1) {_OMC_LIT217,_OMC_LIT232}};
#define _OMC_LIT233 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT233)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT234,2,1) {_OMC_LIT201,_OMC_LIT233}};
#define _OMC_LIT234 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT234)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT235,2,1) {_OMC_LIT200,_OMC_LIT234}};
#define _OMC_LIT235 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT235)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT236,2,1) {_OMC_LIT199,_OMC_LIT235}};
#define _OMC_LIT236 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT236)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT237,2,1) {_OMC_LIT195,_OMC_LIT236}};
#define _OMC_LIT237 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT237)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT238,2,1) {_OMC_LIT194,_OMC_LIT237}};
#define _OMC_LIT238 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT238)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT239,2,1) {_OMC_LIT193,_OMC_LIT238}};
#define _OMC_LIT239 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT239)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT240,2,1) {_OMC_LIT190,_OMC_LIT239}};
#define _OMC_LIT240 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT240)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT241,2,1) {_OMC_LIT189,_OMC_LIT240}};
#define _OMC_LIT241 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT241)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT242,2,1) {_OMC_LIT188,_OMC_LIT241}};
#define _OMC_LIT242 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT242)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT243,11,MMC_ARRAY_TAG) {_OMC_LIT188,_OMC_LIT189,_OMC_LIT190,_OMC_LIT193,_OMC_LIT194,_OMC_LIT195,_OMC_LIT199,_OMC_LIT200,_OMC_LIT201,_OMC_LIT217,_OMC_LIT231}};
#define _OMC_LIT243 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT243)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT244,1,5) {&NFDuplicateTree_Tree_EMPTY__desc,}};
#define _OMC_LIT244 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT244)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT245,6,3) {&NFClass_Prefixes_PREFIXES__desc,_OMC_LIT139,_OMC_LIT140,_OMC_LIT135,_OMC_LIT136,_OMC_LIT137}};
#define _OMC_LIT245 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT245)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT246,1,15) {&NFRestriction_TYPE__desc,}};
#define _OMC_LIT246 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT246)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT247,4,5) {&NFInstNode_CachedData_FUNCTION__desc,MMC_REFSTRUCTLIT(mmc_nil),MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT247 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT247)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT248,2,1) {_OMC_LIT247,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT248 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT248)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT249,1,MMC_ARRAY_TAG) {_OMC_LIT247}};
#define _OMC_LIT249 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT249)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT250,1,6) {&NFInstNode_InstNodeType_BUILTIN__CLASS__desc,}};
#define _OMC_LIT250 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT250)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT251,1,3) {&NFBinding_UNBOUND__desc,}};
#define _OMC_LIT251 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT251)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT252,1,4) {&NFPrefixes_Replaceable_NOT__REPLACEABLE__desc,}};
#define _OMC_LIT252 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT252)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT253,10,3) {&NFAttributes_ATTRIBUTES__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(7)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2)),MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */)),_OMC_LIT252,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT253 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT253)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT254,1,4) {&NFComponentRef_EMPTY__desc,}};
#define _OMC_LIT254 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT254)
#define _OMC_LIT255_data "#"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT255,1,_OMC_LIT255_data);
#define _OMC_LIT255 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT255)
#define _OMC_LIT256_data "|"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT256,1,_OMC_LIT256_data);
#define _OMC_LIT256 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT256)
#define _OMC_LIT257_data "User selected the following connect edges for breaking:\n	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT257,57,_OMC_LIT257_data);
#define _OMC_LIT257 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT257)
#define _OMC_LIT258_data "\n	"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT258,2,_OMC_LIT258_data);
#define _OMC_LIT258 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT258)
#define _OMC_LIT259_data "\nAfer ordering:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT259,16,_OMC_LIT259_data);
#define _OMC_LIT259 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT259)
#define _OMC_LIT260_data "- NFOCConnectionGraph.connectComponents: should remove equations generated from: connect("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT260,89,_OMC_LIT260_data);
#define _OMC_LIT260 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT260)
#define _OMC_LIT261_data ") and add {0, ..., 0} = equalityConstraint(cr1, cr2) instead.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT261,62,_OMC_LIT261_data);
#define _OMC_LIT261 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT261)
#define _OMC_LIT262_data "- NFOCConnectionGraph.addConnection("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT262,36,_OMC_LIT262_data);
#define _OMC_LIT262 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT262)
#define _OMC_LIT263_data "- NFOCConnectionGraph.addBranch("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT263,32,_OMC_LIT263_data);
#define _OMC_LIT263 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT263)
#define _OMC_LIT264_data "- NFOCConnectionGraph.addUniqueRoots("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT264,37,_OMC_LIT264_data);
#define _OMC_LIT264 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT264)
#define _OMC_LIT265_data "- NFOCConnectionGraph.addPotentialRoot("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT265,39,_OMC_LIT265_data);
#define _OMC_LIT265 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT265)
#define _OMC_LIT266_data "- NFOCConnectionGraph.addDefiniteRoot("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT266,38,_OMC_LIT266_data);
#define _OMC_LIT266 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT266)
#define _OMC_LIT267_data "Summary:\n	Nr Roots:           "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT267,30,_OMC_LIT267_data);
#define _OMC_LIT267 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT267)
#define _OMC_LIT268_data "Nr Potential Roots: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT268,20,_OMC_LIT268_data);
#define _OMC_LIT268 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT268)
#define _OMC_LIT269_data "Nr Unique Roots:    "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT269,20,_OMC_LIT269_data);
#define _OMC_LIT269 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT269)
#define _OMC_LIT270_data "Nr Branches:        "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT270,20,_OMC_LIT270_data);
#define _OMC_LIT270 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT270)
#define _OMC_LIT271_data "Nr Connections:     "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT271,20,_OMC_LIT271_data);
#define _OMC_LIT271 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT271)
#define _OMC_LIT272_data "Roots: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT272,7,_OMC_LIT272_data);
#define _OMC_LIT272 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT272)
#define _OMC_LIT273_data "Broken connections: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT273,20,_OMC_LIT273_data);
#define _OMC_LIT273 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT273)
#define _OMC_LIT274_data "broken"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT274,6,_OMC_LIT274_data);
#define _OMC_LIT274 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT274)
#define _OMC_LIT275_data "Allowed connections: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT275,21,_OMC_LIT275_data);
#define _OMC_LIT275 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT275)
#define _OMC_LIT276_data "allowed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT276,7,_OMC_LIT276_data);
#define _OMC_LIT276 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT276)
#define _OMC_LIT277_data "- NFOCConnectionGraph.handleOverconstrainedConnections failed for model: "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT277,73,_OMC_LIT277_data);
#define _OMC_LIT277 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT277)
#define _OMC_LIT278_data "equalityConstraint"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT278,18,_OMC_LIT278_data);
#define _OMC_LIT278 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT278)
#define _OMC_LIT279_data "fill"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT279,4,_OMC_LIT279_data);
#define _OMC_LIT279 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT279)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT280,2,4) {&NFExpression_REAL__desc,_OMC_LIT144}};
#define _OMC_LIT280 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT280)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT281,4,3) {&NFCeval_EvalTarget_EVAL__TARGET__desc,_OMC_LIT145,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_none)}};
#define _OMC_LIT281 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT281)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT282,2,5) {&NFExpression_STRING__desc,_OMC_LIT8}};
#define _OMC_LIT282 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT282)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT283,7,3) {&NFOCConnectionGraph_NFOCConnectionGraph_GRAPH__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */)),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT283 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT283)
#define _OMC_LIT284_data " sets:\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT284,7,_OMC_LIT284_data);
#define _OMC_LIT284 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT284)
#define _OMC_LIT285_data "["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT285,1,_OMC_LIT285_data);
#define _OMC_LIT285 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT285)
#define _OMC_LIT286_data "]"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT286,1,_OMC_LIT286_data);
#define _OMC_LIT286 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT286)
#define _OMC_LIT287_data " -> "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT287,4,_OMC_LIT287_data);
#define _OMC_LIT287 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT287)
#include "util/modelica.h"

#include "NFOCConnectionGraph_includes.h"


/* default, do not make protected functions static */
#if !defined(PROTECTED_FUNCTION_STATIC)
#define PROTECTED_FUNCTION_STATIC
#endif
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_newCrefCrefTable(threadData_t *threadData);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_newCrefCrefTable,2,0) {(void*) boxptr_NFOCConnectionGraph_newCrefCrefTable,0}};
#define boxvar_NFOCConnectionGraph_newCrefCrefTable MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_newCrefCrefTable)
PROTECTED_FUNCTION_STATIC modelica_integer omc_NFOCConnectionGraph_identifyConnectionsOperator(threadData_t *threadData, modelica_metatype _functionName);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_identifyConnectionsOperator(threadData_t *threadData, modelica_metatype _functionName);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_identifyConnectionsOperator,2,0) {(void*) boxptr_NFOCConnectionGraph_identifyConnectionsOperator,0}};
#define boxvar_NFOCConnectionGraph_identifyConnectionsOperator MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_identifyConnectionsOperator)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_removeBrokenConnects(threadData_t *threadData, modelica_metatype _inEquations, modelica_metatype _inConnected, modelica_metatype _inBroken, modelica_fnptr _isDeleted);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_removeBrokenConnects,2,0) {(void*) boxptr_NFOCConnectionGraph_removeBrokenConnects,0}};
#define boxvar_NFOCConnectionGraph_removeBrokenConnects MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_removeBrokenConnects)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_showGraphViz(threadData_t *threadData, modelica_string _fileNameGraphViz, modelica_string _modelNameQualified);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_showGraphViz,2,0) {(void*) boxptr_NFOCConnectionGraph_showGraphViz,0}};
#define boxvar_NFOCConnectionGraph_showGraphViz MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_showGraphViz)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_generateGraphViz(threadData_t *threadData, modelica_string _modelNameQualified, modelica_metatype _definiteRoots, modelica_metatype _potentialRoots, modelica_metatype _uniqueRoots, modelica_metatype _branches, modelica_metatype _connections, modelica_metatype _finalRoots, modelica_metatype _broken);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_generateGraphViz,2,0) {(void*) boxptr_NFOCConnectionGraph_generateGraphViz,0}};
#define boxvar_NFOCConnectionGraph_generateGraphViz MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_generateGraphViz)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizPotentialRoot(threadData_t *threadData, modelica_metatype _inPotentialRoot, modelica_metatype _inFinalRoots);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizPotentialRoot,2,0) {(void*) boxptr_NFOCConnectionGraph_graphVizPotentialRoot,0}};
#define boxvar_NFOCConnectionGraph_graphVizPotentialRoot MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizPotentialRoot)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizDefiniteRoot(threadData_t *threadData, modelica_metatype _inDefiniteRoot, modelica_metatype _inFinalRoots);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizDefiniteRoot,2,0) {(void*) boxptr_NFOCConnectionGraph_graphVizDefiniteRoot,0}};
#define boxvar_NFOCConnectionGraph_graphVizDefiniteRoot MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizDefiniteRoot)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_FlatEdgeIsEqual(threadData_t *threadData, modelica_metatype _inEdge1, modelica_metatype _inEdge2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_FlatEdgeIsEqual(threadData_t *threadData, modelica_metatype _inEdge1, modelica_metatype _inEdge2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_FlatEdgeIsEqual,2,0) {(void*) boxptr_NFOCConnectionGraph_FlatEdgeIsEqual,0}};
#define boxvar_NFOCConnectionGraph_FlatEdgeIsEqual MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_FlatEdgeIsEqual)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizFlatEdge(threadData_t *threadData, modelica_metatype _edge, modelica_metatype _inBrokenFlatEdges);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizFlatEdge,2,0) {(void*) boxptr_NFOCConnectionGraph_graphVizFlatEdge,0}};
#define boxvar_NFOCConnectionGraph_graphVizFlatEdge MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizFlatEdge)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizEdge(threadData_t *threadData, modelica_metatype _inEdge);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizEdge,2,0) {(void*) boxptr_NFOCConnectionGraph_graphVizEdge,0}};
#define boxvar_NFOCConnectionGraph_graphVizEdge MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_graphVizEdge)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_merge(threadData_t *threadData, modelica_metatype _inGraph1, modelica_metatype _inGraph2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_merge,2,0) {(void*) boxptr_NFOCConnectionGraph_merge,0}};
#define boxvar_NFOCConnectionGraph_merge MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_merge)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getConnections(threadData_t *threadData, modelica_metatype _inGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getConnections,2,0) {(void*) boxptr_NFOCConnectionGraph_getConnections,0}};
#define boxvar_NFOCConnectionGraph_getConnections MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getConnections)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getBranches(threadData_t *threadData, modelica_metatype _inGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getBranches,2,0) {(void*) boxptr_NFOCConnectionGraph_getBranches,0}};
#define boxvar_NFOCConnectionGraph_getBranches MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getBranches)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getPotentialRoots(threadData_t *threadData, modelica_metatype _inGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getPotentialRoots,2,0) {(void*) boxptr_NFOCConnectionGraph_getPotentialRoots,0}};
#define boxvar_NFOCConnectionGraph_getPotentialRoots MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getPotentialRoots)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getUniqueRoots(threadData_t *threadData, modelica_metatype _inGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getUniqueRoots,2,0) {(void*) boxptr_NFOCConnectionGraph_getUniqueRoots,0}};
#define boxvar_NFOCConnectionGraph_getUniqueRoots MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getUniqueRoots)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getDefiniteRoots(threadData_t *threadData, modelica_metatype _inGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getDefiniteRoots,2,0) {(void*) boxptr_NFOCConnectionGraph_getDefiniteRoots,0}};
#define boxvar_NFOCConnectionGraph_getDefiniteRoots MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getDefiniteRoots)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_printNFOCConnectionGraph(threadData_t *threadData, modelica_metatype _inGraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printNFOCConnectionGraph,2,0) {(void*) boxptr_NFOCConnectionGraph_printNFOCConnectionGraph,0}};
#define boxvar_NFOCConnectionGraph_printNFOCConnectionGraph MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printNFOCConnectionGraph)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_printFlatEdges(threadData_t *threadData, modelica_metatype _inEdges);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printFlatEdges,2,0) {(void*) boxptr_NFOCConnectionGraph_printFlatEdges,0}};
#define boxvar_NFOCConnectionGraph_printFlatEdges MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printFlatEdges)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_printEdges(threadData_t *threadData, modelica_metatype _inEdges);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printEdges,2,0) {(void*) boxptr_NFOCConnectionGraph_printEdges,0}};
#define boxvar_NFOCConnectionGraph_printEdges MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printEdges)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_printConnectionStr(threadData_t *threadData, modelica_metatype _edge, modelica_string _ty);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printConnectionStr,2,0) {(void*) boxptr_NFOCConnectionGraph_printConnectionStr,0}};
#define boxvar_NFOCConnectionGraph_printConnectionStr MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printConnectionStr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getEdge(threadData_t *threadData, modelica_metatype _cr, modelica_metatype _edges);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getEdge,2,0) {(void*) boxptr_NFOCConnectionGraph_getEdge,0}};
#define boxvar_NFOCConnectionGraph_getEdge MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getEdge)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_getRooted(threadData_t *threadData, modelica_metatype _cref1, modelica_metatype _cref2, modelica_metatype _rooted);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_getRooted(threadData_t *threadData, modelica_metatype _cref1, modelica_metatype _cref2, modelica_metatype _rooted);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getRooted,2,0) {(void*) boxptr_NFOCConnectionGraph_getRooted,0}};
#define boxvar_NFOCConnectionGraph_getRooted MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getRooted)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evalConnectionsOperatorsHelper(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _rooted, modelica_metatype _roots, modelica_metatype _graph, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evalConnectionsOperatorsHelper,2,0) {(void*) boxptr_NFOCConnectionGraph_evalConnectionsOperatorsHelper,0}};
#define boxvar_NFOCConnectionGraph_evalConnectionsOperatorsHelper MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evalConnectionsOperatorsHelper)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evaluateOperators(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype _rooted, modelica_metatype _roots, modelica_metatype _graph, modelica_metatype _info);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evaluateOperators,2,0) {(void*) boxptr_NFOCConnectionGraph_evaluateOperators,0}};
#define boxvar_NFOCConnectionGraph_evaluateOperators MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evaluateOperators)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evalConnectionsOperatorsVar(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _rooted, modelica_metatype _graph, modelica_metatype __omcQ_24in_5Fvar);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evalConnectionsOperatorsVar,2,0) {(void*) boxptr_NFOCConnectionGraph_evalConnectionsOperatorsVar,0}};
#define boxvar_NFOCConnectionGraph_evalConnectionsOperatorsVar MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evalConnectionsOperatorsVar)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evalConnectionsOperatorsEqs(threadData_t *threadData, modelica_metatype _inRoots, modelica_metatype _rooted, modelica_metatype _graph, modelica_metatype __omcQ_24in_5Fequations);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evalConnectionsOperatorsEqs,2,0) {(void*) boxptr_NFOCConnectionGraph_evalConnectionsOperatorsEqs,0}};
#define boxvar_NFOCConnectionGraph_evalConnectionsOperatorsEqs MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_evalConnectionsOperatorsEqs)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addConnectionRooted(threadData_t *threadData, modelica_metatype _cref1, modelica_metatype _cref2, modelica_metatype _table);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnectionRooted,2,0) {(void*) boxptr_NFOCConnectionGraph_addConnectionRooted,0}};
#define boxvar_NFOCConnectionGraph_addConnectionRooted MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnectionRooted)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addConnectionsRooted(threadData_t *threadData, modelica_metatype _connection, modelica_metatype _table);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnectionsRooted,2,0) {(void*) boxptr_NFOCConnectionGraph_addConnectionsRooted,0}};
#define boxvar_NFOCConnectionGraph_addConnectionsRooted MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnectionsRooted)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addBranches(threadData_t *threadData, modelica_metatype _edge, modelica_metatype _table);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBranches,2,0) {(void*) boxptr_NFOCConnectionGraph_addBranches,0}};
#define boxvar_NFOCConnectionGraph_addBranches MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBranches)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_setRootDistance(threadData_t *threadData, modelica_metatype _finalRoots, modelica_metatype _table, modelica_integer _distance, modelica_metatype _nextLevel, modelica_metatype _rooted);
PROTECTED_FUNCTION_STATIC void boxptr_NFOCConnectionGraph_setRootDistance(threadData_t *threadData, modelica_metatype _finalRoots, modelica_metatype _table, modelica_metatype _distance, modelica_metatype _nextLevel, modelica_metatype _rooted);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_setRootDistance,2,0) {(void*) boxptr_NFOCConnectionGraph_setRootDistance,0}};
#define boxvar_NFOCConnectionGraph_setRootDistance MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_setRootDistance)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_buildRootedTable(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _graph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_buildRootedTable,2,0) {(void*) boxptr_NFOCConnectionGraph_buildRootedTable,0}};
#define boxvar_NFOCConnectionGraph_buildRootedTable MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_buildRootedTable)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_printPotentialRootTuple(threadData_t *threadData, modelica_metatype _potentialRoot);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printPotentialRootTuple,2,0) {(void*) boxptr_NFOCConnectionGraph_printPotentialRootTuple,0}};
#define boxvar_NFOCConnectionGraph_printPotentialRootTuple MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printPotentialRootTuple)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_makeTuple(threadData_t *threadData, modelica_metatype _inLstLst);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_makeTuple,2,0) {(void*) boxptr_NFOCConnectionGraph_makeTuple,0}};
#define boxvar_NFOCConnectionGraph_makeTuple MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_makeTuple)
PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_printTupleStr(threadData_t *threadData, modelica_metatype _inTpl);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printTupleStr,2,0) {(void*) boxptr_NFOCConnectionGraph_printTupleStr,0}};
#define boxvar_NFOCConnectionGraph_printTupleStr MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_printTupleStr)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_orderConnectsGuidedByUser(threadData_t *threadData, modelica_metatype _inConnections, modelica_metatype _inUserSelectedBreaking);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_orderConnectsGuidedByUser,2,0) {(void*) boxptr_NFOCConnectionGraph_orderConnectsGuidedByUser,0}};
#define boxvar_NFOCConnectionGraph_orderConnectsGuidedByUser MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_orderConnectsGuidedByUser)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_findResultGraph(threadData_t *threadData, modelica_metatype _inGraph, modelica_string _modelNameQualified, modelica_metatype *out_outConnectedConnections, modelica_metatype *out_outBrokenConnections);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_findResultGraph,2,0) {(void*) boxptr_NFOCConnectionGraph_findResultGraph,0}};
#define boxvar_NFOCConnectionGraph_findResultGraph MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_findResultGraph)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addConnections(threadData_t *threadData, modelica_metatype _table, modelica_metatype _inConnections, modelica_metatype *out_outBrokenConnections);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnections,2,0) {(void*) boxptr_NFOCConnectionGraph_addConnections,0}};
#define boxvar_NFOCConnectionGraph_addConnections MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnections)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addPotentialRootsToTable(threadData_t *threadData, modelica_metatype _table, modelica_metatype _potentialRoots, modelica_metatype _roots, modelica_metatype _firstRoot);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addPotentialRootsToTable,2,0) {(void*) boxptr_NFOCConnectionGraph_addPotentialRootsToTable,0}};
#define boxvar_NFOCConnectionGraph_addPotentialRootsToTable MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addPotentialRootsToTable)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_ord(threadData_t *threadData, modelica_metatype _inEl1, modelica_metatype _inEl2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_ord(threadData_t *threadData, modelica_metatype _inEl1, modelica_metatype _inEl2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_ord,2,0) {(void*) boxptr_NFOCConnectionGraph_ord,0}};
#define boxvar_NFOCConnectionGraph_ord MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_ord)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addBranchesToTable(threadData_t *threadData, modelica_metatype _table, modelica_metatype _branches);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBranchesToTable,2,0) {(void*) boxptr_NFOCConnectionGraph_addBranchesToTable,0}};
#define boxvar_NFOCConnectionGraph_addBranchesToTable MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBranchesToTable)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_resultGraphWithRoots(threadData_t *threadData, modelica_metatype _roots);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_resultGraphWithRoots,2,0) {(void*) boxptr_NFOCConnectionGraph_resultGraphWithRoots,0}};
#define boxvar_NFOCConnectionGraph_resultGraphWithRoots MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_resultGraphWithRoots)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addRootsToTable(threadData_t *threadData, modelica_metatype _table, modelica_metatype _roots, modelica_metatype _firstRoot);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addRootsToTable,2,0) {(void*) boxptr_NFOCConnectionGraph_addRootsToTable,0}};
#define boxvar_NFOCConnectionGraph_addRootsToTable MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addRootsToTable)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_connectCanonicalComponents(threadData_t *threadData, modelica_metatype _inPartition, modelica_metatype _inRef1, modelica_metatype _inRef2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_connectCanonicalComponents(threadData_t *threadData, modelica_metatype _inPartition, modelica_metatype _inRef1, modelica_metatype _inRef2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_connectCanonicalComponents,2,0) {(void*) boxptr_NFOCConnectionGraph_connectCanonicalComponents,0}};
#define boxvar_NFOCConnectionGraph_connectCanonicalComponents MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_connectCanonicalComponents)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_connectComponents(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _edge, modelica_metatype *out_outBrokenConnections);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_connectComponents,2,0) {(void*) boxptr_NFOCConnectionGraph_connectComponents,0}};
#define boxvar_NFOCConnectionGraph_connectComponents MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_connectComponents)
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_connectBranchComponents(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _ref1, modelica_metatype _ref2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_connectBranchComponents,2,0) {(void*) boxptr_NFOCConnectionGraph_connectBranchComponents,0}};
#define boxvar_NFOCConnectionGraph_connectBranchComponents MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_connectBranchComponents)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_areInSameComponent(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _ref1, modelica_metatype _ref2);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_areInSameComponent(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _ref1, modelica_metatype _ref2);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_areInSameComponent,2,0) {(void*) boxptr_NFOCConnectionGraph_areInSameComponent,0}};
#define boxvar_NFOCConnectionGraph_areInSameComponent MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_areInSameComponent)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_canonical(threadData_t *threadData, modelica_metatype _inPartition, modelica_metatype _inRef);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_canonical,2,0) {(void*) boxptr_NFOCConnectionGraph_canonical,0}};
#define boxvar_NFOCConnectionGraph_canonical MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_canonical)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addConnection(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_metatype _source, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addConnection(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_metatype _source, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnection,2,0) {(void*) boxptr_NFOCConnectionGraph_addConnection,0}};
#define boxvar_NFOCConnectionGraph_addConnection MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addConnection)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addBranch(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addBranch(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBranch,2,0) {(void*) boxptr_NFOCConnectionGraph_addBranch,0}};
#define boxvar_NFOCConnectionGraph_addBranch MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBranch)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addUniqueRoots(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _message, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addUniqueRoots(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _message, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addUniqueRoots,2,0) {(void*) boxptr_NFOCConnectionGraph_addUniqueRoots,0}};
#define boxvar_NFOCConnectionGraph_addUniqueRoots MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addUniqueRoots)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addPotentialRoot(threadData_t *threadData, modelica_metatype _root, modelica_real _priority, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addPotentialRoot(threadData_t *threadData, modelica_metatype _root, modelica_metatype _priority, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addPotentialRoot,2,0) {(void*) boxptr_NFOCConnectionGraph_addPotentialRoot,0}};
#define boxvar_NFOCConnectionGraph_addPotentialRoot MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addPotentialRoot)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addDefiniteRoot(threadData_t *threadData, modelica_metatype _root, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addDefiniteRoot(threadData_t *threadData, modelica_metatype _root, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addDefiniteRoot,2,0) {(void*) boxptr_NFOCConnectionGraph_addDefiniteRoot,0}};
#define boxvar_NFOCConnectionGraph_addDefiniteRoot MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addDefiniteRoot)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_handleOverconstrainedConnections__dispatch(threadData_t *threadData, modelica_metatype _graph, modelica_metatype __omcQ_24in_5FflatModel, modelica_metatype *out_connected, modelica_metatype *out_broken);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_handleOverconstrainedConnections__dispatch,2,0) {(void*) boxptr_NFOCConnectionGraph_handleOverconstrainedConnections__dispatch,0}};
#define boxvar_NFOCConnectionGraph_handleOverconstrainedConnections__dispatch MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_handleOverconstrainedConnections__dispatch)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getOverconstrainedCref(threadData_t *threadData, modelica_metatype _cref);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getOverconstrainedCref,2,0) {(void*) boxptr_NFOCConnectionGraph_getOverconstrainedCref,0}};
#define boxvar_NFOCConnectionGraph_getOverconstrainedCref MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getOverconstrainedCref)
PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_isOverconstrainedCref(threadData_t *threadData, modelica_metatype _cref);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_isOverconstrainedCref(threadData_t *threadData, modelica_metatype _cref);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_isOverconstrainedCref,2,0) {(void*) boxptr_NFOCConnectionGraph_isOverconstrainedCref,0}};
#define boxvar_NFOCConnectionGraph_isOverconstrainedCref MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_isOverconstrainedCref)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getOverconstrainedCrefs(threadData_t *threadData, modelica_metatype _conn, modelica_fnptr _isDeleted);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getOverconstrainedCrefs,2,0) {(void*) boxptr_NFOCConnectionGraph_getOverconstrainedCrefs,0}};
#define boxvar_NFOCConnectionGraph_getOverconstrainedCrefs MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_getOverconstrainedCrefs)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_generateEqualityConstraintEquation(threadData_t *threadData, modelica_metatype _lhs, modelica_metatype _rhs, modelica_metatype _source);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_generateEqualityConstraintEquation,2,0) {(void*) boxptr_NFOCConnectionGraph_generateEqualityConstraintEquation,0}};
#define boxvar_NFOCConnectionGraph_generateEqualityConstraintEquation MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_generateEqualityConstraintEquation)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addRootsAndBranches(threadData_t *threadData, modelica_metatype _equations, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph, modelica_metatype *out_graph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addRootsAndBranches(threadData_t *threadData, modelica_metatype _equations, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph, modelica_metatype *out_graph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addRootsAndBranches,2,0) {(void*) boxptr_NFOCConnectionGraph_addRootsAndBranches,0}};
#define boxvar_NFOCConnectionGraph_addRootsAndBranches MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addRootsAndBranches)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addBreakableBranches(threadData_t *threadData, modelica_metatype _connections, modelica_fnptr _isDeleted, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addBreakableBranches(threadData_t *threadData, modelica_metatype _connections, modelica_fnptr _isDeleted, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph);
static const MMC_DEFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBreakableBranches,2,0) {(void*) boxptr_NFOCConnectionGraph_addBreakableBranches,0}};
#define boxvar_NFOCConnectionGraph_addBreakableBranches MMC_REFSTRUCTLIT(boxvar_lit_NFOCConnectionGraph_addBreakableBranches)

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_newCrefCrefTable(threadData_t *threadData)
{
  modelica_metatype _table = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _table has no default value.
  _table = omc_UnorderedMap_new(threadData, boxvar_NFComponentRef_hash, boxvar_NFComponentRef_isEqual, ((modelica_integer) 1));
  _return: OMC_LABEL_UNUSED
  return _table;
}

PROTECTED_FUNCTION_STATIC modelica_integer omc_NFOCConnectionGraph_identifyConnectionsOperator(threadData_t *threadData, modelica_metatype _functionName)
{
  modelica_integer _call;
  modelica_integer tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _call has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _functionName;
    {
      modelica_string _name = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _name has no default value.
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9 = 0;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,2) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (11 != MMC_STRLEN(tmpMeta6) || strcmp(MMC_STRINGDATA(_OMC_LIT7), MMC_STRINGDATA(tmpMeta6)) != 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,1,1) == 0) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta7), 2));
          _name = tmpMeta8;
          /* Pattern matching succeeded */
          { /* match expression */
            modelica_string tmp12_1;
            tmp12_1 = _name;
            {
              volatile mmc_switch_type tmp12;
              int tmp13;
              tmp12 = 0;
              for (; tmp12 < 8; tmp12++) {
                switch (MMC_SWITCH_CAST(tmp12)) {
                case 0: {
                  if (6 != MMC_STRLEN(tmp12_1) || strcmp(MMC_STRINGDATA(_OMC_LIT0), MMC_STRINGDATA(tmp12_1)) != 0) goto tmp11_end;
                  /* Pattern matching succeeded */
                  tmp9 = 1;
                  goto tmp11_done;
                }
                case 1: {
                  if (4 != MMC_STRLEN(tmp12_1) || strcmp(MMC_STRINGDATA(_OMC_LIT1), MMC_STRINGDATA(tmp12_1)) != 0) goto tmp11_end;
                  /* Pattern matching succeeded */
                  tmp9 = 2;
                  goto tmp11_done;
                }
                case 2: {
                  if (13 != MMC_STRLEN(tmp12_1) || strcmp(MMC_STRINGDATA(_OMC_LIT2), MMC_STRINGDATA(tmp12_1)) != 0) goto tmp11_end;
                  /* Pattern matching succeeded */
                  tmp9 = 3;
                  goto tmp11_done;
                }
                case 3: {
                  if (6 != MMC_STRLEN(tmp12_1) || strcmp(MMC_STRINGDATA(_OMC_LIT3), MMC_STRINGDATA(tmp12_1)) != 0) goto tmp11_end;
                  /* Pattern matching succeeded */
                  tmp9 = 4;
                  goto tmp11_done;
                }
                case 4: {
                  if (6 != MMC_STRLEN(tmp12_1) || strcmp(MMC_STRINGDATA(_OMC_LIT4), MMC_STRINGDATA(tmp12_1)) != 0) goto tmp11_end;
                  /* Pattern matching succeeded */
                  tmp9 = 5;
                  goto tmp11_done;
                }
                case 5: {
                  if (10 != MMC_STRLEN(tmp12_1) || strcmp(MMC_STRINGDATA(_OMC_LIT5), MMC_STRINGDATA(tmp12_1)) != 0) goto tmp11_end;
                  /* Pattern matching succeeded */
                  tmp9 = 6;
                  goto tmp11_done;
                }
                case 6: {
                  if (17 != MMC_STRLEN(tmp12_1) || strcmp(MMC_STRINGDATA(_OMC_LIT6), MMC_STRINGDATA(tmp12_1)) != 0) goto tmp11_end;
                  /* Pattern matching succeeded */
                  tmp9 = 7;
                  goto tmp11_done;
                }
                case 7: {
                  
                  /* Pattern matching succeeded */
                  tmp9 = 8;
                  goto tmp11_done;
                }
                }
                goto tmp11_end;
                tmp11_end: ;
              }
              goto goto_10;
              goto_10:;
              goto goto_2;
              goto tmp11_done;
              tmp11_done:;
            }
          }tmp1 = tmp9;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,1,1) == 0) goto tmp3_end;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (6 != MMC_STRLEN(tmpMeta14) || strcmp(MMC_STRINGDATA(_OMC_LIT4), MMC_STRINGDATA(tmpMeta14)) != 0) goto tmp3_end;
          /* Pattern matching succeeded */
          tmp1 = 5;
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          tmp1 = 8;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _call = tmp1;
  _return: OMC_LABEL_UNUSED
  return _call;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_identifyConnectionsOperator(threadData_t *threadData, modelica_metatype _functionName)
{
  modelica_integer _call;
  modelica_metatype out_call;
  _call = omc_NFOCConnectionGraph_identifyConnectionsOperator(threadData, _functionName);
  out_call = mmc_mk_icon(_call);
  return out_call;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_removeBrokenConnects(threadData_t *threadData, modelica_metatype _inEquations, modelica_metatype _inConnected, modelica_metatype _inBroken, modelica_fnptr _isDeleted)
{
  modelica_metatype _outEquations = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outEquations has no default value.
  { /* match expression */
    modelica_metatype tmp5_1;
    tmp5_1 = _inBroken;
    {
      modelica_metatype _lhs = NULL;
      modelica_metatype _rhs = NULL;
      modelica_metatype _eql = NULL;
      modelica_metatype tmpMeta3;
      modelica_boolean _isThere;
      modelica_string _str = NULL;
      modelica_metatype _source = NULL;
      volatile mmc_switch_type tmp5;
      int tmp6;
      // _lhs has no default value.
      // _rhs has no default value.
      tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
      _eql = tmpMeta3;
      _isThere = 0 /* false */;
      // _str has no default value.
      // _source has no default value.
      tmp5 = 0;
      for (; tmp5 < 2; tmp5++) {
        switch (MMC_SWITCH_CAST(tmp5)) {
        case 0: {
          if (!listEmpty(tmp5_1)) goto tmp4_end;
          /* Pattern matching succeeded */
          tmpMeta1 = _inEquations;
          goto tmp4_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          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;
          
          /* Pattern matching succeeded */
          {
            modelica_metatype _eq;
            for (tmpMeta7 = _inEquations; !listEmpty(tmpMeta7); tmpMeta7=MMC_CDR(tmpMeta7))
            {
              _eq = MMC_CAR(tmpMeta7);
              { /* match expression */
                modelica_metatype tmp11_1;
                tmp11_1 = _eq;
                {
                  volatile mmc_switch_type tmp11;
                  int tmp12;
                  tmp11 = 0;
                  for (; tmp11 < 2; tmp11++) {
                    switch (MMC_SWITCH_CAST(tmp11)) {
                    case 0: {
                      modelica_metatype tmpMeta13;
                      modelica_metatype tmpMeta14;
                      modelica_metatype tmpMeta15;
                      modelica_metatype tmpMeta16;
                      modelica_metatype tmpMeta17;
                      modelica_metatype tmpMeta18;
                      modelica_metatype tmpMeta19;
                      modelica_metatype tmpMeta20;
                      if (mmc__uniontype__metarecord__typedef__equal(tmp11_1,1,4) == 0) goto tmp10_end;
                      tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp11_1), 2));
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta13,6,2) == 0) goto tmp10_end;
                      tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 3));
                      tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp11_1), 3));
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta15,6,2) == 0) goto tmp10_end;
                      tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta15), 3));
                      tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp11_1), 5));
                      _lhs = tmpMeta14;
                      _rhs = tmpMeta16;
                      _source = tmpMeta17;
                      /* Pattern matching succeeded */
                      if((!(mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 2))), _lhs) : ((modelica_metatype(*)(threadData_t*, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 1)))) (threadData, _lhs)) || mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 2))), _rhs) : ((modelica_metatype(*)(threadData_t*, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 1)))) (threadData, _rhs)))))
                      {
                        _isThere = 0 /* false */;

                        {
                          modelica_metatype _b;
                          for (tmpMeta18 = _inBroken; !listEmpty(tmpMeta18); tmpMeta18=MMC_CDR(tmpMeta18))
                          {
                            _b = MMC_CAR(tmpMeta18);
                            if(((omc_NFComponentRef_isEqual(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_b), 2))), _lhs) && omc_NFComponentRef_isEqual(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_b), 3))), _rhs)) || (omc_NFComponentRef_isEqual(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_b), 3))), _lhs) && omc_NFComponentRef_isEqual(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_b), 2))), _rhs))))
                            {
                              _isThere = 1 /* true */;

                              break;
                            }
                          }
                        }
                      }

                      if((!_isThere))
                      {
                        tmpMeta20 = mmc_mk_cons(_eq, _eql);
                        _eql = tmpMeta20;
                      }
                      tmpMeta8 = _eql;
                      goto tmp10_done;
                    }
                    case 1: {
                      modelica_metatype tmpMeta21;
                      
                      /* Pattern matching succeeded */
                      tmpMeta21 = mmc_mk_cons(_eq, _eql);
                      tmpMeta8 = tmpMeta21;
                      goto tmp10_done;
                    }
                    }
                    goto tmp10_end;
                    tmp10_end: ;
                  }
                  goto goto_9;
                  goto_9:;
                  goto goto_2;
                  goto tmp10_done;
                  tmp10_done:;
                }
              }
              _eql = tmpMeta8;
            }
          }

          _eql = listReverseInPlace(_eql);

          if(omc_Flags_isSet(threadData, _OMC_LIT16))
          {
            _str = _OMC_LIT8;

            {
              modelica_metatype _b;
              for (tmpMeta23 = _inBroken; !listEmpty(tmpMeta23); tmpMeta23=MMC_CDR(tmpMeta23))
              {
                _b = MMC_CAR(tmpMeta23);
                tmpMeta24 = stringAppend(_str,_OMC_LIT9);
                tmpMeta25 = stringAppend(tmpMeta24,omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_b), 2)))));
                tmpMeta26 = stringAppend(tmpMeta25,_OMC_LIT10);
                tmpMeta27 = stringAppend(tmpMeta26,omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_b), 3)))));
                tmpMeta28 = stringAppend(tmpMeta27,_OMC_LIT11);
                _str = tmpMeta28;
              }
            }

            tmpMeta30 = stringAppend(_OMC_LIT12,_str);
            tmpMeta31 = stringAppend(tmpMeta30,_OMC_LIT13);
            fputs(MMC_STRINGDATA(tmpMeta31),stdout);
          }
          tmpMeta1 = _eql;
          goto tmp4_done;
        }
        }
        goto tmp4_end;
        tmp4_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp4_done;
      tmp4_done:;
    }
  }
  _outEquations = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outEquations;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_showGraphViz(threadData_t *threadData, modelica_string _fileNameGraphViz, modelica_string _modelNameQualified)
{
  modelica_string _brokenConnectsViaGraphViz = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _brokenConnectsViaGraphViz has no default value.
  { /* matchcontinue expression */
    {
      modelica_string _leftyCMD = NULL;
      modelica_string _fileNameTraceRemovedConnections = NULL;
      modelica_string _omhome = NULL;
      modelica_string _brokenConnects = NULL;
      modelica_integer _leftyExitStatus;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _leftyCMD has no default value.
      // _fileNameTraceRemovedConnections has no default value.
      // _omhome has no default value.
      // _brokenConnects has no default value.
      // _leftyExitStatus 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_Flags_isSet(threadData, _OMC_LIT19);
          if (0 /* false */ != tmp6) goto goto_2;
          tmp1 = _OMC_LIT8;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          /* Pattern matching succeeded */
          tmpMeta7 = stringAppend(_modelNameQualified,_OMC_LIT20);
          _fileNameTraceRemovedConnections = tmpMeta7;

          fputs(MMC_STRINGDATA(_OMC_LIT21),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT22),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT23),stdout);

          _omhome = omc_Settings_getInstallationDirectoryPath(threadData);

          _omhome = omc_System_stringReplace(threadData, _omhome, _OMC_LIT24, _OMC_LIT8);

          tmpMeta8 = stringAppend(_OMC_LIT25,_omhome);
          tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT26);
          tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT27);
          tmpMeta11 = stringAppend(tmpMeta10,_fileNameGraphViz);
          tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT28);
          _leftyCMD = tmpMeta12;

          tmpMeta13 = stringAppend(_OMC_LIT29,_leftyCMD);
          tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT30);
          tmpMeta15 = stringAppend(tmpMeta14,_fileNameTraceRemovedConnections);
          tmpMeta16 = stringAppend(tmpMeta15,_OMC_LIT13);
          fputs(MMC_STRINGDATA(tmpMeta16),stdout);

          tmpMeta17 = stringAppend(_OMC_LIT31,_leftyCMD);
          _leftyExitStatus = omc_System_systemCall(threadData, tmpMeta17, _fileNameTraceRemovedConnections);

          tmpMeta18 = stringAppend(_OMC_LIT32,intString(_leftyExitStatus));
          tmpMeta19 = stringAppend(tmpMeta18,_OMC_LIT13);
          fputs(MMC_STRINGDATA(tmpMeta19),stdout);

          _brokenConnects = omc_System_readFile(threadData, _fileNameTraceRemovedConnections);

          tmpMeta20 = stringAppend(_OMC_LIT33,_brokenConnects);
          tmpMeta21 = stringAppend(tmpMeta20,_OMC_LIT13);
          fputs(MMC_STRINGDATA(tmpMeta21),stdout);
          tmp1 = _brokenConnects;
          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:;
    }
  }
  _brokenConnectsViaGraphViz = tmp1;
  _return: OMC_LABEL_UNUSED
  return _brokenConnectsViaGraphViz;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_generateGraphViz(threadData_t *threadData, modelica_string _modelNameQualified, modelica_metatype _definiteRoots, modelica_metatype _potentialRoots, modelica_metatype _uniqueRoots, modelica_metatype _branches, modelica_metatype _connections, modelica_metatype _finalRoots, modelica_metatype _broken)
{
  modelica_string _brokenConnectsViaGraphViz = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _brokenConnectsViaGraphViz has no default value.
  { /* matchcontinue expression */
    {
      modelica_string _fileName = NULL;
      modelica_string _i = NULL;
      modelica_string _nrDR = NULL;
      modelica_string _nrPR = NULL;
      modelica_string _nrUR = NULL;
      modelica_string _nrBR = NULL;
      modelica_string _nrCO = NULL;
      modelica_string _nrFR = NULL;
      modelica_string _nrBC = NULL;
      modelica_string _timeStr = NULL;
      modelica_string _infoNodeStr = NULL;
      modelica_real _tStart;
      modelica_real _tEnd;
      modelica_real _t;
      modelica_metatype _graphVizStream = NULL;
      modelica_metatype _infoNode = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _fileName has no default value.
      // _i has no default value.
      // _nrDR has no default value.
      // _nrPR has no default value.
      // _nrUR has no default value.
      // _nrBR has no default value.
      // _nrCO has no default value.
      // _nrFR has no default value.
      // _nrBC has no default value.
      // _timeStr has no default value.
      // _infoNodeStr has no default value.
      // _tStart has no default value.
      // _tEnd has no default value.
      // _t has no default value.
      // _graphVizStream has no default value.
      // _infoNode 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_Flags_isSet(threadData, _OMC_LIT36) || omc_Flags_isSet(threadData, _OMC_LIT19));
          if (0 /* false */ != tmp6) goto goto_2;
          tmp1 = _OMC_LIT8;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          /* Pattern matching succeeded */
          _tStart = mmc_clock();

          _i = _OMC_LIT37;

          tmpMeta7 = stringAppend(_modelNameQualified,_OMC_LIT38);
          _fileName = tmpMeta7;

          _graphVizStream = omc_IOStream_create(threadData, _fileName, _OMC_LIT39);

          _nrDR = intString(listLength(_definiteRoots));

          _nrPR = intString(listLength(_potentialRoots));

          _nrUR = intString(listLength(_uniqueRoots));

          _nrBR = intString(listLength(_branches));

          _nrCO = intString(listLength(_connections));

          _nrFR = intString(listLength(_finalRoots));

          _nrBC = intString(listLength(_broken));

          tmpMeta8 = mmc_mk_cons(_OMC_LIT40, mmc_mk_cons(_OMC_LIT41, mmc_mk_cons(_modelNameQualified, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_OMC_LIT42, mmc_mk_cons(_OMC_LIT43, mmc_mk_cons(_OMC_LIT44, mmc_mk_cons(_nrDR, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_OMC_LIT45, mmc_mk_cons(_nrPR, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_OMC_LIT46, mmc_mk_cons(_nrUR, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_OMC_LIT47, mmc_mk_cons(_nrBR, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_OMC_LIT48, mmc_mk_cons(_nrCO, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_OMC_LIT49, mmc_mk_cons(_nrFR, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_OMC_LIT50, mmc_mk_cons(_nrBC, mmc_mk_cons(_OMC_LIT13, MMC_REFSTRUCTLIT(mmc_nil))))))))))))))))))))))))))));
          _infoNode = tmpMeta8;

          _infoNodeStr = stringAppendList(_infoNode);

          _infoNodeStr = omc_System_stringReplace(threadData, _infoNodeStr, _OMC_LIT13, _OMC_LIT51);

          _infoNodeStr = omc_System_stringReplace(threadData, _infoNodeStr, _OMC_LIT37, _OMC_LIT52);

          _infoNodeStr = omc_System_stringReplace(threadData, _infoNodeStr, _OMC_LIT53, _OMC_LIT8);

          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, _infoNode);

          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, _OMC_LIT55);

          tmpMeta9 = mmc_mk_cons(_OMC_LIT56, mmc_mk_cons(_modelNameQualified, mmc_mk_cons(_OMC_LIT57, MMC_REFSTRUCTLIT(mmc_nil))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta9);

          tmpMeta10 = mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT58, MMC_REFSTRUCTLIT(mmc_nil)));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta10);

          tmpMeta11 = mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT59, MMC_REFSTRUCTLIT(mmc_nil)));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta11);

          tmpMeta12 = mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT60, mmc_mk_cons(_OMC_LIT61, mmc_mk_cons(_OMC_LIT62, mmc_mk_cons(_OMC_LIT63, mmc_mk_cons(_OMC_LIT64, mmc_mk_cons(_OMC_LIT65, MMC_REFSTRUCTLIT(mmc_nil))))))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta12);

          tmpMeta13 = mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT66, mmc_mk_cons(_OMC_LIT67, mmc_mk_cons(_OMC_LIT68, mmc_mk_cons(_OMC_LIT65, MMC_REFSTRUCTLIT(mmc_nil))))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta13);

          tmpMeta14 = mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT69, mmc_mk_cons(_infoNodeStr, mmc_mk_cons(_OMC_LIT70, mmc_mk_cons(_i, MMC_REFSTRUCTLIT(mmc_nil))))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta14);

          tmpMeta15 = mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT71, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, MMC_REFSTRUCTLIT(mmc_nil))))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta15);

          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, omc_List_map1(threadData, _definiteRoots, boxvar_NFOCConnectionGraph_graphVizDefiniteRoot, _finalRoots));

          tmpMeta16 = mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT72, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, MMC_REFSTRUCTLIT(mmc_nil))))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta16);

          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, omc_List_map1(threadData, _potentialRoots, boxvar_NFOCConnectionGraph_graphVizPotentialRoot, _finalRoots));

          tmpMeta17 = mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT73, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, MMC_REFSTRUCTLIT(mmc_nil))))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta17);

          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, omc_List_map(threadData, _branches, boxvar_NFOCConnectionGraph_graphVizEdge));

          tmpMeta18 = mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, mmc_mk_cons(_OMC_LIT74, mmc_mk_cons(_OMC_LIT13, mmc_mk_cons(_i, MMC_REFSTRUCTLIT(mmc_nil))))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta18);

          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, omc_List_map1(threadData, _connections, boxvar_NFOCConnectionGraph_graphVizFlatEdge, _broken));

          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, _OMC_LIT76);

          _tEnd = mmc_clock();

          _t = _tEnd - _tStart;

          _timeStr = realString(_t);

          tmpMeta19 = mmc_mk_cons(_OMC_LIT77, mmc_mk_cons(_timeStr, mmc_mk_cons(_OMC_LIT78, MMC_REFSTRUCTLIT(mmc_nil))));
          _graphVizStream = omc_IOStream_appendList(threadData, _graphVizStream, tmpMeta19);

          omc_System_writeFile(threadData, _fileName, omc_IOStream_string(threadData, _graphVizStream));

          tmpMeta20 = stringAppend(_OMC_LIT79,_modelNameQualified);
          tmpMeta21 = stringAppend(tmpMeta20,_OMC_LIT80);
          tmpMeta22 = stringAppend(tmpMeta21,_fileName);
          tmpMeta23 = stringAppend(tmpMeta22,_OMC_LIT13);
          fputs(MMC_STRINGDATA(tmpMeta23),stdout);
          tmp1 = omc_NFOCConnectionGraph_showGraphViz(threadData, _fileName, _modelNameQualified);
          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:;
    }
  }
  _brokenConnectsViaGraphViz = tmp1;
  _return: OMC_LABEL_UNUSED
  return _brokenConnectsViaGraphViz;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizPotentialRoot(threadData_t *threadData, modelica_metatype _inPotentialRoot, modelica_metatype _inFinalRoots)
{
  modelica_string _out = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inPotentialRoot;
    {
      modelica_metatype _c = NULL;
      modelica_real _priority;
      modelica_boolean _isSelectedRoot;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _c has no default value.
      // _priority has no default value.
      // _isSelectedRoot has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_real tmp8;
          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;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp8 = mmc_unbox_real(tmpMeta7);
          _c = tmpMeta6;
          _priority = tmp8  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          _isSelectedRoot = omc_List_isMemberOnTrue(threadData, _c, _inFinalRoots, boxvar_NFComponentRef_isEqual);
          tmpMeta9 = stringAppend(_OMC_LIT24,omc_NFComponentRef_toString(threadData, _c));
          tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT24);
          tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT81);
          tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT24);
          tmpMeta13 = stringAppend(tmpMeta12,omc_NFComponentRef_toString(threadData, _c));
          tmpMeta14 = stringAppend(tmpMeta13,_OMC_LIT82);
          tmpMeta15 = stringAppend(tmpMeta14,realString(_priority));
          tmpMeta16 = stringAppend(tmpMeta15,_OMC_LIT83);
          tmpMeta17 = stringAppend(tmpMeta16,(_isSelectedRoot?_OMC_LIT84:_OMC_LIT85));
          tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT86);
          tmp1 = tmpMeta18;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out = tmp1;
  _return: OMC_LABEL_UNUSED
  return _out;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizDefiniteRoot(threadData_t *threadData, modelica_metatype _inDefiniteRoot, modelica_metatype _inFinalRoots)
{
  modelica_string _out = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inDefiniteRoot;
    {
      modelica_metatype _c = NULL;
      modelica_boolean _isSelectedRoot;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _c has no default value.
      // _isSelectedRoot has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          
          _c = tmp4_1;
          /* Pattern matching succeeded */
          _isSelectedRoot = omc_List_isMemberOnTrue(threadData, _c, _inFinalRoots, boxvar_NFComponentRef_isEqual);
          tmpMeta6 = stringAppend(_OMC_LIT24,omc_NFComponentRef_toString(threadData, _c));
          tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT24);
          tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT87);
          tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT24);
          tmpMeta10 = stringAppend(tmpMeta9,omc_NFComponentRef_toString(threadData, _c));
          tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT83);
          tmpMeta12 = stringAppend(tmpMeta11,(_isSelectedRoot?_OMC_LIT88:_OMC_LIT85));
          tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT86);
          tmp1 = tmpMeta13;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out = tmp1;
  _return: OMC_LABEL_UNUSED
  return _out;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_FlatEdgeIsEqual(threadData_t *threadData, modelica_metatype _inEdge1, modelica_metatype _inEdge2)
{
  modelica_boolean _isEqual;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _isEqual has no default value.
  _isEqual = (omc_NFComponentRef_isEqual(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEdge1), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEdge2), 2)))) && omc_NFComponentRef_isEqual(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEdge1), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_inEdge2), 3)))));
  _return: OMC_LABEL_UNUSED
  return _isEqual;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_FlatEdgeIsEqual(threadData_t *threadData, modelica_metatype _inEdge1, modelica_metatype _inEdge2)
{
  modelica_boolean _isEqual;
  modelica_metatype out_isEqual;
  _isEqual = omc_NFOCConnectionGraph_FlatEdgeIsEqual(threadData, _inEdge1, _inEdge2);
  out_isEqual = mmc_mk_icon(_isEqual);
  return out_isEqual;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizFlatEdge(threadData_t *threadData, modelica_metatype _edge, modelica_metatype _inBrokenFlatEdges)
{
  modelica_string _out = NULL;
  modelica_string _sc1 = NULL;
  modelica_string _sc2 = NULL;
  modelica_string _label = NULL;
  modelica_string _labelFontSize = NULL;
  modelica_string _decorate = NULL;
  modelica_string _color = NULL;
  modelica_string _style = NULL;
  modelica_string _fontColor = NULL;
  modelica_boolean _isBroken;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out has no default value.
  // _sc1 has no default value.
  // _sc2 has no default value.
  // _label has no default value.
  // _labelFontSize has no default value.
  // _decorate has no default value.
  // _color has no default value.
  // _style has no default value.
  // _fontColor has no default value.
  // _isBroken has no default value.
  _isBroken = omc_List_isMemberOnTrue(threadData, _edge, _inBrokenFlatEdges, boxvar_NFOCConnectionGraph_FlatEdgeIsEqual);

  _label = (_isBroken?_OMC_LIT89:_OMC_LIT90);

  _color = (_isBroken?_OMC_LIT91:_OMC_LIT92);

  _style = (_isBroken?_OMC_LIT93:_OMC_LIT94);

  _decorate = (_isBroken?_OMC_LIT95:_OMC_LIT96);

  _fontColor = (_isBroken?_OMC_LIT91:_OMC_LIT92);

  _labelFontSize = (_isBroken?_OMC_LIT97:_OMC_LIT8);

  _sc1 = omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 2))));

  _sc2 = omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 3))));

  tmpMeta1 = mmc_mk_cons(_OMC_LIT24, mmc_mk_cons(_sc1, mmc_mk_cons(_OMC_LIT98, mmc_mk_cons(_sc2, mmc_mk_cons(_OMC_LIT99, mmc_mk_cons(_style, mmc_mk_cons(_OMC_LIT100, mmc_mk_cons(_decorate, mmc_mk_cons(_OMC_LIT101, mmc_mk_cons(_color, mmc_mk_cons(_OMC_LIT10, mmc_mk_cons(_labelFontSize, mmc_mk_cons(_OMC_LIT102, mmc_mk_cons(_fontColor, mmc_mk_cons(_OMC_LIT103, mmc_mk_cons(_label, mmc_mk_cons(_OMC_LIT104, MMC_REFSTRUCTLIT(mmc_nil))))))))))))))))));
  _out = stringAppendList(tmpMeta1);
  _return: OMC_LABEL_UNUSED
  return _out;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_graphVizEdge(threadData_t *threadData, modelica_metatype _inEdge)
{
  modelica_string _out = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inEdge;
    {
      modelica_metatype _c1 = NULL;
      modelica_metatype _c2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _c1 has no default value.
      // _c2 has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          _c1 = tmpMeta6;
          _c2 = tmpMeta7;
          /* Pattern matching succeeded */
          tmpMeta8 = stringAppend(_OMC_LIT24,omc_NFComponentRef_toString(threadData, _c1));
          tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT98);
          tmpMeta10 = stringAppend(tmpMeta9,omc_NFComponentRef_toString(threadData, _c2));
          tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT24);
          tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT105);
          tmp1 = tmpMeta12;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out = tmp1;
  _return: OMC_LABEL_UNUSED
  return _out;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_merge(threadData_t *threadData, modelica_metatype _inGraph1, modelica_metatype _inGraph2)
{
  modelica_metatype _outGraph = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outGraph has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _inGraph1;
    tmp4_2 = _inGraph2;
    {
      modelica_boolean _updateGraph;
      modelica_boolean _updateGraph1;
      modelica_boolean _updateGraph2;
      modelica_metatype _definiteRoots = NULL;
      modelica_metatype _definiteRoots1 = NULL;
      modelica_metatype _definiteRoots2 = NULL;
      modelica_metatype _uniqueRoots = NULL;
      modelica_metatype _uniqueRoots1 = NULL;
      modelica_metatype _uniqueRoots2 = NULL;
      modelica_metatype _potentialRoots = NULL;
      modelica_metatype _potentialRoots1 = NULL;
      modelica_metatype _potentialRoots2 = NULL;
      modelica_metatype _branches = NULL;
      modelica_metatype _branches1 = NULL;
      modelica_metatype _branches2 = NULL;
      modelica_metatype _connections = NULL;
      modelica_metatype _connections1 = NULL;
      modelica_metatype _connections2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _updateGraph has no default value.
      // _updateGraph1 has no default value.
      // _updateGraph2 has no default value.
      // _definiteRoots has no default value.
      // _definiteRoots1 has no default value.
      // _definiteRoots2 has no default value.
      // _uniqueRoots has no default value.
      // _uniqueRoots1 has no default value.
      // _uniqueRoots2 has no default value.
      // _potentialRoots has no default value.
      // _potentialRoots1 has no default value.
      // _potentialRoots2 has no default value.
      // _branches has no default value.
      // _branches1 has no default value.
      // _branches2 has no default value.
      // _connections has no default value.
      // _connections1 has no default value.
      // _connections2 has no default value.
      tmp4 = 0;
      for (; tmp4 < 4; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          if (!listEmpty(tmpMeta6)) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          if (!listEmpty(tmpMeta7)) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
          if (!listEmpty(tmpMeta8)) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
          if (!listEmpty(tmpMeta9)) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (!listEmpty(tmpMeta10)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = _inGraph1;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (!listEmpty(tmpMeta11)) goto tmp3_end;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          if (!listEmpty(tmpMeta12)) goto tmp3_end;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          if (!listEmpty(tmpMeta13)) goto tmp3_end;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          if (!listEmpty(tmpMeta14)) goto tmp3_end;
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          if (!listEmpty(tmpMeta15)) goto tmp3_end;
          
          /* Pattern matching succeeded */
          tmpMeta1 = _inGraph2;
          goto tmp3_done;
        }
        case 2: {
          
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!valueEq(_inGraph1, _inGraph2)) goto tmp3_end;
          tmpMeta1 = _inGraph1;
          goto tmp3_done;
        }
        case 3: {
          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_integer tmp24;
          modelica_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta27;
          modelica_metatype tmpMeta28;
          modelica_metatype tmpMeta29;
          modelica_metatype tmpMeta30;
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp17 = mmc_unbox_integer(tmpMeta16);
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta19 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmpMeta21 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          tmpMeta22 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          tmpMeta23 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp24 = mmc_unbox_integer(tmpMeta23);
          tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta26 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
          tmpMeta28 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
          tmpMeta29 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          _updateGraph1 = tmp17  /* pattern as ty=Boolean */;
          _definiteRoots1 = tmpMeta18;
          _potentialRoots1 = tmpMeta19;
          _uniqueRoots1 = tmpMeta20;
          _branches1 = tmpMeta21;
          _connections1 = tmpMeta22;
          _updateGraph2 = tmp24  /* pattern as ty=Boolean */;
          _definiteRoots2 = tmpMeta25;
          _potentialRoots2 = tmpMeta26;
          _uniqueRoots2 = tmpMeta27;
          _branches2 = tmpMeta28;
          _connections2 = tmpMeta29;
          /* Pattern matching succeeded */
          if(omc_Flags_isSet(threadData, _OMC_LIT16))
          {
            omc_Debug_trace(threadData, _OMC_LIT106);
          }

          _updateGraph = (_updateGraph1 || _updateGraph2);

          _definiteRoots = omc_List_union(threadData, _definiteRoots1, _definiteRoots2);

          _potentialRoots = omc_List_union(threadData, _potentialRoots1, _potentialRoots2);

          _uniqueRoots = omc_List_union(threadData, _uniqueRoots1, _uniqueRoots2);

          _branches = omc_List_union(threadData, _branches1, _branches2);

          _connections = omc_List_union(threadData, _connections1, _connections2);
          tmpMeta30 = mmc_mk_box7(3, &NFOCConnectionGraph_NFOCConnectionGraph_GRAPH__desc, mmc_mk_boolean(_updateGraph), _definiteRoots, _potentialRoots, _uniqueRoots, _branches, _connections);
          tmpMeta1 = tmpMeta30;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outGraph = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outGraph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getConnections(threadData_t *threadData, modelica_metatype _inGraph)
{
  modelica_metatype _outResult = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outResult has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inGraph;
    {
      modelica_metatype _result = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _result has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          _result = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _result;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outResult = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outResult;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getBranches(threadData_t *threadData, modelica_metatype _inGraph)
{
  modelica_metatype _outResult = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outResult has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inGraph;
    {
      modelica_metatype _result = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _result has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          
          _result = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _result;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outResult = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outResult;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getPotentialRoots(threadData_t *threadData, modelica_metatype _inGraph)
{
  modelica_metatype _outResult = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outResult has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inGraph;
    {
      modelica_metatype _result = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _result has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          
          _result = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _result;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outResult = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outResult;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getUniqueRoots(threadData_t *threadData, modelica_metatype _inGraph)
{
  modelica_metatype _outResult = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outResult has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inGraph;
    {
      modelica_metatype _result = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _result has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          
          _result = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _result;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outResult = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outResult;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getDefiniteRoots(threadData_t *threadData, modelica_metatype _inGraph)
{
  modelica_metatype _outResult = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outResult has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inGraph;
    {
      modelica_metatype _result = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _result has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          
          _result = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta1 = _result;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outResult = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outResult;
}

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_printNFOCConnectionGraph(threadData_t *threadData, modelica_metatype _inGraph)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _inGraph;
    {
      modelica_metatype _connections = NULL;
      modelica_metatype _branches = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _connections has no default value.
      // _branches has no default value.
      tmp3 = 0;
      for (; tmp3 < 1; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 6));
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp3_1), 7));
          _branches = tmpMeta5;
          _connections = tmpMeta6;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT107),stdout);

          omc_NFOCConnectionGraph_printFlatEdges(threadData, _connections);

          fputs(MMC_STRINGDATA(_OMC_LIT108),stdout);

          omc_NFOCConnectionGraph_printEdges(threadData, _branches);
          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_NFOCConnectionGraph_printFlatEdges(threadData_t *threadData, modelica_metatype _inEdges)
{
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  {
    modelica_metatype _edge;
    for (tmpMeta1 = _inEdges; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _edge = MMC_CAR(tmpMeta1);
      fputs(MMC_STRINGDATA(_OMC_LIT109),stdout);

      fputs(MMC_STRINGDATA(omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 2))))),stdout);

      fputs(MMC_STRINGDATA(_OMC_LIT110),stdout);

      fputs(MMC_STRINGDATA(omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 3))))),stdout);

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

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_printEdges(threadData_t *threadData, modelica_metatype _inEdges)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;
    tmp3_1 = _inEdges;
    {
      modelica_metatype _c1 = NULL;
      modelica_metatype _c2 = NULL;
      modelica_metatype _tail = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _c1 has no default value.
      // _c2 has no default value.
      // _tail 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;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta5 = MMC_CAR(tmp3_1);
          tmpMeta6 = MMC_CDR(tmp3_1);
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
          _c1 = tmpMeta7;
          _c2 = tmpMeta8;
          _tail = tmpMeta6;
          /* Pattern matching succeeded */
          fputs(MMC_STRINGDATA(_OMC_LIT109),stdout);

          fputs(MMC_STRINGDATA(omc_NFComponentRef_toString(threadData, _c1)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT110),stdout);

          fputs(MMC_STRINGDATA(omc_NFComponentRef_toString(threadData, _c2)),stdout);

          fputs(MMC_STRINGDATA(_OMC_LIT13),stdout);

          /* Tail recursive call */
          _inEdges = _tail;
          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 modelica_string omc_NFOCConnectionGraph_printConnectionStr(threadData_t *threadData, modelica_metatype _edge, modelica_string _ty)
{
  modelica_string _outStr = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStr has no default value.
  tmpMeta1 = stringAppend(_ty,_OMC_LIT111);
  tmpMeta2 = stringAppend(tmpMeta1,omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 2)))));
  tmpMeta3 = stringAppend(tmpMeta2,_OMC_LIT10);
  tmpMeta4 = stringAppend(tmpMeta3,omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 3)))));
  tmpMeta5 = stringAppend(tmpMeta4,_OMC_LIT112);
  _outStr = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _outStr;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getEdge(threadData_t *threadData, modelica_metatype _cr, modelica_metatype _edges)
{
  modelica_metatype _ocr = NULL;
  modelica_metatype _cref1 = NULL;
  modelica_metatype _cref2 = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ocr has no default value.
  // _cref1 has no default value.
  // _cref2 has no default value.
  {
    modelica_metatype _edge;
    for (tmpMeta1 = _edges; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _edge = MMC_CAR(tmpMeta1);
      /* Pattern-matching assignment */
      tmpMeta2 = _edge;
      tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 1));
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
      _cref1 = tmpMeta3;
      _cref2 = tmpMeta4;

      if(omc_NFComponentRef_isEqual(threadData, _cr, _cref1))
      {
        _ocr = _cref2;

        goto _return;
      }
      else
      {
        if(omc_NFComponentRef_isEqual(threadData, _cr, _cref2))
        {
          _ocr = _cref1;

          goto _return;
        }
      }
    }
  }

  MMC_THROW_INTERNAL();
  _return: OMC_LABEL_UNUSED
  return _ocr;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_getRooted(threadData_t *threadData, modelica_metatype _cref1, modelica_metatype _cref2, modelica_metatype _rooted)
{
  modelica_boolean _result;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _result has no default value.
  { /* matchcontinue expression */
    {
      modelica_integer _i1;
      modelica_integer _i2;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _i1 has no default value.
      // _i2 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 */
          _i1 = mmc_unbox_integer(omc_UnorderedMap_getOrFail(threadData, _cref1, _rooted));

          _i2 = mmc_unbox_integer(omc_UnorderedMap_getOrFail(threadData, _cref2, _rooted));
          tmp1 = (_i1 < _i2);
          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:;
    }
  }
  _result = tmp1;
  _return: OMC_LABEL_UNUSED
  return _result;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_getRooted(threadData_t *threadData, modelica_metatype _cref1, modelica_metatype _cref2, modelica_metatype _rooted)
{
  modelica_boolean _result;
  modelica_metatype out_result;
  _result = omc_NFOCConnectionGraph_getRooted(threadData, _cref1, _cref2, _rooted);
  out_result = mmc_mk_icon(_result);
  return out_result;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evalConnectionsOperatorsHelper(threadData_t *threadData, modelica_metatype _exp, modelica_metatype _rooted, modelica_metatype _roots, modelica_metatype _graph, modelica_metatype _info)
{
  modelica_metatype _outExp = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outExp has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _exp;
    {
      modelica_metatype _uroots = NULL;
      modelica_metatype _nodes = NULL;
      modelica_metatype _message = NULL;
      modelica_metatype _cref = NULL;
      modelica_metatype _cref1 = NULL;
      modelica_boolean _result;
      modelica_metatype _branches = NULL;
      modelica_metatype _call = NULL;
      modelica_string _str = NULL;
      modelica_metatype _dim = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _uroots has no default value.
      // _nodes has no default value.
      // _message has no default value.
      // _cref has no default value.
      // _cref1 has no default value.
      // _result has no default value.
      // _branches has no default value.
      // _call has no default value.
      // _str has no default value.
      // _dim has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,13,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,2,6) == 0) goto tmp3_end;
          
          _call = tmpMeta6;
          /* Pattern matching succeeded */
          { /* match expression */
            modelica_integer tmp10_1;
            tmp10_1 = omc_NFOCConnectionGraph_identifyConnectionsOperator(threadData, omc_NFFunction_Function_name(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_call), 2)))));
            {
              int tmp10;
              {
                switch (MMC_SWITCH_CAST(tmp10_1)) {
                case 5: {
                  modelica_metatype tmpMeta11;
                  if (5 != tmp10_1) goto tmp9_end;
                  /* Pattern matching succeeded */
                  { /* match expression */
                    modelica_metatype tmp14_1;
                    tmp14_1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_call), 6)));
                    {
                      volatile mmc_switch_type tmp14;
                      int tmp15;
                      tmp14 = 0;
                      for (; tmp14 < 2; tmp14++) {
                        switch (MMC_SWITCH_CAST(tmp14)) {
                        case 0: {
                          modelica_metatype tmpMeta16;
                          modelica_metatype tmpMeta17;
                          
                          /* Pattern matching succeeded */
                          /* Check guard condition after assignments */
                          if (!omc_NFExpression_isEmptyArray(threadData, listHead((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_call), 6)))))) goto tmp13_end;
                          if(omc_Flags_isSet(threadData, _OMC_LIT16))
                          {
                            tmpMeta16 = stringAppend(_OMC_LIT113,omc_NFExpression_toString(threadData, _exp));
                            tmpMeta17 = stringAppend(tmpMeta16,_OMC_LIT114);
                            fputs(MMC_STRINGDATA(tmpMeta17),stdout);
                          }
                          tmpMeta11 = _OMC_LIT115;
                          goto tmp13_done;
                        }
                        case 1: {
                          modelica_metatype tmpMeta18;
                          modelica_metatype tmpMeta19;
                          modelica_metatype tmpMeta20;
                          modelica_metatype tmpMeta34;
                          if (listEmpty(tmp14_1)) goto tmp13_end;
                          tmpMeta18 = MMC_CAR(tmp14_1);
                          tmpMeta19 = MMC_CDR(tmp14_1);
                          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta18,6,2) == 0) goto tmp13_end;
                          tmpMeta20 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta18), 3));
                          if (!listEmpty(tmpMeta19)) goto tmp13_end;
                          _cref = tmpMeta20;
                          /* Pattern matching succeeded */
                          _branches = omc_NFOCConnectionGraph_getBranches(threadData, _graph);

                          _cref = omc_NFComponentRef_stripIteratorSubscripts(threadData, _cref);

                          { /* matchcontinue expression */
                            {
                              volatile mmc_switch_type tmp23;
                              int tmp24;
                              tmp23 = 0;
                              MMC_TRY_INTERNAL(mmc_jumper)
                              tmp22_top:
                              threadData->mmc_jumper = &new_mmc_jumper;
                              for (; tmp23 < 2; tmp23++) {
                                switch (MMC_SWITCH_CAST(tmp23)) {
                                case 0: {
                                  modelica_metatype tmpMeta25;
                                  modelica_metatype tmpMeta26;
                                  modelica_metatype tmpMeta27;
                                  modelica_metatype tmpMeta28;
                                  modelica_metatype tmpMeta29;
                                  modelica_metatype tmpMeta30;
                                  modelica_metatype tmpMeta31;
                                  modelica_metatype tmpMeta32;
                                  /* Pattern matching succeeded */
                                  _cref1 = omc_NFOCConnectionGraph_getEdge(threadData, _cref, _branches);

                                  if(omc_Flags_isSet(threadData, _OMC_LIT16))
                                  {
                                    tmpMeta25 = stringAppend(_OMC_LIT116,omc_NFComponentRef_toString(threadData, _cref));
                                    tmpMeta26 = stringAppend(tmpMeta25,_OMC_LIT10);
                                    tmpMeta27 = stringAppend(tmpMeta26,omc_NFComponentRef_toString(threadData, _cref1));
                                    tmpMeta28 = stringAppend(tmpMeta27,_OMC_LIT13);
                                    fputs(MMC_STRINGDATA(tmpMeta28),stdout);
                                  }

                                  _result = omc_NFOCConnectionGraph_getRooted(threadData, _cref, _cref1, _rooted);

                                  if(omc_Flags_isSet(threadData, _OMC_LIT16))
                                  {
                                    tmpMeta29 = stringAppend(_OMC_LIT113,omc_NFExpression_toString(threadData, _exp));
                                    tmpMeta30 = stringAppend(tmpMeta29,_OMC_LIT117);
                                    tmpMeta31 = stringAppend(tmpMeta30,(_result?_OMC_LIT95:_OMC_LIT96));
                                    tmpMeta32 = stringAppend(tmpMeta31,_OMC_LIT13);
                                    fputs(MMC_STRINGDATA(tmpMeta32),stdout);
                                  }
                                  goto tmp22_done;
                                }
                                case 1: {
                                  modelica_metatype tmpMeta33;
                                  /* Pattern matching succeeded */
                                  _str = omc_NFComponentRef_toString(threadData, _cref);

                                  tmpMeta33 = mmc_mk_cons(_str, mmc_mk_cons(_str, mmc_mk_cons(_str, MMC_REFSTRUCTLIT(mmc_nil))));
                                  omc_Error_addSourceMessage(threadData, _OMC_LIT121, tmpMeta33, _info);

                                  _result = 0 /* false */;
                                  goto tmp22_done;
                                }
                                }
                                goto tmp22_end;
                                tmp22_end: ;
                              }
                              goto goto_21;
                              tmp22_done:
                              (void)tmp23;
                              MMC_RESTORE_INTERNAL(mmc_jumper);
                              goto tmp22_done2;
                              goto_21:;
                              MMC_CATCH_INTERNAL(mmc_jumper);
                              if (++tmp23 < 2) {
                                goto tmp22_top;
                              }
                              goto goto_12;
                              tmp22_done2:;
                            }
                          }
                          ;
                          tmpMeta34 = mmc_mk_box2(6, &NFExpression_BOOLEAN__desc, mmc_mk_boolean(_result));
                          tmpMeta11 = tmpMeta34;
                          goto tmp13_done;
                        }
                        }
                        goto tmp13_end;
                        tmp13_end: ;
                      }
                      goto goto_12;
                      goto_12:;
                      goto goto_8;
                      goto tmp13_done;
                      tmp13_done:;
                    }
                  }tmpMeta7 = tmpMeta11;
                  goto tmp9_done;
                }
                case 4: {
                  modelica_metatype tmpMeta35;
                  if (4 != tmp10_1) goto tmp9_end;
                  /* Pattern matching succeeded */
                  { /* match expression */
                    modelica_metatype tmp38_1;
                    tmp38_1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_call), 6)));
                    {
                      volatile mmc_switch_type tmp38;
                      int tmp39;
                      tmp38 = 0;
                      for (; tmp38 < 2; tmp38++) {
                        switch (MMC_SWITCH_CAST(tmp38)) {
                        case 0: {
                          modelica_metatype tmpMeta40;
                          modelica_metatype tmpMeta41;
                          
                          /* Pattern matching succeeded */
                          /* Check guard condition after assignments */
                          if (!omc_NFExpression_isEmptyArray(threadData, listHead((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_call), 6)))))) goto tmp37_end;
                          if(omc_Flags_isSet(threadData, _OMC_LIT16))
                          {
                            tmpMeta40 = stringAppend(_OMC_LIT113,omc_NFExpression_toString(threadData, _exp));
                            tmpMeta41 = stringAppend(tmpMeta40,_OMC_LIT114);
                            fputs(MMC_STRINGDATA(tmpMeta41),stdout);
                          }
                          tmpMeta35 = _OMC_LIT115;
                          goto tmp37_done;
                        }
                        case 1: {
                          modelica_metatype tmpMeta42;
                          modelica_metatype tmpMeta43;
                          modelica_metatype tmpMeta44;
                          modelica_metatype tmpMeta45;
                          modelica_metatype tmpMeta46;
                          modelica_metatype tmpMeta47;
                          modelica_metatype tmpMeta48;
                          modelica_metatype tmpMeta49;
                          if (listEmpty(tmp38_1)) goto tmp37_end;
                          tmpMeta42 = MMC_CAR(tmp38_1);
                          tmpMeta43 = MMC_CDR(tmp38_1);
                          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta42,6,2) == 0) goto tmp37_end;
                          tmpMeta44 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta42), 3));
                          if (!listEmpty(tmpMeta43)) goto tmp37_end;
                          _cref = tmpMeta44;
                          /* Pattern matching succeeded */
                          _cref = omc_NFComponentRef_stripIteratorSubscripts(threadData, _cref);

                          _result = omc_List_isMemberOnTrue(threadData, _cref, _roots, boxvar_NFComponentRef_isEqual);

                          if(omc_Flags_isSet(threadData, _OMC_LIT16))
                          {
                            tmpMeta45 = stringAppend(_OMC_LIT113,omc_NFExpression_toString(threadData, _exp));
                            tmpMeta46 = stringAppend(tmpMeta45,_OMC_LIT117);
                            tmpMeta47 = stringAppend(tmpMeta46,(_result?_OMC_LIT95:_OMC_LIT96));
                            tmpMeta48 = stringAppend(tmpMeta47,_OMC_LIT13);
                            fputs(MMC_STRINGDATA(tmpMeta48),stdout);
                          }
                          tmpMeta49 = mmc_mk_box2(6, &NFExpression_BOOLEAN__desc, mmc_mk_boolean(_result));
                          tmpMeta35 = tmpMeta49;
                          goto tmp37_done;
                        }
                        }
                        goto tmp37_end;
                        tmp37_end: ;
                      }
                      goto goto_36;
                      goto_36:;
                      goto goto_8;
                      goto tmp37_done;
                      tmp37_done:;
                    }
                  }tmpMeta7 = tmpMeta35;
                  goto tmp9_done;
                }
                case 7: {
                  modelica_metatype tmpMeta50;
                  if (7 != tmp10_1) goto tmp9_end;
                  /* Pattern matching succeeded */
                  { /* match expression */
                    modelica_metatype tmp53_1;
                    tmp53_1 = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_call), 6)));
                    {
                      volatile mmc_switch_type tmp53;
                      int tmp54;
                      tmp53 = 0;
                      for (; tmp53 < 1; tmp53++) {
                        switch (MMC_SWITCH_CAST(tmp53)) {
                        case 0: {
                          modelica_metatype tmpMeta55;
                          modelica_metatype tmpMeta56;
                          modelica_metatype tmpMeta57;
                          modelica_metatype tmpMeta58;
                          modelica_metatype tmpMeta59;
                          modelica_metatype tmpMeta60;
                          modelica_metatype tmpMeta61;
                          modelica_metatype tmpMeta62;
                          modelica_metatype tmpMeta63;
                          modelica_metatype tmpMeta64;
                          modelica_metatype tmpMeta65;
                          modelica_metatype tmpMeta66;
                          modelica_metatype tmpMeta67;
                          if (listEmpty(tmp53_1)) goto tmp52_end;
                          tmpMeta55 = MMC_CAR(tmp53_1);
                          tmpMeta56 = MMC_CDR(tmp53_1);
                          if (listEmpty(tmpMeta56)) goto tmp52_end;
                          tmpMeta57 = MMC_CAR(tmpMeta56);
                          tmpMeta58 = MMC_CDR(tmpMeta56);
                          if (listEmpty(tmpMeta58)) goto tmp52_end;
                          tmpMeta59 = MMC_CAR(tmpMeta58);
                          tmpMeta60 = MMC_CDR(tmpMeta58);
                          if (!listEmpty(tmpMeta60)) goto tmp52_end;
                          _uroots = tmpMeta55;
                          _nodes = tmpMeta57;
                          _message = tmpMeta59;
                          /* Pattern matching succeeded */
                          if(omc_Flags_isSet(threadData, _OMC_LIT16))
                          {
                            tmpMeta61 = stringAppend(_OMC_LIT122,omc_NFExpression_toString(threadData, _uroots));
                            tmpMeta62 = stringAppend(tmpMeta61,_OMC_LIT123);
                            tmpMeta63 = stringAppend(tmpMeta62,omc_NFExpression_toString(threadData, _nodes));
                            tmpMeta64 = stringAppend(tmpMeta63,_OMC_LIT123);
                            tmpMeta65 = stringAppend(tmpMeta64,omc_NFExpression_toString(threadData, _message));
                            tmpMeta66 = stringAppend(tmpMeta65,_OMC_LIT11);
                            fputs(MMC_STRINGDATA(tmpMeta66),stdout);
                          }

                          _dim = omc_NFType_nthDimension(threadData, omc_NFExpression_typeOf(threadData, _uroots), ((modelica_integer) 1));

                          if((!omc_NFDimension_isKnown(threadData, _dim, 0 /* false */)))
                          {
                            tmpMeta67 = mmc_mk_cons(omc_NFExpression_toString(threadData, _exp), MMC_REFSTRUCTLIT(mmc_nil));
                            omc_Error_addSourceMessage(threadData, _OMC_LIT126, tmpMeta67, _info);

                            goto goto_51;
                          }
                          tmpMeta50 = omc_NFExpression_fillArray(threadData, omc_NFDimension_size(threadData, _dim, 0 /* false */), _OMC_LIT127);
                          goto tmp52_done;
                        }
                        }
                        goto tmp52_end;
                        tmp52_end: ;
                      }
                      goto goto_51;
                      goto_51:;
                      goto goto_8;
                      goto tmp52_done;
                      tmp52_done:;
                    }
                  }tmpMeta7 = tmpMeta50;
                  goto tmp9_done;
                }
                default:
                tmp9_default: OMC_LABEL_UNUSED; {
                  
                  /* Pattern matching succeeded */
                  tmpMeta7 = _exp;
                  goto tmp9_done;
                }
                }
                goto tmp9_end;
                tmp9_end: ;
              }
              goto goto_8;
              goto_8:;
              goto goto_2;
              goto tmp9_done;
              tmp9_done:;
            }
          }tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _exp;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outExp = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outExp;
}

static modelica_metatype closure0_NFOCConnectionGraph_evalConnectionsOperatorsHelper(threadData_t *thData, modelica_metatype closure, modelica_metatype exp)
{
  modelica_metatype rooted = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype roots = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype graph = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype info = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_NFOCConnectionGraph_evalConnectionsOperatorsHelper(thData, exp, rooted, roots, graph, info);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evaluateOperators(threadData_t *threadData, modelica_metatype __omcQ_24in_5Fexp, modelica_metatype _rooted, modelica_metatype _roots, modelica_metatype _graph, modelica_metatype _info)
{
  modelica_metatype _exp = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _exp = __omcQ_24in_5Fexp;
  tmpMeta1 = mmc_mk_box4(0, _rooted, _roots, _graph, _info);
  _exp = omc_NFExpression_map(threadData, _exp, (modelica_fnptr) mmc_mk_box2(0,closure0_NFOCConnectionGraph_evalConnectionsOperatorsHelper,tmpMeta1));
  _return: OMC_LABEL_UNUSED
  return _exp;
}

static modelica_metatype closure1_NFOCConnectionGraph_evaluateOperators(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_exp)
{
  modelica_metatype rooted = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype roots = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype graph = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype info = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_NFOCConnectionGraph_evaluateOperators(thData, $in_exp, rooted, roots, graph, info);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evalConnectionsOperatorsVar(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _rooted, modelica_metatype _graph, modelica_metatype __omcQ_24in_5Fvar)
{
  modelica_metatype _var = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _var = __omcQ_24in_5Fvar;
  tmpMeta2 = mmc_mk_box4(0, _rooted, _roots, _graph, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_var), 10))));
  tmpMeta1 = MMC_TAGPTR(mmc_alloc_words(12));
  memcpy(MMC_UNTAGPTR(tmpMeta1), MMC_UNTAGPTR(_var), 12*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta1))[4] = omc_NFBinding_mapExpShallow(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_var), 4))), (modelica_fnptr) mmc_mk_box2(0,closure1_NFOCConnectionGraph_evaluateOperators,tmpMeta2));
  _var = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _var;
}

static modelica_metatype closure2_NFOCConnectionGraph_evaluateOperators(threadData_t *thData, modelica_metatype closure, modelica_metatype $in_exp)
{
  modelica_metatype rooted = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  modelica_metatype roots = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),2));
  modelica_metatype graph = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),3));
  modelica_metatype info = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),4));
  return boxptr_NFOCConnectionGraph_evaluateOperators(thData, $in_exp, rooted, roots, graph, info);
}
PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_evalConnectionsOperatorsEqs(threadData_t *threadData, modelica_metatype _inRoots, modelica_metatype _rooted, modelica_metatype _graph, modelica_metatype __omcQ_24in_5Fequations)
{
  modelica_metatype _equations = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _equations = __omcQ_24in_5Fequations;
  {
    modelica_metatype __omcQ_24tmpVar1;
    modelica_metatype* tmp2;
    modelica_metatype tmpMeta3;
    modelica_metatype tmpMeta4;
    modelica_metatype __omcQ_24tmpVar0;
    modelica_integer tmp5;
    modelica_metatype _eq_loopVar = 0;
    modelica_metatype _eq;
    _eq_loopVar = _equations;
    tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar1 = tmpMeta3; /* defaultValue */
    tmp2 = &__omcQ_24tmpVar1;
    while(1) {
      tmp5 = 1;
      if (!listEmpty(_eq_loopVar)) {
        _eq = MMC_CAR(_eq_loopVar);
        _eq_loopVar = MMC_CDR(_eq_loopVar);
        tmp5--;
      }
      if (tmp5 == 0) {
        tmpMeta4 = mmc_mk_box4(0, _rooted, _inRoots, _graph, omc_NFEquation_info(threadData, _eq));
        __omcQ_24tmpVar0 = omc_NFEquation_mapExpShallow(threadData, _eq, (modelica_fnptr) mmc_mk_box2(0,closure2_NFOCConnectionGraph_evaluateOperators,tmpMeta4));
        *tmp2 = mmc_mk_cons(__omcQ_24tmpVar0,0);
        tmp2 = &MMC_CDR(*tmp2);
      } else if (tmp5 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp2 = mmc_mk_nil();
    tmpMeta1 = __omcQ_24tmpVar1;
  }
  _equations = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _equations;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_addConnectionRooted_updateRooted(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _newRoot)
{
  modelica_metatype _outRoots = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outRoots has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _roots;
    {
      volatile mmc_switch_type tmp4;
      int tmp5;
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (optionNone(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          _outRoots = tmpMeta6;
          /* Pattern matching succeeded */
          tmpMeta7 = mmc_mk_cons(_newRoot, _outRoots);
          tmpMeta1 = tmpMeta7;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta8;
          
          /* Pattern matching succeeded */
          tmpMeta8 = mmc_mk_cons(_newRoot, MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta1 = tmpMeta8;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outRoots = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outRoots;
}

static modelica_metatype closure3_NFOCConnectionGraph_addConnectionRooted_updateRooted(threadData_t *thData, modelica_metatype closure, modelica_metatype roots)
{
  modelica_metatype newRoot = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(closure),1));
  return boxptr_NFOCConnectionGraph_addConnectionRooted_updateRooted(thData, roots, newRoot);
}
PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addConnectionRooted(threadData_t *threadData, modelica_metatype _cref1, modelica_metatype _cref2, modelica_metatype _table)
{
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = mmc_mk_box1(0, _cref2);
  omc_UnorderedMap_addUpdate(threadData, _cref1, (modelica_fnptr) mmc_mk_box2(0,closure3_NFOCConnectionGraph_addConnectionRooted_updateRooted,tmpMeta1), _table);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addConnectionsRooted(threadData_t *threadData, modelica_metatype _connection, modelica_metatype _table)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  omc_NFOCConnectionGraph_addConnectionRooted(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_connection), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_connection), 3))), _table);

  omc_NFOCConnectionGraph_addConnectionRooted(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_connection), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_connection), 2))), _table);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addBranches(threadData_t *threadData, modelica_metatype _edge, modelica_metatype _table)
{
  modelica_metatype _cref1 = NULL;
  modelica_metatype _cref2 = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _cref1 has no default value.
  // _cref2 has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _edge;
  tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
  tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 2));
  _cref1 = tmpMeta2;
  _cref2 = tmpMeta3;

  omc_NFOCConnectionGraph_addConnectionRooted(threadData, _cref1, _cref2, _table);

  omc_NFOCConnectionGraph_addConnectionRooted(threadData, _cref2, _cref1, _table);
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_setRootDistance(threadData_t *threadData, modelica_metatype _finalRoots, modelica_metatype _table, modelica_integer _distance, modelica_metatype _nextLevel, modelica_metatype _rooted)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  { /* match expression */
    modelica_metatype tmp3_1;modelica_metatype tmp3_2;
    tmp3_1 = _finalRoots;
    tmp3_2 = _nextLevel;
    {
      modelica_metatype _rest = NULL;
      modelica_metatype _next = NULL;
      modelica_metatype _cr = NULL;
      volatile mmc_switch_type tmp3;
      int tmp4;
      // _rest has no default value.
      // _next has no default value.
      // _cr has no default value.
      tmp3 = 0;
      for (; tmp3 < 4; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          if (!listEmpty(tmp3_2)) goto tmp2_end;
          /* Pattern matching succeeded */
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta5;
          if (!listEmpty(tmp3_1)) goto tmp2_end;
          
          /* Pattern matching succeeded */
          tmpMeta5 = MMC_REFSTRUCTLIT(mmc_nil);
          /* Tail recursive call */
          _finalRoots = _nextLevel;
          _distance = ((modelica_integer) 1) + _distance;
          _nextLevel = tmpMeta5;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        case 2: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta6 = MMC_CAR(tmp3_1);
          tmpMeta7 = MMC_CDR(tmp3_1);
          
          _cr = tmpMeta6;
          _rest = tmpMeta7;
          /* Pattern matching succeeded */
          /* Check guard condition after assignments */
          if (!(!omc_UnorderedMap_contains(threadData, _cr, _rooted))) goto tmp2_end;
          omc_UnorderedMap_addNew(threadData, _cr, mmc_mk_integer(_distance), _rooted);

          { /* match expression */
            modelica_metatype tmp11_1;
            tmp11_1 = omc_UnorderedMap_get(threadData, _cr, _table);
            {
              volatile mmc_switch_type tmp11;
              int tmp12;
              tmp11 = 0;
              for (; tmp11 < 2; tmp11++) {
                switch (MMC_SWITCH_CAST(tmp11)) {
                case 0: {
                  modelica_metatype tmpMeta13;
                  if (optionNone(tmp11_1)) goto tmp10_end;
                  tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp11_1), 1));
                  _next = tmpMeta13;
                  /* Pattern matching succeeded */
                  tmpMeta8 = listAppend(_nextLevel, _next);
                  goto tmp10_done;
                }
                case 1: {
                  
                  /* Pattern matching succeeded */
                  tmpMeta8 = _nextLevel;
                  goto tmp10_done;
                }
                }
                goto tmp10_end;
                tmp10_end: ;
              }
              goto goto_9;
              goto_9:;
              goto goto_1;
              goto tmp10_done;
              tmp10_done:;
            }
          }
          _next = tmpMeta8;

          /* Tail recursive call */
          _finalRoots = _rest;
          _nextLevel = _next;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          ;
          goto tmp2_done;
        }
        case 3: {
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          if (listEmpty(tmp3_1)) goto tmp2_end;
          tmpMeta14 = MMC_CAR(tmp3_1);
          tmpMeta15 = MMC_CDR(tmp3_1);
          
          _rest = tmpMeta15;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _finalRoots = _rest;
          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_NFOCConnectionGraph_setRootDistance(threadData_t *threadData, modelica_metatype _finalRoots, modelica_metatype _table, modelica_metatype _distance, modelica_metatype _nextLevel, modelica_metatype _rooted)
{
  modelica_integer tmp1;
  tmp1 = mmc_unbox_integer(_distance);
  omc_NFOCConnectionGraph_setRootDistance(threadData, _finalRoots, _table, tmp1, _nextLevel, _rooted);
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_buildRootedTable(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _graph)
{
  modelica_metatype _rooted = NULL;
  modelica_metatype _table = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _rooted has no default value.
  // _table has no default value.
  _table = omc_UnorderedMap_new(threadData, boxvar_NFComponentRef_hash, boxvar_NFComponentRef_isEqual, ((modelica_integer) 1));

  omc_List_map1__0(threadData, omc_NFOCConnectionGraph_getBranches(threadData, _graph), boxvar_NFOCConnectionGraph_addBranches, _table);

  omc_List_map1__0(threadData, omc_NFOCConnectionGraph_getConnections(threadData, _graph), boxvar_NFOCConnectionGraph_addConnectionsRooted, _table);

  _rooted = omc_UnorderedMap_new(threadData, boxvar_NFComponentRef_hash, boxvar_NFComponentRef_isEqual, ((modelica_integer) 1));

  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  omc_NFOCConnectionGraph_setRootDistance(threadData, _roots, _table, ((modelica_integer) 0), tmpMeta1, _rooted);
  _return: OMC_LABEL_UNUSED
  return _rooted;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_printPotentialRootTuple(threadData_t *threadData, modelica_metatype _potentialRoot)
{
  modelica_string _outStr = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outStr has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _potentialRoot;
    {
      modelica_metatype _cr = NULL;
      modelica_real _priority;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _cr has no default value.
      // _priority has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_real tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp8 = mmc_unbox_real(tmpMeta7);
          _cr = tmpMeta6;
          _priority = tmp8  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          tmpMeta9 = stringAppend(omc_NFComponentRef_toString(threadData, _cr),_OMC_LIT111);
          tmpMeta10 = stringAppend(tmpMeta9,realString(_priority));
          tmpMeta11 = stringAppend(tmpMeta10,_OMC_LIT112);
          tmp1 = tmpMeta11;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outStr = tmp1;
  _return: OMC_LABEL_UNUSED
  return _outStr;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_makeTuple(threadData_t *threadData, modelica_metatype _inLstLst)
{
  modelica_metatype _outLst = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outLst has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _inLstLst;
    {
      modelica_string _c1 = NULL;
      modelica_string _c2 = NULL;
      modelica_metatype _rest = NULL;
      modelica_metatype _lst = NULL;
      modelica_metatype _bad = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _c1 has no default value.
      // _c2 has no default value.
      // _rest has no default value.
      // _lst has no default value.
      // _bad has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          tmp4 += 4; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta6 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta1 = tmpMeta6;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta7 = MMC_CAR(tmp4_1);
          tmpMeta8 = MMC_CDR(tmp4_1);
          if (listEmpty(tmpMeta7)) goto tmp3_end;
          tmpMeta9 = MMC_CAR(tmpMeta7);
          tmpMeta10 = MMC_CDR(tmpMeta7);
          if (listEmpty(tmpMeta10)) goto tmp3_end;
          tmpMeta11 = MMC_CAR(tmpMeta10);
          tmpMeta12 = MMC_CDR(tmpMeta10);
          if (!listEmpty(tmpMeta12)) goto tmp3_end;
          _c1 = tmpMeta9;
          _c2 = tmpMeta11;
          _rest = tmpMeta8;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          _lst = omc_NFOCConnectionGraph_makeTuple(threadData, _rest);
          tmpMeta14 = mmc_mk_box2(0, _c1, _c2);
          tmpMeta13 = mmc_mk_cons(tmpMeta14, _lst);
          tmpMeta1 = tmpMeta13;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta15 = MMC_CAR(tmp4_1);
          tmpMeta16 = MMC_CDR(tmp4_1);
          if (listEmpty(tmpMeta15)) goto tmp3_end;
          tmpMeta17 = MMC_CAR(tmpMeta15);
          tmpMeta18 = MMC_CDR(tmpMeta15);
          if (0 != MMC_STRLEN(tmpMeta17) || strcmp(MMC_STRINGDATA(_OMC_LIT8), MMC_STRINGDATA(tmpMeta17)) != 0) goto tmp3_end;
          if (!listEmpty(tmpMeta18)) goto tmp3_end;
          _rest = tmpMeta16;
          tmp4 += 1; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta1 = omc_NFOCConnectionGraph_makeTuple(threadData, _rest);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta19 = MMC_CAR(tmp4_1);
          tmpMeta20 = MMC_CDR(tmp4_1);
          if (!listEmpty(tmpMeta19)) goto tmp3_end;
          _rest = tmpMeta20;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFOCConnectionGraph_makeTuple(threadData, _rest);
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta21;
          modelica_metatype tmpMeta22;
          modelica_metatype tmpMeta23;
          modelica_metatype tmpMeta24;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta21 = MMC_CAR(tmp4_1);
          tmpMeta22 = MMC_CDR(tmp4_1);
          _bad = tmpMeta21;
          _rest = tmpMeta22;
          /* Pattern matching succeeded */
          tmpMeta23 = stringAppend(_OMC_LIT128,stringDelimitList(_bad, _OMC_LIT10));
          tmpMeta24 = stringAppend(tmpMeta23,_OMC_LIT129);
          fputs(MMC_STRINGDATA(tmpMeta24),stdout);
          tmpMeta1 = omc_NFOCConnectionGraph_makeTuple(threadData, _rest);
          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:;
    }
  }
  _outLst = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outLst;
}

PROTECTED_FUNCTION_STATIC modelica_string omc_NFOCConnectionGraph_printTupleStr(threadData_t *threadData, modelica_metatype _inTpl)
{
  modelica_string _out = NULL;
  modelica_string tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inTpl;
    {
      modelica_string _c1 = NULL;
      modelica_string _c2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _c1 has no default value.
      // _c2 has no default value.
      tmp4 = 0;
      for (; tmp4 < 1; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          _c1 = tmpMeta6;
          _c2 = tmpMeta7;
          /* Pattern matching succeeded */
          tmpMeta8 = stringAppend(_c1,_OMC_LIT110);
          tmpMeta9 = stringAppend(tmpMeta8,_c2);
          tmp1 = tmpMeta9;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out = tmp1;
  _return: OMC_LABEL_UNUSED
  return _out;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_orderConnectsGuidedByUser(threadData_t *threadData, modelica_metatype _inConnections, modelica_metatype _inUserSelectedBreaking)
{
  modelica_metatype _outOrderedConnections = NULL;
  modelica_metatype _front = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _back = NULL;
  modelica_metatype tmpMeta2;
  modelica_string _sc1 = NULL;
  modelica_string _sc2 = NULL;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outOrderedConnections has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _front = tmpMeta1;
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _back = tmpMeta2;
  // _sc1 has no default value.
  // _sc2 has no default value.
  {
    modelica_metatype _e;
    for (tmpMeta3 = _inConnections; !listEmpty(tmpMeta3); tmpMeta3=MMC_CDR(tmpMeta3))
    {
      _e = MMC_CAR(tmpMeta3);
      _sc1 = omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e), 2))));

      _sc2 = omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_e), 3))));

      tmpMeta4 = mmc_mk_box2(0, _sc1, _sc2);
      tmpMeta5 = mmc_mk_box2(0, _sc2, _sc1);
      if((listMember(tmpMeta4, _inUserSelectedBreaking) || listMember(tmpMeta5, _inUserSelectedBreaking)))
      {
        tmpMeta6 = mmc_mk_cons(_e, _back);
        _back = tmpMeta6;
      }
      else
      {
        tmpMeta7 = mmc_mk_cons(_e, _front);
        _front = tmpMeta7;
      }
    }
  }

  _outOrderedConnections = omc_List_append__reverse(threadData, _front, _back);
  _return: OMC_LABEL_UNUSED
  return _outOrderedConnections;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_findResultGraph(threadData_t *threadData, modelica_metatype _inGraph, modelica_string _modelNameQualified, modelica_metatype *out_outConnectedConnections, modelica_metatype *out_outBrokenConnections)
{
  modelica_metatype _outRoots = NULL;
  modelica_metatype _outConnectedConnections = NULL;
  modelica_metatype _outBrokenConnections = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outRoots has no default value.
  // _outConnectedConnections has no default value.
  // _outBrokenConnections has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _inGraph;
    {
      modelica_metatype _definiteRoots = NULL;
      modelica_metatype _finalRoots = NULL;
      modelica_metatype _potentialRoots = NULL;
      modelica_metatype _orderedPotentialRoots = NULL;
      modelica_metatype _uniqueRoots = NULL;
      modelica_metatype _branches = NULL;
      modelica_metatype _connections = NULL;
      modelica_metatype _broken = NULL;
      modelica_metatype _connected = NULL;
      modelica_metatype _table = NULL;
      modelica_metatype _dummyRoot = NULL;
      modelica_string _brokenConnectsViaGraphViz = NULL;
      modelica_metatype _userBrokenLst = NULL;
      modelica_metatype _userBrokenLstLst = NULL;
      modelica_metatype _userBrokenTplLst = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _definiteRoots has no default value.
      // _finalRoots has no default value.
      // _potentialRoots has no default value.
      // _orderedPotentialRoots has no default value.
      // _uniqueRoots has no default value.
      // _branches has no default value.
      // _connections has no default value.
      // _broken has no default value.
      // _connected has no default value.
      // _table has no default value.
      // _dummyRoot has no default value.
      // _brokenConnectsViaGraphViz has no default value.
      // _userBrokenLst has no default value.
      // _userBrokenLstLst has no default value.
      // _userBrokenTplLst has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          if (!listEmpty(tmpMeta6)) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          if (!listEmpty(tmpMeta7)) goto tmp3_end;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          if (!listEmpty(tmpMeta8)) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          if (!listEmpty(tmpMeta9)) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          if (!listEmpty(tmpMeta10)) goto tmp3_end;
          /* Pattern matching succeeded */
          tmpMeta11 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta12 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta13 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta[0+0] = tmpMeta11;
          tmpMeta[0+1] = tmpMeta12;
          tmpMeta[0+2] = tmpMeta13;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          modelica_metatype tmpMeta16;
          modelica_metatype tmpMeta17;
          modelica_metatype tmpMeta18;
          modelica_metatype tmpMeta19;
          modelica_metatype tmpMeta20;
          modelica_metatype tmpMeta21;
          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;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 3));
          tmpMeta15 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 4));
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmpMeta17 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 7));
          _definiteRoots = tmpMeta14;
          _potentialRoots = tmpMeta15;
          _uniqueRoots = tmpMeta16;
          _branches = tmpMeta17;
          _connections = tmpMeta18;
          /* Pattern matching succeeded */
          _connections = listReverse(_connections);

          _table = omc_NFOCConnectionGraph_resultGraphWithRoots(threadData, _definiteRoots);

          omc_NFOCConnectionGraph_addBranchesToTable(threadData, _table, _branches);

          _orderedPotentialRoots = omc_List_sort(threadData, _potentialRoots, boxvar_NFOCConnectionGraph_ord);

          if(omc_Flags_isSet(threadData, _OMC_LIT16))
          {
            tmpMeta19 = stringAppend(_OMC_LIT130,stringDelimitList(omc_List_map(threadData, _orderedPotentialRoots, boxvar_NFOCConnectionGraph_printPotentialRootTuple), _OMC_LIT10));
            tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT13);
            fputs(MMC_STRINGDATA(tmpMeta20),stdout);
          }

          _connected = omc_NFOCConnectionGraph_addConnections(threadData, _table, _connections ,&_broken);

          tmpMeta21 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta22 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta23 = mmc_mk_box6(6, &NFClassTree_ClassTree_FLAT__TREE__desc, _OMC_LIT181, listArray(tmpMeta21), _OMC_LIT243, listArray(tmpMeta22), _OMC_LIT244);
          tmpMeta24 = mmc_mk_box6(5, &NFClass_PARTIAL__BUILTIN__desc, _OMC_LIT147, tmpMeta23, _OMC_LIT183, _OMC_LIT245, _OMC_LIT246);
          tmpMeta25 = mmc_mk_box8(3, &NFInstNode_InstNode_CLASS__NODE__desc, _OMC_LIT132, _OMC_LIT146, mmc_mk_integer(1), mmc_mk_some(tmpMeta24), _OMC_LIT249, _OMC_LIT186, _OMC_LIT250);
          tmpMeta26 = mmc_mk_box9(4, &NFComponent_COMPONENT__desc, tmpMeta25, _OMC_LIT147, _OMC_LIT251, _OMC_LIT251, _OMC_LIT253, _OMC_LIT143, mmc_mk_integer(4), _OMC_LIT145);
          tmpMeta27 = mmc_mk_box7(4, &NFInstNode_InstNode_COMPONENT__NODE__desc, _OMC_LIT131, mmc_mk_none(), mmc_mk_integer(1), mmc_mk_some(tmpMeta26), _OMC_LIT186, _OMC_LIT187);
          tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
          tmpMeta29 = mmc_mk_box6(3, &NFComponentRef_CREF__desc, tmpMeta27, tmpMeta28, _OMC_LIT147, mmc_mk_integer(1), _OMC_LIT254);
          _dummyRoot = tmpMeta29;

          _finalRoots = omc_NFOCConnectionGraph_addPotentialRootsToTable(threadData, _table, _orderedPotentialRoots, _definiteRoots, _dummyRoot);

          _brokenConnectsViaGraphViz = omc_NFOCConnectionGraph_generateGraphViz(threadData, _modelNameQualified, _definiteRoots, _potentialRoots, _uniqueRoots, _branches, _connections, _finalRoots, _broken);

          if((stringEqual(_brokenConnectsViaGraphViz, _OMC_LIT8)))
          {
          }
          else
          {
            _userBrokenLst = omc_Util_stringSplitAtChar(threadData, _brokenConnectsViaGraphViz, _OMC_LIT255);

            _userBrokenLstLst = omc_List_map1(threadData, _userBrokenLst, boxvar_Util_stringSplitAtChar, _OMC_LIT256);

            _userBrokenTplLst = omc_NFOCConnectionGraph_makeTuple(threadData, _userBrokenLstLst);

            tmpMeta30 = stringAppend(_OMC_LIT257,stringDelimitList(omc_List_map(threadData, _userBrokenTplLst, boxvar_NFOCConnectionGraph_printTupleStr), _OMC_LIT258));
            tmpMeta31 = stringAppend(tmpMeta30,_OMC_LIT13);
            fputs(MMC_STRINGDATA(tmpMeta31),stdout);

            omc_NFOCConnectionGraph_printFlatEdges(threadData, _connections);

            _connections = omc_NFOCConnectionGraph_orderConnectsGuidedByUser(threadData, _connections, _userBrokenTplLst);

            _connections = listReverse(_connections);

            fputs(MMC_STRINGDATA(_OMC_LIT259),stdout);

            tmpMeta32 = mmc_mk_box7(3, &NFOCConnectionGraph_NFOCConnectionGraph_GRAPH__desc, mmc_mk_boolean(0 /* false */), _definiteRoots, _potentialRoots, _uniqueRoots, _branches, _connections);
            _finalRoots = omc_NFOCConnectionGraph_findResultGraph(threadData, tmpMeta32, _modelNameQualified ,&_connected ,&_broken);
          }
          tmpMeta[0+0] = _finalRoots;
          tmpMeta[0+1] = _connected;
          tmpMeta[0+2] = _broken;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outRoots = tmpMeta[0+0];
  _outConnectedConnections = tmpMeta[0+1];
  _outBrokenConnections = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_outConnectedConnections) { *out_outConnectedConnections = _outConnectedConnections; }
  if (out_outBrokenConnections) { *out_outBrokenConnections = _outBrokenConnections; }
  return _outRoots;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addConnections(threadData_t *threadData, modelica_metatype _table, modelica_metatype _inConnections, modelica_metatype *out_outBrokenConnections)
{
  modelica_metatype _outConnectedConnections = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _outBrokenConnections = NULL;
  modelica_metatype tmpMeta2;
  modelica_metatype _connected = NULL;
  modelica_metatype _broken = NULL;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _outConnectedConnections = tmpMeta1;
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  _outBrokenConnections = tmpMeta2;
  // _connected has no default value.
  // _broken has no default value.
  {
    modelica_metatype _c;
    for (tmpMeta3 = _inConnections; !listEmpty(tmpMeta3); tmpMeta3=MMC_CDR(tmpMeta3))
    {
      _c = MMC_CAR(tmpMeta3);
      _connected = omc_NFOCConnectionGraph_connectComponents(threadData, _table, _c ,&_broken);

      _outConnectedConnections = listAppend(_connected, _outConnectedConnections);

      _outBrokenConnections = listAppend(_broken, _outBrokenConnections);
    }
  }
  _return: OMC_LABEL_UNUSED
  if (out_outBrokenConnections) { *out_outBrokenConnections = _outBrokenConnections; }
  return _outConnectedConnections;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addPotentialRootsToTable(threadData_t *threadData, modelica_metatype _table, modelica_metatype _potentialRoots, modelica_metatype _roots, modelica_metatype _firstRoot)
{
  modelica_metatype _outRoots = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outRoots has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;
    tmp4_1 = _potentialRoots;
    {
      modelica_metatype _potentialRoot = NULL;
      modelica_metatype _canon1 = NULL;
      modelica_metatype _canon2 = NULL;
      modelica_metatype _tail = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _potentialRoot has no default value.
      // _canon1 has no default value.
      // _canon2 has no default value.
      // _tail has no default value.
      tmp4 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp3_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (!listEmpty(tmp4_1)) goto tmp3_end;
          tmp4 += 2; /* Pattern matching succeeded; we may skip some cases if we fail */
          tmpMeta1 = _roots;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_boolean tmp9;
          modelica_metatype tmpMeta10;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta6 = MMC_CAR(tmp4_1);
          tmpMeta7 = MMC_CDR(tmp4_1);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 1));
          
          _potentialRoot = tmpMeta8;
          _tail = tmpMeta7;
          /* Pattern matching succeeded */
          _canon1 = omc_NFOCConnectionGraph_canonical(threadData, _table, _potentialRoot);

          _canon2 = omc_NFOCConnectionGraph_canonical(threadData, _table, _firstRoot);

          /* Pattern-matching assignment */
          tmp9 = omc_NFOCConnectionGraph_connectCanonicalComponents(threadData, _table, _canon1, _canon2);
          if (1 /* true */ != tmp9) goto goto_2;
          tmpMeta10 = mmc_mk_cons(_potentialRoot, _roots);
          tmpMeta1 = omc_NFOCConnectionGraph_addPotentialRootsToTable(threadData, _table, _tail, tmpMeta10, _firstRoot);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          if (listEmpty(tmp4_1)) goto tmp3_end;
          tmpMeta11 = MMC_CAR(tmp4_1);
          tmpMeta12 = MMC_CDR(tmp4_1);
          _tail = tmpMeta12;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_NFOCConnectionGraph_addPotentialRootsToTable(threadData, _table, _tail, _roots, _firstRoot);
          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:;
    }
  }
  _outRoots = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outRoots;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_ord(threadData_t *threadData, modelica_metatype _inEl1, modelica_metatype _inEl2)
{
  modelica_boolean _outBoolean;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outBoolean has no default value.
  { /* matchcontinue expression */
    volatile modelica_metatype tmp4_1;volatile modelica_metatype tmp4_2;
    tmp4_1 = _inEl1;
    tmp4_2 = _inEl2;
    {
      modelica_real _r1;
      modelica_real _r2;
      modelica_metatype _c1 = NULL;
      modelica_metatype _c2 = NULL;
      modelica_string _s1 = NULL;
      modelica_string _s2 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _r1 has no default value.
      // _r2 has no default value.
      // _c1 has no default value.
      // _c2 has no default value.
      // _s1 has no default value.
      // _s2 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_real tmp8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_real tmp11;
          modelica_boolean tmp12;
          modelica_integer tmp13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp8 = mmc_unbox_real(tmpMeta7);
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp11 = mmc_unbox_real(tmpMeta10);
          _c1 = tmpMeta6;
          _r1 = tmp8  /* pattern as ty=Real */;
          _c2 = tmpMeta9;
          _r2 = tmp11  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp12 = (_r1 == _r2);
          if (1 /* true */ != tmp12) goto goto_2;

          _s1 = omc_NFComponentRef_toString(threadData, _c1);

          _s2 = omc_NFComponentRef_toString(threadData, _c2);

          /* Pattern-matching assignment */
          tmp13 = stringCompare(_s1, _s2);
          if (1 != tmp13) goto goto_2;
          tmp1 = 1 /* true */;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          modelica_real tmp15;
          modelica_metatype tmpMeta16;
          modelica_real tmp17;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmp15 = mmc_unbox_real(tmpMeta14);
          tmpMeta16 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp17 = mmc_unbox_real(tmpMeta16);
          _r1 = tmp15  /* pattern as ty=Real */;
          _r2 = tmp17  /* pattern as ty=Real */;
          /* Pattern matching succeeded */
          tmp1 = (_r1 > _r2);
          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:;
    }
  }
  _outBoolean = tmp1;
  _return: OMC_LABEL_UNUSED
  return _outBoolean;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_ord(threadData_t *threadData, modelica_metatype _inEl1, modelica_metatype _inEl2)
{
  modelica_boolean _outBoolean;
  modelica_metatype out_outBoolean;
  _outBoolean = omc_NFOCConnectionGraph_ord(threadData, _inEl1, _inEl2);
  out_outBoolean = mmc_mk_icon(_outBoolean);
  return out_outBoolean;
}

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addBranchesToTable(threadData_t *threadData, modelica_metatype _table, modelica_metatype _branches)
{
  modelica_metatype _ref1 = NULL;
  modelica_metatype _ref2 = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _ref1 has no default value.
  // _ref2 has no default value.
  {
    modelica_metatype _branch;
    for (tmpMeta1 = _branches; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _branch = MMC_CAR(tmpMeta1);
      /* Pattern-matching assignment */
      tmpMeta2 = _branch;
      tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 1));
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
      _ref1 = tmpMeta3;
      _ref2 = tmpMeta4;

      omc_NFOCConnectionGraph_connectBranchComponents(threadData, _table, _ref1, _ref2);
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_resultGraphWithRoots(threadData_t *threadData, modelica_metatype _roots)
{
  modelica_metatype _outTable = NULL;
  modelica_metatype _dummyRoot = 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
  // _outTable has no default value.
  // _dummyRoot has no default value.
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta3 = mmc_mk_box6(6, &NFClassTree_ClassTree_FLAT__TREE__desc, _OMC_LIT181, listArray(tmpMeta1), _OMC_LIT243, listArray(tmpMeta2), _OMC_LIT244);
  tmpMeta4 = mmc_mk_box6(5, &NFClass_PARTIAL__BUILTIN__desc, _OMC_LIT147, tmpMeta3, _OMC_LIT183, _OMC_LIT245, _OMC_LIT246);
  tmpMeta5 = mmc_mk_box8(3, &NFInstNode_InstNode_CLASS__NODE__desc, _OMC_LIT132, _OMC_LIT146, mmc_mk_integer(1), mmc_mk_some(tmpMeta4), _OMC_LIT249, _OMC_LIT186, _OMC_LIT250);
  tmpMeta6 = mmc_mk_box9(4, &NFComponent_COMPONENT__desc, tmpMeta5, _OMC_LIT147, _OMC_LIT251, _OMC_LIT251, _OMC_LIT253, _OMC_LIT143, mmc_mk_integer(4), _OMC_LIT145);
  tmpMeta7 = mmc_mk_box7(4, &NFInstNode_InstNode_COMPONENT__NODE__desc, _OMC_LIT131, mmc_mk_none(), mmc_mk_integer(1), mmc_mk_some(tmpMeta6), _OMC_LIT186, _OMC_LIT187);
  tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta9 = mmc_mk_box6(3, &NFComponentRef_CREF__desc, tmpMeta7, tmpMeta8, _OMC_LIT147, mmc_mk_integer(1), _OMC_LIT254);
  _dummyRoot = tmpMeta9;

  _outTable = omc_NFOCConnectionGraph_newCrefCrefTable(threadData);

  omc_NFOCConnectionGraph_addRootsToTable(threadData, _outTable, _roots, _dummyRoot);
  _return: OMC_LABEL_UNUSED
  return _outTable;
}

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_addRootsToTable(threadData_t *threadData, modelica_metatype _table, modelica_metatype _roots, modelica_metatype _firstRoot)
{
  modelica_metatype _root = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _root has no default value.
  {
    modelica_metatype _root;
    for (tmpMeta1 = _roots; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _root = MMC_CAR(tmpMeta1);
      omc_UnorderedMap_add(threadData, _root, _firstRoot, _table);
    }
  }
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_connectCanonicalComponents(threadData_t *threadData, modelica_metatype _inPartition, modelica_metatype _inRef1, modelica_metatype _inRef2)
{
  modelica_boolean _outReallyConnected;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outReallyConnected has no default value.
  _outReallyConnected = (!omc_NFComponentRef_isEqual(threadData, _inRef1, _inRef2));

  if(_outReallyConnected)
  {
    omc_UnorderedMap_add(threadData, _inRef1, _inRef2, _inPartition);
  }
  _return: OMC_LABEL_UNUSED
  return _outReallyConnected;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_connectCanonicalComponents(threadData_t *threadData, modelica_metatype _inPartition, modelica_metatype _inRef1, modelica_metatype _inRef2)
{
  modelica_boolean _outReallyConnected;
  modelica_metatype out_outReallyConnected;
  _outReallyConnected = omc_NFOCConnectionGraph_connectCanonicalComponents(threadData, _inPartition, _inRef1, _inRef2);
  out_outReallyConnected = mmc_mk_icon(_outReallyConnected);
  return out_outReallyConnected;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_connectComponents(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _edge, modelica_metatype *out_outBrokenConnections)
{
  modelica_metatype _outConnectedConnections = NULL;
  modelica_metatype _outBrokenConnections = NULL;
  modelica_metatype _canon1 = NULL;
  modelica_metatype _canon2 = NULL;
  modelica_metatype _eq = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outConnectedConnections has no default value.
  // _outBrokenConnections has no default value.
  // _canon1 has no default value.
  // _canon2 has no default value.
  // _eq has no default value.
  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_boolean tmp5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_metatype tmpMeta11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          /* Pattern matching succeeded */
          _canon1 = omc_NFOCConnectionGraph_canonical(threadData, _partition, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 2))));

          _canon2 = omc_NFOCConnectionGraph_canonical(threadData, _partition, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 3))));

          /* Pattern-matching assignment */
          tmp5 = omc_NFOCConnectionGraph_connectCanonicalComponents(threadData, _partition, _canon1, _canon2);
          if (0 /* false */ != tmp5) goto goto_1;

          if(omc_Flags_isSet(threadData, _OMC_LIT16))
          {
            tmpMeta6 = stringAppend(_OMC_LIT260,omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 2)))));
            tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT10);
            tmpMeta8 = stringAppend(tmpMeta7,omc_NFComponentRef_toString(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 3)))));
            tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT261);
            omc_Debug_trace(threadData, tmpMeta9);
          }

          tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
          _outConnectedConnections = tmpMeta10;

          _eq = omc_NFOCConnectionGraph_generateEqualityConstraintEquation(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 4))));

          tmpMeta12 = mmc_mk_cons(_eq, MMC_REFSTRUCTLIT(mmc_nil));
          tmpMeta13 = mmc_mk_box5(3, &NFConnections_BrokenEdge_BROKEN__EDGE__desc, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_edge), 4))), tmpMeta12);
          tmpMeta11 = mmc_mk_cons(tmpMeta13, MMC_REFSTRUCTLIT(mmc_nil));
          _outBrokenConnections = tmpMeta11;
          goto tmp2_done;
        }
        case 1: {
          modelica_metatype tmpMeta14;
          modelica_metatype tmpMeta15;
          /* Pattern matching succeeded */
          tmpMeta14 = mmc_mk_cons(_edge, MMC_REFSTRUCTLIT(mmc_nil));
          _outConnectedConnections = tmpMeta14;

          tmpMeta15 = MMC_REFSTRUCTLIT(mmc_nil);
          _outBrokenConnections = tmpMeta15;
          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
  if (out_outBrokenConnections) { *out_outBrokenConnections = _outBrokenConnections; }
  return _outConnectedConnections;
}

PROTECTED_FUNCTION_STATIC void omc_NFOCConnectionGraph_connectBranchComponents(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _ref1, modelica_metatype _ref2)
{
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  omc_NFOCConnectionGraph_connectCanonicalComponents(threadData, _partition, omc_NFOCConnectionGraph_canonical(threadData, _partition, _ref1), omc_NFOCConnectionGraph_canonical(threadData, _partition, _ref2));
  _return: OMC_LABEL_UNUSED
  return;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_areInSameComponent(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _ref1, modelica_metatype _ref2)
{
  modelica_boolean _outResult;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outResult has no default value.
  _outResult = omc_NFComponentRef_isEqual(threadData, omc_NFOCConnectionGraph_canonical(threadData, _partition, _ref1), omc_NFOCConnectionGraph_canonical(threadData, _partition, _ref2));
  _return: OMC_LABEL_UNUSED
  return _outResult;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_areInSameComponent(threadData_t *threadData, modelica_metatype _partition, modelica_metatype _ref1, modelica_metatype _ref2)
{
  modelica_boolean _outResult;
  modelica_metatype out_outResult;
  _outResult = omc_NFOCConnectionGraph_areInSameComponent(threadData, _partition, _ref1, _ref2);
  out_outResult = mmc_mk_icon(_outResult);
  return out_outResult;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_canonical(threadData_t *threadData, modelica_metatype _inPartition, modelica_metatype _inRef)
{
  modelica_metatype _outCanonical = NULL;
  modelica_metatype _cref_opt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outCanonical has no default value.
  // _cref_opt has no default value.
  _cref_opt = omc_UnorderedMap_get(threadData, _inRef, _inPartition);

  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _cref_opt;
    {
      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));
          _outCanonical = tmpMeta6;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _inRef = _outCanonical;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 1: {
          
          /* Pattern matching succeeded */
          tmpMeta1 = _inRef;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _outCanonical = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _outCanonical;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addConnection(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_metatype _source, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_metatype _graph = 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
  _graph = __omcQ_24in_5Fgraph;
  if(_printTrace)
  {
    tmpMeta1 = stringAppend(_OMC_LIT262,omc_NFComponentRef_toString(threadData, _ref1));
    tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT10);
    tmpMeta3 = stringAppend(tmpMeta2,omc_NFComponentRef_toString(threadData, _ref2));
    tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT11);
    fputs(MMC_STRINGDATA(tmpMeta4),stdout);
  }

  tmpMeta7 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta8 = mmc_mk_box5(3, &NFConnections_BrokenEdge_BROKEN__EDGE__desc, _ref1, _ref2, _source, tmpMeta7);
  tmpMeta6 = mmc_mk_cons(tmpMeta8, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_graph), 7))));
  tmpMeta5 = MMC_TAGPTR(mmc_alloc_words(8));
  memcpy(MMC_UNTAGPTR(tmpMeta5), MMC_UNTAGPTR(_graph), 8*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta5))[7] = tmpMeta6;
  _graph = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _graph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addConnection(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_metatype _source, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_integer tmp1;
  modelica_metatype _graph = NULL;
  tmp1 = mmc_unbox_integer(_printTrace);
  _graph = omc_NFOCConnectionGraph_addConnection(threadData, _ref1, _ref2, _source, tmp1, __omcQ_24in_5Fgraph);
  /* skip box _graph; NFOCConnectionGraph.NFOCConnectionGraph */
  return _graph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addBranch(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_metatype _graph = 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
  _graph = __omcQ_24in_5Fgraph;
  if(_printTrace)
  {
    tmpMeta1 = stringAppend(_OMC_LIT263,omc_NFComponentRef_toString(threadData, _ref1));
    tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT10);
    tmpMeta3 = stringAppend(tmpMeta2,omc_NFComponentRef_toString(threadData, _ref2));
    tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT11);
    fputs(MMC_STRINGDATA(tmpMeta4),stdout);
  }

  tmpMeta7 = mmc_mk_box2(0, _ref1, _ref2);
  tmpMeta6 = mmc_mk_cons(tmpMeta7, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_graph), 6))));
  tmpMeta5 = MMC_TAGPTR(mmc_alloc_words(8));
  memcpy(MMC_UNTAGPTR(tmpMeta5), MMC_UNTAGPTR(_graph), 8*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta5))[6] = tmpMeta6;
  _graph = tmpMeta5;
  _return: OMC_LABEL_UNUSED
  return _graph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addBranch(threadData_t *threadData, modelica_metatype _ref1, modelica_metatype _ref2, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_integer tmp1;
  modelica_metatype _graph = NULL;
  tmp1 = mmc_unbox_integer(_printTrace);
  _graph = omc_NFOCConnectionGraph_addBranch(threadData, _ref1, _ref2, tmp1, __omcQ_24in_5Fgraph);
  /* skip box _graph; NFOCConnectionGraph.NFOCConnectionGraph */
  return _graph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addUniqueRoots(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _message, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_metatype _graph = NULL;
  modelica_metatype _unique_roots = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta13;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _graph = __omcQ_24in_5Fgraph;
  _unique_roots = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_graph), 5)));
  {
    modelica_metatype _root;
    for (tmpMeta1 = omc_NFExpression_arrayScalarElements(threadData, _roots); !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _root = MMC_CAR(tmpMeta1);
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _root;
        {
          volatile mmc_switch_type tmp5;
          int tmp6;
          tmp5 = 0;
          for (; tmp5 < 2; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              modelica_metatype tmpMeta7;
              modelica_metatype tmpMeta8;
              modelica_metatype tmpMeta9;
              modelica_metatype tmpMeta10;
              modelica_metatype tmpMeta11;
              modelica_metatype tmpMeta12;
              if (mmc__uniontype__metarecord__typedef__equal(tmp5_1,6,2) == 0) goto tmp4_end;
              
              /* Pattern matching succeeded */
              if(_printTrace)
              {
                tmpMeta7 = stringAppend(_OMC_LIT264,omc_NFExpression_toString(threadData, _root));
                tmpMeta8 = stringAppend(tmpMeta7,_OMC_LIT10);
                tmpMeta9 = stringAppend(tmpMeta8,omc_NFExpression_toString(threadData, _message));
                tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT11);
                fputs(MMC_STRINGDATA(tmpMeta10),stdout);
              }
              tmpMeta12 = mmc_mk_box2(0, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_root), 3))), _message);
              tmpMeta11 = mmc_mk_cons(tmpMeta12, _unique_roots);
              tmpMeta2 = tmpMeta11;
              goto tmp4_done;
            }
            case 1: {
              
              /* Pattern matching succeeded */
              tmpMeta2 = _unique_roots;
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _unique_roots = tmpMeta2;
    }
  }
  _return: OMC_LABEL_UNUSED
  return _graph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addUniqueRoots(threadData_t *threadData, modelica_metatype _roots, modelica_metatype _message, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_integer tmp1;
  modelica_metatype _graph = NULL;
  tmp1 = mmc_unbox_integer(_printTrace);
  _graph = omc_NFOCConnectionGraph_addUniqueRoots(threadData, _roots, _message, tmp1, __omcQ_24in_5Fgraph);
  /* skip box _graph; NFOCConnectionGraph.NFOCConnectionGraph */
  return _graph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addPotentialRoot(threadData_t *threadData, modelica_metatype _root, modelica_real _priority, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_metatype _graph = 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
  _graph = __omcQ_24in_5Fgraph;
  if(_printTrace)
  {
    tmpMeta1 = stringAppend(_OMC_LIT265,omc_NFComponentRef_toString(threadData, _root));
    tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT10);
    tmpMeta3 = stringAppend(tmpMeta2,realString(_priority));
    tmpMeta4 = stringAppend(tmpMeta3,_OMC_LIT112);
    tmpMeta5 = stringAppend(tmpMeta4,_OMC_LIT13);
    fputs(MMC_STRINGDATA(tmpMeta5),stdout);
  }

  tmpMeta8 = mmc_mk_box2(0, _root, mmc_mk_real(_priority));
  tmpMeta7 = mmc_mk_cons(tmpMeta8, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_graph), 4))));
  tmpMeta6 = MMC_TAGPTR(mmc_alloc_words(8));
  memcpy(MMC_UNTAGPTR(tmpMeta6), MMC_UNTAGPTR(_graph), 8*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta6))[4] = tmpMeta7;
  _graph = tmpMeta6;
  _return: OMC_LABEL_UNUSED
  return _graph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addPotentialRoot(threadData_t *threadData, modelica_metatype _root, modelica_metatype _priority, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_real tmp1;
  modelica_integer tmp2;
  modelica_metatype _graph = NULL;
  tmp1 = mmc_unbox_real(_priority);
  tmp2 = mmc_unbox_integer(_printTrace);
  _graph = omc_NFOCConnectionGraph_addPotentialRoot(threadData, _root, tmp1, tmp2, __omcQ_24in_5Fgraph);
  /* skip box _graph; NFOCConnectionGraph.NFOCConnectionGraph */
  return _graph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addDefiniteRoot(threadData_t *threadData, modelica_metatype _root, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_metatype _graph = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _graph = __omcQ_24in_5Fgraph;
  if(_printTrace)
  {
    tmpMeta1 = stringAppend(_OMC_LIT266,omc_NFComponentRef_toString(threadData, _root));
    tmpMeta2 = stringAppend(tmpMeta1,_OMC_LIT11);
    fputs(MMC_STRINGDATA(tmpMeta2),stdout);
  }

  tmpMeta4 = mmc_mk_cons(_root, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_graph), 3))));
  tmpMeta3 = MMC_TAGPTR(mmc_alloc_words(8));
  memcpy(MMC_UNTAGPTR(tmpMeta3), MMC_UNTAGPTR(_graph), 8*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta3))[3] = tmpMeta4;
  _graph = tmpMeta3;
  _return: OMC_LABEL_UNUSED
  return _graph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addDefiniteRoot(threadData_t *threadData, modelica_metatype _root, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_integer tmp1;
  modelica_metatype _graph = NULL;
  tmp1 = mmc_unbox_integer(_printTrace);
  _graph = omc_NFOCConnectionGraph_addDefiniteRoot(threadData, _root, tmp1, __omcQ_24in_5Fgraph);
  /* skip box _graph; NFOCConnectionGraph.NFOCConnectionGraph */
  return _graph;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_handleOverconstrainedConnections__dispatch(threadData_t *threadData, modelica_metatype _graph, modelica_metatype __omcQ_24in_5FflatModel, modelica_metatype *out_connected, modelica_metatype *out_broken)
{
  modelica_metatype _flatModel = NULL;
  modelica_metatype _connected = NULL;
  modelica_metatype _broken = NULL;
  modelica_metatype _roots = NULL;
  modelica_metatype _rooted = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _flatModel = __omcQ_24in_5FflatModel;
  // _connected has no default value.
  // _broken has no default value.
  // _roots has no default value.
  // _rooted has no default value.
  { /* matchcontinue expression */
    {
      volatile mmc_switch_type tmp3;
      int tmp4;
      tmp3 = 0;
      MMC_TRY_INTERNAL(mmc_jumper)
      tmp2_top:
      threadData->mmc_jumper = &new_mmc_jumper;
      for (; tmp3 < 2; tmp3++) {
        switch (MMC_SWITCH_CAST(tmp3)) {
        case 0: {
          modelica_metatype tmpMeta5;
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          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_metatype tmpMeta25;
          modelica_metatype tmpMeta26;
          modelica_metatype tmpMeta30;
          modelica_metatype tmpMeta31;
          /* Pattern matching succeeded */
          if(omc_Flags_isSet(threadData, _OMC_LIT16))
          {
            tmpMeta5 = stringAppend(_OMC_LIT267,intString(listLength(omc_NFOCConnectionGraph_getDefiniteRoots(threadData, _graph))));
            tmpMeta6 = stringAppend(tmpMeta5,_OMC_LIT258);
            tmpMeta7 = stringAppend(tmpMeta6,_OMC_LIT268);
            tmpMeta8 = stringAppend(tmpMeta7,intString(listLength(omc_NFOCConnectionGraph_getPotentialRoots(threadData, _graph))));
            tmpMeta9 = stringAppend(tmpMeta8,_OMC_LIT258);
            tmpMeta10 = stringAppend(tmpMeta9,_OMC_LIT269);
            tmpMeta11 = stringAppend(tmpMeta10,intString(listLength(omc_NFOCConnectionGraph_getUniqueRoots(threadData, _graph))));
            tmpMeta12 = stringAppend(tmpMeta11,_OMC_LIT258);
            tmpMeta13 = stringAppend(tmpMeta12,_OMC_LIT270);
            tmpMeta14 = stringAppend(tmpMeta13,intString(listLength(omc_NFOCConnectionGraph_getBranches(threadData, _graph))));
            tmpMeta15 = stringAppend(tmpMeta14,_OMC_LIT258);
            tmpMeta16 = stringAppend(tmpMeta15,_OMC_LIT271);
            tmpMeta17 = stringAppend(tmpMeta16,intString(listLength(omc_NFOCConnectionGraph_getConnections(threadData, _graph))));
            tmpMeta18 = stringAppend(tmpMeta17,_OMC_LIT13);
            fputs(MMC_STRINGDATA(tmpMeta18),stdout);
          }

          _roots = omc_NFOCConnectionGraph_findResultGraph(threadData, _graph, omc_NFFlatModel_fullName(threadData, _flatModel) ,&_connected ,&_broken);

          if(omc_Flags_isSet(threadData, _OMC_LIT16))
          {
            tmpMeta19 = stringAppend(_OMC_LIT272,stringDelimitList(omc_List_map(threadData, _roots, boxvar_NFComponentRef_toString), _OMC_LIT10));
            tmpMeta20 = stringAppend(tmpMeta19,_OMC_LIT13);
            fputs(MMC_STRINGDATA(tmpMeta20),stdout);

            tmpMeta21 = stringAppend(_OMC_LIT273,stringDelimitList(omc_List_map1(threadData, _broken, boxvar_NFOCConnectionGraph_printConnectionStr, _OMC_LIT274), _OMC_LIT10));
            tmpMeta22 = stringAppend(tmpMeta21,_OMC_LIT13);
            fputs(MMC_STRINGDATA(tmpMeta22),stdout);

            tmpMeta23 = stringAppend(_OMC_LIT275,stringDelimitList(omc_List_map1(threadData, _connected, boxvar_NFOCConnectionGraph_printConnectionStr, _OMC_LIT276), _OMC_LIT10));
            tmpMeta24 = stringAppend(tmpMeta23,_OMC_LIT13);
            fputs(MMC_STRINGDATA(tmpMeta24),stdout);
          }

          _rooted = omc_NFOCConnectionGraph_buildRootedTable(threadData, _roots, _graph);

          {
            modelica_metatype __omcQ_24tmpVar3;
            modelica_metatype* tmp27;
            modelica_metatype tmpMeta28;
            modelica_metatype __omcQ_24tmpVar2;
            modelica_integer tmp29;
            modelica_metatype _v_loopVar = 0;
            modelica_metatype _v;
            _v_loopVar = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 3)));
            tmpMeta28 = MMC_REFSTRUCTLIT(mmc_nil);
            __omcQ_24tmpVar3 = tmpMeta28; /* defaultValue */
            tmp27 = &__omcQ_24tmpVar3;
            while(1) {
              tmp29 = 1;
              if (!listEmpty(_v_loopVar)) {
                _v = MMC_CAR(_v_loopVar);
                _v_loopVar = MMC_CDR(_v_loopVar);
                tmp29--;
              }
              if (tmp29 == 0) {
                __omcQ_24tmpVar2 = omc_NFOCConnectionGraph_evalConnectionsOperatorsVar(threadData, _roots, _rooted, _graph, _v);
                *tmp27 = mmc_mk_cons(__omcQ_24tmpVar2,0);
                tmp27 = &MMC_CDR(*tmp27);
              } else if (tmp29 == 1) {
                break;
              } else {
                goto goto_1;
              }
            }
            *tmp27 = mmc_mk_nil();
            tmpMeta26 = __omcQ_24tmpVar3;
          }
          tmpMeta25 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta25), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta25))[3] = tmpMeta26;
          _flatModel = tmpMeta25;

          tmpMeta30 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta30), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta30))[4] = omc_NFOCConnectionGraph_evalConnectionsOperatorsEqs(threadData, _roots, _rooted, _graph, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 4))));
          _flatModel = tmpMeta30;

          tmpMeta31 = MMC_TAGPTR(mmc_alloc_words(9));
          memcpy(MMC_UNTAGPTR(tmpMeta31), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
          ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta31))[5] = omc_NFOCConnectionGraph_evalConnectionsOperatorsEqs(threadData, _roots, _rooted, _graph, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 5))));
          _flatModel = tmpMeta31;
          goto tmp2_done;
        }
        case 1: {
          modelica_boolean tmp32;
          modelica_metatype tmpMeta33;
          modelica_metatype tmpMeta34;
          /* Pattern matching succeeded */
          /* Pattern-matching assignment */
          tmp32 = omc_Flags_isSet(threadData, _OMC_LIT16);
          if (1 /* true */ != tmp32) goto goto_1;

          tmpMeta33 = stringAppend(_OMC_LIT277,omc_NFFlatModel_fullName(threadData, _flatModel));
          tmpMeta34 = stringAppend(tmpMeta33,_OMC_LIT13);
          fputs(MMC_STRINGDATA(tmpMeta34),stdout);

          goto goto_1;
          goto tmp2_done;
        }
        }
        goto tmp2_end;
        tmp2_end: ;
      }
      goto goto_1;
      tmp2_done:
      (void)tmp3;
      MMC_RESTORE_INTERNAL(mmc_jumper);
      goto tmp2_done2;
      goto_1:;
      MMC_CATCH_INTERNAL(mmc_jumper);
      if (++tmp3 < 2) {
        goto tmp2_top;
      }
      MMC_THROW_INTERNAL();
      tmp2_done2:;
    }
  }
  ;
  _return: OMC_LABEL_UNUSED
  if (out_connected) { *out_connected = _connected; }
  if (out_broken) { *out_broken = _broken; }
  return _flatModel;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getOverconstrainedCref(threadData_t *threadData, modelica_metatype _cref)
{
  modelica_metatype _c = NULL;
  modelica_metatype _node = NULL;
  modelica_metatype _rest = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _c has no default value.
  // _node has no default value.
  // _rest has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _cref;
    {
      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_boolean tmp10;
          modelica_metatype tmpMeta11;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          if (1 != tmp8) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _node = tmpMeta6;
          _rest = tmpMeta9;
          /* Pattern matching succeeded */
          tmp10 = (modelica_boolean)omc_NFClass_isOverdetermined(threadData, omc_NFInstNode_InstNode_getClass(threadData, _node));
          if(tmp10)
          {
            tmpMeta11 = _cref;
          }
          else
          {
            /* Tail recursive call */
            _cref = _rest;
            goto _tailrecursive;
            /* TODO: Make sure any eventual dead code below is never generated */
          }
          tmpMeta1 = tmpMeta11;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _c = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _c;
}

PROTECTED_FUNCTION_STATIC modelica_boolean omc_NFOCConnectionGraph_isOverconstrainedCref(threadData_t *threadData, modelica_metatype _cref)
{
  modelica_boolean _b;
  modelica_metatype _node = NULL;
  modelica_metatype _rest = NULL;
  modelica_boolean tmp1 = 0;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _b = 0 /* false */;
  // _node has no default value.
  // _rest has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;
    tmp4_1 = _cref;
    {
      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;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_1,0,5) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 5));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          if (1 != tmp8) goto tmp3_end;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_1), 6));
          _node = tmpMeta6;
          _rest = tmpMeta9;
          /* Pattern matching succeeded */
          tmp1 = (omc_NFClass_isOverdetermined(threadData, omc_NFInstNode_InstNode_getClass(threadData, _node)) || omc_NFOCConnectionGraph_isOverconstrainedCref(threadData, _rest));
          goto tmp3_done;
        }
        case 1: {
          
          /* 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:;
    }
  }
  _b = tmp1;
  _return: OMC_LABEL_UNUSED
  return _b;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_isOverconstrainedCref(threadData_t *threadData, modelica_metatype _cref)
{
  modelica_boolean _b;
  modelica_metatype out_b;
  _b = omc_NFOCConnectionGraph_isOverconstrainedCref(threadData, _cref);
  out_b = mmc_mk_icon(_b);
  return out_b;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_getOverconstrainedCrefs(threadData_t *threadData, modelica_metatype _conn, modelica_fnptr _isDeleted)
{
  modelica_metatype _crefs = NULL;
  modelica_metatype _conns = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _crefs has no default value.
  // _conns has no default value.
  _conns = omc_NFConnector_split(threadData, _conn);

  _conns = omc_List_mapFlat(threadData, _conns, boxvar_NFConnector_scalarizePrefix);

  {
    modelica_metatype __omcQ_24tmpVar5;
    modelica_metatype* tmp2;
    modelica_metatype tmpMeta3;
    modelica_metatype __omcQ_24tmpVar4;
    modelica_integer tmp4;
    modelica_metatype _c_loopVar = 0;
    modelica_metatype _c;
    _c_loopVar = _conns;
    tmpMeta3 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar5 = tmpMeta3; /* defaultValue */
    tmp2 = &__omcQ_24tmpVar5;
    while(1) {
      tmp4 = 1;
      while (!listEmpty(_c_loopVar)) {
        _c = MMC_CAR(_c_loopVar);
        _c_loopVar = MMC_CDR(_c_loopVar);
        if (((!mmc_unbox_boolean((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 2))) ? ((modelica_metatype(*)(threadData_t*, modelica_metatype, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 2))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2)))) : ((modelica_metatype(*)(threadData_t*, modelica_metatype)) (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_isDeleted), 1)))) (threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2)))))) && omc_NFOCConnectionGraph_isOverconstrainedCref(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2)))))) {
          tmp4--;
          break;
        }
      }
      if (tmp4 == 0) {
        __omcQ_24tmpVar4 = omc_NFOCConnectionGraph_getOverconstrainedCref(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c), 2))));
        *tmp2 = mmc_mk_cons(__omcQ_24tmpVar4,0);
        tmp2 = &MMC_CDR(*tmp2);
      } else if (tmp4 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp2 = mmc_mk_nil();
    tmpMeta1 = __omcQ_24tmpVar5;
  }
  _crefs = tmpMeta1;

  _crefs = omc_List_uniqueOnTrue(threadData, _crefs, boxvar_NFComponentRef_isEqual);
  _return: OMC_LABEL_UNUSED
  return _crefs;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_generateEqualityConstraintEquation(threadData_t *threadData, modelica_metatype _lhs, modelica_metatype _rhs, modelica_metatype _source)
{
  modelica_metatype _equalityConstraintEq = NULL;
  modelica_integer _context;
  modelica_metatype _fcref_rhs = NULL;
  modelica_metatype _fcref_lhs = NULL;
  modelica_metatype _fn_node_rhs = NULL;
  modelica_metatype _fn_node_lhs = NULL;
  modelica_metatype _exp_rhs = NULL;
  modelica_metatype _exp_lhs = NULL;
  modelica_metatype _ty = NULL;
  modelica_metatype _info = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta10;
  modelica_metatype tmpMeta11;
  modelica_metatype tmpMeta12;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _equalityConstraintEq has no default value.
  // _context has no default value.
  // _fcref_rhs has no default value.
  // _fcref_lhs has no default value.
  // _fn_node_rhs has no default value.
  // _fn_node_lhs has no default value.
  // _exp_rhs has no default value.
  // _exp_lhs has no default value.
  // _ty has no default value.
  _info = omc_ElementSource_getInfo(threadData, _source);
  _context = ((modelica_integer) 8388736);

  _fcref_rhs = omc_NFFunction_Function_lookupFunctionSimple(threadData, _OMC_LIT278, omc_NFInstNode_InstNode_classScope(threadData, omc_NFComponentRef_node(threadData, _lhs)), _context);

  _fcref_rhs = omc_NFFunction_Function_instFunctionRef(threadData, _fcref_rhs, _context, _OMC_LIT145 ,&_fn_node_rhs, NULL);

  tmpMeta1 = mmc_mk_cons(omc_NFExpression_fromCref(threadData, _lhs, 0 /* false */), mmc_mk_cons(omc_NFExpression_fromCref(threadData, _rhs, 0 /* false */), MMC_REFSTRUCTLIT(mmc_nil)));
  tmpMeta2 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta3 = mmc_mk_box5(3, &NFCall_UNTYPED__CALL__desc, _fcref_rhs, tmpMeta1, tmpMeta2, _fn_node_rhs);
  tmpMeta4 = mmc_mk_box2(16, &NFExpression_CALL__desc, tmpMeta3);
  _exp_rhs = tmpMeta4;

  _exp_rhs = omc_NFTyping_typeExp(threadData, _exp_rhs, _context, _info, 0 /* false */ ,&_ty, NULL, NULL);

  _fcref_lhs = omc_NFFunction_Function_lookupFunctionSimple(threadData, _OMC_LIT279, omc_NFInstNode_InstNode_topScope(threadData, omc_NFComponentRef_node(threadData, _lhs)), _context);

  _fcref_lhs = omc_NFFunction_Function_instFunctionRef(threadData, _fcref_lhs, _context, _OMC_LIT145 ,&_fn_node_lhs, NULL);

  {
    modelica_metatype __omcQ_24tmpVar7;
    modelica_metatype* tmp7;
    modelica_metatype tmpMeta8;
    modelica_metatype __omcQ_24tmpVar6;
    modelica_integer tmp9;
    modelica_metatype _d_loopVar = 0;
    modelica_metatype _d;
    _d_loopVar = omc_NFType_arrayDims(threadData, _ty);
    tmpMeta8 = MMC_REFSTRUCTLIT(mmc_nil);
    __omcQ_24tmpVar7 = tmpMeta8; /* defaultValue */
    tmp7 = &__omcQ_24tmpVar7;
    while(1) {
      tmp9 = 1;
      if (!listEmpty(_d_loopVar)) {
        _d = MMC_CAR(_d_loopVar);
        _d_loopVar = MMC_CDR(_d_loopVar);
        tmp9--;
      }
      if (tmp9 == 0) {
        __omcQ_24tmpVar6 = omc_NFDimension_sizeExp(threadData, _d);
        *tmp7 = mmc_mk_cons(__omcQ_24tmpVar6,0);
        tmp7 = &MMC_CDR(*tmp7);
      } else if (tmp9 == 1) {
        break;
      } else {
        MMC_THROW_INTERNAL();
      }
    }
    *tmp7 = mmc_mk_nil();
    tmpMeta6 = __omcQ_24tmpVar7;
  }
  tmpMeta5 = mmc_mk_cons(_OMC_LIT280, tmpMeta6);
  tmpMeta10 = MMC_REFSTRUCTLIT(mmc_nil);
  tmpMeta11 = mmc_mk_box5(3, &NFCall_UNTYPED__CALL__desc, _fcref_lhs, tmpMeta5, tmpMeta10, _fn_node_lhs);
  tmpMeta12 = mmc_mk_box2(16, &NFExpression_CALL__desc, tmpMeta11);
  _exp_lhs = tmpMeta12;

  _exp_lhs = omc_NFTyping_typeExp(threadData, _exp_lhs, _context, _info, 0 /* false */ ,&_ty, NULL, NULL);

  _equalityConstraintEq = omc_NFEquation_makeEquality(threadData, _exp_rhs, _exp_lhs, _ty, _source, _OMC_LIT186, 3);
  _return: OMC_LABEL_UNUSED
  return _equalityConstraintEq;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addRootsAndBranches(threadData_t *threadData, modelica_metatype _equations, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph, modelica_metatype *out_graph)
{
  modelica_metatype _outEquations = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype _graph = NULL;
  modelica_metatype _call = NULL;
  modelica_metatype _args = NULL;
  modelica_metatype _arg1 = NULL;
  modelica_metatype _arg2 = NULL;
  modelica_metatype _root = NULL;
  modelica_metatype _msg = NULL;
  modelica_metatype _cref = NULL;
  modelica_metatype _lhs = NULL;
  modelica_metatype _rhs = NULL;
  modelica_integer _priority;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta51;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  tmpMeta1 = MMC_REFSTRUCTLIT(mmc_nil);
  _outEquations = tmpMeta1;
  _graph = __omcQ_24in_5Fgraph;
  // _call has no default value.
  // _args has no default value.
  // _arg1 has no default value.
  // _arg2 has no default value.
  // _root has no default value.
  // _msg has no default value.
  // _cref has no default value.
  // _lhs has no default value.
  // _rhs has no default value.
  // _priority has no default value.
  {
    modelica_metatype _eq;
    for (tmpMeta2 = _equations; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
    {
      _eq = MMC_CAR(tmpMeta2);
      { /* match expression */
        modelica_metatype tmp6_1;
        tmp6_1 = _eq;
        {
          volatile mmc_switch_type tmp6;
          int tmp7;
          tmp6 = 0;
          for (; tmp6 < 2; tmp6++) {
            switch (MMC_SWITCH_CAST(tmp6)) {
            case 0: {
              modelica_metatype tmpMeta8;
              modelica_metatype tmpMeta9;
              modelica_metatype tmpMeta10;
              modelica_metatype tmpMeta11;
              if (mmc__uniontype__metarecord__typedef__equal(tmp6_1,8,3) == 0) goto tmp5_end;
              tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp6_1), 2));
              if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,13,1) == 0) goto tmp5_end;
              tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta8), 2));
              if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,6) == 0) goto tmp5_end;
              tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 6));
              
              _call = tmpMeta9;
              _args = tmpMeta10;
              /* Pattern matching succeeded */
              { /* match expression */
                modelica_integer tmp14_1;
                tmp14_1 = omc_NFOCConnectionGraph_identifyConnectionsOperator(threadData, omc_NFFunction_Function_name(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_call), 2)))));
                {
                  int tmp14;
                  {
                    switch (MMC_SWITCH_CAST(tmp14_1)) {
                    case 2: {
                      modelica_metatype tmpMeta15;
                      modelica_metatype tmpMeta16;
                      modelica_metatype tmpMeta17;
                      modelica_metatype tmpMeta18;
                      if (2 != tmp14_1) goto tmp13_end;
                      /* Pattern matching succeeded */
                      /* Pattern-matching assignment */
                      tmpMeta15 = _args;
                      if (listEmpty(tmpMeta15)) goto goto_12;
                      tmpMeta16 = MMC_CAR(tmpMeta15);
                      tmpMeta17 = MMC_CDR(tmpMeta15);
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta16,6,2) == 0) goto goto_12;
                      tmpMeta18 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta16), 3));
                      if (!listEmpty(tmpMeta17)) goto goto_12;
                      _cref = tmpMeta18;

                      _graph = omc_NFOCConnectionGraph_addDefiniteRoot(threadData, _cref, _printTrace, _graph);
                      tmpMeta11 = _outEquations;
                      goto tmp13_done;
                    }
                    case 3: {
                      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_integer tmp28;
                      if (3 != tmp14_1) goto tmp13_end;
                      /* Pattern matching succeeded */
                      /* Pattern-matching assignment */
                      tmpMeta19 = _args;
                      if (listEmpty(tmpMeta19)) goto goto_12;
                      tmpMeta20 = MMC_CAR(tmpMeta19);
                      tmpMeta21 = MMC_CDR(tmpMeta19);
                      if (listEmpty(tmpMeta21)) goto goto_12;
                      tmpMeta22 = MMC_CAR(tmpMeta21);
                      tmpMeta23 = MMC_CDR(tmpMeta21);
                      if (!listEmpty(tmpMeta23)) goto goto_12;
                      _arg1 = tmpMeta20;
                      _arg2 = tmpMeta22;

                      /* Pattern-matching assignment */
                      tmpMeta24 = _arg1;
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta24,6,2) == 0) goto goto_12;
                      tmpMeta25 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta24), 3));
                      _cref = tmpMeta25;

                      /* Pattern-matching assignment */
                      tmpMeta26 = omc_NFCeval_evalExp(threadData, _arg2, _OMC_LIT281);
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta26,0,1) == 0) goto goto_12;
                      tmpMeta27 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta26), 2));
                      tmp28 = mmc_unbox_integer(tmpMeta27);
                      _priority = tmp28  /* pattern as ty=Integer */;

                      _graph = omc_NFOCConnectionGraph_addPotentialRoot(threadData, _cref, ((modelica_real)_priority), _printTrace, _graph);
                      tmpMeta11 = _outEquations;
                      goto tmp13_done;
                    }
                    case 6: {
                      modelica_metatype tmpMeta29;
                      if (6 != tmp14_1) goto tmp13_end;
                      /* Pattern matching succeeded */
                      { /* match expression */
                        modelica_metatype tmp32_1;
                        tmp32_1 = _args;
                        {
                          volatile mmc_switch_type tmp32;
                          int tmp33;
                          tmp32 = 0;
                          for (; tmp32 < 2; tmp32++) {
                            switch (MMC_SWITCH_CAST(tmp32)) {
                            case 0: {
                              modelica_metatype tmpMeta34;
                              modelica_metatype tmpMeta35;
                              modelica_metatype tmpMeta36;
                              if (listEmpty(tmp32_1)) goto tmp31_end;
                              tmpMeta34 = MMC_CAR(tmp32_1);
                              tmpMeta35 = MMC_CDR(tmp32_1);
                              if (mmc__uniontype__metarecord__typedef__equal(tmpMeta34,6,2) == 0) goto tmp31_end;
                              tmpMeta36 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta34), 3));
                              if (!listEmpty(tmpMeta35)) goto tmp31_end;
                              _root = tmpMeta34;
                              _cref = tmpMeta36;
                              /* Pattern matching succeeded */
                              tmpMeta29 = omc_NFOCConnectionGraph_addUniqueRoots(threadData, _root, _OMC_LIT282, _printTrace, _graph);
                              goto tmp31_done;
                            }
                            case 1: {
                              modelica_metatype tmpMeta37;
                              modelica_metatype tmpMeta38;
                              modelica_metatype tmpMeta39;
                              modelica_metatype tmpMeta40;
                              modelica_metatype tmpMeta41;
                              if (listEmpty(tmp32_1)) goto tmp31_end;
                              tmpMeta37 = MMC_CAR(tmp32_1);
                              tmpMeta38 = MMC_CDR(tmp32_1);
                              if (mmc__uniontype__metarecord__typedef__equal(tmpMeta37,6,2) == 0) goto tmp31_end;
                              tmpMeta39 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta37), 3));
                              if (listEmpty(tmpMeta38)) goto tmp31_end;
                              tmpMeta40 = MMC_CAR(tmpMeta38);
                              tmpMeta41 = MMC_CDR(tmpMeta38);
                              if (!listEmpty(tmpMeta41)) goto tmp31_end;
                              _root = tmpMeta37;
                              _cref = tmpMeta39;
                              _msg = tmpMeta40;
                              /* Pattern matching succeeded */
                              tmpMeta29 = omc_NFOCConnectionGraph_addUniqueRoots(threadData, _root, _msg, _printTrace, _graph);
                              goto tmp31_done;
                            }
                            }
                            goto tmp31_end;
                            tmp31_end: ;
                          }
                          goto goto_30;
                          goto_30:;
                          goto goto_12;
                          goto tmp31_done;
                          tmp31_done:;
                        }
                      }
                      _graph = tmpMeta29;
                      tmpMeta11 = _outEquations;
                      goto tmp13_done;
                    }
                    case 1: {
                      modelica_metatype tmpMeta42;
                      modelica_metatype tmpMeta43;
                      modelica_metatype tmpMeta44;
                      modelica_metatype tmpMeta45;
                      modelica_metatype tmpMeta46;
                      modelica_metatype tmpMeta47;
                      modelica_metatype tmpMeta48;
                      if (1 != tmp14_1) goto tmp13_end;
                      /* Pattern matching succeeded */
                      /* Pattern-matching assignment */
                      tmpMeta42 = _args;
                      if (listEmpty(tmpMeta42)) goto goto_12;
                      tmpMeta43 = MMC_CAR(tmpMeta42);
                      tmpMeta44 = MMC_CDR(tmpMeta42);
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta43,6,2) == 0) goto goto_12;
                      tmpMeta45 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta43), 3));
                      if (listEmpty(tmpMeta44)) goto goto_12;
                      tmpMeta46 = MMC_CAR(tmpMeta44);
                      tmpMeta47 = MMC_CDR(tmpMeta44);
                      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta46,6,2) == 0) goto goto_12;
                      tmpMeta48 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta46), 3));
                      if (!listEmpty(tmpMeta47)) goto goto_12;
                      _lhs = tmpMeta45;
                      _rhs = tmpMeta48;

                      _graph = omc_NFOCConnectionGraph_addBranch(threadData, _lhs, _rhs, _printTrace, _graph);
                      tmpMeta11 = _outEquations;
                      goto tmp13_done;
                    }
                    default:
                    tmp13_default: OMC_LABEL_UNUSED; {
                      modelica_metatype tmpMeta49;
                      
                      /* Pattern matching succeeded */
                      tmpMeta49 = mmc_mk_cons(_eq, _outEquations);
                      tmpMeta11 = tmpMeta49;
                      goto tmp13_done;
                    }
                    }
                    goto tmp13_end;
                    tmp13_end: ;
                  }
                  goto goto_12;
                  goto_12:;
                  goto goto_4;
                  goto tmp13_done;
                  tmp13_done:;
                }
              }tmpMeta3 = tmpMeta11;
              goto tmp5_done;
            }
            case 1: {
              modelica_metatype tmpMeta50;
              
              /* Pattern matching succeeded */
              tmpMeta50 = mmc_mk_cons(_eq, _outEquations);
              tmpMeta3 = tmpMeta50;
              goto tmp5_done;
            }
            }
            goto tmp5_end;
            tmp5_end: ;
          }
          goto goto_4;
          goto_4:;
          MMC_THROW_INTERNAL();
          goto tmp5_done;
          tmp5_done:;
        }
      }
      _outEquations = tmpMeta3;
    }
  }

  _outEquations = listReverseInPlace(_outEquations);
  _return: OMC_LABEL_UNUSED
  if (out_graph) { *out_graph = _graph; }
  return _outEquations;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addRootsAndBranches(threadData_t *threadData, modelica_metatype _equations, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph, modelica_metatype *out_graph)
{
  modelica_integer tmp1;
  modelica_metatype _outEquations = NULL;
  modelica_metatype tmpMeta2;
  tmp1 = mmc_unbox_integer(_printTrace);
  _outEquations = omc_NFOCConnectionGraph_addRootsAndBranches(threadData, _equations, tmp1, __omcQ_24in_5Fgraph, out_graph);
  /* skip box _outEquations; list<NFEquation> */
  /* skip box _graph; NFOCConnectionGraph.NFOCConnectionGraph */
  return _outEquations;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_NFOCConnectionGraph_addBreakableBranches(threadData_t *threadData, modelica_metatype _connections, modelica_fnptr _isDeleted, modelica_boolean _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_metatype _graph = NULL;
  modelica_metatype _breakable = NULL;
  modelica_metatype _c1 = NULL;
  modelica_metatype _c2 = NULL;
  modelica_metatype _lhs_crefs = NULL;
  modelica_metatype _rhs_crefs = NULL;
  modelica_metatype _rhs = NULL;
  modelica_integer _lhs_set;
  modelica_integer _rhs_set;
  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
  _graph = __omcQ_24in_5Fgraph;
  // _breakable has no default value.
  // _c1 has no default value.
  // _c2 has no default value.
  // _lhs_crefs has no default value.
  // _rhs_crefs has no default value.
  // _rhs has no default value.
  // _lhs_set has no default value.
  // _rhs_set has no default value.
  _breakable = omc_NFOCConnectionGraph_CrefSets_emptySets(threadData, ((modelica_integer) 3));

  {
    modelica_metatype _conn;
    for (tmpMeta1 = _connections; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _conn = MMC_CAR(tmpMeta1);
      /* Pattern-matching assignment */
      tmpMeta2 = _conn;
      if (mmc__uniontype__metarecord__typedef__equal(tmpMeta2,0,2) == 0) MMC_THROW_INTERNAL();
      tmpMeta3 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 2));
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta2), 3));
      _c1 = tmpMeta3;
      _c2 = tmpMeta4;

      _lhs_crefs = omc_NFOCConnectionGraph_getOverconstrainedCrefs(threadData, _c1, ((modelica_fnptr) _isDeleted));

      _rhs_crefs = omc_NFOCConnectionGraph_getOverconstrainedCrefs(threadData, _c2, ((modelica_fnptr) _isDeleted));

      {
        modelica_metatype _lhs;
        for (tmpMeta5 = _lhs_crefs; !listEmpty(tmpMeta5); tmpMeta5=MMC_CDR(tmpMeta5))
        {
          _lhs = MMC_CAR(tmpMeta5);
          /* Pattern-matching assignment */
          tmpMeta6 = _rhs_crefs;
          if (listEmpty(tmpMeta6)) MMC_THROW_INTERNAL();
          tmpMeta7 = MMC_CAR(tmpMeta6);
          tmpMeta8 = MMC_CDR(tmpMeta6);
          _rhs = tmpMeta7;
          _rhs_crefs = tmpMeta8;

          _lhs_set = omc_NFOCConnectionGraph_CrefSets_findSet(threadData, _lhs, _breakable ,&_breakable);

          _rhs_set = omc_NFOCConnectionGraph_CrefSets_findSet(threadData, _rhs, _breakable ,&_breakable);

          if((_lhs_set != _rhs_set))
          {
            _graph = omc_NFOCConnectionGraph_addConnection(threadData, _lhs, _rhs, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_c1), 6))), _printTrace, _graph);

            _breakable = omc_NFOCConnectionGraph_CrefSets_union(threadData, _lhs_set, _rhs_set, _breakable);
          }
        }
      }
    }
  }
  _return: OMC_LABEL_UNUSED
  return _graph;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_NFOCConnectionGraph_addBreakableBranches(threadData_t *threadData, modelica_metatype _connections, modelica_fnptr _isDeleted, modelica_metatype _printTrace, modelica_metatype __omcQ_24in_5Fgraph)
{
  modelica_integer tmp1;
  modelica_metatype _graph = NULL;
  tmp1 = mmc_unbox_integer(_printTrace);
  _graph = omc_NFOCConnectionGraph_addBreakableBranches(threadData, _connections, _isDeleted, tmp1, __omcQ_24in_5Fgraph);
  /* skip box _graph; NFOCConnectionGraph.NFOCConnectionGraph */
  return _graph;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_handleOverconstrainedConnections(threadData_t *threadData, modelica_metatype __omcQ_24in_5FflatModel, modelica_metatype _conns, modelica_fnptr _isDeleted, modelica_metatype *out_broken)
{
  modelica_metatype _flatModel = NULL;
  modelica_metatype _broken = NULL;
  modelica_metatype _graph = NULL;
  modelica_metatype _connected = NULL;
  modelica_metatype _eql = NULL;
  modelica_boolean _print_trace;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _flatModel = __omcQ_24in_5FflatModel;
  // _broken has no default value.
  _graph = _OMC_LIT283;
  // _connected has no default value.
  // _eql has no default value.
  _print_trace = omc_Flags_isSet(threadData, _OMC_LIT16);
  _graph = omc_NFOCConnectionGraph_addBreakableBranches(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_conns), 2))), ((modelica_fnptr) _isDeleted), _print_trace, _graph);

  _eql = omc_NFOCConnectionGraph_addRootsAndBranches(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 4))), _print_trace, _graph ,&_graph);

  tmpMeta1 = MMC_TAGPTR(mmc_alloc_words(9));
  memcpy(MMC_UNTAGPTR(tmpMeta1), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta1))[4] = _eql;
  _flatModel = tmpMeta1;

  _flatModel = omc_NFOCConnectionGraph_handleOverconstrainedConnections__dispatch(threadData, _graph, _flatModel ,&_connected ,&_broken);

  tmpMeta2 = MMC_TAGPTR(mmc_alloc_words(9));
  memcpy(MMC_UNTAGPTR(tmpMeta2), MMC_UNTAGPTR(_flatModel), 9*sizeof(modelica_metatype));
  ((modelica_metatype*)MMC_UNTAGPTR(tmpMeta2))[4] = omc_NFOCConnectionGraph_removeBrokenConnects(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_flatModel), 4))), _connected, _broken, ((modelica_fnptr) _isDeleted));
  _flatModel = tmpMeta2;
  _return: OMC_LABEL_UNUSED
  if (out_broken) { *out_broken = _broken; }
  return _flatModel;
}

DLLDirection
modelica_boolean omc_NFOCConnectionGraph_CrefSets_EntryEqual(threadData_t *threadData, modelica_metatype _entry1, modelica_metatype _entry2)
{
  modelica_boolean _isEqual;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _isEqual has no default value.
  _isEqual = omc_NFComponentRef_isEqual(threadData, _entry1, _entry2);
  _return: OMC_LABEL_UNUSED
  return _isEqual;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_EntryEqual(threadData_t *threadData, modelica_metatype _entry1, modelica_metatype _entry2)
{
  modelica_boolean _isEqual;
  modelica_metatype out_isEqual;
  _isEqual = omc_NFOCConnectionGraph_CrefSets_EntryEqual(threadData, _entry1, _entry2);
  out_isEqual = mmc_mk_icon(_isEqual);
  return out_isEqual;
}

DLLDirection
modelica_integer omc_NFOCConnectionGraph_CrefSets_EntryHash(threadData_t *threadData, modelica_metatype _entry)
{
  modelica_integer _hash;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _hash has no default value.
  _hash = omc_NFComponentRef_hash(threadData, _entry);
  _return: OMC_LABEL_UNUSED
  return _hash;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_EntryHash(threadData_t *threadData, modelica_metatype _entry)
{
  modelica_integer _hash;
  modelica_metatype out_hash;
  _hash = omc_NFOCConnectionGraph_CrefSets_EntryHash(threadData, _entry);
  out_hash = mmc_mk_icon(_hash);
  return out_hash;
}

DLLDirection
modelica_string omc_NFOCConnectionGraph_CrefSets_EntryString(threadData_t *threadData, modelica_metatype _entry)
{
  modelica_string _str = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _str has no default value.
  _str = omc_NFComponentRef_toString(threadData, _entry);
  _return: OMC_LABEL_UNUSED
  return _str;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_add(threadData_t *threadData, modelica_metatype _entry, modelica_metatype __omcQ_24in_5Fsets, modelica_integer *out_index)
{
  modelica_metatype _sets = NULL;
  modelica_integer _index;
  modelica_metatype _nodes = NULL;
  modelica_metatype _elements = NULL;
  modelica_integer _node_count;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sets = __omcQ_24in_5Fsets;
  // _index has no default value.
  // _nodes has no default value.
  // _elements has no default value.
  // _node_count has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _sets;
  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));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  _nodes = tmpMeta2;
  _elements = tmpMeta3;
  _node_count = tmp5  /* pattern as ty=Integer */;

  _index = ((modelica_integer) 1) + _node_count;

  if((_index > arrayLength(_nodes)))
  {
    _nodes = omc_Array_expand(threadData, ((modelica_integer)floor((1.4) * (((modelica_real)_index)))), _nodes, mmc_mk_integer(((modelica_integer) -1)));
  }

  omc_UnorderedMap_addNew(threadData, _entry, mmc_mk_integer(_index), _elements);

  tmpMeta6 = mmc_mk_box4(3, &NFOCConnectionGraph_CrefSets_Sets_DISJOINT__SETS__desc, _nodes, _elements, mmc_mk_integer(_index));
  _sets = tmpMeta6;
  _return: OMC_LABEL_UNUSED
  if (out_index) { *out_index = _index; }
  return _sets;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_add(threadData_t *threadData, modelica_metatype _entry, modelica_metatype __omcQ_24in_5Fsets, modelica_metatype *out_index)
{
  modelica_integer _index;
  modelica_metatype _sets = NULL;
  _sets = omc_NFOCConnectionGraph_CrefSets_add(threadData, _entry, __omcQ_24in_5Fsets, &_index);
  /* skip box _sets; NFOCConnectionGraph.CrefSets.Sets */
  if (out_index) { *out_index = mmc_mk_icon(_index); }
  return _sets;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_addList(threadData_t *threadData, modelica_metatype _entries, modelica_metatype __omcQ_24in_5Fsets)
{
  modelica_metatype _sets = NULL;
  modelica_metatype _nodes = NULL;
  modelica_metatype _elements = NULL;
  modelica_integer _node_count;
  modelica_integer _sz;
  modelica_integer _index;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_integer tmp5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sets = __omcQ_24in_5Fsets;
  // _nodes has no default value.
  // _elements has no default value.
  // _node_count has no default value.
  // _sz has no default value.
  // _index has no default value.
  /* Pattern-matching assignment */
  tmpMeta1 = _sets;
  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));
  tmp5 = mmc_unbox_integer(tmpMeta4);
  _nodes = tmpMeta2;
  _elements = tmpMeta3;
  _node_count = tmp5  /* pattern as ty=Integer */;

  _sz = listLength(_entries);

  _index = ((modelica_integer) 1) + _node_count;

  _node_count = _node_count + _sz;

  if((_node_count > arrayLength(_nodes)))
  {
    _nodes = omc_Array_expand(threadData, ((modelica_integer)floor((1.4) * (((modelica_real)_node_count)))), _nodes, mmc_mk_integer(((modelica_integer) -1)));
  }

  {
    modelica_metatype _e;
    for (tmpMeta6 = _entries; !listEmpty(tmpMeta6); tmpMeta6=MMC_CDR(tmpMeta6))
    {
      _e = MMC_CAR(tmpMeta6);
      omc_UnorderedMap_addNew(threadData, _e, mmc_mk_integer(_index), _elements);

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

  tmpMeta8 = mmc_mk_box4(3, &NFOCConnectionGraph_CrefSets_Sets_DISJOINT__SETS__desc, _nodes, _elements, mmc_mk_integer(_node_count));
  _sets = tmpMeta8;
  _return: OMC_LABEL_UNUSED
  return _sets;
}

DLLDirection
modelica_boolean omc_NFOCConnectionGraph_CrefSets_contains(threadData_t *threadData, modelica_metatype _entry, modelica_metatype _sets)
{
  modelica_boolean _found;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _found has no default value.
  _found = isSome(omc_UnorderedMap_get(threadData, _entry, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 3)))));
  _return: OMC_LABEL_UNUSED
  return _found;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_contains(threadData_t *threadData, modelica_metatype _entry, modelica_metatype _sets)
{
  modelica_boolean _found;
  modelica_metatype out_found;
  _found = omc_NFOCConnectionGraph_CrefSets_contains(threadData, _entry, _sets);
  out_found = mmc_mk_icon(_found);
  return out_found;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_emptySets(threadData_t *threadData, modelica_integer _setCount)
{
  modelica_metatype _sets = NULL;
  modelica_metatype _nodes = NULL;
  modelica_metatype _elements = NULL;
  modelica_integer _sz;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _sets has no default value.
  // _nodes has no default value.
  // _elements has no default value.
  // _sz has no default value.
  _sz = modelica_integer_max((modelica_integer)(_setCount),(modelica_integer)(((modelica_integer) 3)));

  _nodes = arrayCreate(_sz, mmc_mk_integer(((modelica_integer) -1)));

  _elements = omc_UnorderedMap_new(threadData, boxvar_NFOCConnectionGraph_CrefSets_EntryHash, boxvar_NFOCConnectionGraph_CrefSets_EntryEqual, ((modelica_integer) 1));

  tmpMeta1 = mmc_mk_box4(3, &NFOCConnectionGraph_CrefSets_Sets_DISJOINT__SETS__desc, _nodes, _elements, mmc_mk_integer(((modelica_integer) 0)));
  _sets = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _sets;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_emptySets(threadData_t *threadData, modelica_metatype _setCount)
{
  modelica_integer tmp1;
  modelica_metatype _sets = NULL;
  tmp1 = mmc_unbox_integer(_setCount);
  _sets = omc_NFOCConnectionGraph_CrefSets_emptySets(threadData, tmp1);
  /* skip box _sets; NFOCConnectionGraph.CrefSets.Sets */
  return _sets;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_extractSets(threadData_t *threadData, modelica_metatype _sets, modelica_metatype *out_assignedSets)
{
  modelica_metatype _setsArray = NULL;
  modelica_metatype _assignedSets = NULL;
  modelica_metatype _nodes = NULL;
  modelica_integer _set_idx;
  modelica_integer _idx;
  modelica_metatype _entries = NULL;
  modelica_metatype _e = NULL;
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_integer tmp3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_metatype tmpMeta6;
  modelica_metatype tmpMeta7;
  modelica_integer tmp8;
  modelica_metatype tmpMeta9;
  modelica_integer tmp10;
  modelica_integer tmp11;
  modelica_integer tmp12;
  modelica_metatype tmpMeta13;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _setsArray has no default value.
  // _assignedSets has no default value.
  // _nodes has no default value.
  _set_idx = ((modelica_integer) 0);
  // _idx has no default value.
  // _entries has no default value.
  // _e has no default value.
  _nodes = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2)));

  tmp1 = ((modelica_integer) 1); tmp2 = 1; tmp3 = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 4))));
  if(!(((tmp2 > 0) && (tmp1 > tmp3)) || ((tmp2 < 0) && (tmp1 < tmp3))))
  {
    modelica_integer _i;
    for(_i = ((modelica_integer) 1); in_range_integer(_i, tmp1, tmp3); _i += tmp2)
    {
      if((mmc_unbox_integer(arrayGet(_nodes,_i) /* DAE.ASUB */) < ((modelica_integer) 0)))
      {
        _set_idx = ((modelica_integer) 1) + _set_idx;

        arrayUpdate(_nodes,_i,mmc_mk_integer((-_set_idx)));
      }
    }
  }

  tmpMeta4 = MMC_REFSTRUCTLIT(mmc_nil);
  _setsArray = arrayCreate(_set_idx, tmpMeta4);

  _entries = omc_UnorderedMap_toArray(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 3))));

  tmp10 = arrayLength(_entries); tmp11 = ((modelica_integer) -1); tmp12 = ((modelica_integer) 1);
  if(!(((tmp11 > 0) && (tmp10 > tmp12)) || ((tmp11 < 0) && (tmp10 < tmp12))))
  {
    modelica_integer _i;
    for(_i = arrayLength(_entries); in_range_integer(_i, tmp10, tmp12); _i += tmp11)
    {
      /* Pattern-matching assignment */
      tmpMeta5 = arrayGetNoBoundsChecking(_entries, _i);
      tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 1));
      tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta5), 2));
      tmp8 = mmc_unbox_integer(tmpMeta7);
      _e = tmpMeta6;
      _idx = tmp8  /* pattern as ty=Integer */;

      _set_idx = mmc_unbox_integer(arrayGet(_nodes,_idx) /* DAE.ASUB */);

      while(1)
      {
        if(!(_set_idx > ((modelica_integer) 0))) break;
        _set_idx = mmc_unbox_integer(arrayGet(_nodes,_set_idx) /* DAE.ASUB */);
      }

      _set_idx = (-_set_idx);

      tmpMeta9 = mmc_mk_cons(_e, arrayGet(_setsArray,_set_idx) /* DAE.ASUB */);
      arrayUpdate(_setsArray,_set_idx,tmpMeta9);
    }
  }

  tmpMeta13 = mmc_mk_box4(3, &NFOCConnectionGraph_CrefSets_Sets_DISJOINT__SETS__desc, _nodes, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 3))), (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 4))));
  _assignedSets = tmpMeta13;
  _return: OMC_LABEL_UNUSED
  if (out_assignedSets) { *out_assignedSets = _assignedSets; }
  return _setsArray;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_find(threadData_t *threadData, modelica_metatype _entry, modelica_metatype __omcQ_24in_5Fsets, modelica_integer *out_index)
{
  modelica_metatype _sets = NULL;
  modelica_integer _index;
  modelica_metatype _oindex = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_integer tmp3;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sets = __omcQ_24in_5Fsets;
  // _index has no default value.
  // _oindex has no default value.
  _oindex = omc_UnorderedMap_get(threadData, _entry, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 3))));

  if(isSome(_oindex))
  {
    /* Pattern-matching assignment */
    tmpMeta1 = _oindex;
    if (optionNone(tmpMeta1)) MMC_THROW_INTERNAL();
    tmpMeta2 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta1), 1));
    tmp3 = mmc_unbox_integer(tmpMeta2);
    _index = tmp3  /* pattern as ty=Integer */;
  }
  else
  {
    _sets = omc_NFOCConnectionGraph_CrefSets_add(threadData, _entry, _sets ,&_index);
  }
  _return: OMC_LABEL_UNUSED
  if (out_index) { *out_index = _index; }
  return _sets;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_find(threadData_t *threadData, modelica_metatype _entry, modelica_metatype __omcQ_24in_5Fsets, modelica_metatype *out_index)
{
  modelica_integer _index;
  modelica_metatype _sets = NULL;
  _sets = omc_NFOCConnectionGraph_CrefSets_find(threadData, _entry, __omcQ_24in_5Fsets, &_index);
  /* skip box _sets; NFOCConnectionGraph.CrefSets.Sets */
  if (out_index) { *out_index = mmc_mk_icon(_index); }
  return _sets;
}

DLLDirection
modelica_integer omc_NFOCConnectionGraph_CrefSets_findRoot(threadData_t *threadData, modelica_integer _nodeIndex, modelica_metatype _nodes)
{
  modelica_integer _rootIndex;
  modelica_integer _parent;
  modelica_integer _idx;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _rootIndex = _nodeIndex;
  _parent = mmc_unbox_integer(arrayGet(_nodes,_nodeIndex) /* DAE.ASUB */);
  _idx = _nodeIndex;
  while(1)
  {
    if(!(_parent > ((modelica_integer) 0))) break;
    _rootIndex = _parent;

    _parent = mmc_unbox_integer(arrayGet(_nodes,_parent) /* DAE.ASUB */);
  }

  _parent = mmc_unbox_integer(arrayGet(_nodes,_nodeIndex) /* DAE.ASUB */);

  while(1)
  {
    if(!(_parent > ((modelica_integer) 0))) break;
    arrayUpdate(_nodes, _idx, mmc_mk_integer(_rootIndex));

    _idx = _parent;

    _parent = mmc_unbox_integer(arrayGet(_nodes,_parent) /* DAE.ASUB */);
  }
  _return: OMC_LABEL_UNUSED
  return _rootIndex;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_findRoot(threadData_t *threadData, modelica_metatype _nodeIndex, modelica_metatype _nodes)
{
  modelica_integer tmp1;
  modelica_integer _rootIndex;
  modelica_metatype out_rootIndex;
  tmp1 = mmc_unbox_integer(_nodeIndex);
  _rootIndex = omc_NFOCConnectionGraph_CrefSets_findRoot(threadData, tmp1, _nodes);
  out_rootIndex = mmc_mk_icon(_rootIndex);
  return out_rootIndex;
}

DLLDirection
modelica_integer omc_NFOCConnectionGraph_CrefSets_findSet(threadData_t *threadData, modelica_metatype _entry, modelica_metatype _sets, modelica_metatype *out_updatedSets)
{
  modelica_integer _set;
  modelica_metatype _updatedSets = NULL;
  modelica_integer _index;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _set has no default value.
  // _updatedSets has no default value.
  // _index has no default value.
  _updatedSets = omc_NFOCConnectionGraph_CrefSets_find(threadData, _entry, _sets ,&_index);

  _set = omc_NFOCConnectionGraph_CrefSets_findRoot(threadData, _index, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_updatedSets), 2))));
  _return: OMC_LABEL_UNUSED
  if (out_updatedSets) { *out_updatedSets = _updatedSets; }
  return _set;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_findSet(threadData_t *threadData, modelica_metatype _entry, modelica_metatype _sets, modelica_metatype *out_updatedSets)
{
  modelica_integer _set;
  modelica_metatype out_set;
  _set = omc_NFOCConnectionGraph_CrefSets_findSet(threadData, _entry, _sets, out_updatedSets);
  out_set = mmc_mk_icon(_set);
  /* skip box _updatedSets; NFOCConnectionGraph.CrefSets.Sets */
  return out_set;
}

DLLDirection
modelica_integer omc_NFOCConnectionGraph_CrefSets_findSetArrayIndex(threadData_t *threadData, modelica_metatype _entry, modelica_metatype _sets)
{
  modelica_integer _set;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _set has no default value.
  _set = mmc_unbox_integer(omc_UnorderedMap_getOrFail(threadData, _entry, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 3)))));

  while(1)
  {
    if(!(_set > ((modelica_integer) 0))) break;
    _set = mmc_unbox_integer(arrayGet((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))),_set) /* DAE.ASUB */);
  }

  _set = (-_set);
  _return: OMC_LABEL_UNUSED
  return _set;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_findSetArrayIndex(threadData_t *threadData, modelica_metatype _entry, modelica_metatype _sets)
{
  modelica_integer _set;
  modelica_metatype out_set;
  _set = omc_NFOCConnectionGraph_CrefSets_findSetArrayIndex(threadData, _entry, _sets);
  out_set = mmc_mk_icon(_set);
  return out_set;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_getEntry(threadData_t *threadData, modelica_metatype _entry, modelica_metatype _sets)
{
  modelica_metatype _outEntry = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _outEntry has no default value.
  _outEntry = omc_UnorderedMap_getKey(threadData, _entry, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 3))));
  _return: OMC_LABEL_UNUSED
  return _outEntry;
}

DLLDirection
modelica_integer omc_NFOCConnectionGraph_CrefSets_getNodeCount(threadData_t *threadData, modelica_metatype _sets)
{
  modelica_integer _nodeCount;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _nodeCount = mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 4))));
  _return: OMC_LABEL_UNUSED
  return _nodeCount;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_getNodeCount(threadData_t *threadData, modelica_metatype _sets)
{
  modelica_integer _nodeCount;
  modelica_metatype out_nodeCount;
  _nodeCount = omc_NFOCConnectionGraph_CrefSets_getNodeCount(threadData, _sets);
  out_nodeCount = mmc_mk_icon(_nodeCount);
  return out_nodeCount;
}

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_merge(threadData_t *threadData, modelica_metatype _entry1, modelica_metatype _entry2, modelica_metatype __omcQ_24in_5Fsets)
{
  modelica_metatype _sets = NULL;
  modelica_integer _set1;
  modelica_integer _set2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sets = __omcQ_24in_5Fsets;
  // _set1 has no default value.
  // _set2 has no default value.
  _set1 = omc_NFOCConnectionGraph_CrefSets_findSet(threadData, _entry1, _sets ,&_sets);

  _set2 = omc_NFOCConnectionGraph_CrefSets_findSet(threadData, _entry2, _sets ,&_sets);

  _sets = omc_NFOCConnectionGraph_CrefSets_union(threadData, _set1, _set2, _sets);
  _return: OMC_LABEL_UNUSED
  return _sets;
}

DLLDirection
void omc_NFOCConnectionGraph_CrefSets_printSets(threadData_t *threadData, modelica_metatype _sets)
{
  modelica_metatype _nodes = NULL;
  modelica_metatype _entries = NULL;
  modelica_metatype _e = NULL;
  modelica_integer _i;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta3;
  modelica_metatype tmpMeta4;
  modelica_metatype tmpMeta5;
  modelica_integer tmp6;
  modelica_string tmp7;
  modelica_string tmp8;
  modelica_metatype tmpMeta9;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _nodes has no default value.
  // _entries has no default value.
  // _e has no default value.
  // _i has no default value.
  tmpMeta1 = stringAppend(intString(mmc_unbox_integer((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 4))))),_OMC_LIT284);
  fputs(MMC_STRINGDATA(tmpMeta1),stdout);

  _nodes = (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2)));

  _entries = omc_UnorderedMap_toList(threadData, (MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 3))));

  {
    modelica_metatype _p;
    for (tmpMeta2 = _entries; !listEmpty(tmpMeta2); tmpMeta2=MMC_CDR(tmpMeta2))
    {
      _p = MMC_CAR(tmpMeta2);
      /* Pattern-matching assignment */
      tmpMeta3 = _p;
      tmpMeta4 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 1));
      tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta3), 2));
      tmp6 = mmc_unbox_integer(tmpMeta5);
      _e = tmpMeta4;
      _i = tmp6  /* pattern as ty=Integer */;

      fputs(MMC_STRINGDATA(_OMC_LIT285),stdout);

      tmp7 = modelica_integer_to_modelica_string(_i, ((modelica_integer) 0), 1 /* true */);
      fputs(MMC_STRINGDATA(tmp7),stdout);

      fputs(MMC_STRINGDATA(_OMC_LIT286),stdout);

      fputs(MMC_STRINGDATA(omc_NFOCConnectionGraph_CrefSets_EntryString(threadData, _e)),stdout);

      fputs(MMC_STRINGDATA(_OMC_LIT287),stdout);

      tmp8 = modelica_integer_to_modelica_string(mmc_unbox_integer(arrayGet(_nodes,_i) /* DAE.ASUB */), ((modelica_integer) 0), 1 /* true */);
      fputs(MMC_STRINGDATA(tmp8),stdout);

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

DLLDirection
modelica_metatype omc_NFOCConnectionGraph_CrefSets_union(threadData_t *threadData, modelica_integer _set1, modelica_integer _set2, modelica_metatype __omcQ_24in_5Fsets)
{
  modelica_metatype _sets = NULL;
  modelica_integer _rank1;
  modelica_integer _rank2;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _sets = __omcQ_24in_5Fsets;
  // _rank1 has no default value.
  // _rank2 has no default value.
  if((_set1 != _set2))
  {
    _rank1 = mmc_unbox_integer(arrayGet((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))),_set1) /* DAE.ASUB */);

    _rank2 = mmc_unbox_integer(arrayGet((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))),_set2) /* DAE.ASUB */);

    if((_rank1 > _rank2))
    {
      arrayUpdate((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))), _set2, mmc_mk_integer(_set1));
    }
    else
    {
      if((_rank1 < _rank2))
      {
        arrayUpdate((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))), _set1, mmc_mk_integer(_set2));
      }
      else
      {
        arrayUpdate((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))), _set1, mmc_mk_integer(((modelica_integer) -1) + mmc_unbox_integer(arrayGet((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))),_set1) /* DAE.ASUB */)));

        arrayUpdate((MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(_sets), 2))), _set2, mmc_mk_integer(_set1));
      }
    }
  }
  _return: OMC_LABEL_UNUSED
  return _sets;
}
modelica_metatype boxptr_NFOCConnectionGraph_CrefSets_union(threadData_t *threadData, modelica_metatype _set1, modelica_metatype _set2, modelica_metatype __omcQ_24in_5Fsets)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _sets = NULL;
  tmp1 = mmc_unbox_integer(_set1);
  tmp2 = mmc_unbox_integer(_set2);
  _sets = omc_NFOCConnectionGraph_CrefSets_union(threadData, tmp1, tmp2, __omcQ_24in_5Fsets);
  /* skip box _sets; NFOCConnectionGraph.CrefSets.Sets */
  return _sets;
}

