#include "omc_simulation_settings.h"
#include "CodegenOMSI_common.h"
#define _OMC_LIT0_data "/*\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT0,3,_OMC_LIT0_data);
#define _OMC_LIT0 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT0)
#define _OMC_LIT1_data " * This file is part of OpenModelica.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT1,38,_OMC_LIT1_data);
#define _OMC_LIT1 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT1)
#define _OMC_LIT2_data " *\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT2,3,_OMC_LIT2_data);
#define _OMC_LIT2 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT2)
#define _OMC_LIT3_data " * Copyright (c) 1998-2014, Open Source Modelica Consortium (OSMC),\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT3,68,_OMC_LIT3_data);
#define _OMC_LIT3 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT3)
#define _OMC_LIT4_data " * c/o Linköpings universitet, Department of Computer and Information Science,\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT4,80,_OMC_LIT4_data);
#define _OMC_LIT4 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT4)
#define _OMC_LIT5_data " * SE-58183 Linköping, Sweden.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT5,32,_OMC_LIT5_data);
#define _OMC_LIT5 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT5)
#define _OMC_LIT6_data " * All rights reserved.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT6,24,_OMC_LIT6_data);
#define _OMC_LIT6 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT6)
#define _OMC_LIT7_data " * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT7,72,_OMC_LIT7_data);
#define _OMC_LIT7 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT7)
#define _OMC_LIT8_data " * THIS OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT8,51,_OMC_LIT8_data);
#define _OMC_LIT8 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT8)
#define _OMC_LIT9_data " * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT9,69,_OMC_LIT9_data);
#define _OMC_LIT9 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT9)
#define _OMC_LIT10_data " * RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT10,75,_OMC_LIT10_data);
#define _OMC_LIT10 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT10)
#define _OMC_LIT11_data " * ACCORDING TO RECIPIENTS CHOICE.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT11,35,_OMC_LIT11_data);
#define _OMC_LIT11 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT11)
#define _OMC_LIT12_data " * The OpenModelica software and the Open Source Modelica\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT12,58,_OMC_LIT12_data);
#define _OMC_LIT12 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT12)
#define _OMC_LIT13_data " * Consortium (OSMC) Public License (OSMC-PL) are obtained\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT13,59,_OMC_LIT13_data);
#define _OMC_LIT13 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT13)
#define _OMC_LIT14_data " * from OSMC, either from the above address,\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT14,45,_OMC_LIT14_data);
#define _OMC_LIT14 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT14)
#define _OMC_LIT15_data " * from the URLs: http://www.ida.liu.se/projects/OpenModelica or\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT15,65,_OMC_LIT15_data);
#define _OMC_LIT15 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT15)
#define _OMC_LIT16_data " * http://www.openmodelica.org, and in the OpenModelica distribution.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT16,70,_OMC_LIT16_data);
#define _OMC_LIT16 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT16)
#define _OMC_LIT17_data " * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT17,73,_OMC_LIT17_data);
#define _OMC_LIT17 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT17)
#define _OMC_LIT18_data " * This program is distributed WITHOUT ANY WARRANTY; without\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT18,61,_OMC_LIT18_data);
#define _OMC_LIT18 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT18)
#define _OMC_LIT19_data " * even the implied warranty of  MERCHANTABILITY or FITNESS\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT19,60,_OMC_LIT19_data);
#define _OMC_LIT19 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT19)
#define _OMC_LIT20_data " * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT20,59,_OMC_LIT20_data);
#define _OMC_LIT20 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT20)
#define _OMC_LIT21_data " * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT21,74,_OMC_LIT21_data);
#define _OMC_LIT21 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT21)
#define _OMC_LIT22_data " * See the full OSMC Public License conditions for more details.\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT22,65,_OMC_LIT22_data);
#define _OMC_LIT22 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT22)
#define _OMC_LIT23_data " */"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT23,3,_OMC_LIT23_data);
#define _OMC_LIT23 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT23)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_1,2,1) {_OMC_LIT23,MMC_REFSTRUCTLIT(mmc_nil)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_2,2,1) {_OMC_LIT2,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_1)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_3,2,1) {_OMC_LIT22,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_2)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_4,2,1) {_OMC_LIT2,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_3)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_5,2,1) {_OMC_LIT21,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_4)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_6,2,1) {_OMC_LIT20,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_5)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_7,2,1) {_OMC_LIT19,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_6)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_8,2,1) {_OMC_LIT18,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_7)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_9,2,1) {_OMC_LIT2,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_8)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_10,2,1) {_OMC_LIT17,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_9)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_11,2,1) {_OMC_LIT16,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_10)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_12,2,1) {_OMC_LIT15,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_11)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_13,2,1) {_OMC_LIT14,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_12)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_14,2,1) {_OMC_LIT13,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_13)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_15,2,1) {_OMC_LIT12,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_14)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_16,2,1) {_OMC_LIT2,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_15)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_17,2,1) {_OMC_LIT11,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_16)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_18,2,1) {_OMC_LIT10,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_17)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_19,2,1) {_OMC_LIT9,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_18)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_20,2,1) {_OMC_LIT8,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_19)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_21,2,1) {_OMC_LIT7,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_20)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_22,2,1) {_OMC_LIT2,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_21)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_23,2,1) {_OMC_LIT6,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_22)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_24,2,1) {_OMC_LIT2,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_23)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_25,2,1) {_OMC_LIT5,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_24)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_26,2,1) {_OMC_LIT4,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_25)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_27,2,1) {_OMC_LIT3,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_26)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_28,2,1) {_OMC_LIT2,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_27)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_29,2,1) {_OMC_LIT1,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_28)}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_30,2,1) {_OMC_LIT0,MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_29)}};
#define _OMC_LIT24 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT24_cons_30)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT25,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT24,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT25 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT25)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT26,3,3) {&Tpl_Text_MEM__TEXT__desc,MMC_REFSTRUCTLIT(mmc_nil),MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT26 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT26)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT27,1,3) {&Tpl_StringToken_ST__NEW__LINE__desc,}};
#define _OMC_LIT27 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT27)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT28,9,3) {&Tpl_IterOptions_ITER__OPTIONS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_none),MMC_REFSTRUCTLIT(mmc_none),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27}};
#define _OMC_LIT28 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT28)
#define _OMC_LIT29_data " /* Initializes sample time events */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT29,38,_OMC_LIT29_data);
#define _OMC_LIT29 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT29)
#define _OMC_LIT30_data "void "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT30,5,_OMC_LIT30_data);
#define _OMC_LIT30 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT30)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT31,2,1) {_OMC_LIT30,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT31 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT31)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT32,2,1) {_OMC_LIT29,_OMC_LIT31}};
#define _OMC_LIT32 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT32)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT33,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT32,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT33 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT33)
#define _OMC_LIT34_data "_instantiate_samples(omsi_sample* sample_events)\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT34,49,_OMC_LIT34_data);
#define _OMC_LIT34 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT34)
#define _OMC_LIT35_data "{\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT35,2,_OMC_LIT35_data);
#define _OMC_LIT35 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT35)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT36,2,1) {_OMC_LIT35,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT36 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT36)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT37,2,1) {_OMC_LIT34,_OMC_LIT36}};
#define _OMC_LIT37 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT37)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT38,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT37,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT38 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT38)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT39,2,4) {&Tpl_BlockType_BT__INDENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(2))}};
#define _OMC_LIT39 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT39)
#define _OMC_LIT40_data "}"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT40,1,_OMC_LIT40_data);
#define _OMC_LIT40 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT40)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT41,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT40}};
#define _OMC_LIT41 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT41)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT42,1,7) {&SimCodeFunction_Context_OTHER__CONTEXT__desc,}};
#define _OMC_LIT42 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT42)
#define _OMC_LIT43_data "/* sample "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT43,10,_OMC_LIT43_data);
#define _OMC_LIT43 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT43)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT44,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT43}};
#define _OMC_LIT44 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT44)
#define _OMC_LIT45_data " */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT45,4,_OMC_LIT45_data);
#define _OMC_LIT45 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT45)
#define _OMC_LIT46_data "sample_events["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT46,14,_OMC_LIT46_data);
#define _OMC_LIT46 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT46)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT47,2,1) {_OMC_LIT46,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT47 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT47)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT48,2,1) {_OMC_LIT45,_OMC_LIT47}};
#define _OMC_LIT48 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT48)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT49,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT48,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT49 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT49)
#define _OMC_LIT50_data "].id = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT50,7,_OMC_LIT50_data);
#define _OMC_LIT50 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT50)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT51,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT50}};
#define _OMC_LIT51 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT51)
#define _OMC_LIT52_data ";\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT52,2,_OMC_LIT52_data);
#define _OMC_LIT52 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT52)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT53,2,1) {_OMC_LIT52,_OMC_LIT47}};
#define _OMC_LIT53 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT53)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT54,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT53,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT54 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT54)
#define _OMC_LIT55_data "].start_time = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT55,15,_OMC_LIT55_data);
#define _OMC_LIT55 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT55)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT56,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT55}};
#define _OMC_LIT56 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT56)
#define _OMC_LIT57_data "].interval = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,13,_OMC_LIT57_data);
#define _OMC_LIT57 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT57)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT58,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT57}};
#define _OMC_LIT58 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT58)
#define _OMC_LIT59_data ";"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT59,1,_OMC_LIT59_data);
#define _OMC_LIT59 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT59)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT60,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT59}};
#define _OMC_LIT60 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT60)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT61,1,1) {_OMC_LIT27}};
#define _OMC_LIT61 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT61)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT62,9,3) {&Tpl_IterOptions_ITER__OPTIONS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT61,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27}};
#define _OMC_LIT62 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT62)
#define _OMC_LIT63_data "_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT63,1,_OMC_LIT63_data);
#define _OMC_LIT63 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT63)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT64,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT63}};
#define _OMC_LIT64 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT64)
#define _OMC_LIT65_data "_instantiate_AlgSystem_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT65,23,_OMC_LIT65_data);
#define _OMC_LIT65 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT65)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT66,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT65}};
#define _OMC_LIT66 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT66)
#define _OMC_LIT67_data "(&(omsi_function->algebraic_system_t["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT67,37,_OMC_LIT67_data);
#define _OMC_LIT67 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT67)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT68,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT67}};
#define _OMC_LIT68 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT68)
#define _OMC_LIT69_data "]), omsi_function->function_vars, omsi_function->pre_vars);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT69,60,_OMC_LIT69_data);
#define _OMC_LIT69 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT69)
#define _OMC_LIT70_data "if (!&omsi_function->algebraic_system_t["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT70,40,_OMC_LIT70_data);
#define _OMC_LIT70 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT70)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT71,2,1) {_OMC_LIT70,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT71 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT71)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT72,2,1) {_OMC_LIT69,_OMC_LIT71}};
#define _OMC_LIT72 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT72)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT73,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT72,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT73 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT73)
#define _OMC_LIT74_data "]) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT74,5,_OMC_LIT74_data);
#define _OMC_LIT74 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT74)
#define _OMC_LIT75_data "  filtered_base_logger(global_logCategories, log_statuserror, omsi_error,\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT75,74,_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)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT77,2,1) {_OMC_LIT74,_OMC_LIT76}};
#define _OMC_LIT77 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT77)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT78,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT77,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT78 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT78)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT79,2,4) {&Tpl_BlockType_BT__INDENT__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(6))}};
#define _OMC_LIT79 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT79)
#define _OMC_LIT80_data "\"fmi2Instantiate: Function "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT80,27,_OMC_LIT80_data);
#define _OMC_LIT80 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT80)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT81,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT80}};
#define _OMC_LIT81 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT81)
#define _OMC_LIT82_data " failed.\");\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT82,12,_OMC_LIT82_data);
#define _OMC_LIT82 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT82)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT83,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT82}};
#define _OMC_LIT83 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT83)
#define _OMC_LIT84_data "  return omsi_error;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT84,21,_OMC_LIT84_data);
#define _OMC_LIT84 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT84)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT85,2,1) {_OMC_LIT40,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT85 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT85)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT86,2,1) {_OMC_LIT84,_OMC_LIT85}};
#define _OMC_LIT86 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT86)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT87,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT86,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT87 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT87)
#define _OMC_LIT88_data "omsi_status "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT88,12,_OMC_LIT88_data);
#define _OMC_LIT88 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT88)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT89,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT88}};
#define _OMC_LIT89 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT89)
#define _OMC_LIT90_data "_instantiate_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT90,13,_OMC_LIT90_data);
#define _OMC_LIT90 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT90)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT91,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT90}};
#define _OMC_LIT91 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT91)
#define _OMC_LIT92_data "_OMSIFunc (struct omsi_function_t* omsi_function);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT92,51,_OMC_LIT92_data);
#define _OMC_LIT92 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT92)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT93,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT92}};
#define _OMC_LIT93 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT93)
#define _OMC_LIT94_data "#include <omsu_helper.h>\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT94,25,_OMC_LIT94_data);
#define _OMC_LIT94 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT94)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT95,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT94}};
#define _OMC_LIT95 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT95)
#define _OMC_LIT96_data "#include <omsi_input_sim_data.h>"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT96,32,_OMC_LIT96_data);
#define _OMC_LIT96 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT96)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT97,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT96}};
#define _OMC_LIT97 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT97)
#define _OMC_LIT98_data "\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT98,1,_OMC_LIT98_data);
#define _OMC_LIT98 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT98)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT99,2,1) {_OMC_LIT88,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT99 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT99)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT100,2,1) {_OMC_LIT98,_OMC_LIT99}};
#define _OMC_LIT100 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT100)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT101,2,1) {_OMC_LIT98,_OMC_LIT100}};
#define _OMC_LIT101 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT101)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT102,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT101,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT102 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT102)
#define _OMC_LIT103_data "_OMSIFunc (struct omsi_function_t* omsi_function) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT103,52,_OMC_LIT103_data);
#define _OMC_LIT103 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT103)
#define _OMC_LIT104_data "  filtered_base_logger(global_logCategories, log_all, omsi_ok,\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT104,63,_OMC_LIT104_data);
#define _OMC_LIT104 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT104)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT105,2,1) {_OMC_LIT104,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT105 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT105)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT106,2,1) {_OMC_LIT98,_OMC_LIT105}};
#define _OMC_LIT106 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT106)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT107,2,1) {_OMC_LIT98,_OMC_LIT106}};
#define _OMC_LIT107 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT107)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT108,2,1) {_OMC_LIT98,_OMC_LIT107}};
#define _OMC_LIT108 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT108)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT109,2,1) {_OMC_LIT103,_OMC_LIT108}};
#define _OMC_LIT109 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT109)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT110,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT109,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT110 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT110)
#define _OMC_LIT111_data "\"fmi2Instantiate: Instantiate omsi_function "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT111,44,_OMC_LIT111_data);
#define _OMC_LIT111 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT111)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT112,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT111}};
#define _OMC_LIT112 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT112)
#define _OMC_LIT113_data ".\");\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT113,5,_OMC_LIT113_data);
#define _OMC_LIT113 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT113)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT114,2,1) {_OMC_LIT98,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT114 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT114)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT115,2,1) {_OMC_LIT113,_OMC_LIT114}};
#define _OMC_LIT115 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT115)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT116,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT115,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT116 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT116)
#define _OMC_LIT117_data "omsi_function->n_algebraic_system = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT117,36,_OMC_LIT117_data);
#define _OMC_LIT117 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT117)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT118,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT117}};
#define _OMC_LIT118 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT118)
#define _OMC_LIT119_data "omsi_function->n_input_vars = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT119,30,_OMC_LIT119_data);
#define _OMC_LIT119 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT119)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT120,2,1) {_OMC_LIT119,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT120 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT120)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT121,2,1) {_OMC_LIT98,_OMC_LIT120}};
#define _OMC_LIT121 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT121)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT122,2,1) {_OMC_LIT52,_OMC_LIT121}};
#define _OMC_LIT122 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT122)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT123,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT122,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT123 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT123)
#define _OMC_LIT124_data "omsi_function->n_inner_vars = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT124,30,_OMC_LIT124_data);
#define _OMC_LIT124 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT124)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT125,2,1) {_OMC_LIT124,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT125 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT125)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT126,2,1) {_OMC_LIT52,_OMC_LIT125}};
#define _OMC_LIT126 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT126)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT127,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT126,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT127 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT127)
#define _OMC_LIT128_data "omsi_function->n_output_vars = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT128,31,_OMC_LIT128_data);
#define _OMC_LIT128 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT128)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT129,2,1) {_OMC_LIT128,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT129 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT129)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT130,2,1) {_OMC_LIT52,_OMC_LIT129}};
#define _OMC_LIT130 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT130)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT131,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT130,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT131 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT131)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT132,2,1) {_OMC_LIT52,_OMC_LIT114}};
#define _OMC_LIT132 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT132)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT133,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT132,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT133 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT133)
#define _OMC_LIT134_data "if (instantiate_input_inner_output_indices (omsi_function, "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT134,59,_OMC_LIT134_data);
#define _OMC_LIT134 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT134)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT135,2,1) {_OMC_LIT134,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT135 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT135)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT136,2,1) {_OMC_LIT98,_OMC_LIT135}};
#define _OMC_LIT136 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT136)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT137,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT136,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT137 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT137)
#define _OMC_LIT138_data ", "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT138,2,_OMC_LIT138_data);
#define _OMC_LIT138 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT138)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT139,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT138}};
#define _OMC_LIT139 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT139)
#define _OMC_LIT140_data ") == omsi_error) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT140,19,_OMC_LIT140_data);
#define _OMC_LIT140 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT140)
#define _OMC_LIT141_data "}\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT141,2,_OMC_LIT141_data);
#define _OMC_LIT141 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT141)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT142,2,1) {_OMC_LIT141,_OMC_LIT114}};
#define _OMC_LIT142 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT142)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT143,2,1) {_OMC_LIT84,_OMC_LIT142}};
#define _OMC_LIT143 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT143)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT144,2,1) {_OMC_LIT140,_OMC_LIT143}};
#define _OMC_LIT144 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT144)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT145,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT144,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT145 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT145)
#define _OMC_LIT146_data "/* fill omsi_index_type indices */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT146,35,_OMC_LIT146_data);
#define _OMC_LIT146 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT146)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT147,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT146}};
#define _OMC_LIT147 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT147)
#define _OMC_LIT148_data "omsi_function->input_vars_indices"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT148,33,_OMC_LIT148_data);
#define _OMC_LIT148 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT148)
#define _OMC_LIT149_data "sim_data->model_vars_and_params"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT149,31,_OMC_LIT149_data);
#define _OMC_LIT149 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT149)
#define _OMC_LIT150_data "omsi_function->output_vars_indices"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT150,34,_OMC_LIT150_data);
#define _OMC_LIT150 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT150)
#define _OMC_LIT151_data "/* Set pointer for evaluation function */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT151,42,_OMC_LIT151_data);
#define _OMC_LIT151 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT151)
#define _OMC_LIT152_data "omsi_function->evaluate = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT152,26,_OMC_LIT152_data);
#define _OMC_LIT152 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT152)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT153,2,1) {_OMC_LIT152,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT153 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT153)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT154,2,1) {_OMC_LIT151,_OMC_LIT153}};
#define _OMC_LIT154 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT154)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT155,2,1) {_OMC_LIT98,_OMC_LIT154}};
#define _OMC_LIT155 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT155)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT156,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT155,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT156 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT156)
#define _OMC_LIT157_data "return omsi_ok;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT157,16,_OMC_LIT157_data);
#define _OMC_LIT157 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT157)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT158,2,1) {_OMC_LIT157,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT158 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT158)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT159,2,1) {_OMC_LIT98,_OMC_LIT158}};
#define _OMC_LIT159 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT159)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT160,2,1) {_OMC_LIT52,_OMC_LIT159}};
#define _OMC_LIT160 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT160)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT161,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT160,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT161 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT161)
#define _OMC_LIT162_data "/* Allocate memory for local variables */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT162,42,_OMC_LIT162_data);
#define _OMC_LIT162 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT162)
#define _OMC_LIT163_data "omsi_function->local_vars = instantiate_omsi_values("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT163,52,_OMC_LIT163_data);
#define _OMC_LIT163 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT163)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT164,2,1) {_OMC_LIT163,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT164 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT164)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT165,2,1) {_OMC_LIT162,_OMC_LIT164}};
#define _OMC_LIT165 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT165)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT166,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT165,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT166 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT166)
#define _OMC_LIT167_data ", 0, 0, 0);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT167,12,_OMC_LIT167_data);
#define _OMC_LIT167 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT167)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT168,2,1) {_OMC_LIT167,_OMC_LIT114}};
#define _OMC_LIT168 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT168)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT169,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT168,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT169 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT169)
#define _OMC_LIT170_data "/* Instantiate algebraic system */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT170,35,_OMC_LIT170_data);
#define _OMC_LIT170 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT170)
#define _OMC_LIT171_data "omsi_function->algebraic_system_t = omsu_instantiate_alg_system_array("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT171,70,_OMC_LIT171_data);
#define _OMC_LIT171 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT171)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT172,2,1) {_OMC_LIT171,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT172 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT172)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT173,2,1) {_OMC_LIT170,_OMC_LIT172}};
#define _OMC_LIT173 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT173)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT174,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT173,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT174 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT174)
#define _OMC_LIT175_data ");\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT175,3,_OMC_LIT175_data);
#define _OMC_LIT175 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT175)
#define _OMC_LIT176_data "if (!omsi_function->algebraic_system_t) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT176,42,_OMC_LIT176_data);
#define _OMC_LIT176 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT176)
#define _OMC_LIT177_data "                \"fmi2Instantiate: Not enough memory.\");\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT177,56,_OMC_LIT177_data);
#define _OMC_LIT177 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT177)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT178,2,1) {_OMC_LIT141,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT178 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT178)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT179,2,1) {_OMC_LIT84,_OMC_LIT178}};
#define _OMC_LIT179 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT179)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT180,2,1) {_OMC_LIT177,_OMC_LIT179}};
#define _OMC_LIT180 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT180)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT181,2,1) {_OMC_LIT75,_OMC_LIT180}};
#define _OMC_LIT181 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT181)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT182,2,1) {_OMC_LIT176,_OMC_LIT181}};
#define _OMC_LIT182 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT182)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT183,2,1) {_OMC_LIT175,_OMC_LIT182}};
#define _OMC_LIT183 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT183)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT184,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT183,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT184 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT184)
#define _OMC_LIT185_data "  #include <solver_api.h>"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT185,25,_OMC_LIT185_data);
#define _OMC_LIT185 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT185)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT186,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT185}};
#define _OMC_LIT186 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT186)
#define _OMC_LIT187_data "/* maps to "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT187,11,_OMC_LIT187_data);
#define _OMC_LIT187 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT187)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT188,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT187}};
#define _OMC_LIT188 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT188)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT189,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT45}};
#define _OMC_LIT189 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT189)
#define _OMC_LIT190_data "["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT190,1,_OMC_LIT190_data);
#define _OMC_LIT190 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT190)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT191,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT190}};
#define _OMC_LIT191 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT191)
#define _OMC_LIT192_data "].type  = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT192,10,_OMC_LIT192_data);
#define _OMC_LIT192 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT192)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT193,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT192}};
#define _OMC_LIT193 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT193)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT194,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT52}};
#define _OMC_LIT194 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT194)
#define _OMC_LIT195_data "].index = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT195,10,_OMC_LIT195_data);
#define _OMC_LIT195 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT195)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT196,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT195}};
#define _OMC_LIT196 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT196)
#define _OMC_LIT197_data ";   "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT197,4,_OMC_LIT197_data);
#define _OMC_LIT197 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT197)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT198,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT197}};
#define _OMC_LIT198 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT198)
#define _OMC_LIT199_data "OMSI_TYPE_REAL"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT199,14,_OMC_LIT199_data);
#define _OMC_LIT199 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT199)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT200,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT199}};
#define _OMC_LIT200 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT200)
#define _OMC_LIT201_data "OMSI_TYPE_INTEGER"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT201,17,_OMC_LIT201_data);
#define _OMC_LIT201 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT201)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT202,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT201}};
#define _OMC_LIT202 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT202)
#define _OMC_LIT203_data "OMSI_TYPE_BOOLEAN"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT203,17,_OMC_LIT203_data);
#define _OMC_LIT203 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT203)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT204,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT203}};
#define _OMC_LIT204 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT204)
#define _OMC_LIT205_data "OMSI_TYPE_STRING"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT205,16,_OMC_LIT205_data);
#define _OMC_LIT205 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT205)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT206,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT205}};
#define _OMC_LIT206 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT206)
#define _OMC_LIT207_data "OMSI_TYPE_UNKNOWN"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT207,17,_OMC_LIT207_data);
#define _OMC_LIT207 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT207)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT208,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT207}};
#define _OMC_LIT208 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT208)
#define _OMC_LIT209_data "(omsi_algebraic_system_t* algSystem, omsi_values* function_vars, omsi_values* pre_vars);"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT209,88,_OMC_LIT209_data);
#define _OMC_LIT209 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT209)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT210,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT209}};
#define _OMC_LIT210 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT210)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT211,1,1) {_OMC_LIT139}};
#define _OMC_LIT211 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT211)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT212,9,3) {&Tpl_IterOptions_ITER__OPTIONS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT211,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27}};
#define _OMC_LIT212 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT212)
#define _OMC_LIT213_data "/* Function instantiate omsi_algebraic_system_t struct */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT213,58,_OMC_LIT213_data);
#define _OMC_LIT213 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT213)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT214,2,1) {_OMC_LIT213,_OMC_LIT99}};
#define _OMC_LIT214 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT214)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT215,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT214,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT215 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT215)
#define _OMC_LIT216_data "(omsi_algebraic_system_t* algSystem, omsi_values* function_vars, omsi_values* pre_vars) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT216,90,_OMC_LIT216_data);
#define _OMC_LIT216 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT216)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT217,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT216}};
#define _OMC_LIT217 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT217)
#define _OMC_LIT218_data "algSystem->n_iteration_vars = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT218,30,_OMC_LIT218_data);
#define _OMC_LIT218 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT218)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT219,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT218}};
#define _OMC_LIT219 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT219)
#define _OMC_LIT220_data "algSystem->n_conditions = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT220,26,_OMC_LIT220_data);
#define _OMC_LIT220 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT220)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT221,2,1) {_OMC_LIT220,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT221 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT221)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT222,2,1) {_OMC_LIT98,_OMC_LIT221}};
#define _OMC_LIT222 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT222)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT223,2,1) {_OMC_LIT52,_OMC_LIT222}};
#define _OMC_LIT223 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT223)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT224,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT223,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT224 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT224)
#define _OMC_LIT225_data "algSystem->isLinear = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT225,22,_OMC_LIT225_data);
#define _OMC_LIT225 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT225)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT226,2,1) {_OMC_LIT225,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT226 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT226)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT227,2,1) {_OMC_LIT98,_OMC_LIT226}};
#define _OMC_LIT227 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT227)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT228,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT227,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT228 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT228)
#define _OMC_LIT229_data "/* Instantiate omsi_function_t jacobian */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT229,43,_OMC_LIT229_data);
#define _OMC_LIT229 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT229)
#define _OMC_LIT230_data "algSystem->jacobian = omsu_instantiate_omsi_function (function_vars, pre_vars);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT230,80,_OMC_LIT230_data);
#define _OMC_LIT230 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT230)
#define _OMC_LIT231_data "if (!algSystem->jacobian) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT231,28,_OMC_LIT231_data);
#define _OMC_LIT231 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT231)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT232,2,1) {_OMC_LIT231,_OMC_LIT179}};
#define _OMC_LIT232 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT232)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT233,2,1) {_OMC_LIT230,_OMC_LIT232}};
#define _OMC_LIT233 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT233)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT234,2,1) {_OMC_LIT229,_OMC_LIT233}};
#define _OMC_LIT234 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT234)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT235,2,1) {_OMC_LIT98,_OMC_LIT234}};
#define _OMC_LIT235 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT235)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT236,2,1) {_OMC_LIT52,_OMC_LIT235}};
#define _OMC_LIT236 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT236)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT237,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT236,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT237 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT237)
#define _OMC_LIT238_data "/* Instantiate omsi_function_t function */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT238,43,_OMC_LIT238_data);
#define _OMC_LIT238 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT238)
#define _OMC_LIT239_data "algSystem->functions = omsu_instantiate_omsi_function (function_vars, pre_vars);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT239,81,_OMC_LIT239_data);
#define _OMC_LIT239 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT239)
#define _OMC_LIT240_data "if (!algSystem->functions) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT240,29,_OMC_LIT240_data);
#define _OMC_LIT240 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT240)
#define _OMC_LIT241_data "if ("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT241,4,_OMC_LIT241_data);
#define _OMC_LIT241 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT241)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT242,2,1) {_OMC_LIT241,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT242 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT242)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT243,2,1) {_OMC_LIT141,_OMC_LIT242}};
#define _OMC_LIT243 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT243)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT244,2,1) {_OMC_LIT84,_OMC_LIT243}};
#define _OMC_LIT244 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT244)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT245,2,1) {_OMC_LIT240,_OMC_LIT244}};
#define _OMC_LIT245 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT245)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT246,2,1) {_OMC_LIT239,_OMC_LIT245}};
#define _OMC_LIT246 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT246)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT247,2,1) {_OMC_LIT238,_OMC_LIT246}};
#define _OMC_LIT247 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT247)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT248,2,1) {_OMC_LIT98,_OMC_LIT247}};
#define _OMC_LIT248 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT248)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT249,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT248,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT249 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT249)
#define _OMC_LIT250_data "_instantiate_resFunction_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT250,25,_OMC_LIT250_data);
#define _OMC_LIT250 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT250)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT251,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT250}};
#define _OMC_LIT251 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT251)
#define _OMC_LIT252_data "_OMSIFunc(algSystem->functions) == omsi_error){\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT252,48,_OMC_LIT252_data);
#define _OMC_LIT252 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT252)
#define _OMC_LIT253_data "/* ToDo: put into init functions */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT253,36,_OMC_LIT253_data);
#define _OMC_LIT253 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT253)
#define _OMC_LIT254_data "algSystem->functions->evaluate = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT254,33,_OMC_LIT254_data);
#define _OMC_LIT254 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT254)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT255,2,1) {_OMC_LIT254,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT255 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT255)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT256,2,1) {_OMC_LIT253,_OMC_LIT255}};
#define _OMC_LIT256 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT256)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT257,2,1) {_OMC_LIT98,_OMC_LIT256}};
#define _OMC_LIT257 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT257)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT258,2,1) {_OMC_LIT141,_OMC_LIT257}};
#define _OMC_LIT258 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT258)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT259,2,1) {_OMC_LIT84,_OMC_LIT258}};
#define _OMC_LIT259 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT259)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT260,2,1) {_OMC_LIT252,_OMC_LIT259}};
#define _OMC_LIT260 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT260)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT261,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT260,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT261 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT261)
#define _OMC_LIT262_data "_resFunction_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT262,13,_OMC_LIT262_data);
#define _OMC_LIT262 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT262)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT263,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT262}};
#define _OMC_LIT263 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT263)
#define _OMC_LIT264_data "algSystem->jacobian->evaluate = "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT264,32,_OMC_LIT264_data);
#define _OMC_LIT264 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT264)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT265,2,1) {_OMC_LIT264,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT265 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT265)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT266,2,1) {_OMC_LIT52,_OMC_LIT265}};
#define _OMC_LIT266 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT266)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT267,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT266,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT267 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT267)
#define _OMC_LIT268_data "algSystem->solver_data = NULL;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT268,31,_OMC_LIT268_data);
#define _OMC_LIT268 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT268)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT269,2,1) {_OMC_LIT268,_OMC_LIT159}};
#define _OMC_LIT269 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT269)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT270,2,1) {_OMC_LIT98,_OMC_LIT269}};
#define _OMC_LIT270 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT270)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT271,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT270,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT271 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT271)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT272,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT142,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT272 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT272)
#define _OMC_LIT273_data "resFunction_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT273,12,_OMC_LIT273_data);
#define _OMC_LIT273 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT273)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT274,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT273}};
#define _OMC_LIT274 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT274)
#define _OMC_LIT275_data ""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT275,0,_OMC_LIT275_data);
#define _OMC_LIT275 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT275)
#define _OMC_LIT276_data "NULL;"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT276,5,_OMC_LIT276_data);
#define _OMC_LIT276 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT276)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT277,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT276}};
#define _OMC_LIT277 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT277)
#define _OMC_LIT278_data "_derivativeMatFunc_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT278,19,_OMC_LIT278_data);
#define _OMC_LIT278 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT278)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT279,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT278}};
#define _OMC_LIT279 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT279)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT280,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT241}};
#define _OMC_LIT280 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT280)
#define _OMC_LIT281_data "_instantiate_derivativeMatFunc_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT281,31,_OMC_LIT281_data);
#define _OMC_LIT281 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT281)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT282,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT281}};
#define _OMC_LIT282 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT282)
#define _OMC_LIT283_data "_OMSIFunc(algSystem->jacobian) == omsi_error){\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT283,47,_OMC_LIT283_data);
#define _OMC_LIT283 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT283)
#define _OMC_LIT284_data "        return omsi_error;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT284,27,_OMC_LIT284_data);
#define _OMC_LIT284 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT284)
#define _OMC_LIT285_data "      }"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT285,7,_OMC_LIT285_data);
#define _OMC_LIT285 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT285)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT286,2,1) {_OMC_LIT285,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT286 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT286)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT287,2,1) {_OMC_LIT284,_OMC_LIT286}};
#define _OMC_LIT287 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT287)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT288,2,1) {_OMC_LIT283,_OMC_LIT287}};
#define _OMC_LIT288 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT288)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT289,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT288,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT289 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT289)
#define _OMC_LIT290_data "omsi_false"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT290,10,_OMC_LIT290_data);
#define _OMC_LIT290 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT290)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT291,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT290}};
#define _OMC_LIT291 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT291)
#define _OMC_LIT292_data "omsi_true"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT292,9,_OMC_LIT292_data);
#define _OMC_LIT292 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT292)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT293,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT292}};
#define _OMC_LIT293 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT293)
#define _OMC_LIT294_data "algSystem->zerocrossing_indices = NULL;"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT294,39,_OMC_LIT294_data);
#define _OMC_LIT294 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT294)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT295,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT294}};
#define _OMC_LIT295 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT295)
#define _OMC_LIT296_data "algSystem->zerocrossing_indices[listLength(zeroCrossingConditions)] = {"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT296,71,_OMC_LIT296_data);
#define _OMC_LIT296 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT296)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT297,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT296}};
#define _OMC_LIT297 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT297)
#define _OMC_LIT298_data "};"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT298,2,_OMC_LIT298_data);
#define _OMC_LIT298 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT298)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT299,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT298}};
#define _OMC_LIT299 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT299)
#define _OMC_LIT300_data "_derMat_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT300,8,_OMC_LIT300_data);
#define _OMC_LIT300 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT300)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT301,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT300}};
#define _OMC_LIT301 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT301)
#define _OMC_LIT302_data "/* derivative matrix code for algebraic system "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT302,47,_OMC_LIT302_data);
#define _OMC_LIT302 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT302)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT303,2,1) {_OMC_LIT302,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT303 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT303)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT304,2,1) {_OMC_LIT98,_OMC_LIT303}};
#define _OMC_LIT304 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT304)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT305,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT304,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT305 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT305)
#define _OMC_LIT306_data "*/\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT306,3,_OMC_LIT306_data);
#define _OMC_LIT306 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT306)
#define _OMC_LIT307_data "#include \""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT307,10,_OMC_LIT307_data);
#define _OMC_LIT307 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT307)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT308,2,1) {_OMC_LIT307,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT308 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT308)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT309,2,1) {_OMC_LIT306,_OMC_LIT308}};
#define _OMC_LIT309 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT309)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT310,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT309,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT310 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT310)
#define _OMC_LIT311_data ".h\"\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT311,4,_OMC_LIT311_data);
#define _OMC_LIT311 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT311)
#define _OMC_LIT312_data "#if defined(__cplusplus)\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT312,25,_OMC_LIT312_data);
#define _OMC_LIT312 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT312)
#define _OMC_LIT313_data "extern \"C\" {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT313,13,_OMC_LIT313_data);
#define _OMC_LIT313 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT313)
#define _OMC_LIT314_data "#endif\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT314,7,_OMC_LIT314_data);
#define _OMC_LIT314 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT314)
#define _OMC_LIT315_data "/* Instantiation and initalization */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT315,38,_OMC_LIT315_data);
#define _OMC_LIT315 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT315)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT316,2,1) {_OMC_LIT315,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT316 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT316)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT317,2,1) {_OMC_LIT98,_OMC_LIT316}};
#define _OMC_LIT317 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT317)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT318,2,1) {_OMC_LIT314,_OMC_LIT317}};
#define _OMC_LIT318 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT318)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT319,2,1) {_OMC_LIT313,_OMC_LIT318}};
#define _OMC_LIT319 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT319)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT320,2,1) {_OMC_LIT312,_OMC_LIT319}};
#define _OMC_LIT320 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT320)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT321,2,1) {_OMC_LIT98,_OMC_LIT320}};
#define _OMC_LIT321 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT321)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT322,2,1) {_OMC_LIT311,_OMC_LIT321}};
#define _OMC_LIT322 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT322)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT323,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT322,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT323 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT323)
#define _OMC_LIT324_data "/* derivative matrix evaluation */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT324,35,_OMC_LIT324_data);
#define _OMC_LIT324 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT324)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT325,2,1) {_OMC_LIT324,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT325 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT325)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT326,2,1) {_OMC_LIT98,_OMC_LIT325}};
#define _OMC_LIT326 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT326)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT327,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT326,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT327 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT327)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT328,2,1) {_OMC_LIT314,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT328 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT328)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT329,2,1) {_OMC_LIT141,_OMC_LIT328}};
#define _OMC_LIT329 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT329)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT330,2,1) {_OMC_LIT312,_OMC_LIT329}};
#define _OMC_LIT330 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT330)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT331,2,1) {_OMC_LIT98,_OMC_LIT330}};
#define _OMC_LIT331 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT331)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT332,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT331,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT332 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT332)
#define _OMC_LIT333_data "/"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT333,1,_OMC_LIT333_data);
#define _OMC_LIT333 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT333)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT334,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT333}};
#define _OMC_LIT334 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT334)
#define _OMC_LIT335_data ".c"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT335,2,_OMC_LIT335_data);
#define _OMC_LIT335 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT335)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT336,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT335}};
#define _OMC_LIT336 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT336)
#define _OMC_LIT337_data ".h"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT337,2,_OMC_LIT337_data);
#define _OMC_LIT337 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT337)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT338,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT337}};
#define _OMC_LIT338 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT338)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT339,2,1) {_OMC_LIT98,_OMC_LIT114}};
#define _OMC_LIT339 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT339)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT340,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT339,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT340 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT340)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT341,1,1) {_OMC_LIT340}};
#define _OMC_LIT341 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT341)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT342,9,3) {&Tpl_IterOptions_ITER__OPTIONS__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_REFSTRUCTLIT(mmc_none),_OMC_LIT341,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT27}};
#define _OMC_LIT342 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT342)
#define _OMC_LIT343_data "derivativeMatFunc_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT343,18,_OMC_LIT343_data);
#define _OMC_LIT343 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT343)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT344,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT343}};
#define _OMC_LIT344 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT344)
#define _OMC_LIT345_data "#if !defined("
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT345,13,_OMC_LIT345_data);
#define _OMC_LIT345 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT345)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT346,2,1) {_OMC_LIT345,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT346 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT346)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT347,2,1) {_OMC_LIT98,_OMC_LIT346}};
#define _OMC_LIT347 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT347)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT348,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT347,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT348 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT348)
#define _OMC_LIT349_data "_H)\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT349,4,_OMC_LIT349_data);
#define _OMC_LIT349 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT349)
#define _OMC_LIT350_data "#define "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT350,8,_OMC_LIT350_data);
#define _OMC_LIT350 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT350)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT351,2,1) {_OMC_LIT350,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT351 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT351)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT352,2,1) {_OMC_LIT349,_OMC_LIT351}};
#define _OMC_LIT352 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT352)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT353,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT352,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT353 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT353)
#define _OMC_LIT354_data "_H\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT354,3,_OMC_LIT354_data);
#define _OMC_LIT354 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT354)
#define _OMC_LIT355_data "#include <omsi.h>\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT355,18,_OMC_LIT355_data);
#define _OMC_LIT355 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT355)
#define _OMC_LIT356_data "#include <omsic.h>\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT356,19,_OMC_LIT356_data);
#define _OMC_LIT356 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT356)
#define _OMC_LIT357_data "#include <omsi_callbacks.h>\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT357,28,_OMC_LIT357_data);
#define _OMC_LIT357 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT357)
#define _OMC_LIT358_data "#include <omsi_global.h>\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT358,25,_OMC_LIT358_data);
#define _OMC_LIT358 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT358)
#define _OMC_LIT359_data "#include <stdlib.h>\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT359,20,_OMC_LIT359_data);
#define _OMC_LIT359 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT359)
#define _OMC_LIT360_data "#include <math.h>\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT360,18,_OMC_LIT360_data);
#define _OMC_LIT360 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT360)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT361,2,1) {_OMC_LIT360,_OMC_LIT114}};
#define _OMC_LIT361 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT361)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT362,2,1) {_OMC_LIT359,_OMC_LIT361}};
#define _OMC_LIT362 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT362)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT363,2,1) {_OMC_LIT98,_OMC_LIT362}};
#define _OMC_LIT363 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT363)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT364,2,1) {_OMC_LIT358,_OMC_LIT363}};
#define _OMC_LIT364 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT364)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT365,2,1) {_OMC_LIT357,_OMC_LIT364}};
#define _OMC_LIT365 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT365)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT366,2,1) {_OMC_LIT356,_OMC_LIT365}};
#define _OMC_LIT366 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT366)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT367,2,1) {_OMC_LIT355,_OMC_LIT366}};
#define _OMC_LIT367 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT367)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT368,2,1) {_OMC_LIT98,_OMC_LIT367}};
#define _OMC_LIT368 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT368)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT369,2,1) {_OMC_LIT354,_OMC_LIT368}};
#define _OMC_LIT369 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT369)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT370,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT369,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT370 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT370)
#define _OMC_LIT371_data "/* Function prototypes */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT371,26,_OMC_LIT371_data);
#define _OMC_LIT371 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT371)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT372,2,1) {_OMC_LIT371,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT372 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT372)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT373,2,1) {_OMC_LIT98,_OMC_LIT372}};
#define _OMC_LIT373 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT373)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT374,2,1) {_OMC_LIT314,_OMC_LIT373}};
#define _OMC_LIT374 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT374)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT375,2,1) {_OMC_LIT313,_OMC_LIT374}};
#define _OMC_LIT375 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT375)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT376,2,1) {_OMC_LIT312,_OMC_LIT375}};
#define _OMC_LIT376 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT376)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT377,2,1) {_OMC_LIT98,_OMC_LIT376}};
#define _OMC_LIT377 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT377)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT378,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT377,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT378 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT378)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT379,2,1) {_OMC_LIT98,_OMC_LIT328}};
#define _OMC_LIT379 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT379)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT380,2,1) {_OMC_LIT314,_OMC_LIT379}};
#define _OMC_LIT380 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT380)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT381,2,1) {_OMC_LIT141,_OMC_LIT380}};
#define _OMC_LIT381 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT381)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT382,2,1) {_OMC_LIT312,_OMC_LIT381}};
#define _OMC_LIT382 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT382)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT383,2,1) {_OMC_LIT98,_OMC_LIT382}};
#define _OMC_LIT383 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT383)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT384,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT383,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT384 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT384)
#define _OMC_LIT385_data "#include <omsi_solve_alg_system.h>"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT385,34,_OMC_LIT385_data);
#define _OMC_LIT385 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT385)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT386,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT385}};
#define _OMC_LIT386 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT386)
#define _OMC_LIT387_data "this_function"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT387,13,_OMC_LIT387_data);
#define _OMC_LIT387 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT387)
#define _OMC_LIT388_data " (struct omsi_function_t* this_function, const omsi_values* model_vars_and_params, void* data);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT388,96,_OMC_LIT388_data);
#define _OMC_LIT388 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT388)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT389,2,1) {_OMC_LIT388,_OMC_LIT99}};
#define _OMC_LIT389 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT389)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT390,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT389,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT390 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT390)
#define _OMC_LIT391_data "_algSystFunction_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT391,17,_OMC_LIT391_data);
#define _OMC_LIT391 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT391)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT392,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT391}};
#define _OMC_LIT392 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT392)
#define _OMC_LIT393_data "(omsi_algebraic_system_t* this_alg_system, const omsi_values* model_vars_and_params, void* data);"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT393,97,_OMC_LIT393_data);
#define _OMC_LIT393 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT393)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT394,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT393}};
#define _OMC_LIT394 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT394)
#define _OMC_LIT395_data "_algSyst_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT395,9,_OMC_LIT395_data);
#define _OMC_LIT395 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT395)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT396,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT395}};
#define _OMC_LIT396 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT396)
#define _OMC_LIT397_data "/* Algebraic system code */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT397,28,_OMC_LIT397_data);
#define _OMC_LIT397 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT397)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT398,2,1) {_OMC_LIT397,_OMC_LIT308}};
#define _OMC_LIT398 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT398)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT399,2,1) {_OMC_LIT98,_OMC_LIT398}};
#define _OMC_LIT399 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT399)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT400,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT399,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT400 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT400)
#define _OMC_LIT401_data "/* Instantiation and initialization */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT401,39,_OMC_LIT401_data);
#define _OMC_LIT401 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT401)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT402,2,1) {_OMC_LIT401,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT402 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT402)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT403,2,1) {_OMC_LIT98,_OMC_LIT402}};
#define _OMC_LIT403 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT403)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT404,2,1) {_OMC_LIT314,_OMC_LIT403}};
#define _OMC_LIT404 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT404)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT405,2,1) {_OMC_LIT313,_OMC_LIT404}};
#define _OMC_LIT405 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT405)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT406,2,1) {_OMC_LIT312,_OMC_LIT405}};
#define _OMC_LIT406 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT406)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT407,2,1) {_OMC_LIT98,_OMC_LIT406}};
#define _OMC_LIT407 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT407)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT408,2,1) {_OMC_LIT311,_OMC_LIT407}};
#define _OMC_LIT408 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT408)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT409,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT408,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT409 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT409)
#define _OMC_LIT410_data "/* Evaluation functions for "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT410,28,_OMC_LIT410_data);
#define _OMC_LIT410 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT410)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT411,2,1) {_OMC_LIT410,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT411 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT411)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT412,2,1) {_OMC_LIT98,_OMC_LIT411}};
#define _OMC_LIT412 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT412)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT413,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT412,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT413 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT413)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT414,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT100,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT414 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT414)
#define _OMC_LIT415_data " (struct omsi_function_t* this_function, const omsi_values* model_vars_and_params, void* data) {\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT415,97,_OMC_LIT415_data);
#define _OMC_LIT415 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT415)
#define _OMC_LIT416_data "  omsi_real* res = (omsi_real*) data;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT416,38,_OMC_LIT416_data);
#define _OMC_LIT416 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT416)
#define _OMC_LIT417_data "  omsi_unsigned_int i=0;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT417,25,_OMC_LIT417_data);
#define _OMC_LIT417 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT417)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT418,2,1) {_OMC_LIT417,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT418 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT418)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT419,2,1) {_OMC_LIT416,_OMC_LIT418}};
#define _OMC_LIT419 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT419)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT420,2,1) {_OMC_LIT415,_OMC_LIT419}};
#define _OMC_LIT420 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT420)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT421,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT420,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT421 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT421)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT422,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT159,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT422 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT422)
#define _OMC_LIT423_data "/* Algebraic system evaluation */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT423,34,_OMC_LIT423_data);
#define _OMC_LIT423 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT423)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT424,2,1) {_OMC_LIT0,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT424 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT424)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT425,2,1) {_OMC_LIT423,_OMC_LIT424}};
#define _OMC_LIT425 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT425)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT426,2,1) {_OMC_LIT98,_OMC_LIT425}};
#define _OMC_LIT426 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT426)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT427,2,1) {_OMC_LIT141,_OMC_LIT426}};
#define _OMC_LIT427 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT427)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT428,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT427,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT428 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT428)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT429,2,1) {_OMC_LIT306,_OMC_LIT99}};
#define _OMC_LIT429 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT429)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT430,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT429,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT430 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT430)
#define _OMC_LIT431_data "(omsi_algebraic_system_t* this_alg_system,\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT431,43,_OMC_LIT431_data);
#define _OMC_LIT431 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT431)
#define _OMC_LIT432_data "                          const omsi_values* model_vars_and_params,\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT432,68,_OMC_LIT432_data);
#define _OMC_LIT432 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT432)
#define _OMC_LIT433_data "                          void* data){\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT433,39,_OMC_LIT433_data);
#define _OMC_LIT433 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT433)
#define _OMC_LIT434_data "  /* Variables */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT434,18,_OMC_LIT434_data);
#define _OMC_LIT434 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT434)
#define _OMC_LIT435_data "  omsi_status status;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT435,22,_OMC_LIT435_data);
#define _OMC_LIT435 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT435)
#define _OMC_LIT436_data "  /* Log function call */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT436,26,_OMC_LIT436_data);
#define _OMC_LIT436 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT436)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT437,2,1) {_OMC_LIT436,_OMC_LIT105}};
#define _OMC_LIT437 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT437)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT438,2,1) {_OMC_LIT98,_OMC_LIT437}};
#define _OMC_LIT438 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT438)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT439,2,1) {_OMC_LIT435,_OMC_LIT438}};
#define _OMC_LIT439 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT439)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT440,2,1) {_OMC_LIT434,_OMC_LIT439}};
#define _OMC_LIT440 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT440)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT441,2,1) {_OMC_LIT98,_OMC_LIT440}};
#define _OMC_LIT441 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT441)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT442,2,1) {_OMC_LIT433,_OMC_LIT441}};
#define _OMC_LIT442 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT442)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT443,2,1) {_OMC_LIT432,_OMC_LIT442}};
#define _OMC_LIT443 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT443)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT444,2,1) {_OMC_LIT431,_OMC_LIT443}};
#define _OMC_LIT444 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT444)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT445,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT444,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT445 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT445)
#define _OMC_LIT446_data "\"fmi2Evaluate: Solve algebraic system "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT446,38,_OMC_LIT446_data);
#define _OMC_LIT446 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT446)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT447,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT446}};
#define _OMC_LIT447 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT447)
#define _OMC_LIT448_data "  /* call API function something */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT448,36,_OMC_LIT448_data);
#define _OMC_LIT448 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT448)
#define _OMC_LIT449_data "  status = omsi_solve_algebraic_system(this_alg_system, model_vars_and_params);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT449,80,_OMC_LIT449_data);
#define _OMC_LIT449 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT449)
#define _OMC_LIT450_data "  return status;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT450,17,_OMC_LIT450_data);
#define _OMC_LIT450 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT450)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT451,2,1) {_OMC_LIT141,_OMC_LIT331}};
#define _OMC_LIT451 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT451)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT452,2,1) {_OMC_LIT450,_OMC_LIT451}};
#define _OMC_LIT452 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT452)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT453,2,1) {_OMC_LIT98,_OMC_LIT452}};
#define _OMC_LIT453 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT453)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT454,2,1) {_OMC_LIT449,_OMC_LIT453}};
#define _OMC_LIT454 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT454)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT455,2,1) {_OMC_LIT448,_OMC_LIT454}};
#define _OMC_LIT455 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT455)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT456,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT455,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT456 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT456)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT457,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT307}};
#define _OMC_LIT457 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT457)
#define _OMC_LIT458_data ".h\""
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT458,3,_OMC_LIT458_data);
#define _OMC_LIT458 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT458)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT459,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT458}};
#define _OMC_LIT459 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT459)
#define _OMC_LIT460_data "virtual omsi_status initialize_omsi_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT460,36,_OMC_LIT460_data);
#define _OMC_LIT460 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT460)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT461,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT460}};
#define _OMC_LIT461 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT461)
#define _OMC_LIT462_data "_functions (struct omsi_function_t* omsi_function);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT462,52,_OMC_LIT462_data);
#define _OMC_LIT462 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT462)
#define _OMC_LIT463_data "virtual omsi_status omsi_"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT463,25,_OMC_LIT463_data);
#define _OMC_LIT463 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT463)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT464,2,1) {_OMC_LIT463,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT464 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT464)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT465,2,1) {_OMC_LIT462,_OMC_LIT464}};
#define _OMC_LIT465 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT465)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT466,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT465,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT466 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT466)
#define _OMC_LIT467_data "All(struct omsi_function_t* simulation, const omsi_values* model_vars_and_params, void* data);\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT467,95,_OMC_LIT467_data);
#define _OMC_LIT467 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT467)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT468,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT467}};
#define _OMC_LIT468 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT468)
#define _OMC_LIT469_data " "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT469,1,_OMC_LIT469_data);
#define _OMC_LIT469 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT469)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT470,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT469}};
#define _OMC_LIT470 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT470)
#define _OMC_LIT471_data "TODO: Equation  SES_ALGEBRAIC_SYSTEM not implemented yet"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT471,56,_OMC_LIT471_data);
#define _OMC_LIT471 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT471)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT472,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT471}};
#define _OMC_LIT472 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT472)
#define _OMC_LIT473_data "TODO: Equation not implemented"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT473,30,_OMC_LIT473_data);
#define _OMC_LIT473 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT473)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT474,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT473}};
#define _OMC_LIT474 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT474)
#define _OMC_LIT475_data ", model_vars_and_params"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT475,23,_OMC_LIT475_data);
#define _OMC_LIT475 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT475)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT476,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT475}};
#define _OMC_LIT476 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT476)
#define _OMC_LIT477_data ", model_vars_and_params, &res[i++]"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT477,34,_OMC_LIT477_data);
#define _OMC_LIT477 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT477)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT478,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT477}};
#define _OMC_LIT478 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT478)
#define _OMC_LIT479_data "&"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT479,1,_OMC_LIT479_data);
#define _OMC_LIT479 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT479)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT480,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT479}};
#define _OMC_LIT480 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT480)
#define _OMC_LIT481_data "->algebraic_system_t["
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT481,21,_OMC_LIT481_data);
#define _OMC_LIT481 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT481)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT482,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT481}};
#define _OMC_LIT482 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT482)
#define _OMC_LIT483_data "], model_vars_and_params, "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT483,26,_OMC_LIT483_data);
#define _OMC_LIT483 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT483)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT484,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT483}};
#define _OMC_LIT484 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT484)
#define _OMC_LIT485_data "->function_vars"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT485,15,_OMC_LIT485_data);
#define _OMC_LIT485 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT485)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT486,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT485}};
#define _OMC_LIT486 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT486)
#define _OMC_LIT487_data "allEqns"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT487,7,_OMC_LIT487_data);
#define _OMC_LIT487 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT487)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT488,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT275}};
#define _OMC_LIT488 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT488)
#define _OMC_LIT489_data "_allEqns(struct omsi_function_t* simulation, const omsi_values* model_vars_and_params, void* data);"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT489,99,_OMC_LIT489_data);
#define _OMC_LIT489 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT489)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT490,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT489}};
#define _OMC_LIT490 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT490)
#define _OMC_LIT491_data "  /* All Equations Code */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT491,27,_OMC_LIT491_data);
#define _OMC_LIT491 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT491)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT492,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT491}};
#define _OMC_LIT492 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT492)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT493,2,5) {&Tpl_StringToken_ST__LINE__desc,_OMC_LIT311}};
#define _OMC_LIT493 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT493)
#define _OMC_LIT494_data "/* Instantiation of omsi_function_t */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT494,39,_OMC_LIT494_data);
#define _OMC_LIT494 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT494)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT495,2,1) {_OMC_LIT494,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT495 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT495)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT496,2,1) {_OMC_LIT98,_OMC_LIT495}};
#define _OMC_LIT496 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT496)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT497,2,1) {_OMC_LIT314,_OMC_LIT496}};
#define _OMC_LIT497 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT497)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT498,2,1) {_OMC_LIT313,_OMC_LIT497}};
#define _OMC_LIT498 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT498)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT499,2,1) {_OMC_LIT312,_OMC_LIT498}};
#define _OMC_LIT499 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT499)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT500,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT499,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT500 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT500)
#define _OMC_LIT501_data "/* Evaluation functions for each equation */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT501,45,_OMC_LIT501_data);
#define _OMC_LIT501 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT501)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT502,2,1) {_OMC_LIT501,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT502 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT502)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT503,2,1) {_OMC_LIT98,_OMC_LIT502}};
#define _OMC_LIT503 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT503)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT504,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT503,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT504 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT504)
#define _OMC_LIT505_data "/* Equations evaluation */\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT505,27,_OMC_LIT505_data);
#define _OMC_LIT505 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT505)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT506,2,1) {_OMC_LIT505,_OMC_LIT99}};
#define _OMC_LIT506 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT506)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT507,2,1) {_OMC_LIT98,_OMC_LIT506}};
#define _OMC_LIT507 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT507)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT508,2,1) {_OMC_LIT98,_OMC_LIT507}};
#define _OMC_LIT508 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT508)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT509,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT508,MMC_IMMEDIATE(MMC_TAGFIXNUM(0 /* false */))}};
#define _OMC_LIT509 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT509)
#define _OMC_LIT510_data "_allEqns(struct omsi_function_t* "
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT510,33,_OMC_LIT510_data);
#define _OMC_LIT510 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT510)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT511,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT510}};
#define _OMC_LIT511 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT511)
#define _OMC_LIT512_data ", const omsi_values* model_vars_and_params, void* data){\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT512,57,_OMC_LIT512_data);
#define _OMC_LIT512 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT512)
#define _OMC_LIT513_data "  omsi_status status, new_status;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT513,34,_OMC_LIT513_data);
#define _OMC_LIT513 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT513)
#define _OMC_LIT514_data "  status = omsi_ok;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT514,20,_OMC_LIT514_data);
#define _OMC_LIT514 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT514)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT515,2,1) {_OMC_LIT514,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT515 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT515)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT516,2,1) {_OMC_LIT98,_OMC_LIT515}};
#define _OMC_LIT516 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT516)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT517,2,1) {_OMC_LIT513,_OMC_LIT516}};
#define _OMC_LIT517 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT517)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT518,2,1) {_OMC_LIT434,_OMC_LIT517}};
#define _OMC_LIT518 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT518)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT519,2,1) {_OMC_LIT98,_OMC_LIT518}};
#define _OMC_LIT519 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT519)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT520,2,1) {_OMC_LIT98,_OMC_LIT519}};
#define _OMC_LIT520 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT520)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT521,2,1) {_OMC_LIT512,_OMC_LIT520}};
#define _OMC_LIT521 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT521)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT522,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT521,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT522 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT522)
#define _OMC_LIT523_data "return status;\n"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT523,15,_OMC_LIT523_data);
#define _OMC_LIT523 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT523)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT524,2,1) {_OMC_LIT523,MMC_REFSTRUCTLIT(mmc_nil)}};
#define _OMC_LIT524 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT524)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT525,2,1) {_OMC_LIT98,_OMC_LIT524}};
#define _OMC_LIT525 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT525)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT526,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT525,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT526 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT526)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT527,3,6) {&Tpl_StringToken_ST__STRING__LIST__desc,_OMC_LIT451,MMC_IMMEDIATE(MMC_TAGFIXNUM(1 /* true */))}};
#define _OMC_LIT527 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT527)
#define _OMC_LIT528_data "new_status = omsi_ok;"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT528,21,_OMC_LIT528_data);
#define _OMC_LIT528 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT528)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT529,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT528}};
#define _OMC_LIT529 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT529)
#define _OMC_LIT530_data "sim_eqns"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT530,8,_OMC_LIT530_data);
#define _OMC_LIT530 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT530)
#define _OMC_LIT531_data "_sim_eqns.c"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT531,11,_OMC_LIT531_data);
#define _OMC_LIT531 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT531)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT532,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT531}};
#define _OMC_LIT532 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT532)
#define _OMC_LIT533_data "init_eqns"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT533,9,_OMC_LIT533_data);
#define _OMC_LIT533 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT533)
#define _OMC_LIT534_data "_init_eqns.c"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT534,12,_OMC_LIT534_data);
#define _OMC_LIT534 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT534)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT535,2,4) {&Tpl_StringToken_ST__STRING__desc,_OMC_LIT534}};
#define _OMC_LIT535 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT535)
#include "util/modelica.h"

#include "CodegenOMSI_common_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_CodegenOMSI__common_lm__94(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_metatype __omcQ_24in_5Fa_5FauxFunction, modelica_metatype __omcQ_24in_5Fa_5FvarDecls, modelica_metatype *out_a_auxFunction, modelica_metatype *out_a_varDecls);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__94,2,0) {(void*) boxptr_CodegenOMSI__common_lm__94,0}};
#define boxvar_CodegenOMSI__common_lm__94 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__94)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__93(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_timeEvent, modelica_integer _in_a_i0, modelica_metatype _in_a_auxFunction, modelica_metatype _in_a_varDecls, modelica_metatype *out_out_a_auxFunction, modelica_metatype *out_out_a_varDecls);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__93(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_timeEvent, modelica_metatype _in_a_i0, modelica_metatype _in_a_auxFunction, modelica_metatype _in_a_varDecls, modelica_metatype *out_out_a_auxFunction, modelica_metatype *out_out_a_varDecls);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__93,2,0) {(void*) boxptr_CodegenOMSI__common_fun__93,0}};
#define boxvar_CodegenOMSI__common_fun__93 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__93)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__91(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_string _a_omsiName, modelica_string _a_FileNamePrefix);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__91,2,0) {(void*) boxptr_CodegenOMSI__common_lm__91,0}};
#define boxvar_CodegenOMSI__common_lm__91 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__91)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__90(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_equation, modelica_integer _in_a_i0, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__90(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_equation, modelica_metatype _in_a_i0, modelica_metatype _in_a_omsiName, modelica_metatype _in_a_FileNamePrefix);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__90,2,0) {(void*) boxptr_CodegenOMSI__common_fun__90,0}};
#define boxvar_CodegenOMSI__common_fun__90 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__90)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__88(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_string _in_a_functionName, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_includes, modelica_boolean _in_a_hasLocalVars, modelica_string _in_a_omsiName, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__88(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_functionName, modelica_metatype _in_a_FileNamePrefix, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_includes, modelica_metatype _in_a_hasLocalVars, modelica_metatype _in_a_omsiName, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__88,2,0) {(void*) boxptr_CodegenOMSI__common_fun__88,0}};
#define boxvar_CodegenOMSI__common_fun__88 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__88)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__87(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_mArg);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__87(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_mArg);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__87,2,0) {(void*) boxptr_CodegenOMSI__common_fun__87,0}};
#define boxvar_CodegenOMSI__common_fun__87 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__87)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__86(threadData_t *threadData, modelica_metatype _in_txt, modelica_boolean _in_a_hasLocalVars, modelica_integer _in_a_nAllVars);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__86(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_hasLocalVars, modelica_metatype _in_a_nAllVars);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__86,2,0) {(void*) boxptr_CodegenOMSI__common_fun__86,0}};
#define boxvar_CodegenOMSI__common_fun__86 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__86)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__85(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_a_nAlgebraicSystems, modelica_metatype _in_a_algSystemInit);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__85(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_nAlgebraicSystems, modelica_metatype _in_a_algSystemInit);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__85,2,0) {(void*) boxptr_CodegenOMSI__common_fun__85,0}};
#define boxvar_CodegenOMSI__common_fun__85 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__85)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__84(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_a_nAlgebraicSystems);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__84(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_nAlgebraicSystems);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__84,2,0) {(void*) boxptr_CodegenOMSI__common_fun__84,0}};
#define boxvar_CodegenOMSI__common_fun__84 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__84)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__82(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_mArg, modelica_metatype _in_a_stringBuffer, modelica_string _in_a_targetName);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__82(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_mArg, modelica_metatype _in_a_stringBuffer, modelica_metatype _in_a_targetName);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__82,2,0) {(void*) boxptr_CodegenOMSI__common_fun__82,0}};
#define boxvar_CodegenOMSI__common_fun__82 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__82)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__81(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_string _a_omsiFuncName);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__81,2,0) {(void*) boxptr_CodegenOMSI__common_lm__81,0}};
#define boxvar_CodegenOMSI__common_lm__81 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__81)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__80(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_variable, modelica_metatype _in_a_stringIndex, modelica_metatype _in_a_stringName, modelica_metatype *out_out_a_stringIndex, modelica_metatype *out_out_a_stringName);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__80,2,0) {(void*) boxptr_CodegenOMSI__common_fun__80,0}};
#define boxvar_CodegenOMSI__common_fun__80 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__80)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__79(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_variable);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__79,2,0) {(void*) boxptr_CodegenOMSI__common_fun__79,0}};
#define boxvar_CodegenOMSI__common_fun__79 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__79)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__77(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_integer _in_a_algSysIndex, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__77(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_metatype _in_a_algSysIndex, modelica_metatype _in_a_omsiName, modelica_metatype _in_a_FileNamePrefix);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__77,2,0) {(void*) boxptr_CodegenOMSI__common_fun__77,0}};
#define boxvar_CodegenOMSI__common_fun__77 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__77)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__76(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_integer _in_a_algSysIndex, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__76(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_metatype _in_a_algSysIndex, modelica_metatype _in_a_omsiName, modelica_metatype _in_a_FileNamePrefix);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__76,2,0) {(void*) boxptr_CodegenOMSI__common_fun__76,0}};
#define boxvar_CodegenOMSI__common_fun__76 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__76)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__75(threadData_t *threadData, modelica_metatype _in_txt, modelica_boolean _in_a_linearSystem);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__75(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_linearSystem);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__75,2,0) {(void*) boxptr_CodegenOMSI__common_fun__75,0}};
#define boxvar_CodegenOMSI__common_fun__75 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__75)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__74(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_mArg, modelica_metatype _in_a_zeroCrossingIndices);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__74(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_mArg, modelica_metatype _in_a_zeroCrossingIndices);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__74,2,0) {(void*) boxptr_CodegenOMSI__common_fun__74,0}};
#define boxvar_CodegenOMSI__common_fun__74 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__74)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__73(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__73,2,0) {(void*) boxptr_CodegenOMSI__common_lm__73,0}};
#define boxvar_CodegenOMSI__common_lm__73 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__73)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__71(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_string _in_a_omsiName, modelica_metatype _in_a_includes, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_FileNamePrefix, modelica_string _in_a_index, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_functionPrototypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__71,2,0) {(void*) boxptr_CodegenOMSI__common_fun__71,0}};
#define boxvar_CodegenOMSI__common_fun__71 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__71)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__70(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_string _a_omsiName, modelica_metatype __omcQ_24in_5Fa_5Fincludes, modelica_metatype __omcQ_24in_5Fa_5FfunctionPrototypes, modelica_string _a_FileNamePrefix, modelica_string _a_index, modelica_metatype *out_a_includes, modelica_metatype *out_a_functionPrototypes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__70,2,0) {(void*) boxptr_CodegenOMSI__common_lm__70,0}};
#define boxvar_CodegenOMSI__common_lm__70 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__70)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__67(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_equationSystem, modelica_metatype _in_a_fullPathPrefix, modelica_metatype _in_a_fileNamePrefix, modelica_metatype _in_a_residualCall, modelica_metatype _in_a_functionCall, modelica_metatype _in_a_evaluationCode, modelica_string _in_a_omsiName, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_includes, modelica_metatype *out_out_a_residualCall, modelica_metatype *out_out_a_functionCall, modelica_metatype *out_out_a_evaluationCode, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__67,2,0) {(void*) boxptr_CodegenOMSI__common_fun__67,0}};
#define boxvar_CodegenOMSI__common_fun__67 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__67)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__65(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_FunctionnamePrefix, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__65,2,0) {(void*) boxptr_CodegenOMSI__common_fun__65,0}};
#define boxvar_CodegenOMSI__common_fun__65 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__65)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__64(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_metatype __omcQ_24in_5Fa_5FfunctionPrototypes, modelica_metatype _a_context, modelica_string _a_FunctionnamePrefix, modelica_string _a_FileNamePrefix, modelica_metatype __omcQ_24in_5Fa_5FevaluationCode, modelica_metatype *out_a_functionPrototypes, modelica_metatype *out_a_evaluationCode);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__64,2,0) {(void*) boxptr_CodegenOMSI__common_lm__64,0}};
#define boxvar_CodegenOMSI__common_lm__64 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__64)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__63(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_eqsystem, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_context, modelica_string _in_a_FunctionnamePrefix, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__63,2,0) {(void*) boxptr_CodegenOMSI__common_fun__63,0}};
#define boxvar_CodegenOMSI__common_fun__63 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__63)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__61(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_fullPathPrefix, modelica_metatype _in_a_fileNamePrefix, modelica_metatype _in_a_includes, modelica_metatype _in_a_residualCall, modelica_string _in_a_omsiName, modelica_string _in_a_funcCallArgName, modelica_metatype _in_a_functionCall, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_modelFunctionnamePrefixStr, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_residualCall, modelica_metatype *out_out_a_functionCall, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__61,2,0) {(void*) boxptr_CodegenOMSI__common_fun__61,0}};
#define boxvar_CodegenOMSI__common_fun__61 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__61)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__60(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_metatype _a_fullPathPrefix, modelica_metatype _a_fileNamePrefix, modelica_metatype __omcQ_24in_5Fa_5Fincludes, modelica_metatype __omcQ_24in_5Fa_5FresidualCall, modelica_string _a_omsiName, modelica_string _a_funcCallArgName, modelica_metatype __omcQ_24in_5Fa_5FfunctionCall, modelica_metatype __omcQ_24in_5Fa_5FfunctionPrototypes, modelica_metatype _a_context, modelica_string _a_modelFunctionnamePrefixStr, modelica_string _a_FileNamePrefix, modelica_metatype __omcQ_24in_5Fa_5FevaluationCode, modelica_metatype *out_a_includes, modelica_metatype *out_a_residualCall, modelica_metatype *out_a_functionCall, modelica_metatype *out_a_functionPrototypes, modelica_metatype *out_a_evaluationCode);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__60,2,0) {(void*) boxptr_CodegenOMSI__common_lm__60,0}};
#define boxvar_CodegenOMSI__common_lm__60 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_lm__60)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__59(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_eqsystem, modelica_metatype _in_a_fullPathPrefix, modelica_metatype _in_a_fileNamePrefix, modelica_metatype _in_a_includes, modelica_metatype _in_a_residualCall, modelica_string _in_a_omsiName, modelica_string _in_a_funcCallArgName, modelica_metatype _in_a_functionCall, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_context, modelica_string _in_a_modelFunctionnamePrefixStr, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_residualCall, modelica_metatype *out_out_a_functionCall, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__59,2,0) {(void*) boxptr_CodegenOMSI__common_fun__59,0}};
#define boxvar_CodegenOMSI__common_fun__59 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__59)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__56(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_functionCall, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype _in_a_initializationCode, modelica_metatype _in_a_headerFileName);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__56,2,0) {(void*) boxptr_CodegenOMSI__common_fun__56,0}};
#define boxvar_CodegenOMSI__common_fun__56 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__56)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__55(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_a_nAlgebraicSystems);
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__55(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_nAlgebraicSystems);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__55,2,0) {(void*) boxptr_CodegenOMSI__common_fun__55,0}};
#define boxvar_CodegenOMSI__common_fun__55 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__55)
PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__53(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_simCode, modelica_metatype _in_a_modelNameOMSIC);
static const MMC_DEFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__53,2,0) {(void*) boxptr_CodegenOMSI__common_fun__53,0}};
#define boxvar_CodegenOMSI__common_fun__53 MMC_REFSTRUCTLIT(boxvar_lit_CodegenOMSI__common_fun__53)

DLLDirection
modelica_metatype omc_CodegenOMSI__common_insertCopyrightOpenModelica(threadData_t *threadData, modelica_metatype _txt)
{
  modelica_metatype _out_txt = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  _out_txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT25);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_functionInitSample(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_timeEvents, modelica_string _a_fileNamePrefix)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _l_body = NULL;
  modelica_metatype _l_auxFunction = NULL;
  modelica_metatype _l_varDecls = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _l_body has no default value.
  // _l_auxFunction has no default value.
  // _l_varDecls has no default value.
  _l_varDecls = _OMC_LIT26;

  _l_auxFunction = _OMC_LIT26;

  _l_body = omc_Tpl_pushIter(threadData, _OMC_LIT26, _OMC_LIT28);

  _l_body = omc_CodegenOMSI__common_lm__94(threadData, _l_body, _a_timeEvents, _l_auxFunction, _l_varDecls ,&_l_auxFunction ,&_l_varDecls);

  _l_body = omc_Tpl_popIter(threadData, _l_body);

  _out_txt = omc_Tpl_writeText(threadData, _txt, _l_auxFunction);

  _out_txt = omc_Tpl_softNewLine(threadData, _out_txt);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT33);

  _out_txt = omc_Tpl_writeStr(threadData, _out_txt, _a_fileNamePrefix);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT38);

  _out_txt = omc_Tpl_pushBlock(threadData, _out_txt, _OMC_LIT39);

  _out_txt = omc_Tpl_writeText(threadData, _out_txt, _l_varDecls);

  _out_txt = omc_Tpl_softNewLine(threadData, _out_txt);

  _out_txt = omc_Tpl_writeText(threadData, _out_txt, _l_body);

  _out_txt = omc_Tpl_softNewLine(threadData, _out_txt);

  _out_txt = omc_Tpl_popBlock(threadData, _out_txt);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT41);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__94(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_metatype __omcQ_24in_5Fa_5FauxFunction, modelica_metatype __omcQ_24in_5Fa_5FvarDecls, modelica_metatype *out_a_auxFunction, modelica_metatype *out_a_varDecls)
{
  modelica_metatype _txt = NULL;
  modelica_metatype _a_auxFunction = NULL;
  modelica_metatype _a_varDecls = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _txt = __omcQ_24in_5Ftxt;
  _a_auxFunction = __omcQ_24in_5Fa_5FauxFunction;
  _a_varDecls = __omcQ_24in_5Fa_5FvarDecls;
  {
    modelica_metatype _lstElt_94;
    for (tmpMeta1 = _items; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _lstElt_94 = MMC_CAR(tmpMeta1);
      
      
      
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _lstElt_94;
        {
          modelica_integer _x_i0;
          modelica_metatype _i_timeEvent = NULL;
          volatile mmc_switch_type tmp5;
          int tmp6;
          // _x_i0 has no default value.
          // _i_timeEvent has no default value.
          tmp5 = 0;
          for (; tmp5 < 1; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              
              _i_timeEvent = tmp5_1;
              /* Pattern matching succeeded */
              _x_i0 = omc_Tpl_getIteri__i0(threadData, _txt);

              _txt = omc_CodegenOMSI__common_fun__93(threadData, _txt, _i_timeEvent, _x_i0, _a_auxFunction, _a_varDecls ,&_a_auxFunction ,&_a_varDecls);

              _txt = omc_Tpl_nextIter(threadData, _txt);
              tmpMeta[0+0] = _txt;
              tmpMeta[0+1] = _a_auxFunction;
              tmpMeta[0+2] = _a_varDecls;
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _txt = tmpMeta[0+0];
      _a_auxFunction = tmpMeta[0+1];
      _a_varDecls = tmpMeta[0+2];
    }
  }
  _return: OMC_LABEL_UNUSED
  if (out_a_auxFunction) { *out_a_auxFunction = _a_auxFunction; }
  if (out_a_varDecls) { *out_a_varDecls = _a_varDecls; }
  return _txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__93(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_timeEvent, modelica_integer _in_a_i0, modelica_metatype _in_a_auxFunction, modelica_metatype _in_a_varDecls, modelica_metatype *out_out_a_auxFunction, modelica_metatype *out_out_a_varDecls)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_auxFunction = NULL;
  modelica_metatype _out_a_varDecls = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_auxFunction has no default value.
  // _out_a_varDecls has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_integer tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_timeEvent;
    tmp4_3 = _in_a_i0;
    tmp4_4 = _in_a_auxFunction;
    tmp4_5 = _in_a_varDecls;
    {
      modelica_metatype _txt = NULL;
      modelica_integer _a_i0;
      modelica_metatype _a_auxFunction = NULL;
      modelica_metatype _a_varDecls = NULL;
      modelica_integer _i_index;
      modelica_metatype _i_intervalExp = NULL;
      modelica_metatype _i_startExp = NULL;
      modelica_metatype _l_e2 = NULL;
      modelica_metatype _l_e1 = NULL;
      modelica_metatype _l_preExp = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_i0 has no default value.
      // _a_auxFunction has no default value.
      // _a_varDecls has no default value.
      // _i_index has no default value.
      // _i_intervalExp has no default value.
      // _i_startExp has no default value.
      // _l_e2 has no default value.
      // _l_e1 has no default value.
      // _l_preExp has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,4) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          
          _i_index = tmp7  /* pattern as ty=Integer */;
          _i_startExp = tmpMeta8;
          _i_intervalExp = tmpMeta9;
          _txt = tmp4_1;
          _a_i0 = tmp4_3;
          _a_auxFunction = tmp4_4;
          _a_varDecls = tmp4_5;
          /* Pattern matching succeeded */
          _l_preExp = _OMC_LIT26;

          _l_e1 = omc_CodegenCFunctions_daeExp(threadData, _OMC_LIT26, _i_startExp, _OMC_LIT42, _l_preExp, _a_varDecls, _a_auxFunction ,&_l_preExp ,&_a_varDecls ,&_a_auxFunction);

          _l_e2 = omc_CodegenCFunctions_daeExp(threadData, _OMC_LIT26, _i_intervalExp, _OMC_LIT42, _l_preExp, _a_varDecls, _a_auxFunction ,&_l_preExp ,&_a_varDecls ,&_a_auxFunction);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_preExp);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT44);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_index));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT49);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_i0));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT51);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_index));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT54);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_i0));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT56);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_e1);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT54);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_i0));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT58);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_e2);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT60);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_auxFunction;
          tmpMeta[0+2] = _a_varDecls;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_auxFunction = tmp4_4;
          _a_varDecls = tmp4_5;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_auxFunction;
          tmpMeta[0+2] = _a_varDecls;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_auxFunction = tmpMeta[0+1];
  _out_a_varDecls = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_auxFunction) { *out_out_a_auxFunction = _out_a_auxFunction; }
  if (out_out_a_varDecls) { *out_out_a_varDecls = _out_a_varDecls; }
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__93(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_timeEvent, modelica_metatype _in_a_i0, modelica_metatype _in_a_auxFunction, modelica_metatype _in_a_varDecls, modelica_metatype *out_out_a_auxFunction, modelica_metatype *out_out_a_varDecls)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_i0);
  _out_txt = omc_CodegenOMSI__common_fun__93(threadData, _in_txt, _in_a_timeEvent, tmp1, _in_a_auxFunction, _in_a_varDecls, out_out_a_auxFunction, out_out_a_varDecls);
  /* skip box _out_txt; Tpl.Text */
  /* skip box _out_a_auxFunction; Tpl.Text */
  /* skip box _out_a_varDecls; Tpl.Text */
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateAlgebraicSystemInstantiation(threadData_t *threadData, modelica_metatype _txt, modelica_string _a_FileNamePrefix, modelica_integer _a_nAlgebraicSystems, modelica_metatype _a_equations, modelica_string _a_omsiName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _l_initialization = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _l_initialization has no default value.
  _l_initialization = omc_Tpl_pushIter(threadData, _OMC_LIT26, _OMC_LIT62);

  _l_initialization = omc_CodegenOMSI__common_lm__91(threadData, _l_initialization, _a_equations, _a_omsiName, _a_FileNamePrefix);

  _l_initialization = omc_Tpl_popIter(threadData, _l_initialization);

  _out_txt = omc_Tpl_writeText(threadData, _txt, _l_initialization);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
modelica_metatype boxptr_CodegenOMSI__common_generateAlgebraicSystemInstantiation(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_FileNamePrefix, modelica_metatype _a_nAlgebraicSystems, modelica_metatype _a_equations, modelica_metatype _a_omsiName)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_a_nAlgebraicSystems);
  _out_txt = omc_CodegenOMSI__common_generateAlgebraicSystemInstantiation(threadData, _txt, _a_FileNamePrefix, tmp1, _a_equations, _a_omsiName);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__91(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_string _a_omsiName, modelica_string _a_FileNamePrefix)
{
  modelica_metatype _txt = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _txt = __omcQ_24in_5Ftxt;
  {
    modelica_metatype _lstElt_91;
    for (tmpMeta1 = _items; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _lstElt_91 = MMC_CAR(tmpMeta1);
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _lstElt_91;
        {
          modelica_integer _x_i0;
          modelica_metatype _i_equation = NULL;
          volatile mmc_switch_type tmp5;
          int tmp6;
          // _x_i0 has no default value.
          // _i_equation has no default value.
          tmp5 = 0;
          for (; tmp5 < 1; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              
              _i_equation = tmp5_1;
              /* Pattern matching succeeded */
              _x_i0 = omc_Tpl_getIteri__i0(threadData, _txt);

              _txt = omc_CodegenOMSI__common_fun__90(threadData, _txt, _i_equation, _x_i0, _a_omsiName, _a_FileNamePrefix);
              tmpMeta2 = omc_Tpl_nextIter(threadData, _txt);
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _txt = tmpMeta2;
    }
  }
  _return: OMC_LABEL_UNUSED
  return _txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__90(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_equation, modelica_integer _in_a_i0, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_integer tmp4_3;modelica_string tmp4_4;modelica_string tmp4_5;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_equation;
    tmp4_3 = _in_a_i0;
    tmp4_4 = _in_a_omsiName;
    tmp4_5 = _in_a_FileNamePrefix;
    {
      modelica_metatype _txt = NULL;
      modelica_integer _a_i0;
      modelica_string _a_omsiName = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_integer _i_algSysIndex;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_i0 has no default value.
      // _a_omsiName has no default value.
      // _a_FileNamePrefix has no default value.
      // _i_algSysIndex has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,11) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          
          _i_algSysIndex = tmp7  /* pattern as ty=Integer */;
          _txt = tmp4_1;
          _a_i0 = tmp4_3;
          _a_omsiName = tmp4_4;
          _a_FileNamePrefix = tmp4_5;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT66);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT68);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_i0));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT73);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_i0));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT78);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT79);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT81);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT66);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT83);

          _txt = omc_Tpl_popBlock(threadData, _txt);
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT87);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__90(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_equation, modelica_metatype _in_a_i0, modelica_metatype _in_a_omsiName, modelica_metatype _in_a_FileNamePrefix)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_i0);
  _out_txt = omc_CodegenOMSI__common_fun__90(threadData, _in_txt, _in_a_equation, tmp1, _in_a_omsiName, _in_a_FileNamePrefix);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateInitalizationOMSIFunction(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_omsiFunction, modelica_string _a_functionName, modelica_string _a_FileNamePrefix, modelica_string _a_modelFunctionnamePrefixStr, modelica_metatype _a_functionPrototypes, modelica_metatype _a_includes, modelica_boolean _a_hasLocalVars, modelica_string _a_omsiName, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_includes = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_includes has no default value.
  _out_txt = omc_CodegenOMSI__common_fun__88(threadData, _txt, _a_omsiFunction, _a_functionName, _a_FileNamePrefix, _a_functionPrototypes, _a_includes, _a_hasLocalVars, _a_omsiName ,&_out_a_functionPrototypes ,&_out_a_includes);
  _return: OMC_LABEL_UNUSED
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  return _out_txt;
}
modelica_metatype boxptr_CodegenOMSI__common_generateInitalizationOMSIFunction(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_omsiFunction, modelica_metatype _a_functionName, modelica_metatype _a_FileNamePrefix, modelica_metatype _a_modelFunctionnamePrefixStr, modelica_metatype _a_functionPrototypes, modelica_metatype _a_includes, modelica_metatype _a_hasLocalVars, modelica_metatype _a_omsiName, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_a_hasLocalVars);
  _out_txt = omc_CodegenOMSI__common_generateInitalizationOMSIFunction(threadData, _txt, _a_omsiFunction, _a_functionName, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, _a_functionPrototypes, _a_includes, tmp1, _a_omsiName, out_out_a_functionPrototypes, out_out_a_includes);
  /* skip box _out_txt; Tpl.Text */
  /* skip box _out_a_functionPrototypes; Tpl.Text */
  /* skip box _out_a_includes; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__88(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_string _in_a_functionName, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_includes, modelica_boolean _in_a_hasLocalVars, modelica_string _in_a_omsiName, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_includes has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_string tmp4_3;modelica_string tmp4_4;modelica_metatype tmp4_5;modelica_metatype tmp4_6;modelica_boolean tmp4_7;modelica_string tmp4_8;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_omsiFunction;
    tmp4_3 = _in_a_functionName;
    tmp4_4 = _in_a_FileNamePrefix;
    tmp4_5 = _in_a_functionPrototypes;
    tmp4_6 = _in_a_includes;
    tmp4_7 = _in_a_hasLocalVars;
    tmp4_8 = _in_a_omsiName;
    {
      modelica_metatype _txt = NULL;
      modelica_string _a_functionName = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_metatype _a_includes = NULL;
      modelica_boolean _a_hasLocalVars;
      modelica_string _a_omsiName = NULL;
      modelica_integer _i_nAllVars;
      modelica_metatype _i_outputVars = NULL;
      modelica_metatype _i_innerVars = NULL;
      modelica_metatype _i_inputVars = NULL;
      modelica_metatype _i_equations = NULL;
      modelica_integer _i_nAlgebraicSystems;
      modelica_integer _ret_7;
      modelica_integer _ret_6;
      modelica_integer _ret_5;
      modelica_integer _ret_4;
      modelica_integer _ret_3;
      modelica_integer _ret_2;
      modelica_metatype _l_algSystemInit = NULL;
      modelica_metatype _l_evaluationTarget = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_functionName has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_functionPrototypes has no default value.
      // _a_includes has no default value.
      // _a_hasLocalVars has no default value.
      // _a_omsiName has no default value.
      // _i_nAllVars has no default value.
      // _i_outputVars has no default value.
      // _i_innerVars has no default value.
      // _i_inputVars has no default value.
      // _i_equations has no default value.
      // _i_nAlgebraicSystems has no default value.
      // _ret_7 has no default value.
      // _ret_6 has no default value.
      // _ret_5 has no default value.
      // _ret_4 has no default value.
      // _ret_3 has no default value.
      // _ret_2 has no default value.
      // _l_algSystemInit has no default value.
      // _l_evaluationTarget 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_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_integer tmp13;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 5));
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 6));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 8));
          tmp13 = mmc_unbox_integer(tmpMeta12);
          
          _txt = tmp4_1;
          _i_equations = tmpMeta6;
          _i_inputVars = tmpMeta7;
          _i_outputVars = tmpMeta8;
          _i_innerVars = tmpMeta9;
          _i_nAllVars = tmp11  /* pattern as ty=Integer */;
          _i_nAlgebraicSystems = tmp13  /* pattern as ty=Integer */;
          _a_functionName = tmp4_3;
          _a_FileNamePrefix = tmp4_4;
          _a_functionPrototypes = tmp4_5;
          _a_includes = tmp4_6;
          _a_hasLocalVars = tmp4_7;
          _a_omsiName = tmp4_8;
          /* Pattern matching succeeded */
          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT89);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_FileNamePrefix);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT64);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_omsiName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT91);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_functionName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT93);

          _l_evaluationTarget = omc_Tpl_writeStr(threadData, _OMC_LIT26, _a_FileNamePrefix);

          _l_evaluationTarget = omc_Tpl_writeTok(threadData, _l_evaluationTarget, _OMC_LIT64);

          _l_evaluationTarget = omc_Tpl_writeStr(threadData, _l_evaluationTarget, _a_omsiName);

          _l_evaluationTarget = omc_Tpl_writeTok(threadData, _l_evaluationTarget, _OMC_LIT64);

          _l_evaluationTarget = omc_Tpl_writeStr(threadData, _l_evaluationTarget, _a_functionName);

          _l_algSystemInit = omc_CodegenOMSI__common_generateAlgebraicSystemInstantiation(threadData, _OMC_LIT26, _a_FileNamePrefix, _i_nAlgebraicSystems, _i_equations, _a_omsiName);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT95);

          _a_includes = omc_CodegenOMSI__common_fun__84(threadData, _a_includes, _i_nAlgebraicSystems);

          _a_includes = omc_Tpl_softNewLine(threadData, _a_includes);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT97);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT27);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT102);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT91);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_functionName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT110);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT79);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT112);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_functionName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT116);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT39);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT118);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_nAlgebraicSystems));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT123);

          _ret_2 = listLength(_i_inputVars);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_ret_2));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT127);

          _ret_3 = listLength(_i_innerVars);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_ret_3));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT131);

          _ret_4 = listLength(_i_outputVars);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_ret_4));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT133);

          _txt = omc_CodegenOMSI__common_fun__85(threadData, _txt, _i_nAlgebraicSystems, _l_algSystemInit);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT137);

          _ret_5 = listLength(_i_inputVars);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_ret_5));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT139);

          _ret_6 = listLength(_i_outputVars);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_ret_6));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT145);

          _txt = omc_CodegenOMSI__common_fun__86(threadData, _txt, _a_hasLocalVars, _i_nAllVars);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT147);

          _txt = omc_CodegenOMSI__common_generateOmsiIndexTypeInitialization(threadData, _txt, _i_inputVars, _OMC_LIT148, _OMC_LIT149, _OMC_LIT148);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _ret_7 = listLength(_i_inputVars);

          _txt = omc_CodegenOMSI__common_fun__87(threadData, _txt, _ret_7);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_CodegenOMSI__common_generateOmsiIndexTypeInitialization(threadData, _txt, _i_outputVars, _OMC_LIT150, _OMC_LIT149, _OMC_LIT150);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT156);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_evaluationTarget);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT161);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT41);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_includes;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_5;
          _a_includes = tmp4_6;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_includes;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_functionPrototypes = tmpMeta[0+1];
  _out_a_includes = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__88(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_functionName, modelica_metatype _in_a_FileNamePrefix, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_includes, modelica_metatype _in_a_hasLocalVars, modelica_metatype _in_a_omsiName, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_hasLocalVars);
  _out_txt = omc_CodegenOMSI__common_fun__88(threadData, _in_txt, _in_a_omsiFunction, _in_a_functionName, _in_a_FileNamePrefix, _in_a_functionPrototypes, _in_a_includes, tmp1, _in_a_omsiName, out_out_a_functionPrototypes, out_out_a_includes);
  /* skip box _out_txt; Tpl.Text */
  /* skip box _out_a_functionPrototypes; Tpl.Text */
  /* skip box _out_a_includes; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__87(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_mArg)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_integer tmp4_2;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_mArg;
    {
      modelica_metatype _txt = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__87(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_mArg)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_mArg);
  _out_txt = omc_CodegenOMSI__common_fun__87(threadData, _in_txt, tmp1);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__86(threadData_t *threadData, modelica_metatype _in_txt, modelica_boolean _in_a_hasLocalVars, modelica_integer _in_a_nAllVars)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_boolean tmp4_2;modelica_integer tmp4_3;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_hasLocalVars;
    tmp4_3 = _in_a_nAllVars;
    {
      modelica_metatype _txt = NULL;
      modelica_integer _a_nAllVars;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_nAllVars has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 /* false */ != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_nAllVars = tmp4_3;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT166);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_nAllVars));
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT169);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__86(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_hasLocalVars, modelica_metatype _in_a_nAllVars)
{
  modelica_integer tmp1;
  modelica_integer tmp2;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_hasLocalVars);
  tmp2 = mmc_unbox_integer(_in_a_nAllVars);
  _out_txt = omc_CodegenOMSI__common_fun__86(threadData, _in_txt, tmp1, tmp2);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__85(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_a_nAlgebraicSystems, modelica_metatype _in_a_algSystemInit)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_integer tmp4_2;modelica_metatype tmp4_3;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_nAlgebraicSystems;
    tmp4_3 = _in_a_algSystemInit;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_algSystemInit = NULL;
      modelica_integer _i_nAlgebraicSystems;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_algSystemInit has no default value.
      // _i_nAlgebraicSystems has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _i_nAlgebraicSystems = tmp4_2;
          _a_algSystemInit = tmp4_3;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT174);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_nAlgebraicSystems));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT184);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_algSystemInit);

          _txt = omc_Tpl_softNewLine(threadData, _txt);
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__85(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_nAlgebraicSystems, modelica_metatype _in_a_algSystemInit)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_nAlgebraicSystems);
  _out_txt = omc_CodegenOMSI__common_fun__85(threadData, _in_txt, tmp1, _in_a_algSystemInit);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__84(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_a_nAlgebraicSystems)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_integer tmp4_2;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_nAlgebraicSystems;
    {
      modelica_metatype _txt = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT186);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__84(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_nAlgebraicSystems)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_nAlgebraicSystems);
  _out_txt = omc_CodegenOMSI__common_fun__84(threadData, _in_txt, tmp1);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateOmsiIndexTypeInitialization(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_variables, modelica_string _a_StrucPrefix, modelica_string _a_targetName, modelica_string _a_omsiFuncName)
{
  modelica_metatype _out_txt = NULL;
  modelica_integer _ret_1;
  modelica_metatype _l_stringBuffer = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _ret_1 has no default value.
  // _l_stringBuffer has no default value.
  _l_stringBuffer = omc_Tpl_pushIter(threadData, _OMC_LIT26, _OMC_LIT62);

  _l_stringBuffer = omc_CodegenOMSI__common_lm__81(threadData, _l_stringBuffer, _a_variables, _a_omsiFuncName);

  _l_stringBuffer = omc_Tpl_popIter(threadData, _l_stringBuffer);

  _ret_1 = listLength(_a_variables);

  _out_txt = omc_CodegenOMSI__common_fun__82(threadData, _txt, _ret_1, _l_stringBuffer, _a_targetName);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__82(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_mArg, modelica_metatype _in_a_stringBuffer, modelica_string _in_a_targetName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_integer tmp4_2;modelica_metatype tmp4_3;modelica_string tmp4_4;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_mArg;
    tmp4_3 = _in_a_stringBuffer;
    tmp4_4 = _in_a_targetName;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_stringBuffer = NULL;
      modelica_string _a_targetName = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_stringBuffer has no default value.
      // _a_targetName has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_stringBuffer = tmp4_3;
          _a_targetName = tmp4_4;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT188);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_targetName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT189);
          tmpMeta1 = omc_Tpl_writeText(threadData, _txt, _a_stringBuffer);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__82(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_mArg, modelica_metatype _in_a_stringBuffer, modelica_metatype _in_a_targetName)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_mArg);
  _out_txt = omc_CodegenOMSI__common_fun__82(threadData, _in_txt, tmp1, _in_a_stringBuffer, _in_a_targetName);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__81(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_string _a_omsiFuncName)
{
  modelica_metatype _txt = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta7;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _txt = __omcQ_24in_5Ftxt;
  {
    modelica_metatype _lstElt_81;
    for (tmpMeta1 = _items; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _lstElt_81 = MMC_CAR(tmpMeta1);
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _lstElt_81;
        {
          modelica_integer _x_i0;
          modelica_metatype _i_variable = NULL;
          modelica_metatype _l_stringIndex = NULL;
          modelica_metatype _l_stringName = NULL;
          modelica_metatype _l_stringType = NULL;
          volatile mmc_switch_type tmp5;
          int tmp6;
          // _x_i0 has no default value.
          // _i_variable has no default value.
          // _l_stringIndex has no default value.
          // _l_stringName has no default value.
          // _l_stringType has no default value.
          tmp5 = 0;
          for (; tmp5 < 1; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              
              _i_variable = tmp5_1;
              /* Pattern matching succeeded */
              _x_i0 = omc_Tpl_getIteri__i0(threadData, _txt);

              _l_stringType = omc_CodegenOMSI__common_fun__79(threadData, _OMC_LIT26, _i_variable);

              _l_stringName = _OMC_LIT26;

              _l_stringIndex = _OMC_LIT26;

              omc_CodegenOMSI__common_fun__80(threadData, _OMC_LIT26, _i_variable, _l_stringIndex, _l_stringName ,&_l_stringIndex ,&_l_stringName);

              _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiFuncName);

              _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT191);

              _txt = omc_Tpl_writeStr(threadData, _txt, intString(_x_i0));

              _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT193);

              _txt = omc_Tpl_writeText(threadData, _txt, _l_stringType);

              _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT194);

              _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiFuncName);

              _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT191);

              _txt = omc_Tpl_writeStr(threadData, _txt, intString(_x_i0));

              _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT196);

              _txt = omc_Tpl_writeText(threadData, _txt, _l_stringIndex);

              _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT198);

              _txt = omc_Tpl_writeText(threadData, _txt, _l_stringName);
              tmpMeta2 = omc_Tpl_nextIter(threadData, _txt);
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _txt = tmpMeta2;
    }
  }
  _return: OMC_LABEL_UNUSED
  return _txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__80(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_variable, modelica_metatype _in_a_stringIndex, modelica_metatype _in_a_stringName, modelica_metatype *out_out_a_stringIndex, modelica_metatype *out_out_a_stringName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_stringIndex = NULL;
  modelica_metatype _out_a_stringName = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_stringIndex has no default value.
  // _out_a_stringName has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_variable;
    tmp4_3 = _in_a_stringIndex;
    tmp4_4 = _in_a_stringName;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_stringIndex = NULL;
      modelica_metatype _a_stringName = NULL;
      modelica_integer _i_var_index;
      modelica_metatype _i_var = NULL;
      modelica_string _ret_1 = NULL;
      modelica_metatype _ret_0 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_stringIndex has no default value.
      // _a_stringName has no default value.
      // _i_var_index has no default value.
      // _i_var has no default value.
      // _ret_1 has no default value.
      // _ret_0 has no default value.
      tmp4 = 0;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          modelica_integer tmp8;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,10,0) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          tmp8 = mmc_unbox_integer(tmpMeta7);
          
          _i_var = tmp4_2;
          _i_var_index = tmp8  /* pattern as ty=Integer */;
          _txt = tmp4_1;
          _a_stringIndex = tmp4_3;
          _a_stringName = tmp4_4;
          /* Pattern matching succeeded */
          _a_stringName = omc_CodegenUtil_crefCCommentWithVariability(threadData, _a_stringName, _i_var);

          _a_stringIndex = omc_Tpl_writeStr(threadData, _a_stringIndex, intString(_i_var_index));
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_stringIndex;
          tmpMeta[0+2] = _a_stringName;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,11,0) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          
          _i_var = tmp4_2;
          _i_var_index = tmp11  /* pattern as ty=Integer */;
          _txt = tmp4_1;
          _a_stringIndex = tmp4_3;
          _a_stringName = tmp4_4;
          /* Pattern matching succeeded */
          _a_stringName = omc_CodegenUtil_crefCCommentWithVariability(threadData, _a_stringName, _i_var);

          _a_stringIndex = omc_Tpl_writeStr(threadData, _a_stringIndex, intString(_i_var_index));
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_stringIndex;
          tmpMeta[0+2] = _a_stringName;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_integer tmp14;
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta12,12,0) == 0) goto tmp3_end;
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          tmp14 = mmc_unbox_integer(tmpMeta13);
          
          _i_var = tmp4_2;
          _i_var_index = tmp14  /* pattern as ty=Integer */;
          _txt = tmp4_1;
          _a_stringIndex = tmp4_3;
          _a_stringName = tmp4_4;
          /* Pattern matching succeeded */
          _a_stringName = omc_CodegenUtil_crefCCommentWithVariability(threadData, _a_stringName, _i_var);

          _a_stringIndex = omc_Tpl_writeStr(threadData, _a_stringIndex, intString(_i_var_index));
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_stringIndex;
          tmpMeta[0+2] = _a_stringName;
          goto tmp3_done;
        }
        case 3: {
          
          _txt = tmp4_1;
          _i_var = tmp4_2;
          _a_stringIndex = tmp4_3;
          _a_stringName = tmp4_4;
          /* Pattern matching succeeded */
          _a_stringName = omc_CodegenUtil_crefCCommentWithVariability(threadData, _a_stringName, _i_var);

          _ret_0 = omc_SimCodeUtil_getSimCode(threadData);

          _ret_1 = omc_SimCodeUtil_getValueReference(threadData, _i_var, _ret_0, 0 /* false */);

          _a_stringIndex = omc_Tpl_writeStr(threadData, _a_stringIndex, _ret_1);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_stringIndex;
          tmpMeta[0+2] = _a_stringName;
          goto tmp3_done;
        }
        case 4: {
          
          _txt = tmp4_1;
          _a_stringIndex = tmp4_3;
          _a_stringName = tmp4_4;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_stringIndex;
          tmpMeta[0+2] = _a_stringName;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_stringIndex = tmpMeta[0+1];
  _out_a_stringName = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_stringIndex) { *out_out_a_stringIndex = _out_a_stringIndex; }
  if (out_out_a_stringName) { *out_out_a_stringName = _out_a_stringName; }
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__79(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_variable)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_variable;
    {
      modelica_metatype _txt = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      tmp4 = 0;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 13));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta6,1,1) == 0) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT200);
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta7;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 13));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,0,1) == 0) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT202);
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta8;
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 13));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta8,3,1) == 0) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT204);
          goto tmp3_done;
        }
        case 3: {
          modelica_metatype tmpMeta9;
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 13));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta9,2,1) == 0) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT206);
          goto tmp3_done;
        }
        case 4: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT208);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateInitalizationAlgSystem(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_equationSystem, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_includes, modelica_string _in_a_omsiName, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_includes has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_string tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;modelica_string tmp4_6;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_equationSystem;
    tmp4_3 = _in_a_FileNamePrefix;
    tmp4_4 = _in_a_functionPrototypes;
    tmp4_5 = _in_a_includes;
    tmp4_6 = _in_a_omsiName;
    {
      modelica_metatype _txt = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_metatype _a_includes = NULL;
      modelica_string _a_omsiName = NULL;
      modelica_metatype _i_residual = NULL;
      modelica_metatype _i_matrix = NULL;
      modelica_boolean _i_linearSystem;
      modelica_integer _i_dim__n;
      modelica_metatype _i_zeroCrossingConditions = NULL;
      modelica_integer _i_algSysIndex;
      modelica_metatype _txt_3 = NULL;
      modelica_integer _ret_2;
      modelica_integer _ret_1;
      modelica_metatype _l_zeroCrossingIndices = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_functionPrototypes has no default value.
      // _a_includes has no default value.
      // _a_omsiName has no default value.
      // _i_residual has no default value.
      // _i_matrix has no default value.
      // _i_linearSystem has no default value.
      // _i_dim__n has no default value.
      // _i_zeroCrossingConditions has no default value.
      // _i_algSysIndex has no default value.
      // _txt_3 has no default value.
      // _ret_2 has no default value.
      // _ret_1 has no default value.
      // _l_zeroCrossingIndices has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_integer tmp9;
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,11) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 4));
          tmp9 = mmc_unbox_integer(tmpMeta8);
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 8));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 9));
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 10));
          
          _i_algSysIndex = tmp7  /* pattern as ty=Integer */;
          _i_dim__n = tmp9  /* pattern as ty=Integer */;
          _i_linearSystem = tmp11  /* pattern as ty=Boolean */;
          _i_residual = tmpMeta12;
          _i_matrix = tmpMeta13;
          _i_zeroCrossingConditions = tmpMeta14;
          _txt = tmp4_1;
          _a_FileNamePrefix = tmp4_3;
          _a_functionPrototypes = tmp4_4;
          _a_includes = tmp4_5;
          _a_omsiName = tmp4_6;
          /* Pattern matching succeeded */
          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT89);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_FileNamePrefix);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT64);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_omsiName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT66);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, intString(_i_algSysIndex));

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT210);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT27);

          _l_zeroCrossingIndices = omc_Tpl_pushIter(threadData, _OMC_LIT26, _OMC_LIT212);

          _l_zeroCrossingIndices = omc_CodegenOMSI__common_lm__73(threadData, _l_zeroCrossingIndices, _i_zeroCrossingConditions);

          _l_zeroCrossingIndices = omc_Tpl_popIter(threadData, _l_zeroCrossingIndices);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT215);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT66);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT217);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT39);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT219);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_dim__n));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT224);

          _ret_1 = listLength(_i_zeroCrossingConditions);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_ret_1));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT194);

          _ret_2 = listLength(_i_zeroCrossingConditions);

          _txt = omc_CodegenOMSI__common_fun__74(threadData, _txt, _ret_2, _l_zeroCrossingIndices);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT228);

          _txt = omc_CodegenOMSI__common_fun__75(threadData, _txt, _i_linearSystem);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT237);

          _txt = omc_CodegenOMSI__common_fun__76(threadData, _txt, _i_matrix, _i_algSysIndex, _a_omsiName, _a_FileNamePrefix);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT249);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT251);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT261);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT263);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT267);

          _txt = omc_CodegenOMSI__common_fun__77(threadData, _txt, _i_matrix, _i_algSysIndex, _a_omsiName, _a_FileNamePrefix);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT271);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT272);

          _txt_3 = omc_Tpl_writeTok(threadData, _OMC_LIT26, _OMC_LIT274);

          _txt_3 = omc_Tpl_writeStr(threadData, _txt_3, intString(_i_algSysIndex));
          tmpMeta[0+0] = omc_CodegenOMSI__common_generateInitalizationOMSIFunction(threadData, _txt, _i_residual, omc_Tpl_textString(threadData, _txt_3), _a_FileNamePrefix, _OMC_LIT275, _a_functionPrototypes, _a_includes, 0 /* false */, _a_omsiName, &tmpMeta[0+1], &tmpMeta[0+2]);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_4;
          _a_includes = tmp4_5;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_includes;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_functionPrototypes = tmpMeta[0+1];
  _out_a_includes = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__77(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_integer _in_a_algSysIndex, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_integer tmp4_3;modelica_string tmp4_4;modelica_string tmp4_5;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_matrix;
    tmp4_3 = _in_a_algSysIndex;
    tmp4_4 = _in_a_omsiName;
    tmp4_5 = _in_a_FileNamePrefix;
    {
      modelica_metatype _txt = NULL;
      modelica_integer _a_algSysIndex;
      modelica_string _a_omsiName = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_algSysIndex has no default value.
      // _a_omsiName has no default value.
      // _a_FileNamePrefix has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (!optionNone(tmp4_2)) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT277);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_algSysIndex = tmp4_3;
          _a_omsiName = tmp4_4;
          _a_FileNamePrefix = tmp4_5;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT279);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_algSysIndex));
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT60);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__77(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_metatype _in_a_algSysIndex, modelica_metatype _in_a_omsiName, modelica_metatype _in_a_FileNamePrefix)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_algSysIndex);
  _out_txt = omc_CodegenOMSI__common_fun__77(threadData, _in_txt, _in_a_matrix, tmp1, _in_a_omsiName, _in_a_FileNamePrefix);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__76(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_integer _in_a_algSysIndex, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_integer tmp4_3;modelica_string tmp4_4;modelica_string tmp4_5;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_matrix;
    tmp4_3 = _in_a_algSysIndex;
    tmp4_4 = _in_a_omsiName;
    tmp4_5 = _in_a_FileNamePrefix;
    {
      modelica_metatype _txt = NULL;
      modelica_integer _a_algSysIndex;
      modelica_string _a_omsiName = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_algSysIndex has no default value.
      // _a_omsiName has no default value.
      // _a_FileNamePrefix has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          if (optionNone(tmp4_2)) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          
          _txt = tmp4_1;
          _a_algSysIndex = tmp4_3;
          _a_omsiName = tmp4_4;
          _a_FileNamePrefix = tmp4_5;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT280);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT282);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_a_algSysIndex));
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT289);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__76(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_metatype _in_a_algSysIndex, modelica_metatype _in_a_omsiName, modelica_metatype _in_a_FileNamePrefix)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_algSysIndex);
  _out_txt = omc_CodegenOMSI__common_fun__76(threadData, _in_txt, _in_a_matrix, tmp1, _in_a_omsiName, _in_a_FileNamePrefix);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__75(threadData_t *threadData, modelica_metatype _in_txt, modelica_boolean _in_a_linearSystem)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_boolean tmp4_2;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_linearSystem;
    {
      modelica_metatype _txt = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 /* false */ != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT291);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT293);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__75(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_linearSystem)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_linearSystem);
  _out_txt = omc_CodegenOMSI__common_fun__75(threadData, _in_txt, tmp1);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__74(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_mArg, modelica_metatype _in_a_zeroCrossingIndices)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_integer tmp4_2;modelica_metatype tmp4_3;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_mArg;
    tmp4_3 = _in_a_zeroCrossingIndices;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_zeroCrossingIndices = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_zeroCrossingIndices has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT295);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_zeroCrossingIndices = tmp4_3;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT297);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_zeroCrossingIndices);
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT299);
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__74(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_mArg, modelica_metatype _in_a_zeroCrossingIndices)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_mArg);
  _out_txt = omc_CodegenOMSI__common_fun__74(threadData, _in_txt, tmp1, _in_a_zeroCrossingIndices);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__73(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items)
{
  modelica_metatype _txt = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta2;
  modelica_metatype tmpMeta8;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _txt = __omcQ_24in_5Ftxt;
  {
    modelica_metatype _lstElt_73;
    for (tmpMeta1 = _items; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _lstElt_73 = MMC_CAR(tmpMeta1);
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _lstElt_73;
        {
          modelica_integer _i_cond;
          volatile mmc_switch_type tmp5;
          int tmp6;
          // _i_cond has no default value.
          tmp5 = 0;
          for (; tmp5 < 1; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              modelica_integer tmp7;
              tmp7 = mmc_unbox_integer(tmp5_1);
              _i_cond = tmp7  /* pattern as ty=Integer */;
              /* Pattern matching succeeded */
              _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_cond));
              tmpMeta2 = omc_Tpl_nextIter(threadData, _txt);
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _txt = tmpMeta2;
    }
  }
  _return: OMC_LABEL_UNUSED
  return _txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateDerivativeFile(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_matrix, modelica_string _a_FileNamePrefix, modelica_string _a_index, modelica_string _a_omsiName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _txt_14 = NULL;
  modelica_metatype _l_headerFileContent = NULL;
  modelica_metatype _txt_12 = NULL;
  modelica_metatype _l_content = NULL;
  modelica_metatype _ret_10 = NULL;
  modelica_metatype _l_fullPathPrefix = NULL;
  modelica_metatype _ret_8 = NULL;
  modelica_metatype _l_fileNamePrefix = NULL;
  modelica_metatype _ret_6 = NULL;
  modelica_metatype _l_headerFileName = NULL;
  modelica_metatype _l_body = NULL;
  modelica_metatype _l_initalizationCode = NULL;
  modelica_metatype _l_functionPrototypes = NULL;
  modelica_metatype _l_initalizationCodeCol = NULL;
  modelica_metatype _l_includes = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _txt_14 has no default value.
  // _l_headerFileContent has no default value.
  // _txt_12 has no default value.
  // _l_content has no default value.
  // _ret_10 has no default value.
  // _l_fullPathPrefix has no default value.
  // _ret_8 has no default value.
  // _l_fileNamePrefix has no default value.
  // _ret_6 has no default value.
  // _l_headerFileName has no default value.
  // _l_body has no default value.
  // _l_initalizationCode has no default value.
  // _l_functionPrototypes has no default value.
  // _l_initalizationCodeCol has no default value.
  // _l_includes has no default value.
  _l_includes = _OMC_LIT26;

  _l_initalizationCodeCol = _OMC_LIT26;

  _l_functionPrototypes = _OMC_LIT26;

  _l_initalizationCode = omc_CodegenOMSI__common_fun__71(threadData, _OMC_LIT26, _a_matrix, _a_omsiName, _l_includes, _l_functionPrototypes, _a_FileNamePrefix, _a_index ,&_l_includes ,&_l_functionPrototypes);

  _l_body = omc_CodegenOMSIC__Equations_generateDerivativeMatrix(threadData, _OMC_LIT26, _a_matrix, _a_FileNamePrefix, _a_index, _l_functionPrototypes, _a_omsiName ,&_l_functionPrototypes);

  _ret_6 = omc_SimCodeUtil_getSimCode(threadData);

  _l_headerFileName = omc_CodegenUtilSimulation_fileNamePrefix(threadData, _OMC_LIT26, _ret_6);

  _l_headerFileName = omc_Tpl_writeTok(threadData, _l_headerFileName, _OMC_LIT64);

  _l_headerFileName = omc_Tpl_writeStr(threadData, _l_headerFileName, _a_omsiName);

  _l_headerFileName = omc_Tpl_writeTok(threadData, _l_headerFileName, _OMC_LIT301);

  _l_headerFileName = omc_Tpl_writeStr(threadData, _l_headerFileName, _a_index);

  _ret_8 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fileNamePrefix = omc_CodegenUtilSimulation_fileNamePrefix(threadData, _OMC_LIT26, _ret_8);

  _ret_10 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fullPathPrefix = omc_CodegenUtilSimulation_fullPathPrefix(threadData, _OMC_LIT26, _ret_10);

  _l_content = omc_CodegenOMSI__common_insertCopyrightOpenModelica(threadData, _OMC_LIT26);

  _l_content = omc_Tpl_softNewLine(threadData, _l_content);

  _l_content = omc_Tpl_writeTok(threadData, _l_content, _OMC_LIT305);

  _l_content = omc_Tpl_writeStr(threadData, _l_content, _a_index);

  _l_content = omc_Tpl_writeTok(threadData, _l_content, _OMC_LIT310);

  _l_content = omc_Tpl_writeText(threadData, _l_content, _l_headerFileName);

  _l_content = omc_Tpl_writeTok(threadData, _l_content, _OMC_LIT323);

  _l_content = omc_Tpl_writeText(threadData, _l_content, _l_initalizationCode);

  _l_content = omc_Tpl_softNewLine(threadData, _l_content);

  _l_content = omc_Tpl_writeTok(threadData, _l_content, _OMC_LIT327);

  _l_content = omc_Tpl_writeText(threadData, _l_content, _l_body);

  _l_content = omc_Tpl_softNewLine(threadData, _l_content);

  _l_content = omc_Tpl_writeTok(threadData, _l_content, _OMC_LIT332);

  _l_content = omc_Tpl_writeTok(threadData, _l_content, _OMC_LIT27);

  _txt_12 = omc_Tpl_writeText(threadData, _OMC_LIT26, _l_fullPathPrefix);

  _txt_12 = omc_Tpl_writeTok(threadData, _txt_12, _OMC_LIT334);

  _txt_12 = omc_Tpl_writeText(threadData, _txt_12, _l_fileNamePrefix);

  _txt_12 = omc_Tpl_writeTok(threadData, _txt_12, _OMC_LIT64);

  _txt_12 = omc_Tpl_writeStr(threadData, _txt_12, _a_omsiName);

  _txt_12 = omc_Tpl_writeTok(threadData, _txt_12, _OMC_LIT301);

  _txt_12 = omc_Tpl_writeStr(threadData, _txt_12, _a_index);

  _txt_12 = omc_Tpl_writeTok(threadData, _txt_12, _OMC_LIT336);

  omc_Tpl_textFile(threadData, _l_content, omc_Tpl_textString(threadData, _txt_12));

  _l_headerFileContent = omc_CodegenOMSI__common_generateCodeHeader(threadData, _OMC_LIT26, _a_FileNamePrefix, _l_includes, omc_Tpl_textString(threadData, _l_headerFileName), _l_functionPrototypes ,&_l_includes ,&_l_functionPrototypes);

  _txt_14 = omc_Tpl_writeText(threadData, _OMC_LIT26, _l_fullPathPrefix);

  _txt_14 = omc_Tpl_writeTok(threadData, _txt_14, _OMC_LIT334);

  _txt_14 = omc_Tpl_writeText(threadData, _txt_14, _l_headerFileName);

  _txt_14 = omc_Tpl_writeTok(threadData, _txt_14, _OMC_LIT338);

  omc_Tpl_textFile(threadData, _l_headerFileContent, omc_Tpl_textString(threadData, _txt_14));

  _out_txt = _txt;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__71(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_matrix, modelica_string _in_a_omsiName, modelica_metatype _in_a_includes, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_FileNamePrefix, modelica_string _in_a_index, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_functionPrototypes)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_includes has no default value.
  // _out_a_functionPrototypes has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_string tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;modelica_string tmp4_6;modelica_string tmp4_7;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_matrix;
    tmp4_3 = _in_a_omsiName;
    tmp4_4 = _in_a_includes;
    tmp4_5 = _in_a_functionPrototypes;
    tmp4_6 = _in_a_FileNamePrefix;
    tmp4_7 = _in_a_index;
    {
      modelica_metatype _txt = NULL;
      modelica_string _a_omsiName = NULL;
      modelica_metatype _a_includes = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_string _a_index = NULL;
      modelica_metatype _i_derMat_columns = NULL;
      modelica_metatype _l_initalizationCodeCol = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_omsiName has no default value.
      // _a_includes has no default value.
      // _a_functionPrototypes has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_index has no default value.
      // _i_derMat_columns has no default value.
      // _l_initalizationCodeCol has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          if (optionNone(tmp4_2)) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 1));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta6), 2));
          
          _i_derMat_columns = tmpMeta7;
          _txt = tmp4_1;
          _a_omsiName = tmp4_3;
          _a_includes = tmp4_4;
          _a_functionPrototypes = tmp4_5;
          _a_FileNamePrefix = tmp4_6;
          _a_index = tmp4_7;
          /* Pattern matching succeeded */
          _l_initalizationCodeCol = omc_Tpl_pushIter(threadData, _OMC_LIT26, _OMC_LIT342);

          _l_initalizationCodeCol = omc_CodegenOMSI__common_lm__70(threadData, _l_initalizationCodeCol, _i_derMat_columns, _a_omsiName, _a_includes, _a_functionPrototypes, _a_FileNamePrefix, _a_index ,&_a_includes ,&_a_functionPrototypes);

          _l_initalizationCodeCol = omc_Tpl_popIter(threadData, _l_initalizationCodeCol);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_initalizationCodeCol);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_functionPrototypes;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_includes = tmp4_4;
          _a_functionPrototypes = tmp4_5;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_functionPrototypes;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_includes = tmpMeta[0+1];
  _out_a_functionPrototypes = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__70(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_string _a_omsiName, modelica_metatype __omcQ_24in_5Fa_5Fincludes, modelica_metatype __omcQ_24in_5Fa_5FfunctionPrototypes, modelica_string _a_FileNamePrefix, modelica_string _a_index, modelica_metatype *out_a_includes, modelica_metatype *out_a_functionPrototypes)
{
  modelica_metatype _txt = NULL;
  modelica_metatype _a_includes = NULL;
  modelica_metatype _a_functionPrototypes = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _txt = __omcQ_24in_5Ftxt;
  _a_includes = __omcQ_24in_5Fa_5Fincludes;
  _a_functionPrototypes = __omcQ_24in_5Fa_5FfunctionPrototypes;
  {
    modelica_metatype _lstElt_70;
    for (tmpMeta1 = _items; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _lstElt_70 = MMC_CAR(tmpMeta1);
      
      
      
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _lstElt_70;
        {
          modelica_metatype _i_column = NULL;
          modelica_metatype _txt_0 = NULL;
          volatile mmc_switch_type tmp5;
          int tmp6;
          // _i_column has no default value.
          // _txt_0 has no default value.
          tmp5 = 0;
          for (; tmp5 < 1; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              
              _i_column = tmp5_1;
              /* Pattern matching succeeded */
              _txt_0 = omc_Tpl_writeTok(threadData, _OMC_LIT26, _OMC_LIT344);

              _txt_0 = omc_Tpl_writeStr(threadData, _txt_0, _a_index);

              _txt = omc_CodegenOMSI__common_generateInitalizationOMSIFunction(threadData, _txt, _i_column, omc_Tpl_textString(threadData, _txt_0), _a_FileNamePrefix, _OMC_LIT275, _a_functionPrototypes, _a_includes, 1 /* true */, _a_omsiName ,&_a_functionPrototypes ,&_a_includes);

              _txt = omc_Tpl_nextIter(threadData, _txt);
              tmpMeta[0+0] = _txt;
              tmpMeta[0+1] = _a_includes;
              tmpMeta[0+2] = _a_functionPrototypes;
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _txt = tmpMeta[0+0];
      _a_includes = tmpMeta[0+1];
      _a_functionPrototypes = tmpMeta[0+2];
    }
  }
  _return: OMC_LABEL_UNUSED
  if (out_a_includes) { *out_a_includes = _a_includes; }
  if (out_a_functionPrototypes) { *out_a_functionPrototypes = _a_functionPrototypes; }
  return _txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateCodeHeader(threadData_t *threadData, modelica_metatype _txt, modelica_string _a_FileNamePrefix, modelica_metatype _a_includes, modelica_string _a_headerName, modelica_metatype _a_functionPrototypes, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_functionPrototypes)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_string _ret_1 = NULL;
  modelica_metatype _l_macro__name = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_includes has no default value.
  // _out_a_functionPrototypes has no default value.
  // _ret_1 has no default value.
  // _l_macro__name has no default value.
  _ret_1 = omc_System_makeC89Identifier(threadData, _a_headerName);

  _l_macro__name = omc_Tpl_writeStr(threadData, _OMC_LIT26, _ret_1);

  _out_txt = omc_CodegenOMSI__common_insertCopyrightOpenModelica(threadData, _txt);

  _out_txt = omc_Tpl_softNewLine(threadData, _out_txt);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT348);

  _out_txt = omc_Tpl_writeText(threadData, _out_txt, _l_macro__name);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT353);

  _out_txt = omc_Tpl_writeText(threadData, _out_txt, _l_macro__name);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT370);

  _out_txt = omc_Tpl_writeText(threadData, _out_txt, _a_includes);

  _out_txt = omc_Tpl_softNewLine(threadData, _out_txt);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT378);

  _out_txt = omc_Tpl_writeText(threadData, _out_txt, _a_functionPrototypes);

  _out_txt = omc_Tpl_softNewLine(threadData, _out_txt);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT384);

  _out_txt = omc_Tpl_writeTok(threadData, _out_txt, _OMC_LIT27);

  _out_a_includes = _a_includes;

  _out_a_functionPrototypes = _a_functionPrototypes;
  _return: OMC_LABEL_UNUSED
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateOmsiAlgSystemCode(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_equationSystem, modelica_string _a_FileNamePrefix, modelica_string _a_omsiName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _ret_9 = NULL;
  modelica_metatype _l_fullPathPrefix = NULL;
  modelica_metatype _ret_7 = NULL;
  modelica_metatype _l_fileNamePrefix = NULL;
  modelica_metatype _l_functionPrototypes = NULL;
  modelica_metatype _l_derivativeMatrix = NULL;
  modelica_metatype _l_residualCall = NULL;
  modelica_metatype _l_functionCall = NULL;
  modelica_metatype _l_evaluationCode = NULL;
  modelica_metatype _l_includes = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _ret_9 has no default value.
  // _l_fullPathPrefix has no default value.
  // _ret_7 has no default value.
  // _l_fileNamePrefix has no default value.
  // _l_functionPrototypes has no default value.
  // _l_derivativeMatrix has no default value.
  // _l_residualCall has no default value.
  // _l_functionCall has no default value.
  // _l_evaluationCode has no default value.
  // _l_includes has no default value.
  _l_includes = _OMC_LIT26;

  _l_evaluationCode = _OMC_LIT26;

  _l_functionCall = _OMC_LIT26;

  _l_residualCall = _OMC_LIT26;

  _l_derivativeMatrix = _OMC_LIT26;

  _l_functionPrototypes = _OMC_LIT26;

  _ret_7 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fileNamePrefix = omc_CodegenUtilSimulation_fileNamePrefix(threadData, _OMC_LIT26, _ret_7);

  _ret_9 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fullPathPrefix = omc_CodegenUtilSimulation_fullPathPrefix(threadData, _OMC_LIT26, _ret_9);

  _out_txt = omc_CodegenOMSI__common_fun__67(threadData, _txt, _a_equationSystem, _l_fullPathPrefix, _l_fileNamePrefix, _l_residualCall, _l_functionCall, _l_evaluationCode, _a_omsiName, _l_functionPrototypes, _a_FileNamePrefix, _l_includes ,&_l_residualCall ,&_l_functionCall ,&_l_evaluationCode ,&_l_functionPrototypes ,&_l_includes);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__67(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_equationSystem, modelica_metatype _in_a_fullPathPrefix, modelica_metatype _in_a_fileNamePrefix, modelica_metatype _in_a_residualCall, modelica_metatype _in_a_functionCall, modelica_metatype _in_a_evaluationCode, modelica_string _in_a_omsiName, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_includes, modelica_metatype *out_out_a_residualCall, modelica_metatype *out_out_a_functionCall, modelica_metatype *out_out_a_evaluationCode, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_includes)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_residualCall = NULL;
  modelica_metatype _out_a_functionCall = NULL;
  modelica_metatype _out_a_evaluationCode = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype tmpMeta[6] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_residualCall has no default value.
  // _out_a_functionCall has no default value.
  // _out_a_evaluationCode has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_includes has no default value.
  
  
  
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;modelica_metatype tmp4_6;modelica_metatype tmp4_7;modelica_string tmp4_8;modelica_metatype tmp4_9;modelica_string tmp4_10;modelica_metatype tmp4_11;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_equationSystem;
    tmp4_3 = _in_a_fullPathPrefix;
    tmp4_4 = _in_a_fileNamePrefix;
    tmp4_5 = _in_a_residualCall;
    tmp4_6 = _in_a_functionCall;
    tmp4_7 = _in_a_evaluationCode;
    tmp4_8 = _in_a_omsiName;
    tmp4_9 = _in_a_functionPrototypes;
    tmp4_10 = _in_a_FileNamePrefix;
    tmp4_11 = _in_a_includes;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_fullPathPrefix = NULL;
      modelica_metatype _a_fileNamePrefix = NULL;
      modelica_metatype _a_residualCall = NULL;
      modelica_metatype _a_functionCall = NULL;
      modelica_metatype _a_evaluationCode = NULL;
      modelica_string _a_omsiName = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_includes = NULL;
      modelica_metatype _i_matrix = NULL;
      modelica_integer _i_algSystem_algSysIndex;
      modelica_metatype _i_residual = NULL;
      modelica_metatype _i_algSystem = NULL;
      modelica_metatype _txt_10 = NULL;
      modelica_metatype _ret_8 = NULL;
      modelica_metatype _txt_7 = NULL;
      modelica_metatype _l_headerFileContent = NULL;
      modelica_metatype _l_headerFileName = NULL;
      modelica_metatype _l_matrixString = NULL;
      modelica_metatype _ret_3 = NULL;
      modelica_metatype _l_equationInfos = NULL;
      modelica_metatype _l_initlaizationFunction = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_fullPathPrefix has no default value.
      // _a_fileNamePrefix has no default value.
      // _a_residualCall has no default value.
      // _a_functionCall has no default value.
      // _a_evaluationCode has no default value.
      // _a_omsiName has no default value.
      // _a_functionPrototypes has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_includes has no default value.
      // _i_matrix has no default value.
      // _i_algSystem_algSysIndex has no default value.
      // _i_residual has no default value.
      // _i_algSystem has no default value.
      // _txt_10 has no default value.
      // _ret_8 has no default value.
      // _txt_7 has no default value.
      // _l_headerFileContent has no default value.
      // _l_headerFileName has no default value.
      // _l_matrixString has no default value.
      // _ret_3 has no default value.
      // _l_equationInfos has no default value.
      // _l_initlaizationFunction has no default value.
      tmp4 = 0;
      for (; tmp4 < 3; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_metatype tmpMeta8;
          modelica_metatype tmpMeta9;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,11) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 8));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 9));
          if (!optionNone(tmpMeta9)) goto tmp3_end;
          
          _i_algSystem = tmp4_2;
          _i_algSystem_algSysIndex = tmp7  /* pattern as ty=Integer */;
          _i_residual = tmpMeta8;
          _txt = tmp4_1;
          _a_fullPathPrefix = tmp4_3;
          _a_fileNamePrefix = tmp4_4;
          _a_residualCall = tmp4_5;
          _a_functionCall = tmp4_6;
          _a_evaluationCode = tmp4_7;
          _a_omsiName = tmp4_8;
          _a_functionPrototypes = tmp4_9;
          _a_FileNamePrefix = tmp4_10;
          _a_includes = tmp4_11;
          /* Pattern matching succeeded */
          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT386);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT27);

          _l_initlaizationFunction = omc_CodegenOMSI__common_generateInitalizationAlgSystem(threadData, _OMC_LIT26, _i_algSystem, _a_FileNamePrefix, _a_functionPrototypes, _a_includes, _a_omsiName ,&_a_functionPrototypes ,&_a_includes);

          omc_CodegenOMSI__common_generateOmsiFunctionCode__inner(threadData, _OMC_LIT26, _i_residual, _a_FileNamePrefix, _OMC_LIT275, _OMC_LIT387, _a_includes, _a_evaluationCode, _a_functionCall, _a_residualCall, _a_functionPrototypes, _a_omsiName ,&_a_includes ,&_a_evaluationCode ,&_a_functionCall ,&_a_residualCall ,&_a_functionPrototypes);

          _ret_3 = omc_List_fill(threadData, _i_algSystem, ((modelica_integer) 1));

          _l_equationInfos = omc_CodegenUtilSimulation_dumpEqs(threadData, _OMC_LIT26, _ret_3);

          _l_matrixString = _OMC_LIT26;

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT89);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_FileNamePrefix);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT64);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_omsiName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT263);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, intString(_i_algSystem_algSysIndex));

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT390);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_FileNamePrefix);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT64);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_omsiName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT392);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, intString(_i_algSystem_algSysIndex));

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT394);

          _l_headerFileName = omc_Tpl_writeText(threadData, _OMC_LIT26, _a_fileNamePrefix);

          _l_headerFileName = omc_Tpl_writeTok(threadData, _l_headerFileName, _OMC_LIT64);

          _l_headerFileName = omc_Tpl_writeStr(threadData, _l_headerFileName, _a_omsiName);

          _l_headerFileName = omc_Tpl_writeTok(threadData, _l_headerFileName, _OMC_LIT396);

          _l_headerFileName = omc_Tpl_writeStr(threadData, _l_headerFileName, intString(_i_algSystem_algSysIndex));

          _l_headerFileContent = omc_CodegenOMSI__common_generateCodeHeader(threadData, _OMC_LIT26, _a_FileNamePrefix, _a_includes, omc_Tpl_textString(threadData, _l_headerFileName), _a_functionPrototypes ,&_a_includes ,&_a_functionPrototypes);

          _txt_7 = omc_Tpl_writeText(threadData, _OMC_LIT26, _a_fullPathPrefix);

          _txt_7 = omc_Tpl_writeTok(threadData, _txt_7, _OMC_LIT334);

          _txt_7 = omc_Tpl_writeText(threadData, _txt_7, _l_headerFileName);

          _txt_7 = omc_Tpl_writeTok(threadData, _txt_7, _OMC_LIT338);

          omc_Tpl_textFile(threadData, _l_headerFileContent, omc_Tpl_textString(threadData, _txt_7));

          _txt = omc_CodegenOMSI__common_insertCopyrightOpenModelica(threadData, _txt);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT400);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_headerFileName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT409);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_initlaizationFunction);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_matrixString);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT413);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT263);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT189);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_evaluationCode);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT414);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT263);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT421);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT39);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_functionCall);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_residualCall);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT422);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT428);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_equationInfos);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT430);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT392);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT445);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT79);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT447);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT116);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT456);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_residualCall;
          tmpMeta[0+2] = _a_functionCall;
          tmpMeta[0+3] = _a_evaluationCode;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_includes;
          goto tmp3_done;
        }
        case 1: {
          modelica_metatype tmpMeta10;
          modelica_integer tmp11;
          modelica_metatype tmpMeta12;
          modelica_metatype tmpMeta13;
          modelica_metatype tmpMeta14;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,11) == 0) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmp11 = mmc_unbox_integer(tmpMeta10);
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 8));
          tmpMeta13 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 9));
          if (optionNone(tmpMeta13)) goto tmp3_end;
          tmpMeta14 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta13), 1));
          
          _i_algSystem = tmp4_2;
          _i_algSystem_algSysIndex = tmp11  /* pattern as ty=Integer */;
          _i_residual = tmpMeta12;
          _i_matrix = tmpMeta13;
          _txt = tmp4_1;
          _a_fullPathPrefix = tmp4_3;
          _a_fileNamePrefix = tmp4_4;
          _a_residualCall = tmp4_5;
          _a_functionCall = tmp4_6;
          _a_evaluationCode = tmp4_7;
          _a_omsiName = tmp4_8;
          _a_functionPrototypes = tmp4_9;
          _a_FileNamePrefix = tmp4_10;
          _a_includes = tmp4_11;
          /* Pattern matching succeeded */
          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT386);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT27);

          _l_initlaizationFunction = omc_CodegenOMSI__common_generateInitalizationAlgSystem(threadData, _OMC_LIT26, _i_algSystem, _a_FileNamePrefix, _a_functionPrototypes, _a_includes, _a_omsiName ,&_a_functionPrototypes ,&_a_includes);

          omc_CodegenOMSI__common_generateOmsiFunctionCode__inner(threadData, _OMC_LIT26, _i_residual, _a_FileNamePrefix, _OMC_LIT275, _OMC_LIT387, _a_includes, _a_evaluationCode, _a_functionCall, _a_residualCall, _a_functionPrototypes, _a_omsiName ,&_a_includes ,&_a_evaluationCode ,&_a_functionCall ,&_a_residualCall ,&_a_functionPrototypes);

          _ret_8 = omc_List_fill(threadData, _i_algSystem, ((modelica_integer) 1));

          _l_equationInfos = omc_CodegenUtilSimulation_dumpEqs(threadData, _OMC_LIT26, _ret_8);

          _l_matrixString = omc_CodegenOMSIC__Equations_generateMatrixInitialization(threadData, _OMC_LIT26, _i_matrix);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT457);

          _a_includes = omc_Tpl_writeText(threadData, _a_includes, _a_fileNamePrefix);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT64);

          _a_includes = omc_Tpl_writeStr(threadData, _a_includes, _a_omsiName);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT301);

          _a_includes = omc_Tpl_writeStr(threadData, _a_includes, intString(_i_algSystem_algSysIndex));

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT459);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT27);

          omc_CodegenOMSI__common_generateDerivativeFile(threadData, _OMC_LIT26, _i_matrix, _a_FileNamePrefix, intString(_i_algSystem_algSysIndex), _a_omsiName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT89);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_FileNamePrefix);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT64);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_omsiName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT263);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, intString(_i_algSystem_algSysIndex));

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT390);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_FileNamePrefix);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT64);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, _a_omsiName);

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT392);

          _a_functionPrototypes = omc_Tpl_writeStr(threadData, _a_functionPrototypes, intString(_i_algSystem_algSysIndex));

          _a_functionPrototypes = omc_Tpl_writeTok(threadData, _a_functionPrototypes, _OMC_LIT394);

          _l_headerFileName = omc_Tpl_writeText(threadData, _OMC_LIT26, _a_fileNamePrefix);

          _l_headerFileName = omc_Tpl_writeTok(threadData, _l_headerFileName, _OMC_LIT64);

          _l_headerFileName = omc_Tpl_writeStr(threadData, _l_headerFileName, _a_omsiName);

          _l_headerFileName = omc_Tpl_writeTok(threadData, _l_headerFileName, _OMC_LIT396);

          _l_headerFileName = omc_Tpl_writeStr(threadData, _l_headerFileName, intString(_i_algSystem_algSysIndex));

          _l_headerFileContent = omc_CodegenOMSI__common_generateCodeHeader(threadData, _OMC_LIT26, _a_FileNamePrefix, _a_includes, omc_Tpl_textString(threadData, _l_headerFileName), _a_functionPrototypes ,&_a_includes ,&_a_functionPrototypes);

          _txt_10 = omc_Tpl_writeText(threadData, _OMC_LIT26, _a_fullPathPrefix);

          _txt_10 = omc_Tpl_writeTok(threadData, _txt_10, _OMC_LIT334);

          _txt_10 = omc_Tpl_writeText(threadData, _txt_10, _l_headerFileName);

          _txt_10 = omc_Tpl_writeTok(threadData, _txt_10, _OMC_LIT338);

          omc_Tpl_textFile(threadData, _l_headerFileContent, omc_Tpl_textString(threadData, _txt_10));

          _txt = omc_CodegenOMSI__common_insertCopyrightOpenModelica(threadData, _txt);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT400);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_headerFileName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT409);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_initlaizationFunction);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_matrixString);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT413);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT263);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT189);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_evaluationCode);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT414);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT263);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT421);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT39);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_functionCall);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_residualCall);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT422);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT428);

          _txt = omc_Tpl_writeText(threadData, _txt, _l_equationInfos);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT430);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT392);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT445);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT79);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT447);

          _txt = omc_Tpl_writeStr(threadData, _txt, intString(_i_algSystem_algSysIndex));

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT116);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT456);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_residualCall;
          tmpMeta[0+2] = _a_functionCall;
          tmpMeta[0+3] = _a_evaluationCode;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_includes;
          goto tmp3_done;
        }
        case 2: {
          
          _txt = tmp4_1;
          _a_residualCall = tmp4_5;
          _a_functionCall = tmp4_6;
          _a_evaluationCode = tmp4_7;
          _a_functionPrototypes = tmp4_9;
          _a_includes = tmp4_11;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_residualCall;
          tmpMeta[0+2] = _a_functionCall;
          tmpMeta[0+3] = _a_evaluationCode;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_includes;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_residualCall = tmpMeta[0+1];
  _out_a_functionCall = tmpMeta[0+2];
  _out_a_evaluationCode = tmpMeta[0+3];
  _out_a_functionPrototypes = tmpMeta[0+4];
  _out_a_includes = tmpMeta[0+5];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_residualCall) { *out_out_a_residualCall = _out_a_residualCall; }
  if (out_out_a_functionCall) { *out_out_a_functionCall = _out_a_functionCall; }
  if (out_out_a_evaluationCode) { *out_out_a_evaluationCode = _out_a_evaluationCode; }
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateOmsiMemberFunction(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_omsiFunction, modelica_string _a_FileNamePrefix, modelica_string _a_FunctionnamePrefix)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _l_functionPrototypes = NULL;
  modelica_metatype _l_evaluationCode = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _l_functionPrototypes has no default value.
  // _l_evaluationCode has no default value.
  _l_evaluationCode = _OMC_LIT26;

  _l_functionPrototypes = _OMC_LIT26;

  _out_txt = omc_CodegenOMSI__common_fun__65(threadData, _txt, _a_omsiFunction, _l_functionPrototypes, _a_FunctionnamePrefix, _a_FileNamePrefix, _l_evaluationCode ,&_l_functionPrototypes ,&_l_evaluationCode);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__65(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_FunctionnamePrefix, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_evaluationCode = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_evaluationCode has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_string tmp4_4;modelica_string tmp4_5;modelica_metatype tmp4_6;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_omsiFunction;
    tmp4_3 = _in_a_functionPrototypes;
    tmp4_4 = _in_a_FunctionnamePrefix;
    tmp4_5 = _in_a_FileNamePrefix;
    tmp4_6 = _in_a_evaluationCode;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_string _a_FunctionnamePrefix = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_evaluationCode = NULL;
      modelica_metatype _i_context = NULL;
      modelica_metatype _i_equations = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_functionPrototypes has no default value.
      // _a_FunctionnamePrefix has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_evaluationCode has no default value.
      // _i_context has no default value.
      // _i_equations has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,9,1) == 0) goto tmp3_end;
          
          _i_equations = tmpMeta6;
          _i_context = tmpMeta7;
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_3;
          _a_FunctionnamePrefix = tmp4_4;
          _a_FileNamePrefix = tmp4_5;
          _a_evaluationCode = tmp4_6;
          /* Pattern matching succeeded */
          omc_CodegenOMSI__common_lm__64(threadData, _OMC_LIT26, _i_equations, _a_functionPrototypes, _i_context, _a_FunctionnamePrefix, _a_FileNamePrefix, _a_evaluationCode ,&_a_functionPrototypes ,&_a_evaluationCode);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT39);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT461);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FunctionnamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT466);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FunctionnamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT468);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_functionPrototypes);

          _txt = omc_Tpl_popBlock(threadData, _txt);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_3;
          _a_evaluationCode = tmp4_6;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_evaluationCode;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_functionPrototypes = tmpMeta[0+1];
  _out_a_evaluationCode = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_evaluationCode) { *out_out_a_evaluationCode = _out_a_evaluationCode; }
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__64(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_metatype __omcQ_24in_5Fa_5FfunctionPrototypes, modelica_metatype _a_context, modelica_string _a_FunctionnamePrefix, modelica_string _a_FileNamePrefix, modelica_metatype __omcQ_24in_5Fa_5FevaluationCode, modelica_metatype *out_a_functionPrototypes, modelica_metatype *out_a_evaluationCode)
{
  modelica_metatype _txt = NULL;
  modelica_metatype _a_functionPrototypes = NULL;
  modelica_metatype _a_evaluationCode = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _txt = __omcQ_24in_5Ftxt;
  _a_functionPrototypes = __omcQ_24in_5Fa_5FfunctionPrototypes;
  _a_evaluationCode = __omcQ_24in_5Fa_5FevaluationCode;
  {
    modelica_metatype _lstElt_64;
    for (tmpMeta1 = _items; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _lstElt_64 = MMC_CAR(tmpMeta1);
      
      
      
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _lstElt_64;
        {
          modelica_metatype _i_eqsystem = NULL;
          volatile mmc_switch_type tmp5;
          int tmp6;
          // _i_eqsystem has no default value.
          tmp5 = 0;
          for (; tmp5 < 1; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              
              _i_eqsystem = tmp5_1;
              /* Pattern matching succeeded */
              tmpMeta[0+0] = omc_CodegenOMSI__common_fun__63(threadData, _txt, _i_eqsystem, _a_functionPrototypes, _a_context, _a_FunctionnamePrefix, _a_FileNamePrefix, _a_evaluationCode, &tmpMeta[0+1], &tmpMeta[0+2]);
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _txt = tmpMeta[0+0];
      _a_functionPrototypes = tmpMeta[0+1];
      _a_evaluationCode = tmpMeta[0+2];
    }
  }
  _return: OMC_LABEL_UNUSED
  if (out_a_functionPrototypes) { *out_a_functionPrototypes = _a_functionPrototypes; }
  if (out_a_evaluationCode) { *out_a_evaluationCode = _a_evaluationCode; }
  return _txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__63(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_eqsystem, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_context, modelica_string _in_a_FunctionnamePrefix, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_evaluationCode = NULL;
  modelica_metatype tmpMeta[3] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_evaluationCode has no default value.
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_string tmp4_5;modelica_string tmp4_6;modelica_metatype tmp4_7;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_eqsystem;
    tmp4_3 = _in_a_functionPrototypes;
    tmp4_4 = _in_a_context;
    tmp4_5 = _in_a_FunctionnamePrefix;
    tmp4_6 = _in_a_FileNamePrefix;
    tmp4_7 = _in_a_evaluationCode;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_metatype _a_context = NULL;
      modelica_string _a_FunctionnamePrefix = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_evaluationCode = NULL;
      modelica_metatype _i_whenEq = NULL;
      modelica_metatype _i_eqsystem = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_functionPrototypes has no default value.
      // _a_context has no default value.
      // _a_FunctionnamePrefix has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_evaluationCode has no default value.
      // _i_whenEq has no default value.
      // _i_eqsystem has no default value.
      tmp4 = 0;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,5) == 0) goto tmp3_end;
          
          _i_eqsystem = tmp4_2;
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_3;
          _a_context = tmp4_4;
          _a_FunctionnamePrefix = tmp4_5;
          _a_FileNamePrefix = tmp4_6;
          _a_evaluationCode = tmp4_7;
          /* Pattern matching succeeded */
          _a_evaluationCode = omc_CodegenOMSIC__Equations_generateEquationFunction(threadData, _a_evaluationCode, _i_eqsystem, _a_FileNamePrefix, _a_FunctionnamePrefix, _a_context, _a_functionPrototypes ,&_a_functionPrototypes);

          _a_evaluationCode = omc_Tpl_writeTok(threadData, _a_evaluationCode, _OMC_LIT27);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT470);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,5) == 0) goto tmp3_end;
          
          _i_eqsystem = tmp4_2;
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_3;
          _a_context = tmp4_4;
          _a_FunctionnamePrefix = tmp4_5;
          _a_FileNamePrefix = tmp4_6;
          _a_evaluationCode = tmp4_7;
          /* Pattern matching succeeded */
          _a_evaluationCode = omc_CodegenOMSIC__Equations_generateEquationFunction(threadData, _a_evaluationCode, _i_eqsystem, _a_FileNamePrefix, _a_FunctionnamePrefix, _a_context, _a_functionPrototypes ,&_a_functionPrototypes);

          _a_evaluationCode = omc_Tpl_writeTok(threadData, _a_evaluationCode, _OMC_LIT27);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 2: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,11) == 0) goto tmp3_end;
          
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_3;
          _a_evaluationCode = tmp4_7;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT472);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 3: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,15,7) == 0) goto tmp3_end;
          
          _i_whenEq = tmp4_2;
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_3;
          _a_context = tmp4_4;
          _a_FunctionnamePrefix = tmp4_5;
          _a_FileNamePrefix = tmp4_6;
          _a_evaluationCode = tmp4_7;
          /* Pattern matching succeeded */
          _a_evaluationCode = omc_CodegenOMSIC__Equations_generateEquationFunction(threadData, _a_evaluationCode, _i_whenEq, _a_FileNamePrefix, _a_FunctionnamePrefix, _a_context, _a_functionPrototypes ,&_a_functionPrototypes);

          _a_evaluationCode = omc_Tpl_writeTok(threadData, _a_evaluationCode, _OMC_LIT27);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 4: {
          
          _txt = tmp4_1;
          _a_functionPrototypes = tmp4_3;
          _a_evaluationCode = tmp4_7;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT474);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_functionPrototypes;
          tmpMeta[0+2] = _a_evaluationCode;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_functionPrototypes = tmpMeta[0+1];
  _out_a_evaluationCode = tmpMeta[0+2];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_evaluationCode) { *out_out_a_evaluationCode = _out_a_evaluationCode; }
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateOmsiFunctionCode__inner(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_omsiFunction, modelica_string _a_FileNamePrefix, modelica_string _a_modelFunctionnamePrefixStr, modelica_string _a_funcCallArgName, modelica_metatype _a_includes, modelica_metatype _a_evaluationCode, modelica_metatype _a_functionCall, modelica_metatype _a_residualCall, modelica_metatype _a_functionPrototypes, modelica_string _a_omsiName, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_evaluationCode, modelica_metatype *out_out_a_functionCall, modelica_metatype *out_out_a_residualCall, modelica_metatype *out_out_a_functionPrototypes)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype _out_a_evaluationCode = NULL;
  modelica_metatype _out_a_functionCall = NULL;
  modelica_metatype _out_a_residualCall = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _ret_3 = NULL;
  modelica_metatype _l_fullPathPrefix = NULL;
  modelica_metatype _ret_1 = NULL;
  modelica_metatype _l_fileNamePrefix = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_includes has no default value.
  // _out_a_evaluationCode has no default value.
  // _out_a_functionCall has no default value.
  // _out_a_residualCall has no default value.
  // _out_a_functionPrototypes has no default value.
  // _ret_3 has no default value.
  // _l_fullPathPrefix has no default value.
  // _ret_1 has no default value.
  // _l_fileNamePrefix has no default value.
  _ret_1 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fileNamePrefix = omc_CodegenUtilSimulation_fileNamePrefix(threadData, _OMC_LIT26, _ret_1);

  _ret_3 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fullPathPrefix = omc_CodegenUtilSimulation_fullPathPrefix(threadData, _OMC_LIT26, _ret_3);

  _out_txt = omc_CodegenOMSI__common_fun__61(threadData, _txt, _a_omsiFunction, _l_fullPathPrefix, _l_fileNamePrefix, _a_includes, _a_residualCall, _a_omsiName, _a_funcCallArgName, _a_functionCall, _a_functionPrototypes, _a_modelFunctionnamePrefixStr, _a_FileNamePrefix, _a_evaluationCode ,&_out_a_includes ,&_out_a_residualCall ,&_out_a_functionCall ,&_out_a_functionPrototypes ,&_out_a_evaluationCode);
  _return: OMC_LABEL_UNUSED
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  if (out_out_a_evaluationCode) { *out_out_a_evaluationCode = _out_a_evaluationCode; }
  if (out_out_a_functionCall) { *out_out_a_functionCall = _out_a_functionCall; }
  if (out_out_a_residualCall) { *out_out_a_residualCall = _out_a_residualCall; }
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__61(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_fullPathPrefix, modelica_metatype _in_a_fileNamePrefix, modelica_metatype _in_a_includes, modelica_metatype _in_a_residualCall, modelica_string _in_a_omsiName, modelica_string _in_a_funcCallArgName, modelica_metatype _in_a_functionCall, modelica_metatype _in_a_functionPrototypes, modelica_string _in_a_modelFunctionnamePrefixStr, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_residualCall, modelica_metatype *out_out_a_functionCall, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype _out_a_residualCall = NULL;
  modelica_metatype _out_a_functionCall = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_evaluationCode = NULL;
  modelica_metatype tmpMeta[6] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_includes has no default value.
  // _out_a_residualCall has no default value.
  // _out_a_functionCall has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_evaluationCode has no default value.
  
  
  
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;modelica_metatype tmp4_6;modelica_string tmp4_7;modelica_string tmp4_8;modelica_metatype tmp4_9;modelica_metatype tmp4_10;modelica_string tmp4_11;modelica_string tmp4_12;modelica_metatype tmp4_13;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_omsiFunction;
    tmp4_3 = _in_a_fullPathPrefix;
    tmp4_4 = _in_a_fileNamePrefix;
    tmp4_5 = _in_a_includes;
    tmp4_6 = _in_a_residualCall;
    tmp4_7 = _in_a_omsiName;
    tmp4_8 = _in_a_funcCallArgName;
    tmp4_9 = _in_a_functionCall;
    tmp4_10 = _in_a_functionPrototypes;
    tmp4_11 = _in_a_modelFunctionnamePrefixStr;
    tmp4_12 = _in_a_FileNamePrefix;
    tmp4_13 = _in_a_evaluationCode;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_fullPathPrefix = NULL;
      modelica_metatype _a_fileNamePrefix = NULL;
      modelica_metatype _a_includes = NULL;
      modelica_metatype _a_residualCall = NULL;
      modelica_string _a_omsiName = NULL;
      modelica_string _a_funcCallArgName = NULL;
      modelica_metatype _a_functionCall = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_string _a_modelFunctionnamePrefixStr = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_evaluationCode = NULL;
      modelica_metatype _i_context = NULL;
      modelica_metatype _i_equations = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_fullPathPrefix has no default value.
      // _a_fileNamePrefix has no default value.
      // _a_includes has no default value.
      // _a_residualCall has no default value.
      // _a_omsiName has no default value.
      // _a_funcCallArgName has no default value.
      // _a_functionCall has no default value.
      // _a_functionPrototypes has no default value.
      // _a_modelFunctionnamePrefixStr has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_evaluationCode has no default value.
      // _i_context has no default value.
      // _i_equations has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_metatype tmpMeta7;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 7));
          if (mmc__uniontype__metarecord__typedef__equal(tmpMeta7,9,1) == 0) goto tmp3_end;
          
          _i_equations = tmpMeta6;
          _i_context = tmpMeta7;
          _txt = tmp4_1;
          _a_fullPathPrefix = tmp4_3;
          _a_fileNamePrefix = tmp4_4;
          _a_includes = tmp4_5;
          _a_residualCall = tmp4_6;
          _a_omsiName = tmp4_7;
          _a_funcCallArgName = tmp4_8;
          _a_functionCall = tmp4_9;
          _a_functionPrototypes = tmp4_10;
          _a_modelFunctionnamePrefixStr = tmp4_11;
          _a_FileNamePrefix = tmp4_12;
          _a_evaluationCode = tmp4_13;
          /* Pattern matching succeeded */
          omc_CodegenOMSI__common_lm__60(threadData, _OMC_LIT26, _i_equations, _a_fullPathPrefix, _a_fileNamePrefix, _a_includes, _a_residualCall, _a_omsiName, _a_funcCallArgName, _a_functionCall, _a_functionPrototypes, _i_context, _a_modelFunctionnamePrefixStr, _a_FileNamePrefix, _a_evaluationCode ,&_a_includes ,&_a_residualCall ,&_a_functionCall ,&_a_functionPrototypes ,&_a_evaluationCode);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_residualCall;
          tmpMeta[0+3] = _a_functionCall;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          _a_includes = tmp4_5;
          _a_residualCall = tmp4_6;
          _a_functionCall = tmp4_9;
          _a_functionPrototypes = tmp4_10;
          _a_evaluationCode = tmp4_13;
          /* Pattern matching succeeded */
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_residualCall;
          tmpMeta[0+3] = _a_functionCall;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_evaluationCode;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_includes = tmpMeta[0+1];
  _out_a_residualCall = tmpMeta[0+2];
  _out_a_functionCall = tmpMeta[0+3];
  _out_a_functionPrototypes = tmpMeta[0+4];
  _out_a_evaluationCode = tmpMeta[0+5];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  if (out_out_a_residualCall) { *out_out_a_residualCall = _out_a_residualCall; }
  if (out_out_a_functionCall) { *out_out_a_functionCall = _out_a_functionCall; }
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_evaluationCode) { *out_out_a_evaluationCode = _out_a_evaluationCode; }
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_lm__60(threadData_t *threadData, modelica_metatype __omcQ_24in_5Ftxt, modelica_metatype _items, modelica_metatype _a_fullPathPrefix, modelica_metatype _a_fileNamePrefix, modelica_metatype __omcQ_24in_5Fa_5Fincludes, modelica_metatype __omcQ_24in_5Fa_5FresidualCall, modelica_string _a_omsiName, modelica_string _a_funcCallArgName, modelica_metatype __omcQ_24in_5Fa_5FfunctionCall, modelica_metatype __omcQ_24in_5Fa_5FfunctionPrototypes, modelica_metatype _a_context, modelica_string _a_modelFunctionnamePrefixStr, modelica_string _a_FileNamePrefix, modelica_metatype __omcQ_24in_5Fa_5FevaluationCode, modelica_metatype *out_a_includes, modelica_metatype *out_a_residualCall, modelica_metatype *out_a_functionCall, modelica_metatype *out_a_functionPrototypes, modelica_metatype *out_a_evaluationCode)
{
  modelica_metatype _txt = NULL;
  modelica_metatype _a_includes = NULL;
  modelica_metatype _a_residualCall = NULL;
  modelica_metatype _a_functionCall = NULL;
  modelica_metatype _a_functionPrototypes = NULL;
  modelica_metatype _a_evaluationCode = NULL;
  modelica_metatype tmpMeta1;
  modelica_metatype tmpMeta7;
  modelica_metatype tmpMeta[6] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  _txt = __omcQ_24in_5Ftxt;
  _a_includes = __omcQ_24in_5Fa_5Fincludes;
  _a_residualCall = __omcQ_24in_5Fa_5FresidualCall;
  _a_functionCall = __omcQ_24in_5Fa_5FfunctionCall;
  _a_functionPrototypes = __omcQ_24in_5Fa_5FfunctionPrototypes;
  _a_evaluationCode = __omcQ_24in_5Fa_5FevaluationCode;
  {
    modelica_metatype _lstElt_60;
    for (tmpMeta1 = _items; !listEmpty(tmpMeta1); tmpMeta1=MMC_CDR(tmpMeta1))
    {
      _lstElt_60 = MMC_CAR(tmpMeta1);
      
      
      
      
      
      
      { /* match expression */
        modelica_metatype tmp5_1;
        tmp5_1 = _lstElt_60;
        {
          modelica_metatype _i_eqsystem = NULL;
          volatile mmc_switch_type tmp5;
          int tmp6;
          // _i_eqsystem has no default value.
          tmp5 = 0;
          for (; tmp5 < 1; tmp5++) {
            switch (MMC_SWITCH_CAST(tmp5)) {
            case 0: {
              
              _i_eqsystem = tmp5_1;
              /* Pattern matching succeeded */
              tmpMeta[0+0] = omc_CodegenOMSI__common_fun__59(threadData, _txt, _i_eqsystem, _a_fullPathPrefix, _a_fileNamePrefix, _a_includes, _a_residualCall, _a_omsiName, _a_funcCallArgName, _a_functionCall, _a_functionPrototypes, _a_context, _a_modelFunctionnamePrefixStr, _a_FileNamePrefix, _a_evaluationCode, &tmpMeta[0+1], &tmpMeta[0+2], &tmpMeta[0+3], &tmpMeta[0+4], &tmpMeta[0+5]);
              goto tmp4_done;
            }
            }
            goto tmp4_end;
            tmp4_end: ;
          }
          goto goto_3;
          goto_3:;
          MMC_THROW_INTERNAL();
          goto tmp4_done;
          tmp4_done:;
        }
      }
      _txt = tmpMeta[0+0];
      _a_includes = tmpMeta[0+1];
      _a_residualCall = tmpMeta[0+2];
      _a_functionCall = tmpMeta[0+3];
      _a_functionPrototypes = tmpMeta[0+4];
      _a_evaluationCode = tmpMeta[0+5];
    }
  }
  _return: OMC_LABEL_UNUSED
  if (out_a_includes) { *out_a_includes = _a_includes; }
  if (out_a_residualCall) { *out_a_residualCall = _a_residualCall; }
  if (out_a_functionCall) { *out_a_functionCall = _a_functionCall; }
  if (out_a_functionPrototypes) { *out_a_functionPrototypes = _a_functionPrototypes; }
  if (out_a_evaluationCode) { *out_a_evaluationCode = _a_evaluationCode; }
  return _txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__59(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_eqsystem, modelica_metatype _in_a_fullPathPrefix, modelica_metatype _in_a_fileNamePrefix, modelica_metatype _in_a_includes, modelica_metatype _in_a_residualCall, modelica_string _in_a_omsiName, modelica_string _in_a_funcCallArgName, modelica_metatype _in_a_functionCall, modelica_metatype _in_a_functionPrototypes, modelica_metatype _in_a_context, modelica_string _in_a_modelFunctionnamePrefixStr, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype *out_out_a_includes, modelica_metatype *out_out_a_residualCall, modelica_metatype *out_out_a_functionCall, modelica_metatype *out_out_a_functionPrototypes, modelica_metatype *out_out_a_evaluationCode)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _out_a_includes = NULL;
  modelica_metatype _out_a_residualCall = NULL;
  modelica_metatype _out_a_functionCall = NULL;
  modelica_metatype _out_a_functionPrototypes = NULL;
  modelica_metatype _out_a_evaluationCode = NULL;
  modelica_metatype tmpMeta[6] __attribute__((unused)) = {0};
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _out_a_includes has no default value.
  // _out_a_residualCall has no default value.
  // _out_a_functionCall has no default value.
  // _out_a_functionPrototypes has no default value.
  // _out_a_evaluationCode has no default value.
  
  
  
  
  
  
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_metatype tmp4_4;modelica_metatype tmp4_5;modelica_metatype tmp4_6;modelica_string tmp4_7;modelica_string tmp4_8;modelica_metatype tmp4_9;modelica_metatype tmp4_10;modelica_metatype tmp4_11;modelica_string tmp4_12;modelica_string tmp4_13;modelica_metatype tmp4_14;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_eqsystem;
    tmp4_3 = _in_a_fullPathPrefix;
    tmp4_4 = _in_a_fileNamePrefix;
    tmp4_5 = _in_a_includes;
    tmp4_6 = _in_a_residualCall;
    tmp4_7 = _in_a_omsiName;
    tmp4_8 = _in_a_funcCallArgName;
    tmp4_9 = _in_a_functionCall;
    tmp4_10 = _in_a_functionPrototypes;
    tmp4_11 = _in_a_context;
    tmp4_12 = _in_a_modelFunctionnamePrefixStr;
    tmp4_13 = _in_a_FileNamePrefix;
    tmp4_14 = _in_a_evaluationCode;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_fullPathPrefix = NULL;
      modelica_metatype _a_fileNamePrefix = NULL;
      modelica_metatype _a_includes = NULL;
      modelica_metatype _a_residualCall = NULL;
      modelica_string _a_omsiName = NULL;
      modelica_string _a_funcCallArgName = NULL;
      modelica_metatype _a_functionCall = NULL;
      modelica_metatype _a_functionPrototypes = NULL;
      modelica_metatype _a_context = NULL;
      modelica_string _a_modelFunctionnamePrefixStr = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_evaluationCode = NULL;
      modelica_metatype _i_whenEq = NULL;
      modelica_integer _i_algSystem_algSysIndex;
      modelica_metatype _i_algSystem = NULL;
      modelica_integer _i_algSysIndex;
      modelica_metatype _i_eqsystem = NULL;
      modelica_metatype _txt_5 = NULL;
      modelica_metatype _txt_4 = NULL;
      modelica_metatype _l_content = NULL;
      modelica_metatype _txt_2 = NULL;
      modelica_metatype _txt_1 = NULL;
      modelica_metatype _txt_0 = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_fullPathPrefix has no default value.
      // _a_fileNamePrefix has no default value.
      // _a_includes has no default value.
      // _a_residualCall has no default value.
      // _a_omsiName has no default value.
      // _a_funcCallArgName has no default value.
      // _a_functionCall has no default value.
      // _a_functionPrototypes has no default value.
      // _a_context has no default value.
      // _a_modelFunctionnamePrefixStr has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_evaluationCode has no default value.
      // _i_whenEq has no default value.
      // _i_algSystem_algSysIndex has no default value.
      // _i_algSystem has no default value.
      // _i_algSysIndex has no default value.
      // _i_eqsystem has no default value.
      // _txt_5 has no default value.
      // _txt_4 has no default value.
      // _l_content has no default value.
      // _txt_2 has no default value.
      // _txt_1 has no default value.
      // _txt_0 has no default value.
      tmp4 = 0;
      for (; tmp4 < 5; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,3,5) == 0) goto tmp3_end;
          
          _i_eqsystem = tmp4_2;
          _txt = tmp4_1;
          _a_includes = tmp4_5;
          _a_residualCall = tmp4_6;
          _a_omsiName = tmp4_7;
          _a_funcCallArgName = tmp4_8;
          _a_functionCall = tmp4_9;
          _a_functionPrototypes = tmp4_10;
          _a_context = tmp4_11;
          _a_modelFunctionnamePrefixStr = tmp4_12;
          _a_FileNamePrefix = tmp4_13;
          _a_evaluationCode = tmp4_14;
          /* Pattern matching succeeded */
          _a_evaluationCode = omc_CodegenOMSIC__Equations_generateEquationFunction(threadData, _a_evaluationCode, _i_eqsystem, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, _a_context, _a_functionPrototypes ,&_a_functionPrototypes);

          _a_evaluationCode = omc_Tpl_writeTok(threadData, _a_evaluationCode, _OMC_LIT27);

          _txt_0 = omc_Tpl_writeStr(threadData, _OMC_LIT26, _a_funcCallArgName);

          _txt_0 = omc_Tpl_writeTok(threadData, _txt_0, _OMC_LIT476);

          _a_functionCall = omc_CodegenOMSIC__Equations_equationCall(threadData, _a_functionCall, _i_eqsystem, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, omc_Tpl_textString(threadData, _txt_0), _a_omsiName);

          _a_functionCall = omc_Tpl_writeTok(threadData, _a_functionCall, _OMC_LIT27);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_residualCall;
          tmpMeta[0+3] = _a_functionCall;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 1: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,5) == 0) goto tmp3_end;
          
          _i_eqsystem = tmp4_2;
          _txt = tmp4_1;
          _a_includes = tmp4_5;
          _a_residualCall = tmp4_6;
          _a_omsiName = tmp4_7;
          _a_funcCallArgName = tmp4_8;
          _a_functionCall = tmp4_9;
          _a_functionPrototypes = tmp4_10;
          _a_context = tmp4_11;
          _a_modelFunctionnamePrefixStr = tmp4_12;
          _a_FileNamePrefix = tmp4_13;
          _a_evaluationCode = tmp4_14;
          /* Pattern matching succeeded */
          _a_evaluationCode = omc_CodegenOMSIC__Equations_generateEquationFunction(threadData, _a_evaluationCode, _i_eqsystem, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, _a_context, _a_functionPrototypes ,&_a_functionPrototypes);

          _a_evaluationCode = omc_Tpl_writeTok(threadData, _a_evaluationCode, _OMC_LIT27);

          _txt_1 = omc_Tpl_writeStr(threadData, _OMC_LIT26, _a_funcCallArgName);

          _txt_1 = omc_Tpl_writeTok(threadData, _txt_1, _OMC_LIT478);

          _a_residualCall = omc_CodegenOMSIC__Equations_equationCall(threadData, _a_residualCall, _i_eqsystem, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, omc_Tpl_textString(threadData, _txt_1), _a_omsiName);

          _a_residualCall = omc_Tpl_writeTok(threadData, _a_residualCall, _OMC_LIT27);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_residualCall;
          tmpMeta[0+3] = _a_functionCall;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 2: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          modelica_integer tmp8;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,19,11) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          tmp8 = mmc_unbox_integer(tmpMeta6);
          
          _i_algSystem = tmp4_2;
          _i_algSystem_algSysIndex = tmp7  /* pattern as ty=Integer */;
          _i_algSysIndex = tmp8  /* pattern as ty=Integer */;
          _txt = tmp4_1;
          _a_fullPathPrefix = tmp4_3;
          _a_fileNamePrefix = tmp4_4;
          _a_includes = tmp4_5;
          _a_residualCall = tmp4_6;
          _a_omsiName = tmp4_7;
          _a_funcCallArgName = tmp4_8;
          _a_functionCall = tmp4_9;
          _a_functionPrototypes = tmp4_10;
          _a_modelFunctionnamePrefixStr = tmp4_12;
          _a_FileNamePrefix = tmp4_13;
          _a_evaluationCode = tmp4_14;
          /* Pattern matching succeeded */
          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT457);

          _a_includes = omc_Tpl_writeText(threadData, _a_includes, _a_fileNamePrefix);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT64);

          _a_includes = omc_Tpl_writeStr(threadData, _a_includes, _a_omsiName);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT396);

          _a_includes = omc_Tpl_writeStr(threadData, _a_includes, intString(_i_algSysIndex));

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT459);

          _a_includes = omc_Tpl_writeTok(threadData, _a_includes, _OMC_LIT27);

          _txt_2 = omc_Tpl_writeTok(threadData, _OMC_LIT26, _OMC_LIT480);

          _txt_2 = omc_Tpl_writeStr(threadData, _txt_2, _a_funcCallArgName);

          _txt_2 = omc_Tpl_writeTok(threadData, _txt_2, _OMC_LIT482);

          _txt_2 = omc_Tpl_writeStr(threadData, _txt_2, intString(_i_algSysIndex));

          _txt_2 = omc_Tpl_writeTok(threadData, _txt_2, _OMC_LIT484);

          _txt_2 = omc_Tpl_writeStr(threadData, _txt_2, _a_omsiName);

          _txt_2 = omc_Tpl_writeTok(threadData, _txt_2, _OMC_LIT486);

          _a_functionCall = omc_CodegenOMSIC__Equations_equationCall(threadData, _a_functionCall, _i_algSystem, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, omc_Tpl_textString(threadData, _txt_2), _a_omsiName);

          _a_functionCall = omc_Tpl_writeTok(threadData, _a_functionCall, _OMC_LIT27);

          _l_content = omc_CodegenOMSI__common_generateOmsiAlgSystemCode(threadData, _OMC_LIT26, _i_algSystem, _a_FileNamePrefix, _a_omsiName);

          _txt_4 = omc_Tpl_writeText(threadData, _OMC_LIT26, _a_fullPathPrefix);

          _txt_4 = omc_Tpl_writeTok(threadData, _txt_4, _OMC_LIT334);

          _txt_4 = omc_Tpl_writeText(threadData, _txt_4, _a_fileNamePrefix);

          _txt_4 = omc_Tpl_writeTok(threadData, _txt_4, _OMC_LIT64);

          _txt_4 = omc_Tpl_writeStr(threadData, _txt_4, _a_omsiName);

          _txt_4 = omc_Tpl_writeTok(threadData, _txt_4, _OMC_LIT396);

          _txt_4 = omc_Tpl_writeStr(threadData, _txt_4, intString(_i_algSystem_algSysIndex));

          _txt_4 = omc_Tpl_writeTok(threadData, _txt_4, _OMC_LIT336);

          omc_Tpl_textFile(threadData, _l_content, omc_Tpl_textString(threadData, _txt_4));
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_residualCall;
          tmpMeta[0+3] = _a_functionCall;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 3: {
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,15,7) == 0) goto tmp3_end;
          
          _i_whenEq = tmp4_2;
          _txt = tmp4_1;
          _a_includes = tmp4_5;
          _a_residualCall = tmp4_6;
          _a_omsiName = tmp4_7;
          _a_funcCallArgName = tmp4_8;
          _a_functionCall = tmp4_9;
          _a_functionPrototypes = tmp4_10;
          _a_context = tmp4_11;
          _a_modelFunctionnamePrefixStr = tmp4_12;
          _a_FileNamePrefix = tmp4_13;
          _a_evaluationCode = tmp4_14;
          /* Pattern matching succeeded */
          _a_evaluationCode = omc_CodegenOMSIC__Equations_generateEquationFunction(threadData, _a_evaluationCode, _i_whenEq, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, _a_context, _a_functionPrototypes ,&_a_functionPrototypes);

          _a_evaluationCode = omc_Tpl_writeTok(threadData, _a_evaluationCode, _OMC_LIT27);

          _txt_5 = omc_Tpl_writeStr(threadData, _OMC_LIT26, _a_funcCallArgName);

          _txt_5 = omc_Tpl_writeTok(threadData, _txt_5, _OMC_LIT476);

          _a_functionCall = omc_CodegenOMSIC__Equations_equationCall(threadData, _a_functionCall, _i_whenEq, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, omc_Tpl_textString(threadData, _txt_5), _a_omsiName);

          _a_functionCall = omc_Tpl_writeTok(threadData, _a_functionCall, _OMC_LIT27);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_residualCall;
          tmpMeta[0+3] = _a_functionCall;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_evaluationCode;
          goto tmp3_done;
        }
        case 4: {
          
          _txt = tmp4_1;
          _a_includes = tmp4_5;
          _a_residualCall = tmp4_6;
          _a_functionCall = tmp4_9;
          _a_functionPrototypes = tmp4_10;
          _a_evaluationCode = tmp4_14;
          /* Pattern matching succeeded */
          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT474);
          tmpMeta[0+0] = _txt;
          tmpMeta[0+1] = _a_includes;
          tmpMeta[0+2] = _a_residualCall;
          tmpMeta[0+3] = _a_functionCall;
          tmpMeta[0+4] = _a_functionPrototypes;
          tmpMeta[0+5] = _a_evaluationCode;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta[0+0];
  _out_a_includes = tmpMeta[0+1];
  _out_a_residualCall = tmpMeta[0+2];
  _out_a_functionCall = tmpMeta[0+3];
  _out_a_functionPrototypes = tmpMeta[0+4];
  _out_a_evaluationCode = tmpMeta[0+5];
  _return: OMC_LABEL_UNUSED
  if (out_out_a_includes) { *out_out_a_includes = _out_a_includes; }
  if (out_out_a_residualCall) { *out_out_a_residualCall = _out_a_residualCall; }
  if (out_out_a_functionCall) { *out_out_a_functionCall = _out_a_functionCall; }
  if (out_out_a_functionPrototypes) { *out_out_a_functionPrototypes = _out_a_functionPrototypes; }
  if (out_out_a_evaluationCode) { *out_out_a_evaluationCode = _out_a_evaluationCode; }
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_lastIdentOfPath(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_modelName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_modelName;
    {
      modelica_metatype _txt = NULL;
      modelica_string _i_name = NULL;
      modelica_metatype _i_path = NULL;
      int tmp4;
      // _txt has no default value.
      // _i_name has no default value.
      // _i_path has no default value.
      {
        switch (MMC_SWITCH_CAST(valueConstructor(tmp4_2))) {
        case 3: {
          modelica_metatype tmpMeta5;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,0,2) == 0) goto tmp3_end;
          tmpMeta5 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 3));
          
          _i_path = tmpMeta5;
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _in_txt = _txt;
          _in_a_modelName = _i_path;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        case 4: {
          modelica_metatype tmpMeta6;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,1,1) == 0) goto tmp3_end;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          
          _i_name = tmpMeta6;
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeStr(threadData, _txt, _i_name);
          goto tmp3_done;
        }
        case 5: {
          modelica_metatype tmpMeta7;
          if (mmc__uniontype__metarecord__typedef__equal(tmp4_2,2,1) == 0) goto tmp3_end;
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          
          _i_path = tmpMeta7;
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          /* Tail recursive call */
          _in_txt = _txt;
          _in_a_modelName = _i_path;
          goto _tailrecursive;
          /* TODO: Make sure any eventual dead code below is never generated */
          goto tmp3_done;
        }
        default:
        tmp3_default: OMC_LABEL_UNUSED; {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateOmsiFunctionCode(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_omsiFunction, modelica_string _a_FileNamePrefix, modelica_string _a_modelFunctionnamePrefixStr, modelica_string _a_omsiName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _txt_12 = NULL;
  modelica_metatype _l_headerFileContent = NULL;
  modelica_metatype _l_headerFileName = NULL;
  modelica_metatype _l_0__ = NULL;
  modelica_metatype _l_initializationCode = NULL;
  modelica_metatype _ret_7 = NULL;
  modelica_metatype _l_fullPathPrefix = NULL;
  modelica_metatype _ret_5 = NULL;
  modelica_metatype _l_fileNamePrefix = NULL;
  modelica_metatype _l_functionPrototypes = NULL;
  modelica_metatype _l_functionCall = NULL;
  modelica_metatype _l_evaluationCode = NULL;
  modelica_metatype _l_includes = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _txt_12 has no default value.
  // _l_headerFileContent has no default value.
  // _l_headerFileName has no default value.
  // _l_0__ has no default value.
  // _l_initializationCode has no default value.
  // _ret_7 has no default value.
  // _l_fullPathPrefix has no default value.
  // _ret_5 has no default value.
  // _l_fileNamePrefix has no default value.
  // _l_functionPrototypes has no default value.
  // _l_functionCall has no default value.
  // _l_evaluationCode has no default value.
  // _l_includes has no default value.
  _l_includes = _OMC_LIT26;

  _l_evaluationCode = _OMC_LIT26;

  _l_functionCall = _OMC_LIT26;

  _l_functionPrototypes = _OMC_LIT26;

  _ret_5 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fileNamePrefix = omc_CodegenUtilSimulation_fileNamePrefix(threadData, _OMC_LIT26, _ret_5);

  _ret_7 = omc_SimCodeUtil_getSimCode(threadData);

  _l_fullPathPrefix = omc_CodegenUtilSimulation_fullPathPrefix(threadData, _OMC_LIT26, _ret_7);

  _l_initializationCode = omc_CodegenOMSI__common_generateInitalizationOMSIFunction(threadData, _OMC_LIT26, _a_omsiFunction, _OMC_LIT487, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, _l_functionPrototypes, _l_includes, 0 /* false */, _a_omsiName ,&_l_functionPrototypes ,&_l_includes);

  _l_0__ = omc_CodegenOMSI__common_generateOmsiFunctionCode__inner(threadData, _OMC_LIT26, _a_omsiFunction, _a_FileNamePrefix, _a_modelFunctionnamePrefixStr, _a_omsiName, _l_includes, _l_evaluationCode, _l_functionCall, omc_Tpl_strTokText(threadData, _OMC_LIT488), _l_functionPrototypes, _a_omsiName ,&_l_includes ,&_l_evaluationCode ,&_l_functionCall ,NULL ,&_l_functionPrototypes);

  _l_functionPrototypes = omc_Tpl_writeTok(threadData, _l_functionPrototypes, _OMC_LIT89);

  _l_functionPrototypes = omc_Tpl_writeStr(threadData, _l_functionPrototypes, _a_FileNamePrefix);

  _l_functionPrototypes = omc_Tpl_writeTok(threadData, _l_functionPrototypes, _OMC_LIT64);

  _l_functionPrototypes = omc_Tpl_writeStr(threadData, _l_functionPrototypes, _a_omsiName);

  _l_functionPrototypes = omc_Tpl_writeTok(threadData, _l_functionPrototypes, _OMC_LIT490);

  _l_functionPrototypes = omc_Tpl_writeTok(threadData, _l_functionPrototypes, _OMC_LIT27);

  _l_headerFileName = omc_Tpl_writeText(threadData, _OMC_LIT26, _l_fileNamePrefix);

  _l_headerFileName = omc_Tpl_writeTok(threadData, _l_headerFileName, _OMC_LIT64);

  _l_headerFileName = omc_Tpl_writeStr(threadData, _l_headerFileName, _a_omsiName);

  _l_headerFileContent = omc_CodegenOMSI__common_generateCodeHeader(threadData, _OMC_LIT26, _a_FileNamePrefix, _l_includes, omc_Tpl_textString(threadData, _l_headerFileName), _l_functionPrototypes ,&_l_includes ,&_l_functionPrototypes);

  _txt_12 = omc_Tpl_writeText(threadData, _OMC_LIT26, _l_fullPathPrefix);

  _txt_12 = omc_Tpl_writeTok(threadData, _txt_12, _OMC_LIT334);

  _txt_12 = omc_Tpl_writeText(threadData, _txt_12, _l_headerFileName);

  _txt_12 = omc_Tpl_writeTok(threadData, _txt_12, _OMC_LIT338);

  omc_Tpl_textFile(threadData, _l_headerFileContent, omc_Tpl_textString(threadData, _txt_12));

  _out_txt = omc_CodegenOMSI__common_fun__56(threadData, _txt, _a_omsiFunction, _l_functionCall, _a_omsiName, _a_FileNamePrefix, _l_evaluationCode, _l_initializationCode, _l_headerFileName);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__56(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_omsiFunction, modelica_metatype _in_a_functionCall, modelica_string _in_a_omsiName, modelica_string _in_a_FileNamePrefix, modelica_metatype _in_a_evaluationCode, modelica_metatype _in_a_initializationCode, modelica_metatype _in_a_headerFileName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;modelica_string tmp4_4;modelica_string tmp4_5;modelica_metatype tmp4_6;modelica_metatype tmp4_7;modelica_metatype tmp4_8;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_omsiFunction;
    tmp4_3 = _in_a_functionCall;
    tmp4_4 = _in_a_omsiName;
    tmp4_5 = _in_a_FileNamePrefix;
    tmp4_6 = _in_a_evaluationCode;
    tmp4_7 = _in_a_initializationCode;
    tmp4_8 = _in_a_headerFileName;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_functionCall = NULL;
      modelica_string _a_omsiName = NULL;
      modelica_string _a_FileNamePrefix = NULL;
      modelica_metatype _a_evaluationCode = NULL;
      modelica_metatype _a_initializationCode = NULL;
      modelica_metatype _a_headerFileName = NULL;
      modelica_integer _i_nAlgebraicSystems;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_functionCall has no default value.
      // _a_omsiName has no default value.
      // _a_FileNamePrefix has no default value.
      // _a_evaluationCode has no default value.
      // _a_initializationCode has no default value.
      // _a_headerFileName has no default value.
      // _i_nAlgebraicSystems has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          modelica_metatype tmpMeta6;
          modelica_integer tmp7;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 8));
          tmp7 = mmc_unbox_integer(tmpMeta6);
          
          _txt = tmp4_1;
          _i_nAlgebraicSystems = tmp7  /* pattern as ty=Integer */;
          _a_functionCall = tmp4_3;
          _a_omsiName = tmp4_4;
          _a_FileNamePrefix = tmp4_5;
          _a_evaluationCode = tmp4_6;
          _a_initializationCode = tmp4_7;
          _a_headerFileName = tmp4_8;
          /* Pattern matching succeeded */
          _txt = omc_CodegenOMSI__common_insertCopyrightOpenModelica(threadData, _txt);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT492);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT39);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT457);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_headerFileName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT493);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT500);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_initializationCode);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT504);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_evaluationCode);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT509);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_FileNamePrefix);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT64);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT511);

          _txt = omc_Tpl_writeStr(threadData, _txt, _a_omsiName);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT522);

          _txt = omc_Tpl_pushBlock(threadData, _txt, _OMC_LIT39);

          _txt = omc_CodegenOMSI__common_fun__55(threadData, _txt, _i_nAlgebraicSystems);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);

          _txt = omc_Tpl_writeText(threadData, _txt, _a_functionCall);

          _txt = omc_Tpl_softNewLine(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT526);

          _txt = omc_Tpl_popBlock(threadData, _txt);

          _txt = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT527);
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT27);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__55(threadData_t *threadData, modelica_metatype _in_txt, modelica_integer _in_a_nAlgebraicSystems)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_integer tmp4_2;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_nAlgebraicSystems;
    {
      modelica_metatype _txt = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      tmp4 = 0;
      for (; tmp4 < 2; tmp4++) {
        switch (MMC_SWITCH_CAST(tmp4)) {
        case 0: {
          if (0 != tmp4_2) goto tmp3_end;
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = omc_Tpl_writeTok(threadData, _txt, _OMC_LIT529);
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}
PROTECTED_FUNCTION_STATIC modelica_metatype boxptr_CodegenOMSI__common_fun__55(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_nAlgebraicSystems)
{
  modelica_integer tmp1;
  modelica_metatype _out_txt = NULL;
  tmp1 = mmc_unbox_integer(_in_a_nAlgebraicSystems);
  _out_txt = omc_CodegenOMSI__common_fun__55(threadData, _in_txt, tmp1);
  /* skip box _out_txt; Tpl.Text */
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateEquationsCode(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_simCode, modelica_string _a_FileNamePrefix)
{
  modelica_metatype _out_txt = NULL;
  modelica_string _ret_1 = NULL;
  modelica_metatype _l_modelNameOMSIC = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _ret_1 has no default value.
  // _l_modelNameOMSIC has no default value.
  _ret_1 = omc_System_makeC89Identifier(threadData, _a_FileNamePrefix);

  _l_modelNameOMSIC = omc_Tpl_writeStr(threadData, _OMC_LIT26, _ret_1);

  _out_txt = omc_CodegenOMSI__common_fun__53(threadData, _txt, _a_simCode, _l_modelNameOMSIC);
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

PROTECTED_FUNCTION_STATIC modelica_metatype omc_CodegenOMSI__common_fun__53(threadData_t *threadData, modelica_metatype _in_txt, modelica_metatype _in_a_simCode, modelica_metatype _in_a_modelNameOMSIC)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype tmpMeta1;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  { /* match expression */
    modelica_metatype tmp4_1;modelica_metatype tmp4_2;modelica_metatype tmp4_3;
    tmp4_1 = _in_txt;
    tmp4_2 = _in_a_simCode;
    tmp4_3 = _in_a_modelNameOMSIC;
    {
      modelica_metatype _txt = NULL;
      modelica_metatype _a_modelNameOMSIC = NULL;
      modelica_metatype _i_initialization = NULL;
      modelica_string _i_fileNamePrefix = NULL;
      modelica_string _i_fullPathPrefix = NULL;
      modelica_metatype _i_simulation = NULL;
      modelica_metatype _txt_4 = NULL;
      modelica_metatype _l_content_1 = NULL;
      modelica_metatype _txt_2 = NULL;
      modelica_metatype _l_content = NULL;
      modelica_metatype _l_modelNamePrefix = NULL;
      volatile mmc_switch_type tmp4;
      int tmp5;
      // _txt has no default value.
      // _a_modelNameOMSIC has no default value.
      // _i_initialization has no default value.
      // _i_fileNamePrefix has no default value.
      // _i_fullPathPrefix has no default value.
      // _i_simulation has no default value.
      // _txt_4 has no default value.
      // _l_content_1 has no default value.
      // _txt_2 has no default value.
      // _l_content has no default value.
      // _l_modelNamePrefix 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;
          tmpMeta6 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 2));
          tmpMeta7 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 37));
          tmpMeta8 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 38));
          tmpMeta9 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmp4_2), 52));
          if (optionNone(tmpMeta9)) goto tmp3_end;
          tmpMeta10 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta9), 1));
          tmpMeta11 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 2));
          tmpMeta12 = MMC_FETCH(MMC_OFFSET(MMC_UNTAGPTR(tmpMeta10), 3));
          
          _i_fileNamePrefix = tmpMeta7;
          _i_fullPathPrefix = tmpMeta8;
          _i_initialization = tmpMeta11;
          _i_simulation = tmpMeta12;
          _txt = tmp4_1;
          _a_modelNameOMSIC = tmp4_3;
          /* Pattern matching succeeded */
          _l_modelNamePrefix = omc_Tpl_writeText(threadData, _OMC_LIT26, _a_modelNameOMSIC);

          _l_content = omc_CodegenOMSI__common_generateOmsiFunctionCode(threadData, _OMC_LIT26, _i_simulation, omc_Tpl_textString(threadData, _l_modelNamePrefix), _OMC_LIT275, _OMC_LIT530);

          _txt_2 = omc_Tpl_writeStr(threadData, _OMC_LIT26, _i_fullPathPrefix);

          _txt_2 = omc_Tpl_writeTok(threadData, _txt_2, _OMC_LIT334);

          _txt_2 = omc_Tpl_writeStr(threadData, _txt_2, _i_fileNamePrefix);

          _txt_2 = omc_Tpl_writeTok(threadData, _txt_2, _OMC_LIT532);

          omc_Tpl_textFile(threadData, _l_content, omc_Tpl_textString(threadData, _txt_2));

          _l_content_1 = omc_CodegenOMSI__common_generateOmsiFunctionCode(threadData, _OMC_LIT26, _i_initialization, omc_Tpl_textString(threadData, _l_modelNamePrefix), _OMC_LIT275, _OMC_LIT533);

          _txt_4 = omc_Tpl_writeStr(threadData, _OMC_LIT26, _i_fullPathPrefix);

          _txt_4 = omc_Tpl_writeTok(threadData, _txt_4, _OMC_LIT334);

          _txt_4 = omc_Tpl_writeStr(threadData, _txt_4, _i_fileNamePrefix);

          _txt_4 = omc_Tpl_writeTok(threadData, _txt_4, _OMC_LIT535);

          omc_Tpl_textFile(threadData, _l_content_1, omc_Tpl_textString(threadData, _txt_4));
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        case 1: {
          
          _txt = tmp4_1;
          /* Pattern matching succeeded */
          tmpMeta1 = _txt;
          goto tmp3_done;
        }
        }
        goto tmp3_end;
        tmp3_end: ;
      }
      goto goto_2;
      goto_2:;
      MMC_THROW_INTERNAL();
      goto tmp3_done;
      tmp3_done:;
    }
  }
  _out_txt = tmpMeta1;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

DLLDirection
modelica_metatype omc_CodegenOMSI__common_generateFMUModelDescriptionFile(threadData_t *threadData, modelica_metatype _txt, modelica_metatype _a_simCode, modelica_string _a_guid, modelica_string _a_FMUVersion, modelica_string _a_FMUType, modelica_metatype _a_sourceFiles, modelica_string _a_fileName)
{
  modelica_metatype _out_txt = NULL;
  modelica_metatype _l_content = NULL;
  MMC_SO();
  _tailrecursive: OMC_LABEL_UNUSED
  // _out_txt has no default value.
  // _l_content has no default value.
  _l_content = omc_CodegenFMU_fmuModelDescriptionFile(threadData, _OMC_LIT26, _a_simCode, _a_guid, _a_FMUVersion, _a_FMUType, _a_sourceFiles);

  omc_Tpl_textFile(threadData, _l_content, _a_fileName);

  _out_txt = _txt;
  _return: OMC_LABEL_UNUSED
  return _out_txt;
}

