/* Include files */

#include "blascompat32.h"
#include "ental_sfun.h"
#include "c6_ental.h"
#include "mwmathutil.h"
#define CHARTINSTANCE_CHARTNUMBER      (chartInstance->chartNumber)
#define CHARTINSTANCE_INSTANCENUMBER   (chartInstance->instanceNumber)
#include "ental_sfun_debug_macros.h"

/* Type Definitions */

/* Named Constants */

/* Variable Declarations */

/* Variable Definitions */
static const char *c6_debug_family_names[55] = { "p", "N", "M", "a", "b",
  "jStart", "jStop", "n", "Tc", "va", "S", "jj", "i", "k", "jstart", "jstop",
  "j", "Tc1", "Tc2", "ve", "TSa", "TSe", "V", "nargin", "nargout", "A", "B", "C",
  "D", "E", "beta", "delta", "w1", "w2", "w3", "Tw", "Tt", "Td", "TS", "TTS",
  "OPv", "OPm", "u", "v", "vv", "vzp", "htc", "minHtc", "maxHtc", "zpozdeni",
  "htc1", "v1", "V1", "V2", "V3" };

/* Function Declarations */
static void initialize_c6_ental(SFc6_entalInstanceStruct *chartInstance);
static void initialize_params_c6_ental(SFc6_entalInstanceStruct *chartInstance);
static void enable_c6_ental(SFc6_entalInstanceStruct *chartInstance);
static void disable_c6_ental(SFc6_entalInstanceStruct *chartInstance);
static void c6_update_debugger_state_c6_ental(SFc6_entalInstanceStruct
  *chartInstance);
static const mxArray *get_sim_state_c6_ental(SFc6_entalInstanceStruct
  *chartInstance);
static void set_sim_state_c6_ental(SFc6_entalInstanceStruct *chartInstance,
  const mxArray *c6_st);
static void finalize_c6_ental(SFc6_entalInstanceStruct *chartInstance);
static void sf_c6_ental(SFc6_entalInstanceStruct *chartInstance);
static void c6_c6_ental(SFc6_entalInstanceStruct *chartInstance);
static void compInitSubchartSimstructsFcn_c6_ental(SFc6_entalInstanceStruct
  *chartInstance);
static void init_script_number_translation(uint32_T c6_machineNumber, uint32_T
  c6_chartNumber);
static real_T c6_max(SFc6_entalInstanceStruct *chartInstance, real_T
                     c6_varargin_1[13]);
static real_T c6_sum(SFc6_entalInstanceStruct *chartInstance, real_T c6_x_data
                     [150], int32_T c6_x_sizes[2]);
static real_T c6_b_max(SFc6_entalInstanceStruct *chartInstance, real_T
  c6_varargin_1_data[13], int32_T c6_varargin_1_sizes[1]);
static void c6_power(SFc6_entalInstanceStruct *chartInstance, real_T c6_a[13],
                     real_T c6_b, real_T c6_y[13]);
static void c6_eml_error(SFc6_entalInstanceStruct *chartInstance);
static void c6_b_power(SFc6_entalInstanceStruct *chartInstance, real_T c6_a[13],
  real_T c6_b[13], real_T c6_y[13]);
static const mxArray *c6_sf_marshall(void *chartInstanceVoid, void *c6_u);
static const mxArray *c6_b_sf_marshall(void *chartInstanceVoid, void *c6_u);
static const mxArray *c6_c_sf_marshall(void *chartInstanceVoid, void *c6_u);
static const mxArray *c6_d_sf_marshall(void *chartInstanceVoid, void *c6_u);
static const mxArray *c6_e_sf_marshall(void *chartInstanceVoid, void *c6_u);
static void c6_info_helper(c6_ResolvedFunctionInfo c6_info[49]);
static const mxArray *c6_f_sf_marshall(void *chartInstanceVoid, void *c6_u);
static void c6_emlrt_marshallIn(SFc6_entalInstanceStruct *chartInstance, const
  mxArray *c6_V1, const char_T *c6_name, real_T c6_y[13]);
static real_T c6_b_emlrt_marshallIn(SFc6_entalInstanceStruct *chartInstance,
  const mxArray *c6_v1, const char_T *c6_name);
static uint8_T c6_c_emlrt_marshallIn(SFc6_entalInstanceStruct *chartInstance,
  const mxArray *c6_b_is_active_c6_ental, const char_T *c6_name);
static void init_dsm_address_info(SFc6_entalInstanceStruct *chartInstance);

/* Function Definitions */
static void initialize_c6_ental(SFc6_entalInstanceStruct *chartInstance)
{
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  chartInstance->c6_is_active_c6_ental = 0U;
}

static void initialize_params_c6_ental(SFc6_entalInstanceStruct *chartInstance)
{
}

static void enable_c6_ental(SFc6_entalInstanceStruct *chartInstance)
{
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
}

static void disable_c6_ental(SFc6_entalInstanceStruct *chartInstance)
{
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
}

static void c6_update_debugger_state_c6_ental(SFc6_entalInstanceStruct
  *chartInstance)
{
}

static const mxArray *get_sim_state_c6_ental(SFc6_entalInstanceStruct
  *chartInstance)
{
  const mxArray *c6_st = NULL;
  const mxArray *c6_y = NULL;
  int32_T c6_i0;
  real_T c6_hoistedGlobal[13];
  int32_T c6_i1;
  real_T c6_u[13];
  const mxArray *c6_b_y = NULL;
  int32_T c6_i2;
  real_T c6_b_hoistedGlobal[13];
  int32_T c6_i3;
  real_T c6_b_u[13];
  const mxArray *c6_c_y = NULL;
  int32_T c6_i4;
  real_T c6_c_hoistedGlobal[13];
  int32_T c6_i5;
  real_T c6_c_u[13];
  const mxArray *c6_d_y = NULL;
  int32_T c6_i6;
  real_T c6_d_hoistedGlobal[13];
  int32_T c6_i7;
  real_T c6_d_u[13];
  const mxArray *c6_e_y = NULL;
  real_T c6_e_hoistedGlobal;
  real_T c6_e_u;
  const mxArray *c6_f_y = NULL;
  uint8_T c6_f_hoistedGlobal;
  uint8_T c6_f_u;
  const mxArray *c6_g_y = NULL;
  real_T *c6_v1;
  real_T (*c6_htc1)[13];
  real_T (*c6_V3)[13];
  real_T (*c6_V2)[13];
  real_T (*c6_V1)[13];
  c6_V3 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 5);
  c6_V2 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 4);
  c6_V1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 3);
  c6_v1 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c6_htc1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 1);
  c6_st = NULL;
  c6_y = NULL;
  sf_mex_assign(&c6_y, sf_mex_createcellarray(6));
  for (c6_i0 = 0; c6_i0 < 13; c6_i0 = c6_i0 + 1) {
    c6_hoistedGlobal[c6_i0] = (*c6_V1)[c6_i0];
  }

  for (c6_i1 = 0; c6_i1 < 13; c6_i1 = c6_i1 + 1) {
    c6_u[c6_i1] = c6_hoistedGlobal[c6_i1];
  }

  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_u, 0, 0U, 1U, 0U, 1, 13));
  sf_mex_setcell(c6_y, 0, c6_b_y);
  for (c6_i2 = 0; c6_i2 < 13; c6_i2 = c6_i2 + 1) {
    c6_b_hoistedGlobal[c6_i2] = (*c6_V2)[c6_i2];
  }

  for (c6_i3 = 0; c6_i3 < 13; c6_i3 = c6_i3 + 1) {
    c6_b_u[c6_i3] = c6_b_hoistedGlobal[c6_i3];
  }

  c6_c_y = NULL;
  sf_mex_assign(&c6_c_y, sf_mex_create("y", c6_b_u, 0, 0U, 1U, 0U, 1, 13));
  sf_mex_setcell(c6_y, 1, c6_c_y);
  for (c6_i4 = 0; c6_i4 < 13; c6_i4 = c6_i4 + 1) {
    c6_c_hoistedGlobal[c6_i4] = (*c6_V3)[c6_i4];
  }

  for (c6_i5 = 0; c6_i5 < 13; c6_i5 = c6_i5 + 1) {
    c6_c_u[c6_i5] = c6_c_hoistedGlobal[c6_i5];
  }

  c6_d_y = NULL;
  sf_mex_assign(&c6_d_y, sf_mex_create("y", c6_c_u, 0, 0U, 1U, 0U, 1, 13));
  sf_mex_setcell(c6_y, 2, c6_d_y);
  for (c6_i6 = 0; c6_i6 < 13; c6_i6 = c6_i6 + 1) {
    c6_d_hoistedGlobal[c6_i6] = (*c6_htc1)[c6_i6];
  }

  for (c6_i7 = 0; c6_i7 < 13; c6_i7 = c6_i7 + 1) {
    c6_d_u[c6_i7] = c6_d_hoistedGlobal[c6_i7];
  }

  c6_e_y = NULL;
  sf_mex_assign(&c6_e_y, sf_mex_create("y", c6_d_u, 0, 0U, 1U, 0U, 1, 13));
  sf_mex_setcell(c6_y, 3, c6_e_y);
  c6_e_hoistedGlobal = *c6_v1;
  c6_e_u = c6_e_hoistedGlobal;
  c6_f_y = NULL;
  sf_mex_assign(&c6_f_y, sf_mex_create("y", &c6_e_u, 0, 0U, 0U, 0U, 0));
  sf_mex_setcell(c6_y, 4, c6_f_y);
  c6_f_hoistedGlobal = chartInstance->c6_is_active_c6_ental;
  c6_f_u = c6_f_hoistedGlobal;
  c6_g_y = NULL;
  sf_mex_assign(&c6_g_y, sf_mex_create("y", &c6_f_u, 3, 0U, 0U, 0U, 0));
  sf_mex_setcell(c6_y, 5, c6_g_y);
  sf_mex_assign(&c6_st, c6_y);
  return c6_st;
}

static void set_sim_state_c6_ental(SFc6_entalInstanceStruct *chartInstance,
  const mxArray *c6_st)
{
  const mxArray *c6_u;
  real_T c6_dv0[13];
  int32_T c6_i8;
  real_T c6_dv1[13];
  int32_T c6_i9;
  real_T c6_dv2[13];
  int32_T c6_i10;
  real_T c6_dv3[13];
  int32_T c6_i11;
  real_T *c6_v1;
  real_T (*c6_V1)[13];
  real_T (*c6_V2)[13];
  real_T (*c6_V3)[13];
  real_T (*c6_htc1)[13];
  c6_V3 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 5);
  c6_V2 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 4);
  c6_V1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 3);
  c6_v1 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c6_htc1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 1);
  chartInstance->c6_doneDoubleBufferReInit = TRUE;
  c6_u = sf_mex_dup(c6_st);
  c6_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c6_u, 0)), "V1",
                      c6_dv0);
  for (c6_i8 = 0; c6_i8 < 13; c6_i8 = c6_i8 + 1) {
    (*c6_V1)[c6_i8] = c6_dv0[c6_i8];
  }

  c6_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c6_u, 1)), "V2",
                      c6_dv1);
  for (c6_i9 = 0; c6_i9 < 13; c6_i9 = c6_i9 + 1) {
    (*c6_V2)[c6_i9] = c6_dv1[c6_i9];
  }

  c6_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c6_u, 2)), "V3",
                      c6_dv2);
  for (c6_i10 = 0; c6_i10 < 13; c6_i10 = c6_i10 + 1) {
    (*c6_V3)[c6_i10] = c6_dv2[c6_i10];
  }

  c6_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c6_u, 3)), "htc1",
                      c6_dv3);
  for (c6_i11 = 0; c6_i11 < 13; c6_i11 = c6_i11 + 1) {
    (*c6_htc1)[c6_i11] = c6_dv3[c6_i11];
  }

  *c6_v1 = c6_b_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c6_u,
    4)), "v1");
  chartInstance->c6_is_active_c6_ental = c6_c_emlrt_marshallIn(chartInstance,
    sf_mex_dup(sf_mex_getcell(c6_u, 5)),
    "is_active_c6_ental");
  sf_mex_destroy(&c6_u);
  c6_update_debugger_state_c6_ental(chartInstance);
  sf_mex_destroy(&c6_st);
}

static void finalize_c6_ental(SFc6_entalInstanceStruct *chartInstance)
{
}

static void sf_c6_ental(SFc6_entalInstanceStruct *chartInstance)
{
  int32_T c6_i12;
  int32_T c6_i13;
  int32_T c6_i14;
  int32_T c6_i15;
  int32_T c6_i16;
  int32_T c6_i17;
  int32_T c6_i18;
  int32_T c6_i19;
  int32_T c6_i20;
  int32_T c6_i21;
  int32_T c6_i22;
  int32_T c6_i23;
  int32_T c6_i24;
  int32_T c6_i25;
  int32_T c6_i26;
  int32_T c6_i27;
  int32_T c6_i28;
  int32_T c6_i29;
  int32_T c6_i30;
  int32_T c6_i31;
  int32_T c6_previousEvent;
  real_T *c6_w1;
  real_T *c6_w2;
  real_T *c6_w3;
  real_T *c6_Tw;
  real_T *c6_Td;
  real_T *c6_TTS;
  real_T *c6_vv;
  real_T *c6_v1;
  real_T *c6_minHtc;
  real_T *c6_maxHtc;
  real_T (*c6_zpozdeni)[13];
  real_T (*c6_V3)[13];
  real_T (*c6_V2)[13];
  real_T (*c6_V1)[13];
  real_T (*c6_htc)[13];
  real_T (*c6_htc1)[13];
  real_T (*c6_vzp)[13];
  real_T (*c6_v)[13];
  real_T (*c6_u)[7185];
  real_T (*c6_OPm)[2874];
  real_T (*c6_OPv)[2874];
  real_T (*c6_TS)[13];
  real_T (*c6_Tt)[13];
  real_T (*c6_delta)[13];
  real_T (*c6_beta)[13];
  real_T (*c6_E)[13];
  real_T (*c6_D)[13];
  real_T (*c6_C)[13];
  real_T (*c6_B)[13];
  real_T (*c6_A)[13];
  c6_zpozdeni = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 24);
  c6_V3 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 5);
  c6_V2 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 4);
  c6_V1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 3);
  c6_maxHtc = (real_T *)ssGetInputPortSignal(chartInstance->S, 23);
  c6_minHtc = (real_T *)ssGetInputPortSignal(chartInstance->S, 22);
  c6_htc = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 21);
  c6_v1 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c6_htc1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 1);
  c6_vzp = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 20);
  c6_vv = (real_T *)ssGetInputPortSignal(chartInstance->S, 19);
  c6_v = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 18);
  c6_u = (real_T (*)[7185])ssGetInputPortSignal(chartInstance->S, 17);
  c6_OPm = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 16);
  c6_OPv = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 15);
  c6_TTS = (real_T *)ssGetInputPortSignal(chartInstance->S, 14);
  c6_TS = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 13);
  c6_Td = (real_T *)ssGetInputPortSignal(chartInstance->S, 12);
  c6_Tt = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 11);
  c6_Tw = (real_T *)ssGetInputPortSignal(chartInstance->S, 10);
  c6_w3 = (real_T *)ssGetInputPortSignal(chartInstance->S, 9);
  c6_w2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 8);
  c6_w1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
  c6_delta = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 6);
  c6_beta = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 5);
  c6_E = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 4);
  c6_D = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 3);
  c6_C = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 2);
  c6_B = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 1);
  c6_A = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 5);
  for (c6_i12 = 0; c6_i12 < 13; c6_i12 = c6_i12 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_A)[c6_i12], 0U);
  }

  for (c6_i13 = 0; c6_i13 < 13; c6_i13 = c6_i13 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_B)[c6_i13], 1U);
  }

  for (c6_i14 = 0; c6_i14 < 13; c6_i14 = c6_i14 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_C)[c6_i14], 2U);
  }

  for (c6_i15 = 0; c6_i15 < 13; c6_i15 = c6_i15 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_D)[c6_i15], 3U);
  }

  for (c6_i16 = 0; c6_i16 < 13; c6_i16 = c6_i16 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_E)[c6_i16], 4U);
  }

  for (c6_i17 = 0; c6_i17 < 13; c6_i17 = c6_i17 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_beta)[c6_i17], 5U);
  }

  for (c6_i18 = 0; c6_i18 < 13; c6_i18 = c6_i18 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_delta)[c6_i18], 6U);
  }

  _SFD_DATA_RANGE_CHECK(*c6_w1, 7U);
  _SFD_DATA_RANGE_CHECK(*c6_w2, 8U);
  _SFD_DATA_RANGE_CHECK(*c6_w3, 9U);
  _SFD_DATA_RANGE_CHECK(*c6_Tw, 10U);
  for (c6_i19 = 0; c6_i19 < 13; c6_i19 = c6_i19 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_Tt)[c6_i19], 11U);
  }

  _SFD_DATA_RANGE_CHECK(*c6_Td, 12U);
  for (c6_i20 = 0; c6_i20 < 13; c6_i20 = c6_i20 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_TS)[c6_i20], 13U);
  }

  _SFD_DATA_RANGE_CHECK(*c6_TTS, 14U);
  for (c6_i21 = 0; c6_i21 < 2874; c6_i21 = c6_i21 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_OPv)[c6_i21], 15U);
  }

  for (c6_i22 = 0; c6_i22 < 2874; c6_i22 = c6_i22 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_OPm)[c6_i22], 16U);
  }

  for (c6_i23 = 0; c6_i23 < 7185; c6_i23 = c6_i23 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_u)[c6_i23], 17U);
  }

  for (c6_i24 = 0; c6_i24 < 13; c6_i24 = c6_i24 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_v)[c6_i24], 18U);
  }

  _SFD_DATA_RANGE_CHECK(*c6_vv, 19U);
  for (c6_i25 = 0; c6_i25 < 13; c6_i25 = c6_i25 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_vzp)[c6_i25], 20U);
  }

  for (c6_i26 = 0; c6_i26 < 13; c6_i26 = c6_i26 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_htc1)[c6_i26], 21U);
  }

  _SFD_DATA_RANGE_CHECK(*c6_v1, 22U);
  for (c6_i27 = 0; c6_i27 < 13; c6_i27 = c6_i27 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_htc)[c6_i27], 23U);
  }

  _SFD_DATA_RANGE_CHECK(*c6_minHtc, 24U);
  _SFD_DATA_RANGE_CHECK(*c6_maxHtc, 25U);
  for (c6_i28 = 0; c6_i28 < 13; c6_i28 = c6_i28 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_V1)[c6_i28], 26U);
  }

  for (c6_i29 = 0; c6_i29 < 13; c6_i29 = c6_i29 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_V2)[c6_i29], 27U);
  }

  for (c6_i30 = 0; c6_i30 < 13; c6_i30 = c6_i30 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_V3)[c6_i30], 28U);
  }

  for (c6_i31 = 0; c6_i31 < 13; c6_i31 = c6_i31 + 1) {
    _SFD_DATA_RANGE_CHECK((*c6_zpozdeni)[c6_i31], 29U);
  }

  c6_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  c6_c6_ental(chartInstance);
  _sfEvent_ = c6_previousEvent;
  sf_debug_check_for_state_inconsistency(_entalMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}

static void c6_c6_ental(SFc6_entalInstanceStruct *chartInstance)
{
  int32_T c6_i32;
  real_T c6_hoistedGlobal[13];
  int32_T c6_i33;
  real_T c6_b_hoistedGlobal[13];
  int32_T c6_i34;
  real_T c6_c_hoistedGlobal[13];
  int32_T c6_i35;
  real_T c6_d_hoistedGlobal[13];
  int32_T c6_i36;
  real_T c6_e_hoistedGlobal[13];
  int32_T c6_i37;
  real_T c6_f_hoistedGlobal[13];
  int32_T c6_i38;
  real_T c6_g_hoistedGlobal[13];
  real_T c6_h_hoistedGlobal;
  real_T c6_i_hoistedGlobal;
  real_T c6_j_hoistedGlobal;
  real_T c6_k_hoistedGlobal;
  int32_T c6_i39;
  real_T c6_l_hoistedGlobal[13];
  real_T c6_m_hoistedGlobal;
  int32_T c6_i40;
  real_T c6_n_hoistedGlobal[13];
  real_T c6_o_hoistedGlobal;
  int32_T c6_i41;
  real_T c6_p_hoistedGlobal[2874];
  int32_T c6_i42;
  real_T c6_q_hoistedGlobal[2874];
  int32_T c6_i43;
  static real_T c6_r_hoistedGlobal[7185];
  int32_T c6_i44;
  real_T c6_s_hoistedGlobal[13];
  real_T c6_t_hoistedGlobal;
  int32_T c6_i45;
  real_T c6_u_hoistedGlobal[13];
  int32_T c6_i46;
  real_T c6_v_hoistedGlobal[13];
  real_T c6_w_hoistedGlobal;
  real_T c6_x_hoistedGlobal;
  int32_T c6_i47;
  real_T c6_y_hoistedGlobal[13];
  int32_T c6_i48;
  real_T c6_A[13];
  int32_T c6_i49;
  real_T c6_B[13];
  int32_T c6_i50;
  real_T c6_C[13];
  int32_T c6_i51;
  real_T c6_D[13];
  int32_T c6_i52;
  real_T c6_E[13];
  int32_T c6_i53;
  real_T c6_beta[13];
  int32_T c6_i54;
  real_T c6_delta[13];
  real_T c6_w1;
  real_T c6_w2;
  real_T c6_w3;
  real_T c6_Tw;
  int32_T c6_i55;
  real_T c6_Tt[13];
  real_T c6_Td;
  int32_T c6_i56;
  real_T c6_TS[13];
  real_T c6_TTS;
  int32_T c6_i57;
  real_T c6_OPv[2874];
  int32_T c6_i58;
  real_T c6_OPm[2874];
  int32_T c6_i59;
  static real_T c6_u[7185];
  int32_T c6_i60;
  real_T c6_v[13];
  real_T c6_vv;
  int32_T c6_i61;
  real_T c6_vzp[13];
  int32_T c6_i62;
  real_T c6_htc[13];
  real_T c6_minHtc;
  real_T c6_maxHtc;
  int32_T c6_i63;
  real_T c6_zpozdeni[13];
  uint32_T c6_debug_family_var_map[55];
  static const char *c6_sv0[55] = { "p", "N", "M", "a", "b", "jStart", "jStop",
    "n", "Tc", "va", "S", "jj", "i", "k", "jstart",
    "jstop", "j", "Tc1", "Tc2", "ve", "TSa", "TSe", "V", "nargin", "nargout",
    "A", "B", "C", "D", "E"
    , "beta", "delta", "w1", "w2", "w3", "Tw", "Tt", "Td", "TS", "TTS", "OPv",
    "OPm", "u", "v", "vv",
    "vzp", "htc", "minHtc", "maxHtc", "zpozdeni", "htc1", "v1", "V1", "V2", "V3"
  };

  real_T c6_p;
  real_T c6_N;
  real_T c6_M;
  real_T c6_a[1950];
  real_T c6_b[1950];
  real_T c6_jStart[13];
  real_T c6_jStop[13];
  real_T c6_n[13];
  real_T c6_Tc[13];
  real_T c6_va[13];
  real_T c6_S[13];
  real_T c6_jj;
  real_T c6_i;
  real_T c6_k;
  real_T c6_jstart;
  real_T c6_jstop;
  real_T c6_j;
  real_T c6_Tc1;
  real_T c6_Tc2;
  real_T c6_ve[13];
  real_T c6_TSa[13];
  real_T c6_TSe[13];
  real_T c6_V[13];
  real_T c6_nargin = 25.0;
  real_T c6_nargout = 5.0;
  real_T c6_htc1[13];
  real_T c6_v1;
  real_T c6_V1[13];
  real_T c6_V2[13];
  real_T c6_V3[13];
  int32_T c6_i64;
  int32_T c6_i65;
  int32_T c6_i66;
  int32_T c6_i67;
  int32_T c6_i68;
  int32_T c6_i69;
  int32_T c6_i70;
  int32_T c6_i71;
  real_T c6_b_i;
  real_T c6_b_jj;
  real_T c6_b_j;
  int32_T c6_i72;
  real_T c6_b_jStop[13];
  real_T c6_b_b;
  real_T c6_y;
  real_T c6_b_A;
  real_T c6_x;
  real_T c6_b_x;
  real_T c6_c_x;
  real_T c6_b_y;
  real_T c6_d0;
  boolean_T c6_b0;
  boolean_T c6_b1;
  boolean_T c6_b2;
  int32_T c6_i73;
  int32_T c6_c_i;
  int32_T c6_tmp_sizes[2];
  int32_T c6_loop_ub;
  int32_T c6_i74;
  real_T c6_tmp_data[150];
  int32_T c6_iv0[1];
  int32_T c6_u_sizes[2];
  int32_T c6_b_loop_ub;
  int32_T c6_i75;
  real_T c6_u_data[150];
  real_T c6_c_A;
  real_T c6_b_B;
  real_T c6_d_x;
  real_T c6_c_y;
  real_T c6_e_x;
  real_T c6_d_y;
  real_T c6_f_x;
  real_T c6_e_y;
  real_T c6_d1;
  boolean_T c6_b3;
  boolean_T c6_b4;
  boolean_T c6_b5;
  int32_T c6_i76;
  int32_T c6_d_i;
  int32_T c6_b_tmp_sizes[2];
  int32_T c6_c_loop_ub;
  int32_T c6_i77;
  real_T c6_b_tmp_data[150];
  int32_T c6_iv1[1];
  int32_T c6_b_u_sizes[2];
  int32_T c6_d_loop_ub;
  int32_T c6_i78;
  real_T c6_b_u_data[150];
  real_T c6_d_A;
  real_T c6_c_B;
  real_T c6_g_x;
  real_T c6_f_y;
  real_T c6_h_x;
  real_T c6_g_y;
  real_T c6_i_x;
  real_T c6_h_y;
  real_T c6_e_A;
  real_T c6_j_x;
  real_T c6_k_x;
  real_T c6_l_x;
  real_T c6_i_y;
  real_T c6_d2;
  boolean_T c6_b6;
  boolean_T c6_b7;
  boolean_T c6_b8;
  int32_T c6_i79;
  int32_T c6_e_i;
  int32_T c6_c_tmp_sizes[2];
  int32_T c6_e_loop_ub;
  int32_T c6_i80;
  real_T c6_c_tmp_data[150];
  int32_T c6_iv2[1];
  int32_T c6_c_u_sizes[2];
  int32_T c6_f_loop_ub;
  int32_T c6_i81;
  real_T c6_c_u_data[150];
  real_T c6_f_A;
  real_T c6_d_B;
  real_T c6_m_x;
  real_T c6_j_y;
  real_T c6_n_x;
  real_T c6_k_y;
  real_T c6_o_x;
  real_T c6_l_y;
  real_T c6_m_y;
  real_T c6_f_i;
  real_T c6_c_jj;
  real_T c6_c_j;
  int32_T c6_i82;
  int32_T c6_d_tmp_sizes;
  int32_T c6_g_loop_ub;
  int32_T c6_i83;
  int32_T c6_d_tmp_data[13];
  int32_T c6_e_tmp_sizes[2];
  int32_T c6_iv3[2];
  int32_T c6_i84;
  int32_T c6_i85;
  int32_T c6_h_loop_ub;
  int32_T c6_i86;
  real_T c6_e_tmp_data[13];
  int32_T c6_jStop_sizes;
  int32_T c6_i_loop_ub;
  int32_T c6_i87;
  real_T c6_jStop_data[13];
  real_T c6_c_b;
  real_T c6_n_y;
  real_T c6_g_A;
  real_T c6_p_x;
  real_T c6_q_x;
  real_T c6_r_x;
  real_T c6_o_y;
  real_T c6_d3;
  boolean_T c6_b9;
  boolean_T c6_b10;
  boolean_T c6_b11;
  int32_T c6_i88;
  int32_T c6_g_i;
  int32_T c6_f_tmp_sizes[2];
  int32_T c6_j_loop_ub;
  int32_T c6_i89;
  real_T c6_f_tmp_data[150];
  int32_T c6_iv4[1];
  int32_T c6_d_u_sizes[2];
  int32_T c6_k_loop_ub;
  int32_T c6_i90;
  real_T c6_d_u_data[150];
  real_T c6_h_A;
  real_T c6_e_B;
  real_T c6_s_x;
  real_T c6_p_y;
  real_T c6_t_x;
  real_T c6_q_y;
  real_T c6_u_x;
  real_T c6_r_y;
  real_T c6_s_y;
  int32_T c6_i91;
  int32_T c6_i92;
  real_T c6_b_ve[13];
  real_T c6_dv4[13];
  int32_T c6_i93;
  real_T c6_v_x[13];
  int32_T c6_i94;
  real_T c6_b_vzp[13];
  real_T c6_t_y[13];
  int32_T c6_i95;
  real_T c6_w_x[13];
  int32_T c6_i96;
  real_T c6_u_y[13];
  int32_T c6_i97;
  real_T c6_x_x[13];
  int32_T c6_i98;
  real_T c6_v_y[13];
  int32_T c6_i99;
  real_T c6_z[13];
  int32_T c6_i100;
  real_T c6_y_x[13];
  int32_T c6_i101;
  real_T c6_w_y[13];
  int32_T c6_i102;
  real_T c6_ab_x[13];
  int32_T c6_i103;
  real_T c6_x_y[13];
  int32_T c6_i104;
  real_T c6_bb_x[13];
  int32_T c6_i105;
  real_T c6_y_y[13];
  int32_T c6_i106;
  real_T c6_b_z[13];
  int32_T c6_i107;
  real_T c6_cb_x[13];
  int32_T c6_i108;
  real_T c6_ab_y[13];
  int32_T c6_i109;
  real_T c6_db_x[13];
  int32_T c6_i110;
  real_T c6_bb_y[13];
  int32_T c6_i111;
  real_T c6_eb_x[13];
  int32_T c6_i112;
  real_T c6_cb_y[13];
  int32_T c6_i113;
  real_T c6_c_z[13];
  int32_T c6_i114;
  real_T c6_db_y[13];
  int32_T c6_i115;
  real_T c6_eb_y[13];
  int32_T c6_i116;
  real_T c6_fb_y[13];
  int32_T c6_i117;
  real_T c6_d_z[13];
  int32_T c6_i118;
  real_T c6_e_z[13];
  int32_T c6_i119;
  real_T c6_f_z[13];
  real_T c6_dv5[13];
  int32_T c6_i120;
  int32_T c6_i121;
  int32_T c6_i122;
  real_T c6_b_a[13];
  real_T c6_d_b;
  int32_T c6_i123;
  real_T c6_gb_y[13];
  int32_T c6_i124;
  int32_T c6_i125;
  real_T c6_fb_x[13];
  int32_T c6_i126;
  real_T c6_hb_y[13];
  int32_T c6_i127;
  real_T c6_gb_x[13];
  int32_T c6_i128;
  real_T c6_ib_y[13];
  int32_T c6_i129;
  real_T c6_hb_x[13];
  int32_T c6_i130;
  real_T c6_jb_y[13];
  int32_T c6_i131;
  int32_T c6_i132;
  real_T c6_ib_x[13];
  int32_T c6_i133;
  real_T c6_kb_y[13];
  int32_T c6_i134;
  real_T c6_jb_x[13];
  int32_T c6_i135;
  real_T c6_lb_y[13];
  int32_T c6_i136;
  real_T c6_kb_x[13];
  int32_T c6_i137;
  real_T c6_mb_y[13];
  int32_T c6_i138;
  int32_T c6_i139;
  int32_T c6_i140;
  real_T c6_h_i;
  int32_T c6_i141;
  int32_T c6_i142;
  int32_T c6_i143;
  int32_T c6_i144;
  real_T *c6_b_w1;
  real_T *c6_b_w2;
  real_T *c6_b_w3;
  real_T *c6_b_Tw;
  real_T *c6_b_Td;
  real_T *c6_b_TTS;
  real_T *c6_b_vv;
  real_T *c6_b_minHtc;
  real_T *c6_b_maxHtc;
  real_T *c6_b_v1;
  real_T (*c6_b_htc1)[13];
  real_T (*c6_b_V1)[13];
  real_T (*c6_b_V2)[13];
  real_T (*c6_b_V3)[13];
  real_T (*c6_b_zpozdeni)[13];
  real_T (*c6_b_htc)[13];
  real_T (*c6_c_vzp)[13];
  real_T (*c6_b_v)[13];
  real_T (*c6_b_u)[7185];
  real_T (*c6_b_OPm)[2874];
  real_T (*c6_b_OPv)[2874];
  real_T (*c6_b_TS)[13];
  real_T (*c6_b_Tt)[13];
  real_T (*c6_b_delta)[13];
  real_T (*c6_b_beta)[13];
  real_T (*c6_b_E)[13];
  real_T (*c6_b_D)[13];
  real_T (*c6_b_C)[13];
  real_T (*c6_f_B)[13];
  real_T (*c6_i_A)[13];
  c6_b_zpozdeni = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 24);
  c6_b_V3 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 5);
  c6_b_V2 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 4);
  c6_b_V1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 3);
  c6_b_maxHtc = (real_T *)ssGetInputPortSignal(chartInstance->S, 23);
  c6_b_minHtc = (real_T *)ssGetInputPortSignal(chartInstance->S, 22);
  c6_b_htc = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 21);
  c6_b_v1 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
  c6_b_htc1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 1);
  c6_c_vzp = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 20);
  c6_b_vv = (real_T *)ssGetInputPortSignal(chartInstance->S, 19);
  c6_b_v = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 18);
  c6_b_u = (real_T (*)[7185])ssGetInputPortSignal(chartInstance->S, 17);
  c6_b_OPm = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 16);
  c6_b_OPv = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 15);
  c6_b_TTS = (real_T *)ssGetInputPortSignal(chartInstance->S, 14);
  c6_b_TS = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 13);
  c6_b_Td = (real_T *)ssGetInputPortSignal(chartInstance->S, 12);
  c6_b_Tt = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 11);
  c6_b_Tw = (real_T *)ssGetInputPortSignal(chartInstance->S, 10);
  c6_b_w3 = (real_T *)ssGetInputPortSignal(chartInstance->S, 9);
  c6_b_w2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 8);
  c6_b_w1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
  c6_b_delta = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 6);
  c6_b_beta = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 5);
  c6_b_E = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 4);
  c6_b_D = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 3);
  c6_b_C = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 2);
  c6_f_B = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 1);
  c6_i_A = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 5);
  for (c6_i32 = 0; c6_i32 < 13; c6_i32 = c6_i32 + 1) {
    c6_hoistedGlobal[c6_i32] = (*c6_i_A)[c6_i32];
  }

  for (c6_i33 = 0; c6_i33 < 13; c6_i33 = c6_i33 + 1) {
    c6_b_hoistedGlobal[c6_i33] = (*c6_f_B)[c6_i33];
  }

  for (c6_i34 = 0; c6_i34 < 13; c6_i34 = c6_i34 + 1) {
    c6_c_hoistedGlobal[c6_i34] = (*c6_b_C)[c6_i34];
  }

  for (c6_i35 = 0; c6_i35 < 13; c6_i35 = c6_i35 + 1) {
    c6_d_hoistedGlobal[c6_i35] = (*c6_b_D)[c6_i35];
  }

  for (c6_i36 = 0; c6_i36 < 13; c6_i36 = c6_i36 + 1) {
    c6_e_hoistedGlobal[c6_i36] = (*c6_b_E)[c6_i36];
  }

  for (c6_i37 = 0; c6_i37 < 13; c6_i37 = c6_i37 + 1) {
    c6_f_hoistedGlobal[c6_i37] = (*c6_b_beta)[c6_i37];
  }

  for (c6_i38 = 0; c6_i38 < 13; c6_i38 = c6_i38 + 1) {
    c6_g_hoistedGlobal[c6_i38] = (*c6_b_delta)[c6_i38];
  }

  c6_h_hoistedGlobal = *c6_b_w1;
  c6_i_hoistedGlobal = *c6_b_w2;
  c6_j_hoistedGlobal = *c6_b_w3;
  c6_k_hoistedGlobal = *c6_b_Tw;
  for (c6_i39 = 0; c6_i39 < 13; c6_i39 = c6_i39 + 1) {
    c6_l_hoistedGlobal[c6_i39] = (*c6_b_Tt)[c6_i39];
  }

  c6_m_hoistedGlobal = *c6_b_Td;
  for (c6_i40 = 0; c6_i40 < 13; c6_i40 = c6_i40 + 1) {
    c6_n_hoistedGlobal[c6_i40] = (*c6_b_TS)[c6_i40];
  }

  c6_o_hoistedGlobal = *c6_b_TTS;
  for (c6_i41 = 0; c6_i41 < 2874; c6_i41 = c6_i41 + 1) {
    c6_p_hoistedGlobal[c6_i41] = (*c6_b_OPv)[c6_i41];
  }

  for (c6_i42 = 0; c6_i42 < 2874; c6_i42 = c6_i42 + 1) {
    c6_q_hoistedGlobal[c6_i42] = (*c6_b_OPm)[c6_i42];
  }

  for (c6_i43 = 0; c6_i43 < 7185; c6_i43 = c6_i43 + 1) {
    c6_r_hoistedGlobal[c6_i43] = (*c6_b_u)[c6_i43];
  }

  for (c6_i44 = 0; c6_i44 < 13; c6_i44 = c6_i44 + 1) {
    c6_s_hoistedGlobal[c6_i44] = (*c6_b_v)[c6_i44];
  }

  c6_t_hoistedGlobal = *c6_b_vv;
  for (c6_i45 = 0; c6_i45 < 13; c6_i45 = c6_i45 + 1) {
    c6_u_hoistedGlobal[c6_i45] = (*c6_c_vzp)[c6_i45];
  }

  for (c6_i46 = 0; c6_i46 < 13; c6_i46 = c6_i46 + 1) {
    c6_v_hoistedGlobal[c6_i46] = (*c6_b_htc)[c6_i46];
  }

  c6_w_hoistedGlobal = *c6_b_minHtc;
  c6_x_hoistedGlobal = *c6_b_maxHtc;
  for (c6_i47 = 0; c6_i47 < 13; c6_i47 = c6_i47 + 1) {
    c6_y_hoistedGlobal[c6_i47] = (*c6_b_zpozdeni)[c6_i47];
  }

  for (c6_i48 = 0; c6_i48 < 13; c6_i48 = c6_i48 + 1) {
    c6_A[c6_i48] = c6_hoistedGlobal[c6_i48];
  }

  for (c6_i49 = 0; c6_i49 < 13; c6_i49 = c6_i49 + 1) {
    c6_B[c6_i49] = c6_b_hoistedGlobal[c6_i49];
  }

  for (c6_i50 = 0; c6_i50 < 13; c6_i50 = c6_i50 + 1) {
    c6_C[c6_i50] = c6_c_hoistedGlobal[c6_i50];
  }

  for (c6_i51 = 0; c6_i51 < 13; c6_i51 = c6_i51 + 1) {
    c6_D[c6_i51] = c6_d_hoistedGlobal[c6_i51];
  }

  for (c6_i52 = 0; c6_i52 < 13; c6_i52 = c6_i52 + 1) {
    c6_E[c6_i52] = c6_e_hoistedGlobal[c6_i52];
  }

  for (c6_i53 = 0; c6_i53 < 13; c6_i53 = c6_i53 + 1) {
    c6_beta[c6_i53] = c6_f_hoistedGlobal[c6_i53];
  }

  for (c6_i54 = 0; c6_i54 < 13; c6_i54 = c6_i54 + 1) {
    c6_delta[c6_i54] = c6_g_hoistedGlobal[c6_i54];
  }

  c6_w1 = c6_h_hoistedGlobal;
  c6_w2 = c6_i_hoistedGlobal;
  c6_w3 = c6_j_hoistedGlobal;
  c6_Tw = c6_k_hoistedGlobal;
  for (c6_i55 = 0; c6_i55 < 13; c6_i55 = c6_i55 + 1) {
    c6_Tt[c6_i55] = c6_l_hoistedGlobal[c6_i55];
  }

  c6_Td = c6_m_hoistedGlobal;
  for (c6_i56 = 0; c6_i56 < 13; c6_i56 = c6_i56 + 1) {
    c6_TS[c6_i56] = c6_n_hoistedGlobal[c6_i56];
  }

  c6_TTS = c6_o_hoistedGlobal;
  for (c6_i57 = 0; c6_i57 < 2874; c6_i57 = c6_i57 + 1) {
    c6_OPv[c6_i57] = c6_p_hoistedGlobal[c6_i57];
  }

  for (c6_i58 = 0; c6_i58 < 2874; c6_i58 = c6_i58 + 1) {
    c6_OPm[c6_i58] = c6_q_hoistedGlobal[c6_i58];
  }

  for (c6_i59 = 0; c6_i59 < 7185; c6_i59 = c6_i59 + 1) {
    c6_u[c6_i59] = c6_r_hoistedGlobal[c6_i59];
  }

  for (c6_i60 = 0; c6_i60 < 13; c6_i60 = c6_i60 + 1) {
    c6_v[c6_i60] = c6_s_hoistedGlobal[c6_i60];
  }

  c6_vv = c6_t_hoistedGlobal;
  for (c6_i61 = 0; c6_i61 < 13; c6_i61 = c6_i61 + 1) {
    c6_vzp[c6_i61] = c6_u_hoistedGlobal[c6_i61];
  }

  for (c6_i62 = 0; c6_i62 < 13; c6_i62 = c6_i62 + 1) {
    c6_htc[c6_i62] = c6_v_hoistedGlobal[c6_i62];
  }

  c6_minHtc = c6_w_hoistedGlobal;
  c6_maxHtc = c6_x_hoistedGlobal;
  for (c6_i63 = 0; c6_i63 < 13; c6_i63 = c6_i63 + 1) {
    c6_zpozdeni[c6_i63] = c6_y_hoistedGlobal[c6_i63];
  }

  sf_debug_symbol_scope_push_eml(0U, 55U, 55U, c6_sv0, c6_debug_family_var_map);
  sf_debug_symbol_scope_add_eml(&c6_p, c6_b_sf_marshall, 0U);
  sf_debug_symbol_scope_add_eml(&c6_N, c6_b_sf_marshall, 1U);
  sf_debug_symbol_scope_add_eml(&c6_M, c6_b_sf_marshall, 2U);
  sf_debug_symbol_scope_add_eml(c6_a, c6_e_sf_marshall, 3U);
  sf_debug_symbol_scope_add_eml(c6_b, c6_e_sf_marshall, 4U);
  sf_debug_symbol_scope_add_eml(c6_jStart, c6_sf_marshall, 5U);
  sf_debug_symbol_scope_add_eml(c6_jStop, c6_sf_marshall, 6U);
  sf_debug_symbol_scope_add_eml(c6_n, c6_sf_marshall, 7U);
  sf_debug_symbol_scope_add_eml(c6_Tc, c6_sf_marshall, 8U);
  sf_debug_symbol_scope_add_eml(c6_va, c6_sf_marshall, 9U);
  sf_debug_symbol_scope_add_eml(c6_S, c6_sf_marshall, 10U);
  sf_debug_symbol_scope_add_eml(&c6_jj, c6_b_sf_marshall, 11U);
  sf_debug_symbol_scope_add_eml(&c6_i, c6_b_sf_marshall, 12U);
  sf_debug_symbol_scope_add_eml(&c6_k, c6_b_sf_marshall, 13U);
  sf_debug_symbol_scope_add_eml(&c6_jstart, c6_b_sf_marshall, 14U);
  sf_debug_symbol_scope_add_eml(&c6_jstop, c6_b_sf_marshall, 15U);
  sf_debug_symbol_scope_add_eml(&c6_j, c6_b_sf_marshall, 16U);
  sf_debug_symbol_scope_add_eml(&c6_Tc1, c6_b_sf_marshall, 17U);
  sf_debug_symbol_scope_add_eml(&c6_Tc2, c6_b_sf_marshall, 18U);
  sf_debug_symbol_scope_add_eml(c6_ve, c6_sf_marshall, 19U);
  sf_debug_symbol_scope_add_eml(c6_TSa, c6_sf_marshall, 20U);
  sf_debug_symbol_scope_add_eml(c6_TSe, c6_sf_marshall, 21U);
  sf_debug_symbol_scope_add_eml(c6_V, c6_sf_marshall, 22U);
  sf_debug_symbol_scope_add_eml(&c6_nargin, c6_b_sf_marshall, 23U);
  sf_debug_symbol_scope_add_eml(&c6_nargout, c6_b_sf_marshall, 24U);
  sf_debug_symbol_scope_add_eml(c6_A, c6_sf_marshall, 25U);
  sf_debug_symbol_scope_add_eml(c6_B, c6_sf_marshall, 26U);
  sf_debug_symbol_scope_add_eml(c6_C, c6_sf_marshall, 27U);
  sf_debug_symbol_scope_add_eml(c6_D, c6_sf_marshall, 28U);
  sf_debug_symbol_scope_add_eml(c6_E, c6_sf_marshall, 29U);
  sf_debug_symbol_scope_add_eml(c6_beta, c6_sf_marshall, 30U);
  sf_debug_symbol_scope_add_eml(c6_delta, c6_sf_marshall, 31U);
  sf_debug_symbol_scope_add_eml(&c6_w1, c6_b_sf_marshall, 32U);
  sf_debug_symbol_scope_add_eml(&c6_w2, c6_b_sf_marshall, 33U);
  sf_debug_symbol_scope_add_eml(&c6_w3, c6_b_sf_marshall, 34U);
  sf_debug_symbol_scope_add_eml(&c6_Tw, c6_b_sf_marshall, 35U);
  sf_debug_symbol_scope_add_eml(c6_Tt, c6_sf_marshall, 36U);
  sf_debug_symbol_scope_add_eml(&c6_Td, c6_b_sf_marshall, 37U);
  sf_debug_symbol_scope_add_eml(c6_TS, c6_sf_marshall, 38U);
  sf_debug_symbol_scope_add_eml(&c6_TTS, c6_b_sf_marshall, 39U);
  sf_debug_symbol_scope_add_eml(c6_OPv, c6_d_sf_marshall, 40U);
  sf_debug_symbol_scope_add_eml(c6_OPm, c6_d_sf_marshall, 41U);
  sf_debug_symbol_scope_add_eml(c6_u, c6_c_sf_marshall, 42U);
  sf_debug_symbol_scope_add_eml(c6_v, c6_sf_marshall, 43U);
  sf_debug_symbol_scope_add_eml(&c6_vv, c6_b_sf_marshall, 44U);
  sf_debug_symbol_scope_add_eml(c6_vzp, c6_sf_marshall, 45U);
  sf_debug_symbol_scope_add_eml(c6_htc, c6_sf_marshall, 46U);
  sf_debug_symbol_scope_add_eml(&c6_minHtc, c6_b_sf_marshall, 47U);
  sf_debug_symbol_scope_add_eml(&c6_maxHtc, c6_b_sf_marshall, 48U);
  sf_debug_symbol_scope_add_eml(c6_zpozdeni, c6_sf_marshall, 49U);
  sf_debug_symbol_scope_add_eml(c6_htc1, c6_sf_marshall, 50U);
  sf_debug_symbol_scope_add_eml(&c6_v1, c6_b_sf_marshall, 51U);
  sf_debug_symbol_scope_add_eml(c6_V1, c6_sf_marshall, 52U);
  sf_debug_symbol_scope_add_eml(c6_V2, c6_sf_marshall, 53U);
  sf_debug_symbol_scope_add_eml(c6_V3, c6_sf_marshall, 54U);
  CV_EML_FCN(0, 0);
  _SFD_EML_CALL(0, 3);
  c6_p = 13.0;

  /* pocet chladicich okruhu */
  _SFD_EML_CALL(0, 4);
  c6_N = 479.0;
  _SFD_EML_CALL(0, 4);
  c6_M = 15.0;
  _SFD_EML_CALL(0, 6);
  for (c6_i64 = 0; c6_i64 < 1950; c6_i64 = c6_i64 + 1) {
    c6_a[c6_i64] = 0.0;
  }

  _SFD_EML_CALL(0, 6);
  for (c6_i65 = 0; c6_i65 < 1950; c6_i65 = c6_i65 + 1) {
    c6_b[c6_i65] = c6_a[c6_i65];
  }

  /* 150 - aby se vesly vsechny rezy z okruhu(120=max n(i)) */
  _SFD_EML_CALL(0, 7);
  for (c6_i66 = 0; c6_i66 < 13; c6_i66 = c6_i66 + 1) {
    c6_jStart[c6_i66] = 0.0;
  }

  _SFD_EML_CALL(0, 7);
  for (c6_i67 = 0; c6_i67 < 13; c6_i67 = c6_i67 + 1) {
    c6_jStop[c6_i67] = c6_jStart[c6_i67];
  }

  _SFD_EML_CALL(0, 7);
  for (c6_i68 = 0; c6_i68 < 13; c6_i68 = c6_i68 + 1) {
    c6_n[c6_i68] = 0.0;
  }

  _SFD_EML_CALL(0, 8);
  for (c6_i69 = 0; c6_i69 < 13; c6_i69 = c6_i69 + 1) {
    c6_Tc[c6_i69] = c6_Tt[c6_i69];
  }

  _SFD_EML_CALL(0, 10);
  for (c6_i70 = 0; c6_i70 < 13; c6_i70 = c6_i70 + 1) {
    c6_va[c6_i70] = c6_v[c6_i70];
  }

  _SFD_EML_CALL(0, 10);
  for (c6_i71 = 0; c6_i71 < 13; c6_i71 = c6_i71 + 1) {
    c6_S[c6_i71] = 0.0;
  }

  _SFD_EML_CALL(0, 12);
  c6_jj = 1.0;
  c6_i = 1.0;
  c6_b_i = 1.0;
  while (c6_b_i <= 13.0) {
    c6_i = c6_b_i;
    CV_EML_FOR(0, 0, 1);
    _SFD_EML_CALL(0, 14);
    c6_k = 0.0;
    _SFD_EML_CALL(0, 14);
    c6_jstart = 999.0;
    _SFD_EML_CALL(0, 14);
    c6_jstop = 0.0;
    c6_b_jj = c6_jj;
    c6_j = c6_b_jj;
    c6_b_j = c6_b_jj;
   label_1:
    ;
    if (c6_b_j <= 479.0) {
      c6_j = c6_b_j;
      CV_EML_FOR(0, 1, 1);
      _SFD_EML_CALL(0, 16);
      if (CV_EML_IF(0, 0, c6_OPv[_SFD_EML_ARRAY_BOUNDS_CHECK("OPv", (int32_T)
            c6_j, 1, 479, 1, 0) + 957] == c6_i)) {
        _SFD_EML_CALL(0, 17);
        c6_k = c6_k + 1.0;
        _SFD_EML_CALL(0, 18);
        c6_a[((int32_T)c6_i - 1) + 13 * (_SFD_EML_ARRAY_BOUNDS_CHECK("a",
          (int32_T)c6_k, 1, 150, 2, 0) - 1)] = c6_OPv[
          _SFD_EML_ARRAY_BOUNDS_CHECK("OPv", (int32_T)c6_j, 1, 479, 1, 0) - 1];

        /* vzdalenost rezu */
        _SFD_EML_CALL(0, 19);
        c6_b[((int32_T)c6_i - 1) + 13 * ((int32_T)c6_k - 1)] = c6_j;

        /* poradi rezu */
        _SFD_EML_CALL(0, 20);
        if (CV_EML_IF(0, 1, c6_j < c6_jstart)) {
          _SFD_EML_CALL(0, 21);
          c6_jStart[(int32_T)c6_i - 1] = c6_j;

          /* poradi prvniho rezu v okruhu */
          _SFD_EML_CALL(0, 22);
          c6_jstart = c6_jStart[(int32_T)c6_i - 1];
        }

        _SFD_EML_CALL(0, 24);
        CV_EML_IF(0, 2, c6_j > c6_jstop);
        _SFD_EML_CALL(0, 25);
        c6_jStop[(int32_T)c6_i - 1] = c6_j;

        /* poradi posledniho rezu v okruhu */
      }

      _SFD_EML_CALL(0, 28);
      c6_n[(int32_T)c6_i - 1] = c6_k;
      _SFD_EML_CALL(0, 29);
      if (CV_EML_IF(0, 3, c6_OPv[_SFD_EML_ARRAY_BOUNDS_CHECK("OPv", (int32_T)
            c6_j, 1, 479, 1, 0) + 957] > c6_i)) {
        /* neprochazim nasledujici okruhy */
      } else {
        c6_b_j = c6_b_j + 1.0;
        sf_mex_listen_for_ctrl_c(chartInstance->S);
        goto label_1;
      }
    } else {
      CV_EML_FOR(0, 1, 0);
    }

    /* j - vsechny rezy */
    _SFD_EML_CALL(0, 33);
    for (c6_i72 = 0; c6_i72 < 13; c6_i72 = c6_i72 + 1) {
      c6_b_jStop[c6_i72] = c6_jStop[c6_i72];
    }

    c6_jj = c6_max(chartInstance, c6_b_jStop);

    /* neprochazim predesle okruhy */
    _SFD_EML_CALL(0, 34);
    if (CV_EML_IF(0, 4, c6_n[(int32_T)c6_i - 1] != 0.0)) {
      _SFD_EML_CALL(0, 35);
      c6_b_b = c6_a[(int32_T)c6_i - 1] + c6_a[((int32_T)c6_i - 1) + 13 *
        (_SFD_EML_ARRAY_BOUNDS_CHECK("a", (int32_T)c6_n[(int32_T)c6_i - 1
          ], 1, 150, 2, 0) - 1)];
      c6_y = 0.5 * c6_b_b;
      c6_b_A = c6_y;
      c6_x = c6_b_A;
      c6_b_x = c6_x;
      c6_c_x = c6_b_x;
      c6_b_y = c6_c_x / 1000.0;
      c6_S[(int32_T)c6_i - 1] = c6_b_y;

      /* stred okruhu v m */
      _SFD_EML_CALL(0, 36);
      if (CV_EML_IF(0, 5, c6_i < 6.0)) {
        /* okruhy 1-5 jsou VR i MR */
        _SFD_EML_CALL(0, 37);
        c6_d0 = c6_n[(int32_T)c6_i - 1];
        c6_b0 = (1.0 > c6_d0);
        c6_b1 = c6_b0;
        c6_b2 = c6_b1;
        if (c6_b2) {
          c6_i73 = 0;
        } else {
          c6_i73 = _SFD_EML_ARRAY_BOUNDS_CHECK("b", (int32_T)c6_d0, 1, 150, 0, 0);
        }

        c6_c_i = (int32_T)c6_i - 1;
        c6_tmp_sizes[0] = 1;
        c6_tmp_sizes[1] = c6_i73;
        c6_loop_ub = c6_i73 - 1;
        for (c6_i74 = 0; c6_i74 <= c6_loop_ub; c6_i74 = c6_i74 + 1) {
          c6_tmp_data[c6_tmp_sizes[0] * c6_i74] = (real_T)
            _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)c6_b[c6_c_i + 13 * c6_i74],
            1, 479, 2, 0);
        }

        c6_iv0[0] = c6_tmp_sizes[1];
        c6_u_sizes[0] = 1;
        c6_u_sizes[1] = c6_iv0[0];
        c6_b_loop_ub = c6_iv0[0] - 1;
        for (c6_i75 = 0; c6_i75 <= c6_b_loop_ub; c6_i75 = c6_i75 + 1) {
          c6_u_data[c6_u_sizes[0] * c6_i75] = c6_u[15 * ((int32_T)
            c6_tmp_data[c6_i75] - 1)];
        }

        c6_c_A = c6_sum(chartInstance, c6_u_data, c6_u_sizes);
        c6_b_B = c6_n[(int32_T)c6_i - 1];
        c6_d_x = c6_c_A;
        c6_c_y = c6_b_B;
        c6_e_x = c6_d_x;
        c6_d_y = c6_c_y;
        c6_f_x = c6_e_x;
        c6_e_y = c6_d_y;
        c6_Tc1 = c6_f_x / c6_e_y;

        /* prumerna teplota v okruhu */
        _SFD_EML_CALL(0, 38);
        c6_d1 = c6_n[(int32_T)c6_i - 1];
        c6_b3 = (1.0 > c6_d1);
        c6_b4 = c6_b3;
        c6_b5 = c6_b4;
        if (c6_b5) {
          c6_i76 = 0;
        } else {
          c6_i76 = _SFD_EML_ARRAY_BOUNDS_CHECK("b", (int32_T)c6_d1, 1, 150, 0, 0);
        }

        c6_d_i = (int32_T)c6_i - 1;
        c6_b_tmp_sizes[0] = 1;
        c6_b_tmp_sizes[1] = c6_i76;
        c6_c_loop_ub = c6_i76 - 1;
        for (c6_i77 = 0; c6_i77 <= c6_c_loop_ub; c6_i77 = c6_i77 + 1) {
          c6_b_tmp_data[c6_b_tmp_sizes[0] * c6_i77] = (real_T)
            _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)c6_b[c6_d_i + 13 * c6_i77],
            1, 479, 2
            , 0);
        }

        c6_iv1[0] = c6_b_tmp_sizes[1];
        c6_b_u_sizes[0] = 1;
        c6_b_u_sizes[1] = c6_iv1[0];
        c6_d_loop_ub = c6_iv1[0] - 1;
        for (c6_i78 = 0; c6_i78 <= c6_d_loop_ub; c6_i78 = c6_i78 + 1) {
          c6_b_u_data[c6_b_u_sizes[0] * c6_i78] = c6_u[14 + 15 * ((int32_T)
            c6_b_tmp_data[c6_i78] - 1)];
        }

        c6_d_A = c6_sum(chartInstance, c6_b_u_data, c6_b_u_sizes);
        c6_c_B = c6_n[(int32_T)c6_i - 1];
        c6_g_x = c6_d_A;
        c6_f_y = c6_c_B;
        c6_h_x = c6_g_x;
        c6_g_y = c6_f_y;
        c6_i_x = c6_h_x;
        c6_h_y = c6_g_y;
        c6_Tc2 = c6_i_x / c6_h_y;

        /* prumerna teplota v okruhu */
        _SFD_EML_CALL(0, 39);
        c6_e_A = c6_Tc1 + c6_Tc2;
        c6_j_x = c6_e_A;
        c6_k_x = c6_j_x;
        c6_l_x = c6_k_x;
        c6_i_y = c6_l_x / 2.0;
        c6_Tc[(int32_T)c6_i - 1] = c6_i_y;

        /* prumerna teplota v okruhu */
      } else {
        _SFD_EML_CALL(0, 41);
        c6_d2 = c6_n[(int32_T)c6_i - 1];
        c6_b6 = (1.0 > c6_d2);
        c6_b7 = c6_b6;
        c6_b8 = c6_b7;
        if (c6_b8) {
          c6_i79 = 0;
        } else {
          c6_i79 = _SFD_EML_ARRAY_BOUNDS_CHECK("b", (int32_T)c6_d2, 1, 150, 0, 0);
        }

        c6_e_i = (int32_T)c6_i - 1;
        c6_c_tmp_sizes[0] = 1;
        c6_c_tmp_sizes[1] = c6_i79;
        c6_e_loop_ub = c6_i79 - 1;
        for (c6_i80 = 0; c6_i80 <= c6_e_loop_ub; c6_i80 = c6_i80 + 1) {
          c6_c_tmp_data[c6_c_tmp_sizes[0] * c6_i80] = (real_T)
            _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)c6_b[c6_e_i + 13 * c6_i80],
            1, 479, 2
            , 0);
        }

        c6_iv2[0] = c6_c_tmp_sizes[1];
        c6_c_u_sizes[0] = 1;
        c6_c_u_sizes[1] = c6_iv2[0];
        c6_f_loop_ub = c6_iv2[0] - 1;
        for (c6_i81 = 0; c6_i81 <= c6_f_loop_ub; c6_i81 = c6_i81 + 1) {
          c6_c_u_data[c6_c_u_sizes[0] * c6_i81] = c6_u[14 + 15 * ((int32_T)
            c6_c_tmp_data[c6_i81] - 1)];
        }

        c6_f_A = c6_sum(chartInstance, c6_c_u_data, c6_c_u_sizes);
        c6_d_B = c6_n[(int32_T)c6_i - 1];
        c6_m_x = c6_f_A;
        c6_j_y = c6_d_B;
        c6_n_x = c6_m_x;
        c6_k_y = c6_j_y;
        c6_o_x = c6_n_x;
        c6_l_y = c6_k_y;
        c6_m_y = c6_o_x / c6_l_y;
        c6_Tc[(int32_T)c6_i - 1] = c6_m_y;

        /* prumerna teplota v okruhu */
      }
    }

    c6_b_i = c6_b_i + 1.0;
    sf_mex_listen_for_ctrl_c(chartInstance->S);
  }

  CV_EML_FOR(0, 0, 0);

  /* i chladici okruhy */
  _SFD_EML_CALL(0, 45);
  c6_jj = 1.0;
  c6_i = 6.0;
  c6_f_i = 6.0;
  while (c6_f_i <= 13.0) {
    c6_i = c6_f_i;
    CV_EML_FOR(0, 2, 1);
    _SFD_EML_CALL(0, 47);
    c6_k = 0.0;
    _SFD_EML_CALL(0, 47);
    c6_jstart = 999.0;
    _SFD_EML_CALL(0, 47);
    c6_jstop = 0.0;
    c6_c_jj = c6_jj;
    c6_j = c6_c_jj;
    c6_c_j = c6_c_jj;
   label_2:
    ;
    if (c6_c_j <= 479.0) {
      c6_j = c6_c_j;
      CV_EML_FOR(0, 3, 1);
      _SFD_EML_CALL(0, 49);
      if (CV_EML_IF(0, 6, c6_OPm[_SFD_EML_ARRAY_BOUNDS_CHECK("OPm", (int32_T)
            c6_j, 1, 479, 1, 0) + 957] == c6_i)) {
        _SFD_EML_CALL(0, 50);
        c6_k = c6_k + 1.0;
        _SFD_EML_CALL(0, 51);
        c6_a[((int32_T)c6_i - 1) + 13 * (_SFD_EML_ARRAY_BOUNDS_CHECK("a",
          (int32_T)c6_k, 1, 150, 2, 0) - 1)] = c6_OPm[
          _SFD_EML_ARRAY_BOUNDS_CHECK("OPm", (int32_T)c6_j, 1, 479, 1, 0) - 1];

        /* vzdalenost rezu */
        _SFD_EML_CALL(0, 52);
        c6_b[((int32_T)c6_i - 1) + 13 * ((int32_T)c6_k - 1)] = c6_j;

        /* poradi rezu */
        _SFD_EML_CALL(0, 53);
        if (CV_EML_IF(0, 7, c6_j < c6_jstart)) {
          _SFD_EML_CALL(0, 54);
          c6_jStart[(int32_T)c6_i - 1] = c6_j;

          /* poradi prvniho rezu v okruhu */
          _SFD_EML_CALL(0, 55);
          c6_jstart = c6_jStart[(int32_T)c6_i - 1];
        }

        _SFD_EML_CALL(0, 57);
        CV_EML_IF(0, 8, c6_j > c6_jstop);
        _SFD_EML_CALL(0, 58);
        c6_jStop[(int32_T)c6_i - 1] = c6_j;

        /* poradi posledniho rezu v okruhu */
      }

      _SFD_EML_CALL(0, 61);
      if (CV_EML_IF(0, 9, c6_OPm[_SFD_EML_ARRAY_BOUNDS_CHECK("OPm", (int32_T)
            c6_j, 1, 479, 1, 0) + 957] > c6_i)) {
        /* neprochazim nasledujici okruhy */
      } else {
        c6_c_j = c6_c_j + 1.0;
        sf_mex_listen_for_ctrl_c(chartInstance->S);
        goto label_2;
      }
    } else {
      CV_EML_FOR(0, 3, 0);
    }

    /* j - vsechny rezy */
    _SFD_EML_CALL(0, 65);
    c6_i82 = (int32_T)c6_i;
    c6_d_tmp_sizes = c6_i82;
    c6_g_loop_ub = c6_i82 - 1;
    for (c6_i83 = 0; c6_i83 <= c6_g_loop_ub; c6_i83 = c6_i83 + 1) {
      c6_d_tmp_data[c6_i83] = 1 + c6_i83;
    }

    c6_e_tmp_sizes[0] = 1;
    c6_iv3[0] = 1;
    c6_iv3[1] = c6_d_tmp_sizes;
    c6_e_tmp_sizes[1] = c6_iv3[1];
    c6_i84 = c6_e_tmp_sizes[0];
    c6_i85 = c6_e_tmp_sizes[1];
    c6_h_loop_ub = c6_d_tmp_sizes - 1;
    for (c6_i86 = 0; c6_i86 <= c6_h_loop_ub; c6_i86 = c6_i86 + 1) {
      c6_e_tmp_data[c6_i86] = c6_jStop[c6_d_tmp_data[c6_i86] - 1];
    }

    c6_jStop_sizes = c6_e_tmp_sizes[1];
    c6_i_loop_ub = c6_e_tmp_sizes[1] - 1;
    for (c6_i87 = 0; c6_i87 <= c6_i_loop_ub; c6_i87 = c6_i87 + 1) {
      c6_jStop_data[c6_i87] = c6_e_tmp_data[c6_i87];
    }

    c6_jj = c6_b_max(chartInstance, c6_jStop_data, *((int32_T (*)[1])&
      c6_jStop_sizes));

    /* neprochazim predesle okruhy */
    _SFD_EML_CALL(0, 66);
    if (CV_EML_IF(0, 10, c6_k != 0.0)) {
      _SFD_EML_CALL(0, 67);
      c6_n[(int32_T)c6_i - 1] = c6_k;
      _SFD_EML_CALL(0, 68);
      c6_c_b = c6_a[(int32_T)c6_i - 1] + c6_a[((int32_T)c6_i - 1) + 13 *
        (_SFD_EML_ARRAY_BOUNDS_CHECK("a", (int32_T)c6_n[(int32_T)c6_i - 1
          ], 1, 150, 2, 0) - 1)];
      c6_n_y = 0.5 * c6_c_b;
      c6_g_A = c6_n_y;
      c6_p_x = c6_g_A;
      c6_q_x = c6_p_x;
      c6_r_x = c6_q_x;
      c6_o_y = c6_r_x / 1000.0;
      c6_S[(int32_T)c6_i - 1] = c6_o_y;

      /* stred okruhu v m */
      _SFD_EML_CALL(0, 69);
      c6_d3 = c6_n[(int32_T)c6_i - 1];
      c6_b9 = (1.0 > c6_d3);
      c6_b10 = c6_b9;
      c6_b11 = c6_b10;
      if (c6_b11) {
        c6_i88 = 0;
      } else {
        c6_i88 = _SFD_EML_ARRAY_BOUNDS_CHECK("b", (int32_T)c6_d3, 1, 150, 0, 0);
      }

      c6_g_i = (int32_T)c6_i - 1;
      c6_f_tmp_sizes[0] = 1;
      c6_f_tmp_sizes[1] = c6_i88;
      c6_j_loop_ub = c6_i88 - 1;
      for (c6_i89 = 0; c6_i89 <= c6_j_loop_ub; c6_i89 = c6_i89 + 1) {
        c6_f_tmp_data[c6_f_tmp_sizes[0] * c6_i89] = (real_T)
          _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)c6_b[c6_g_i + 13 * c6_i89],
          1, 479, 2
          , 0);
      }

      c6_iv4[0] = c6_f_tmp_sizes[1];
      c6_d_u_sizes[0] = 1;
      c6_d_u_sizes[1] = c6_iv4[0];
      c6_k_loop_ub = c6_iv4[0] - 1;
      for (c6_i90 = 0; c6_i90 <= c6_k_loop_ub; c6_i90 = c6_i90 + 1) {
        c6_d_u_data[c6_d_u_sizes[0] * c6_i90] = c6_u[15 * ((int32_T)
          c6_f_tmp_data[c6_i90] - 1)];
      }

      c6_h_A = c6_sum(chartInstance, c6_d_u_data, c6_d_u_sizes);
      c6_e_B = c6_n[(int32_T)c6_i - 1];
      c6_s_x = c6_h_A;
      c6_p_y = c6_e_B;
      c6_t_x = c6_s_x;
      c6_q_y = c6_p_y;
      c6_u_x = c6_t_x;
      c6_r_y = c6_q_y;
      c6_s_y = c6_u_x / c6_r_y;
      c6_Tc[(int32_T)c6_i - 1] = c6_s_y;

      /* prumerna teplota v okruhu */
    }

    c6_f_i = c6_f_i + 1.0;
    sf_mex_listen_for_ctrl_c(chartInstance->S);
  }

  CV_EML_FOR(0, 2, 0);

  /* i chladici okruhy */
  _SFD_EML_CALL(0, 73);
  for (c6_i91 = 0; c6_i91 < 13; c6_i91 = c6_i91 + 1) {
    c6_ve[c6_i91] = c6_beta[c6_i91] * c6_va[c6_i91] + (1.0 - c6_beta[c6_i91]) *
      c6_vv;
  }

  _SFD_EML_CALL(0, 74);
  for (c6_i92 = 0; c6_i92 < 13; c6_i92 = c6_i92 + 1) {
    c6_b_ve[c6_i92] = c6_ve[c6_i92];
  }

  c6_power(chartInstance, c6_b_ve, 2.0, c6_dv4);
  for (c6_i93 = 0; c6_i93 < 13; c6_i93 = c6_i93 + 1) {
    c6_v_x[c6_i93] = c6_A[c6_i93] * c6_dv4[c6_i93];
  }

  for (c6_i94 = 0; c6_i94 < 13; c6_i94 = c6_i94 + 1) {
    c6_b_vzp[c6_i94] = c6_vzp[c6_i94];
  }

  c6_power(chartInstance, c6_b_vzp, 2.0, c6_t_y);
  for (c6_i95 = 0; c6_i95 < 13; c6_i95 = c6_i95 + 1) {
    c6_w_x[c6_i95] = c6_v_x[c6_i95];
  }

  for (c6_i96 = 0; c6_i96 < 13; c6_i96 = c6_i96 + 1) {
    c6_u_y[c6_i96] = c6_t_y[c6_i96];
  }

  for (c6_i97 = 0; c6_i97 < 13; c6_i97 = c6_i97 + 1) {
    c6_x_x[c6_i97] = c6_w_x[c6_i97];
  }

  for (c6_i98 = 0; c6_i98 < 13; c6_i98 = c6_i98 + 1) {
    c6_v_y[c6_i98] = c6_u_y[c6_i98];
  }

  for (c6_i99 = 0; c6_i99 < 13; c6_i99 = c6_i99 + 1) {
    c6_z[c6_i99] = c6_x_x[c6_i99] / c6_v_y[c6_i99];
  }

  for (c6_i100 = 0; c6_i100 < 13; c6_i100 = c6_i100 + 1) {
    c6_y_x[c6_i100] = c6_B[c6_i100] * c6_ve[c6_i100];
  }

  for (c6_i101 = 0; c6_i101 < 13; c6_i101 = c6_i101 + 1) {
    c6_w_y[c6_i101] = c6_vzp[c6_i101];
  }

  for (c6_i102 = 0; c6_i102 < 13; c6_i102 = c6_i102 + 1) {
    c6_ab_x[c6_i102] = c6_y_x[c6_i102];
  }

  for (c6_i103 = 0; c6_i103 < 13; c6_i103 = c6_i103 + 1) {
    c6_x_y[c6_i103] = c6_w_y[c6_i103];
  }

  for (c6_i104 = 0; c6_i104 < 13; c6_i104 = c6_i104 + 1) {
    c6_bb_x[c6_i104] = c6_ab_x[c6_i104];
  }

  for (c6_i105 = 0; c6_i105 < 13; c6_i105 = c6_i105 + 1) {
    c6_y_y[c6_i105] = c6_x_y[c6_i105];
  }

  for (c6_i106 = 0; c6_i106 < 13; c6_i106 = c6_i106 + 1) {
    c6_b_z[c6_i106] = c6_bb_x[c6_i106] / c6_y_y[c6_i106];
  }

  for (c6_i107 = 0; c6_i107 < 13; c6_i107 = c6_i107 + 1) {
    c6_cb_x[c6_i107] = (c6_z[c6_i107] + c6_b_z[c6_i107]) + c6_C[c6_i107];
  }

  for (c6_i108 = 0; c6_i108 < 13; c6_i108 = c6_i108 + 1) {
    c6_ab_y[c6_i108] = (c6_A[c6_i108] + c6_B[c6_i108]) + c6_C[c6_i108];
  }

  for (c6_i109 = 0; c6_i109 < 13; c6_i109 = c6_i109 + 1) {
    c6_db_x[c6_i109] = c6_cb_x[c6_i109];
  }

  for (c6_i110 = 0; c6_i110 < 13; c6_i110 = c6_i110 + 1) {
    c6_bb_y[c6_i110] = c6_ab_y[c6_i110];
  }

  for (c6_i111 = 0; c6_i111 < 13; c6_i111 = c6_i111 + 1) {
    c6_eb_x[c6_i111] = c6_db_x[c6_i111];
  }

  for (c6_i112 = 0; c6_i112 < 13; c6_i112 = c6_i112 + 1) {
    c6_cb_y[c6_i112] = c6_bb_y[c6_i112];
  }

  for (c6_i113 = 0; c6_i113 < 13; c6_i113 = c6_i113 + 1) {
    c6_c_z[c6_i113] = c6_eb_x[c6_i113] / c6_cb_y[c6_i113];
  }

  for (c6_i114 = 0; c6_i114 < 13; c6_i114 = c6_i114 + 1) {
    c6_db_y[c6_i114] = c6_zpozdeni[c6_i114];
  }

  for (c6_i115 = 0; c6_i115 < 13; c6_i115 = c6_i115 + 1) {
    c6_eb_y[c6_i115] = c6_db_y[c6_i115];
  }

  for (c6_i116 = 0; c6_i116 < 13; c6_i116 = c6_i116 + 1) {
    c6_fb_y[c6_i116] = c6_eb_y[c6_i116];
  }

  for (c6_i117 = 0; c6_i117 < 13; c6_i117 = c6_i117 + 1) {
    c6_d_z[c6_i117] = 1.0 / c6_fb_y[c6_i117];
  }

  for (c6_i118 = 0; c6_i118 < 13; c6_i118 = c6_i118 + 1) {
    c6_e_z[c6_i118] = c6_c_z[c6_i118];
  }

  for (c6_i119 = 0; c6_i119 < 13; c6_i119 = c6_i119 + 1) {
    c6_f_z[c6_i119] = c6_d_z[c6_i119];
  }

  c6_b_power(chartInstance, c6_e_z, c6_f_z, c6_dv5);
  for (c6_i120 = 0; c6_i120 < 13; c6_i120 = c6_i120 + 1) {
    c6_V1[c6_i120] = c6_dv5[c6_i120];
  }

  _SFD_EML_CALL(0, 76);
  for (c6_i121 = 0; c6_i121 < 13; c6_i121 = c6_i121 + 1) {
    c6_TSa[c6_i121] = c6_TS[c6_i121];
  }

  _SFD_EML_CALL(0, 77);
  for (c6_i122 = 0; c6_i122 < 13; c6_i122 = c6_i122 + 1) {
    c6_b_a[c6_i122] = 1.0 - c6_delta[c6_i122];
  }

  c6_d_b = c6_TTS;
  for (c6_i123 = 0; c6_i123 < 13; c6_i123 = c6_i123 + 1) {
    c6_gb_y[c6_i123] = c6_b_a[c6_i123] * c6_d_b;
  }

  for (c6_i124 = 0; c6_i124 < 13; c6_i124 = c6_i124 + 1) {
    c6_TSe[c6_i124] = c6_delta[c6_i124] * c6_TSa[c6_i124] + c6_gb_y[c6_i124];
  }

  _SFD_EML_CALL(0, 78);
  for (c6_i125 = 0; c6_i125 < 13; c6_i125 = c6_i125 + 1) {
    c6_fb_x[c6_i125] = c6_D[c6_i125] * (c6_TSe[c6_i125] - c6_Td);
  }

  for (c6_i126 = 0; c6_i126 < 13; c6_i126 = c6_i126 + 1) {
    c6_hb_y[c6_i126] = c6_TS[c6_i126] - c6_Td;
  }

  for (c6_i127 = 0; c6_i127 < 13; c6_i127 = c6_i127 + 1) {
    c6_gb_x[c6_i127] = c6_fb_x[c6_i127];
  }

  for (c6_i128 = 0; c6_i128 < 13; c6_i128 = c6_i128 + 1) {
    c6_ib_y[c6_i128] = c6_hb_y[c6_i128];
  }

  for (c6_i129 = 0; c6_i129 < 13; c6_i129 = c6_i129 + 1) {
    c6_hb_x[c6_i129] = c6_gb_x[c6_i129];
  }

  for (c6_i130 = 0; c6_i130 < 13; c6_i130 = c6_i130 + 1) {
    c6_jb_y[c6_i130] = c6_ib_y[c6_i130];
  }

  for (c6_i131 = 0; c6_i131 < 13; c6_i131 = c6_i131 + 1) {
    c6_V2[c6_i131] = c6_hb_x[c6_i131] / c6_jb_y[c6_i131];
  }

  _SFD_EML_CALL(0, 80);
  for (c6_i132 = 0; c6_i132 < 13; c6_i132 = c6_i132 + 1) {
    c6_ib_x[c6_i132] = c6_E[c6_i132] * (c6_Tc[c6_i132] - c6_Tw);
  }

  for (c6_i133 = 0; c6_i133 < 13; c6_i133 = c6_i133 + 1) {
    c6_kb_y[c6_i133] = c6_Tt[c6_i133] - c6_Tw;
  }

  for (c6_i134 = 0; c6_i134 < 13; c6_i134 = c6_i134 + 1) {
    c6_jb_x[c6_i134] = c6_ib_x[c6_i134];
  }

  for (c6_i135 = 0; c6_i135 < 13; c6_i135 = c6_i135 + 1) {
    c6_lb_y[c6_i135] = c6_kb_y[c6_i135];
  }

  for (c6_i136 = 0; c6_i136 < 13; c6_i136 = c6_i136 + 1) {
    c6_kb_x[c6_i136] = c6_jb_x[c6_i136];
  }

  for (c6_i137 = 0; c6_i137 < 13; c6_i137 = c6_i137 + 1) {
    c6_mb_y[c6_i137] = c6_lb_y[c6_i137];
  }

  for (c6_i138 = 0; c6_i138 < 13; c6_i138 = c6_i138 + 1) {
    c6_V3[c6_i138] = c6_kb_x[c6_i138] / c6_mb_y[c6_i138];
  }

  /* V=(V1+V2+V3)/3; %stejne vahy */
  _SFD_EML_CALL(0, 83);
  for (c6_i139 = 0; c6_i139 < 13; c6_i139 = c6_i139 + 1) {
    c6_V[c6_i139] = (c6_V1[c6_i139] * c6_w1 + c6_V2[c6_i139] * c6_w2) +
      c6_V3[c6_i139] * c6_w3;
  }

  /* V=V3; %bez MPC */
  _SFD_EML_CALL(0, 85);
  for (c6_i140 = 0; c6_i140 < 13; c6_i140 = c6_i140 + 1) {
    c6_htc1[c6_i140] = c6_htc[c6_i140] * c6_V[c6_i140];
  }

  c6_i = 1.0;
  c6_h_i = 1.0;
  while (c6_h_i <= 13.0) {
    c6_i = c6_h_i;
    CV_EML_FOR(0, 4, 1);
    _SFD_EML_CALL(0, 87);
    if (CV_EML_IF(0, 11, c6_htc1[(int32_T)c6_i - 1] < c6_minHtc)) {
      _SFD_EML_CALL(0, 88);
      c6_htc1[(int32_T)c6_i - 1] = c6_minHtc;
    } else {
      _SFD_EML_CALL(0, 89);
      if (CV_EML_IF(0, 12, c6_htc1[(int32_T)c6_i - 1] > c6_maxHtc)) {
        _SFD_EML_CALL(0, 90);
        c6_htc1[(int32_T)c6_i - 1] = c6_maxHtc;
      }
    }

    c6_h_i = c6_h_i + 1.0;
    sf_mex_listen_for_ctrl_c(chartInstance->S);
  }

  CV_EML_FOR(0, 4, 0);
  _SFD_EML_CALL(0, 94);
  c6_v1 = c6_vv;
  _SFD_EML_CALL(0, 96);
  c6_htc1[1] = 0.0;

  /* 2okruh neni */
  _SFD_EML_CALL(0, -96);
  sf_debug_symbol_scope_pop();
  for (c6_i141 = 0; c6_i141 < 13; c6_i141 = c6_i141 + 1) {
    (*c6_b_htc1)[c6_i141] = c6_htc1[c6_i141];
  }

  *c6_b_v1 = c6_v1;
  for (c6_i142 = 0; c6_i142 < 13; c6_i142 = c6_i142 + 1) {
    (*c6_b_V1)[c6_i142] = c6_V1[c6_i142];
  }

  for (c6_i143 = 0; c6_i143 < 13; c6_i143 = c6_i143 + 1) {
    (*c6_b_V2)[c6_i143] = c6_V2[c6_i143];
  }

  for (c6_i144 = 0; c6_i144 < 13; c6_i144 = c6_i144 + 1) {
    (*c6_b_V3)[c6_i144] = c6_V3[c6_i144];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 5);
}

static void compInitSubchartSimstructsFcn_c6_ental(SFc6_entalInstanceStruct
  *chartInstance)
{
}

static void init_script_number_translation(uint32_T c6_machineNumber, uint32_T
  c6_chartNumber)
{
}

static real_T c6_max(SFc6_entalInstanceStruct *chartInstance, real_T
                     c6_varargin_1[13])
{
  int32_T c6_i145;
  real_T c6_x[13];
  int32_T c6_i146;
  real_T c6_b_x[13];
  real_T c6_mtmp;
  int32_T c6_ix;
  int32_T c6_k;
  int32_T c6_a;
  real_T c6_b_mtmp;
  for (c6_i145 = 0; c6_i145 < 13; c6_i145 = c6_i145 + 1) {
    c6_x[c6_i145] = c6_varargin_1[c6_i145];
  }

  for (c6_i146 = 0; c6_i146 < 13; c6_i146 = c6_i146 + 1) {
    c6_b_x[c6_i146] = c6_x[c6_i146];
  }

  c6_mtmp = c6_b_x[0];
  c6_ix = 1;
  for (c6_k = 2; c6_k < 14; c6_k = c6_k + 1) {
    c6_a = c6_ix;
    c6_ix = c6_a + 1;
    if (c6_b_x[_SFD_EML_ARRAY_BOUNDS_CHECK("", c6_ix, 1, 13, 1, 0) - 1] >
        c6_mtmp) {
      c6_mtmp = c6_b_x[c6_ix - 1];
    }
  }

  c6_b_mtmp = c6_mtmp;
  return c6_b_mtmp;
}

static real_T c6_sum(SFc6_entalInstanceStruct *chartInstance, real_T c6_x_data
                     [150], int32_T c6_x_sizes[2])
{
  real_T c6_y;
  int32_T c6_varargin_1_sizes[2];
  int32_T c6_varargin_1;
  int32_T c6_b_varargin_1;
  int32_T c6_loop_ub;
  int32_T c6_i147;
  real_T c6_varargin_1_data[150];
  int32_T c6_b_varargin_1_sizes[2];
  int32_T c6_c_varargin_1;
  int32_T c6_d_varargin_1;
  int32_T c6_b_loop_ub;
  int32_T c6_i148;
  real_T c6_b_varargin_1_data[150];
  boolean_T c6_p;
  int32_T c6_x1_sizes[2];
  int32_T c6_x1;
  int32_T c6_b_x1;
  int32_T c6_c_loop_ub;
  int32_T c6_i149;
  real_T c6_x1_data[150];
  int32_T c6_b_x1_sizes[2];
  int32_T c6_c_x1;
  int32_T c6_d_x1;
  int32_T c6_d_loop_ub;
  int32_T c6_i150;
  real_T c6_b_x1_data[150];
  boolean_T c6_b_p;
  real_T c6_k;
  real_T c6_b_k;
  real_T c6_d4;
  int32_T c6_q0;
  int32_T c6_q1;
  int32_T c6_qY;
  real_T c6_d5;
  boolean_T c6_b12;
  boolean_T c6_c_p;
  boolean_T c6_b13;
  int32_T c6_i151;
  static char_T c6_cv0[31] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd', 'M', 'A',
    'T', 'L', 'A', 'B', ':', 's', 'u', 'm', ':', 's', 'p'
    , 'e', 'c', 'i', 'a', 'l', 'E', 'm', 'p', 't', 'y' };

  char_T c6_u[31];
  const mxArray *c6_b_y = NULL;
  int32_T c6_i152;
  static char_T c6_cv1[63] = { 'S', 'U', 'M', ' ', 'w', 'i', 't', 'h', ' ', 'o',
    'n', 'e', ' ', 'v', 'a', 'r', 'i', 'a', 'b', 'l', 'e'
    , '-', 's', 'i', 'z', 'e', ' ', 'm', 'a', 't', 'r', 'i', 'x', ' ', 'i', 'n',
    'p', 'u', 't', ' ', 'o',
    'f', ' ', '[', ']', ' ', 'i', 's', ' ', 'n', 'o', 't', ' ', 's', 'u', 'p',
    'p', 'o', 'r', 't', 'e', 'd'
    , '.' };

  char_T c6_b_u[63];
  const mxArray *c6_c_y = NULL;
  boolean_T c6_b14;
  boolean_T c6_b15;
  int32_T c6_i153;
  static char_T c6_cv2[41] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd', 'M', 'A',
    'T', 'L', 'A', 'B', ':', 's', 'u', 'm', ':', 'a', 'u'
    , 't', 'o', 'D', 'i', 'm', 'I', 'n', 'c', 'o', 'm', 'p', 'a', 't', 'i', 'b',
    'i', 'l', 'i', 't', 'y' };

  char_T c6_c_u[41];
  const mxArray *c6_d_y = NULL;
  int32_T c6_i154;
  static char_T c6_cv3[191] = { 'T', 'h', 'e', ' ', 'w', 'o', 'r', 'k', 'i', 'n',
    'g', ' ', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o',
    'n', ' ', 'w', 'a', 's', ' ', 's', 'e', 'l', 'e', 'c', 't', 'e', 'd', ' ',
    'a', 'u', 't', 'o', 'm',
    'a', 't', 'i', 'c', 'a', 'l', 'l', 'y', ',', ' ', 'i', 's', ' ', 'v', 'a',
    'r', 'i', 'a', 'b', 'l',
    'e', '-', 'l', 'e', 'n', 'g', 't', 'h', ',', ' ', 'a', 'n', 'd', ' ', 'h',
    'a', 's', ' ', 'l', 'e',
    'n', 'g', 't', 'h', ' ', '1', ' ', 'a', 't', ' ', 'r', 'u', 'n', '-', 't',
    'i', 'm', 'e', '.', ' ',
    'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'n', 'o', 't', ' ', 's', 'u', 'p',
    'p', 'o', 'r', 't', 'e',
    'd', '.', ' ', 'M', 'a', 'n', 'u', 'a', 'l', 'l', 'y', ' ', 's', 'e', 'l',
    'e', 'c', 't', ' ', 't',
    'h', 'e', ' ', 'w', 'o', 'r', 'k', 'i', 'n', 'g', ' ', 'd', 'i', 'm', 'e',
    'n', 's', 'i', 'o', 'n',
    ' ', 'b', 'y', ' ', 's', 'u', 'p', 'p', 'l', 'y', 'i', 'n', 'g', ' ', 't',
    'h', 'e', ' ', 'D', 'I',
    'M', ' ', 'a', 'r', 'g', 'u', 'm', 'e', 'n', 't', '.' };

  char_T c6_d_u[191];
  const mxArray *c6_e_y = NULL;
  boolean_T c6_b16;
  real_T c6_d6;
  real_T c6_d7;
  real_T c6_d8;
  int32_T c6_i155;
  int32_T c6_vlen;
  int32_T c6_c_k;
  int32_T c6_d_k;
  c6_varargin_1_sizes[0] = 1;
  c6_varargin_1_sizes[1] = c6_x_sizes[1];
  c6_varargin_1 = c6_varargin_1_sizes[0];
  c6_b_varargin_1 = c6_varargin_1_sizes[1];
  c6_loop_ub = c6_x_sizes[0] * c6_x_sizes[1] - 1;
  for (c6_i147 = 0; c6_i147 <= c6_loop_ub; c6_i147 = c6_i147 + 1) {
    c6_varargin_1_data[c6_i147] = c6_x_data[c6_i147];
  }

  c6_b_varargin_1_sizes[0] = 1;
  c6_b_varargin_1_sizes[1] = c6_varargin_1_sizes[1];
  c6_c_varargin_1 = c6_b_varargin_1_sizes[0];
  c6_d_varargin_1 = c6_b_varargin_1_sizes[1];
  c6_b_loop_ub = c6_varargin_1_sizes[0] * c6_varargin_1_sizes[1] - 1;
  for (c6_i148 = 0; c6_i148 <= c6_b_loop_ub; c6_i148 = c6_i148 + 1) {
    c6_b_varargin_1_data[c6_i148] = c6_varargin_1_data[c6_i148];
  }

  c6_p = FALSE;
  c6_x1_sizes[0] = 1;
  c6_x1_sizes[1] = c6_b_varargin_1_sizes[1];
  c6_x1 = c6_x1_sizes[0];
  c6_b_x1 = c6_x1_sizes[1];
  c6_c_loop_ub = c6_b_varargin_1_sizes[0] * c6_b_varargin_1_sizes[1] - 1;
  for (c6_i149 = 0; c6_i149 <= c6_c_loop_ub; c6_i149 = c6_i149 + 1) {
    c6_x1_data[c6_i149] = c6_b_varargin_1_data[c6_i149];
  }

  c6_b_x1_sizes[0] = 1;
  c6_b_x1_sizes[1] = c6_x1_sizes[1];
  c6_c_x1 = c6_b_x1_sizes[0];
  c6_d_x1 = c6_b_x1_sizes[1];
  c6_d_loop_ub = c6_x1_sizes[0] * c6_x1_sizes[1] - 1;
  for (c6_i150 = 0; c6_i150 <= c6_d_loop_ub; c6_i150 = c6_i150 + 1) {
    c6_b_x1_data[c6_i150] = c6_x1_data[c6_i150];
  }

  c6_b_p = FALSE;
  c6_k = 1.0;
 label_1:
  ;
  if (c6_k <= 2.0) {
    c6_b_k = c6_k;
    c6_d4 = c6_b_k;
    c6_q0 = (int32_T)c6_d4;
    c6_q1 = 1;
    c6_qY = c6_q0 - c6_q1;
    if ((c6_q0 < 0) && ((c6_q1 >= 0) && (c6_qY >= 0))) {
      c6_qY = MIN_int32_T;
    } else {
      if ((c6_q0 >= 0) && ((c6_q1 < 0) && (c6_qY < 0))) {
        c6_qY = MAX_int32_T;
      }
    }

    c6_d5 = (real_T)c6_b_x1_sizes[c6_qY];
    if (c6_d5 != 0.0) {
    } else {
      c6_k = c6_k + 1.0;
      goto label_1;
    }
  } else {
    c6_b_p = TRUE;
  }

  if (c6_b_p) {
    c6_b12 = TRUE;
  } else {
    c6_b12 = FALSE;
  }

  c6_c_p = c6_b12;
  if (!c6_c_p) {
  } else {
    c6_p = TRUE;
  }

  if (!c6_p) {
    c6_b13 = TRUE;
  } else {
    c6_b13 = FALSE;
  }

  if (c6_b13) {
  } else {
    for (c6_i151 = 0; c6_i151 < 31; c6_i151 = c6_i151 + 1) {
      c6_u[c6_i151] = c6_cv0[c6_i151];
    }

    c6_b_y = NULL;
    sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_u, 10, 0U, 1U, 0U, 2, 1, 31));
    for (c6_i152 = 0; c6_i152 < 63; c6_i152 = c6_i152 + 1) {
      c6_b_u[c6_i152] = c6_cv1[c6_i152];
    }

    c6_c_y = NULL;
    sf_mex_assign(&c6_c_y, sf_mex_create("y", c6_b_u, 10, 0U, 1U, 0U, 2, 1, 63));
    sf_mex_call_debug("error", 0U, 2U, 14, c6_b_y, 14, c6_c_y);
  }

  c6_b14 = (c6_x_sizes[1] == 1);
  if (c6_b14) {
  } else if ((real_T)c6_x_sizes[1] != 1.0) {
  } else {
    c6_b15 = FALSE;
    goto label_2;
  }

  c6_b15 = TRUE;
 label_2:
  ;
  if (c6_b15) {
  } else {
    for (c6_i153 = 0; c6_i153 < 41; c6_i153 = c6_i153 + 1) {
      c6_c_u[c6_i153] = c6_cv2[c6_i153];
    }

    c6_d_y = NULL;
    sf_mex_assign(&c6_d_y, sf_mex_create("y", c6_c_u, 10, 0U, 1U, 0U, 2, 1, 41));
    for (c6_i154 = 0; c6_i154 < 191; c6_i154 = c6_i154 + 1) {
      c6_d_u[c6_i154] = c6_cv3[c6_i154];
    }

    c6_e_y = NULL;
    sf_mex_assign(&c6_e_y, sf_mex_create("y", c6_d_u, 10, 0U, 1U, 0U, 2, 1, 191));
    sf_mex_call_debug("error", 0U, 2U, 14, c6_d_y, 14, c6_e_y);
  }

  c6_b16 = (c6_x_sizes[1] == 0);
  if (c6_b16) {
    return 0.0;
  } else {
    c6_d6 = (real_T)c6_x_sizes[1];
    c6_d7 = c6_d6;
    c6_d7 = c6_d7 < 0.0 ? muDoubleScalarCeil(c6_d7 - 0.5) : muDoubleScalarFloor
      (c6_d7 + 0.5);
    c6_d8 = c6_d7;
    if (c6_d8 < 2.147483648E+9) {
      if (c6_d8 >= -2.147483648E+9) {
        c6_i155 = (int32_T)c6_d8;
      } else {
        c6_i155 = MIN_int32_T;
      }
    } else if (c6_d8 >= 2.147483648E+9) {
      c6_i155 = MAX_int32_T;
    } else {
      c6_i155 = 0;
    }

    c6_vlen = c6_i155;
    (real_T)_SFD_EML_ARRAY_BOUNDS_CHECK("", 1, 1, c6_x_sizes[1], 1, 0);
    c6_y = c6_x_data[0];
    for (c6_c_k = 2; c6_c_k <= c6_vlen; c6_c_k = c6_c_k + 1) {
      c6_d_k = c6_c_k;
      c6_y = c6_y + c6_x_data[_SFD_EML_ARRAY_BOUNDS_CHECK("", c6_d_k, 1,
        c6_x_sizes[1], 1, 0) - 1];
    }
  }

  return c6_y;
}

static real_T c6_b_max(SFc6_entalInstanceStruct *chartInstance, real_T
  c6_varargin_1_data[13], int32_T c6_varargin_1_sizes[1])
{
  int32_T c6_x_sizes;
  int32_T c6_loop_ub;
  int32_T c6_i156;
  real_T c6_x_data[13];
  boolean_T c6_b17;
  int32_T c6_i157;
  static char_T c6_cv4[52] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd', 'M', 'A',
    'T', 'L', 'A', 'B', ':', 'e', 'm', 'l', '_', 'm', 'i'
    , 'n', '_', 'o', 'r', '_', 'm', 'a', 'x', ':', 'a', 'u', 't', 'o', 'D', 'i',
    'm', 'I', 'n', 'c', 'o',
    'm', 'p', 'a', 't', 'i', 'b', 'i', 'l', 'i', 't', 'y' };

  char_T c6_u[52];
  const mxArray *c6_y = NULL;
  int32_T c6_i158;
  static char_T c6_cv5[191] = { 'T', 'h', 'e', ' ', 'w', 'o', 'r', 'k', 'i', 'n',
    'g', ' ', 'd', 'i', 'm', 'e', 'n', 's', 'i', 'o',
    'n', ' ', 'w', 'a', 's', ' ', 's', 'e', 'l', 'e', 'c', 't', 'e', 'd', ' ',
    'a', 'u', 't', 'o', 'm',
    'a', 't', 'i', 'c', 'a', 'l', 'l', 'y', ',', ' ', 'i', 's', ' ', 'v', 'a',
    'r', 'i', 'a', 'b', 'l',
    'e', '-', 'l', 'e', 'n', 'g', 't', 'h', ',', ' ', 'a', 'n', 'd', ' ', 'h',
    'a', 's', ' ', 'l', 'e',
    'n', 'g', 't', 'h', ' ', '1', ' ', 'a', 't', ' ', 'r', 'u', 'n', '-', 't',
    'i', 'm', 'e', '.', ' ',
    'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'n', 'o', 't', ' ', 's', 'u', 'p',
    'p', 'o', 'r', 't', 'e',
    'd', '.', ' ', 'M', 'a', 'n', 'u', 'a', 'l', 'l', 'y', ' ', 's', 'e', 'l',
    'e', 'c', 't', ' ', 't',
    'h', 'e', ' ', 'w', 'o', 'r', 'k', 'i', 'n', 'g', ' ', 'd', 'i', 'm', 'e',
    'n', 's', 'i', 'o', 'n',
    ' ', 'b', 'y', ' ', 's', 'u', 'p', 'p', 'l', 'y', 'i', 'n', 'g', ' ', 't',
    'h', 'e', ' ', 'D', 'I',
    'M', ' ', 'a', 'r', 'g', 'u', 'm', 'e', 'n', 't', '.' };

  char_T c6_b_u[191];
  const mxArray *c6_b_y = NULL;
  int32_T c6_i159;
  static char_T c6_cv6[40] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd', 'M', 'A',
    'T', 'L', 'A', 'B', ':', 'e', 'm', 'l', '_', 'm', 'i'
    , 'n', '_', 'o', 'r', '_', 'm', 'a', 'x', ':', 'v', 'a', 'r', 'D', 'i', 'm',
    'Z', 'e', 'r', 'o' };

  char_T c6_c_u[40];
  const mxArray *c6_c_y = NULL;
  int32_T c6_i160;
  static char_T c6_cv7[102] = { 'I', 'f', ' ', 't', 'h', 'e', ' ', 'w', 'o', 'r',
    'k', 'i', 'n', 'g', ' ', 'd', 'i', 'm', 'e', 'n',
    's', 'i', 'o', 'n', ' ', 'o', 'f', ' ', 'M', 'A', 'X', ' ', 'o', 'r', ' ',
    'M', 'I', 'N', ' ', 'i',
    's', ' ', 'v', 'a', 'r', 'i', 'a', 'b', 'l', 'e', ' ', 'i', 'n', ' ', 'l',
    'e', 'n', 'g', 't', 'h',
    ',', ' ', 'i', 't', ' ', 'm', 'u', 's', 't', ' ', 'n', 'o', 't', ' ', 'h',
    'a', 'v', 'e', ' ', 'z',
    'e', 'r', 'o', ' ', 'l', 'e', 'n', 'g', 't', 'h', ' ', 'a', 't', ' ', 'r',
    'u', 'n', 't', 'i', 'm',
    'e', '.' };

  char_T c6_d_u[102];
  const mxArray *c6_d_y = NULL;
  int32_T c6_b_x_sizes;
  int32_T c6_b_loop_ub;
  int32_T c6_i161;
  real_T c6_b_x_data[13];
  real_T c6_d9;
  real_T c6_d10;
  real_T c6_d11;
  int32_T c6_i162;
  int32_T c6_n;
  real_T c6_mtmp;
  int32_T c6_ix;
  int32_T c6_k;
  int32_T c6_a;
  real_T c6_b_mtmp;
  c6_x_sizes = c6_varargin_1_sizes[0];
  c6_loop_ub = c6_varargin_1_sizes[0] - 1;
  for (c6_i156 = 0; c6_i156 <= c6_loop_ub; c6_i156 = c6_i156 + 1) {
    c6_x_data[c6_i156] = c6_varargin_1_data[c6_i156];
  }

  if (c6_x_sizes == 1) {
  } else if ((real_T)c6_x_sizes != 1.0) {
  } else {
    c6_b17 = FALSE;
    goto label_1;
  }

  c6_b17 = TRUE;
 label_1:
  ;
  if (c6_b17) {
  } else {
    for (c6_i157 = 0; c6_i157 < 52; c6_i157 = c6_i157 + 1) {
      c6_u[c6_i157] = c6_cv4[c6_i157];
    }

    c6_y = NULL;
    sf_mex_assign(&c6_y, sf_mex_create("y", c6_u, 10, 0U, 1U, 0U, 2, 1, 52));
    for (c6_i158 = 0; c6_i158 < 191; c6_i158 = c6_i158 + 1) {
      c6_b_u[c6_i158] = c6_cv5[c6_i158];
    }

    c6_b_y = NULL;
    sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_b_u, 10, 0U, 1U, 0U, 2, 1, 191));
    sf_mex_call_debug("error", 0U, 2U, 14, c6_y, 14, c6_b_y);
  }

  if ((real_T)c6_x_sizes > 0.0) {
  } else {
    for (c6_i159 = 0; c6_i159 < 40; c6_i159 = c6_i159 + 1) {
      c6_c_u[c6_i159] = c6_cv6[c6_i159];
    }

    c6_c_y = NULL;
    sf_mex_assign(&c6_c_y, sf_mex_create("y", c6_c_u, 10, 0U, 1U, 0U, 2, 1, 40));
    for (c6_i160 = 0; c6_i160 < 102; c6_i160 = c6_i160 + 1) {
      c6_d_u[c6_i160] = c6_cv7[c6_i160];
    }

    c6_d_y = NULL;
    sf_mex_assign(&c6_d_y, sf_mex_create("y", c6_d_u, 10, 0U, 1U, 0U, 2, 1, 102));
    sf_mex_call_debug("error", 0U, 2U, 14, c6_c_y, 14, c6_d_y);
  }

  c6_b_x_sizes = c6_x_sizes;
  c6_b_loop_ub = c6_x_sizes - 1;
  for (c6_i161 = 0; c6_i161 <= c6_b_loop_ub; c6_i161 = c6_i161 + 1) {
    c6_b_x_data[c6_i161] = c6_x_data[c6_i161];
  }

  c6_d9 = (real_T)c6_b_x_sizes;
  c6_d10 = c6_d9;
  c6_d10 = c6_d10 < 0.0 ? muDoubleScalarCeil(c6_d10 - 0.5) : muDoubleScalarFloor
    (c6_d10 + 0.5);
  c6_d11 = c6_d10;
  if (c6_d11 < 2.147483648E+9) {
    if (c6_d11 >= -2.147483648E+9) {
      c6_i162 = (int32_T)c6_d11;
    } else {
      c6_i162 = MIN_int32_T;
    }
  } else if (c6_d11 >= 2.147483648E+9) {
    c6_i162 = MAX_int32_T;
  } else {
    c6_i162 = 0;
  }

  c6_n = c6_i162;
  c6_mtmp = c6_b_x_data[0];
  if ((real_T)c6_n == 1.0) {
  } else {
    c6_ix = 1;
    for (c6_k = 2; c6_k <= c6_n; c6_k = c6_k + 1) {
      c6_a = c6_ix;
      c6_ix = c6_a + 1;
      if (c6_b_x_data[_SFD_EML_ARRAY_BOUNDS_CHECK("", c6_ix, 1, c6_b_x_sizes, 1,
           0) - 1] > c6_mtmp) {
        c6_mtmp = c6_b_x_data[_SFD_EML_ARRAY_BOUNDS_CHECK("", c6_ix, 1,
          c6_b_x_sizes, 1, 0) - 1];
      }
    }
  }

  c6_b_mtmp = c6_mtmp;
  return c6_b_mtmp;
}

static void c6_power(SFc6_entalInstanceStruct *chartInstance, real_T c6_a[13],
                     real_T c6_b, real_T c6_y[13])
{
  real_T c6_k;
  real_T c6_b_k;
  real_T c6_ak;
  for (c6_k = 1.0; c6_k <= 13.0; c6_k = c6_k + 1.0) {
    c6_b_k = c6_k;
    c6_ak = c6_a[(int32_T)c6_b_k - 1];
    c6_y[(int32_T)c6_b_k - 1] = muDoubleScalarPower(c6_ak, 2.0);
  }
}

static void c6_eml_error(SFc6_entalInstanceStruct *chartInstance)
{
  int32_T c6_i163;
  static char_T c6_cv8[32] = { 'E', 'm', 'b', 'e', 'd', 'd', 'e', 'd', 'M', 'A',
    'T', 'L', 'A', 'B', ':', 'p', 'o', 'w', 'e', 'r', ':'
    , 'd', 'o', 'm', 'a', 'i', 'n', 'E', 'r', 'r', 'o', 'r' };

  char_T c6_u[32];
  const mxArray *c6_y = NULL;
  int32_T c6_i164;
  static char_T c6_cv9[102] = { 'D', 'o', 'm', 'a', 'i', 'n', ' ', 'e', 'r', 'r',
    'o', 'r', '.', ' ', 'T', 'o', ' ', 'c', 'o', 'm',
    'p', 'u', 't', 'e', ' ', 'c', 'o', 'm', 'p', 'l', 'e', 'x', ' ', 'r', 'e',
    's', 'u', 'l', 't', 's',
    ',', ' ', 'm', 'a', 'k', 'e', ' ', 'a', 't', ' ', 'l', 'e', 'a', 's', 't',
    ' ', 'o', 'n', 'e', ' ',
    'i', 'n', 'p', 'u', 't', ' ', 'c', 'o', 'm', 'p', 'l', 'e', 'x', ',', ' ',
    'e', '.', 'g', '.', ' ',
    '\'', 'p', 'o', 'w', 'e', 'r', '(', 'c', 'o', 'm', 'p', 'l', 'e', 'x', '(',
    'a', ')', ',', 'b', ')',
    '\'', '.' };

  char_T c6_b_u[102];
  const mxArray *c6_b_y = NULL;
  for (c6_i163 = 0; c6_i163 < 32; c6_i163 = c6_i163 + 1) {
    c6_u[c6_i163] = c6_cv8[c6_i163];
  }

  c6_y = NULL;
  sf_mex_assign(&c6_y, sf_mex_create("y", c6_u, 10, 0U, 1U, 0U, 2, 1, 32));
  for (c6_i164 = 0; c6_i164 < 102; c6_i164 = c6_i164 + 1) {
    c6_b_u[c6_i164] = c6_cv9[c6_i164];
  }

  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_b_u, 10, 0U, 1U, 0U, 2, 1, 102));
  sf_mex_call_debug("error", 0U, 2U, 14, c6_y, 14, c6_b_y);
}

static void c6_b_power(SFc6_entalInstanceStruct *chartInstance, real_T c6_a[13],
  real_T c6_b[13], real_T c6_y[13])
{
  real_T c6_k;
  real_T c6_b_k;
  real_T c6_ak;
  real_T c6_bk;
  real_T c6_x;
  real_T c6_b_x;
  for (c6_k = 1.0; c6_k <= 13.0; c6_k = c6_k + 1.0) {
    c6_b_k = c6_k;
    c6_ak = c6_a[(int32_T)c6_b_k - 1];
    c6_bk = c6_b[(int32_T)c6_b_k - 1];
    if (c6_ak < 0.0) {
      c6_x = c6_bk;
      c6_b_x = c6_x;
      c6_b_x = muDoubleScalarFloor(c6_b_x);
      if (c6_b_x != c6_bk) {
        c6_eml_error(chartInstance);
        goto label_1;
      }
    }

   label_1:
    ;
    c6_y[(int32_T)c6_b_k - 1] = muDoubleScalarPower(c6_ak, c6_bk);
  }
}

static const mxArray *c6_sf_marshall(void *chartInstanceVoid, void *c6_u)
{
  const mxArray *c6_y = NULL;
  int32_T c6_i165;
  real_T c6_b_u[13];
  int32_T c6_i166;
  real_T c6_c_u[13];
  const mxArray *c6_b_y = NULL;
  SFc6_entalInstanceStruct *chartInstance;
  chartInstance = (SFc6_entalInstanceStruct *)chartInstanceVoid;
  c6_y = NULL;
  for (c6_i165 = 0; c6_i165 < 13; c6_i165 = c6_i165 + 1) {
    c6_b_u[c6_i165] = (*((real_T (*)[13])c6_u))[c6_i165];
  }

  for (c6_i166 = 0; c6_i166 < 13; c6_i166 = c6_i166 + 1) {
    c6_c_u[c6_i166] = c6_b_u[c6_i166];
  }

  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_c_u, 0, 0U, 1U, 0U, 1, 13));
  sf_mex_assign(&c6_y, c6_b_y);
  return c6_y;
}

static const mxArray *c6_b_sf_marshall(void *chartInstanceVoid, void *c6_u)
{
  const mxArray *c6_y = NULL;
  real_T c6_b_u;
  const mxArray *c6_b_y = NULL;
  SFc6_entalInstanceStruct *chartInstance;
  chartInstance = (SFc6_entalInstanceStruct *)chartInstanceVoid;
  c6_y = NULL;
  c6_b_u = *((real_T *)c6_u);
  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", &c6_b_u, 0, 0U, 0U, 0U, 0));
  sf_mex_assign(&c6_y, c6_b_y);
  return c6_y;
}

static const mxArray *c6_c_sf_marshall(void *chartInstanceVoid, void *c6_u)
{
  const mxArray *c6_y = NULL;
  int32_T c6_i167;
  int32_T c6_i168;
  int32_T c6_i169;
  real_T c6_b_u[7185];
  int32_T c6_i170;
  int32_T c6_i171;
  int32_T c6_i172;
  real_T c6_c_u[7185];
  const mxArray *c6_b_y = NULL;
  SFc6_entalInstanceStruct *chartInstance;
  chartInstance = (SFc6_entalInstanceStruct *)chartInstanceVoid;
  c6_y = NULL;
  c6_i167 = 0;
  for (c6_i168 = 0; c6_i168 < 479; c6_i168 = c6_i168 + 1) {
    for (c6_i169 = 0; c6_i169 < 15; c6_i169 = c6_i169 + 1) {
      c6_b_u[c6_i169 + c6_i167] = (*((real_T (*)[7185])c6_u))[c6_i169 + c6_i167];
    }

    c6_i167 = c6_i167 + 15;
  }

  c6_i170 = 0;
  for (c6_i171 = 0; c6_i171 < 479; c6_i171 = c6_i171 + 1) {
    for (c6_i172 = 0; c6_i172 < 15; c6_i172 = c6_i172 + 1) {
      c6_c_u[c6_i172 + c6_i170] = c6_b_u[c6_i172 + c6_i170];
    }

    c6_i170 = c6_i170 + 15;
  }

  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_c_u, 0, 0U, 1U, 0U, 2, 15, 479));
  sf_mex_assign(&c6_y, c6_b_y);
  return c6_y;
}

static const mxArray *c6_d_sf_marshall(void *chartInstanceVoid, void *c6_u)
{
  const mxArray *c6_y = NULL;
  int32_T c6_i173;
  int32_T c6_i174;
  int32_T c6_i175;
  real_T c6_b_u[2874];
  int32_T c6_i176;
  int32_T c6_i177;
  int32_T c6_i178;
  real_T c6_c_u[2874];
  const mxArray *c6_b_y = NULL;
  SFc6_entalInstanceStruct *chartInstance;
  chartInstance = (SFc6_entalInstanceStruct *)chartInstanceVoid;
  c6_y = NULL;
  c6_i173 = 0;
  for (c6_i174 = 0; c6_i174 < 6; c6_i174 = c6_i174 + 1) {
    for (c6_i175 = 0; c6_i175 < 479; c6_i175 = c6_i175 + 1) {
      c6_b_u[c6_i175 + c6_i173] = (*((real_T (*)[2874])c6_u))[c6_i175 + c6_i173];
    }

    c6_i173 = c6_i173 + 479;
  }

  c6_i176 = 0;
  for (c6_i177 = 0; c6_i177 < 6; c6_i177 = c6_i177 + 1) {
    for (c6_i178 = 0; c6_i178 < 479; c6_i178 = c6_i178 + 1) {
      c6_c_u[c6_i178 + c6_i176] = c6_b_u[c6_i178 + c6_i176];
    }

    c6_i176 = c6_i176 + 479;
  }

  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_c_u, 0, 0U, 1U, 0U, 2, 479, 6));
  sf_mex_assign(&c6_y, c6_b_y);
  return c6_y;
}

static const mxArray *c6_e_sf_marshall(void *chartInstanceVoid, void *c6_u)
{
  const mxArray *c6_y = NULL;
  int32_T c6_i179;
  int32_T c6_i180;
  int32_T c6_i181;
  real_T c6_b_u[1950];
  int32_T c6_i182;
  int32_T c6_i183;
  int32_T c6_i184;
  real_T c6_c_u[1950];
  const mxArray *c6_b_y = NULL;
  SFc6_entalInstanceStruct *chartInstance;
  chartInstance = (SFc6_entalInstanceStruct *)chartInstanceVoid;
  c6_y = NULL;
  c6_i179 = 0;
  for (c6_i180 = 0; c6_i180 < 150; c6_i180 = c6_i180 + 1) {
    for (c6_i181 = 0; c6_i181 < 13; c6_i181 = c6_i181 + 1) {
      c6_b_u[c6_i181 + c6_i179] = (*((real_T (*)[1950])c6_u))[c6_i181 + c6_i179];
    }

    c6_i179 = c6_i179 + 13;
  }

  c6_i182 = 0;
  for (c6_i183 = 0; c6_i183 < 150; c6_i183 = c6_i183 + 1) {
    for (c6_i184 = 0; c6_i184 < 13; c6_i184 = c6_i184 + 1) {
      c6_c_u[c6_i184 + c6_i182] = c6_b_u[c6_i184 + c6_i182];
    }

    c6_i182 = c6_i182 + 13;
  }

  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", c6_c_u, 0, 0U, 1U, 0U, 2, 13, 150));
  sf_mex_assign(&c6_y, c6_b_y);
  return c6_y;
}

const mxArray *sf_c6_ental_get_eml_resolved_functions_info(void)
{
  const mxArray *c6_nameCaptureInfo = NULL;
  c6_ResolvedFunctionInfo c6_info[49];
  const mxArray *c6_m0 = NULL;
  int32_T c6_i185;
  c6_ResolvedFunctionInfo *c6_r0;
  c6_nameCaptureInfo = NULL;
  c6_info_helper(c6_info);
  sf_mex_assign(&c6_m0, sf_mex_createstruct("nameCaptureInfo", 1, 49));
  for (c6_i185 = 0; c6_i185 < 49; c6_i185 = c6_i185 + 1) {
    c6_r0 = &c6_info[c6_i185];
    sf_mex_addfield(c6_m0, sf_mex_create("nameCaptureInfo", c6_r0->context, 15,
      0U, 0U, 0U, 2, 1, strlen(c6_r0->context)), "context",
                    "nameCaptureInfo", c6_i185);
    sf_mex_addfield(c6_m0, sf_mex_create("nameCaptureInfo", c6_r0->name, 15, 0U,
      0U, 0U, 2, 1, strlen(c6_r0->name)), "name",
                    "nameCaptureInfo", c6_i185);
    sf_mex_addfield(c6_m0, sf_mex_create("nameCaptureInfo", c6_r0->dominantType,
      15, 0U, 0U, 0U, 2, 1, strlen(c6_r0->dominantType)),
                    "dominantType", "nameCaptureInfo", c6_i185);
    sf_mex_addfield(c6_m0, sf_mex_create("nameCaptureInfo", c6_r0->resolved, 15,
      0U, 0U, 0U, 2, 1, strlen(c6_r0->resolved)), "resolved"
                    , "nameCaptureInfo", c6_i185);
    sf_mex_addfield(c6_m0, sf_mex_create("nameCaptureInfo", &c6_r0->fileLength,
      7, 0U, 0U, 0U, 0), "fileLength", "nameCaptureInfo",
                    c6_i185);
    sf_mex_addfield(c6_m0, sf_mex_create("nameCaptureInfo", &c6_r0->fileTime1, 7,
      0U, 0U, 0U, 0), "fileTime1", "nameCaptureInfo",
                    c6_i185);
    sf_mex_addfield(c6_m0, sf_mex_create("nameCaptureInfo", &c6_r0->fileTime2, 7,
      0U, 0U, 0U, 0), "fileTime2", "nameCaptureInfo",
                    c6_i185);
  }

  sf_mex_assign(&c6_nameCaptureInfo, c6_m0);
  return c6_nameCaptureInfo;
}

static void c6_info_helper(c6_ResolvedFunctionInfo c6_info[49])
{
  c6_info[0].context = "";
  c6_info[0].name = "size";
  c6_info[0].dominantType = "double";
  c6_info[0].resolved = "[B]size";
  c6_info[0].fileLength = 0U;
  c6_info[0].fileTime1 = 0U;
  c6_info[0].fileTime2 = 0U;
  c6_info[1].context = "";
  c6_info[1].name = "max";
  c6_info[1].dominantType = "double";
  c6_info[1].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/max.m";
  c6_info[1].fileLength = 362U;
  c6_info[1].fileTime1 = 1245102360U;
  c6_info[1].fileTime2 = 0U;
  c6_info[2].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/max.m";
  c6_info[2].name = "nargin";
  c6_info[2].dominantType = "";
  c6_info[2].resolved = "[B]nargin";
  c6_info[2].fileLength = 0U;
  c6_info[2].fileTime1 = 0U;
  c6_info[2].fileTime2 = 0U;
  c6_info[3].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/max.m";
  c6_info[3].name = "gt";
  c6_info[3].dominantType = "double";
  c6_info[3].resolved = "[B]gt";
  c6_info[3].fileLength = 0U;
  c6_info[3].fileTime1 = 0U;
  c6_info[3].fileTime2 = 0U;
  c6_info[4].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/max.m";
  c6_info[4].name = "le";
  c6_info[4].dominantType = "double";
  c6_info[4].resolved = "[B]le";
  c6_info[4].fileLength = 0U;
  c6_info[4].fileTime1 = 0U;
  c6_info[4].fileTime2 = 0U;
  c6_info[5].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/max.m";
  c6_info[5].name = "nargout";
  c6_info[5].dominantType = "";
  c6_info[5].resolved = "[B]nargout";
  c6_info[5].fileLength = 0U;
  c6_info[5].fileTime1 = 0U;
  c6_info[5].fileTime2 = 0U;
  c6_info[6].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/max.m";
  c6_info[6].name = "eml_min_or_max";
  c6_info[6].dominantType = "char";
  c6_info[6].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[6].fileLength = 9967U;
  c6_info[6].fileTime1 = 1261951870U;
  c6_info[6].fileTime2 = 0U;
  c6_info[7].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[7].name = "ischar";
  c6_info[7].dominantType = "char";
  c6_info[7].resolved = "[B]ischar";
  c6_info[7].fileLength = 0U;
  c6_info[7].fileTime1 = 0U;
  c6_info[7].fileTime2 = 0U;
  c6_info[8].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[8].name = "strcmp";
  c6_info[8].dominantType = "char";
  c6_info[8].resolved = "[B]strcmp";
  c6_info[8].fileLength = 0U;
  c6_info[8].fileTime1 = 0U;
  c6_info[8].fileTime2 = 0U;
  c6_info[9].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[9].name = "isnumeric";
  c6_info[9].dominantType = "double";
  c6_info[9].resolved = "[B]isnumeric";
  c6_info[9].fileLength = 0U;
  c6_info[9].fileTime1 = 0U;
  c6_info[9].fileTime2 = 0U;
  c6_info[10].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[10].name = "isreal";
  c6_info[10].dominantType = "double";
  c6_info[10].resolved = "[B]isreal";
  c6_info[10].fileLength = 0U;
  c6_info[10].fileTime1 = 0U;
  c6_info[10].fileTime2 = 0U;
  c6_info[11].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[11].name = "eq";
  c6_info[11].dominantType = "double";
  c6_info[11].resolved = "[B]eq";
  c6_info[11].fileLength = 0U;
  c6_info[11].fileTime1 = 0U;
  c6_info[11].fileTime2 = 0U;
  c6_info[12].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[12].name = "eml_const_nonsingleton_dim";
  c6_info[12].dominantType = "double";
  c6_info[12].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_const_nonsingleton_dim.m";
  c6_info[12].fileLength = 1473U;
  c6_info[12].fileTime1 = 1240262002U;
  c6_info[12].fileTime2 = 0U;
  c6_info[13].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_const_nonsingleton_dim.m!local_const_nonsingleton_dim";
  c6_info[13].name = "not";
  c6_info[13].dominantType = "logical";
  c6_info[13].resolved = "[B]not";
  c6_info[13].fileLength = 0U;
  c6_info[13].fileTime1 = 0U;
  c6_info[13].fileTime2 = 0U;
  c6_info[14].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_const_nonsingleton_dim.m!local_const_nonsingleton_dim";
  c6_info[14].name = "ne";
  c6_info[14].dominantType = "double";
  c6_info[14].resolved = "[B]ne";
  c6_info[14].fileLength = 0U;
  c6_info[14].fileTime1 = 0U;
  c6_info[14].fileTime2 = 0U;
  c6_info[15].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[15].name = "eml_scalar_eg";
  c6_info[15].dominantType = "double";
  c6_info[15].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m";
  c6_info[15].fileLength = 3068U;
  c6_info[15].fileTime1 = 1240262010U;
  c6_info[15].fileTime2 = 0U;
  c6_info[16].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m!any_enums";
  c6_info[16].name = "false";
  c6_info[16].dominantType = "";
  c6_info[16].resolved = "[B]false";
  c6_info[16].fileLength = 0U;
  c6_info[16].fileTime1 = 0U;
  c6_info[16].fileTime2 = 0U;
  c6_info[17].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m";
  c6_info[17].name = "isstruct";
  c6_info[17].dominantType = "double";
  c6_info[17].resolved = "[B]isstruct";
  c6_info[17].fileLength = 0U;
  c6_info[17].fileTime1 = 0U;
  c6_info[17].fileTime2 = 0U;
  c6_info[18].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m";
  c6_info[18].name = "isa";
  c6_info[18].dominantType = "double";
  c6_info[18].resolved = "[B]isa";
  c6_info[18].fileLength = 0U;
  c6_info[18].fileTime1 = 0U;
  c6_info[18].fileTime2 = 0U;
  c6_info[19].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m!zerosum";
  c6_info[19].name = "class";
  c6_info[19].dominantType = "double";
  c6_info[19].resolved = "[B]class";
  c6_info[19].fileLength = 0U;
  c6_info[19].fileTime1 = 0U;
  c6_info[19].fileTime2 = 0U;
  c6_info[20].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m!zerosum";
  c6_info[20].name = "cast";
  c6_info[20].dominantType = "double";
  c6_info[20].resolved = "[B]cast";
  c6_info[20].fileLength = 0U;
  c6_info[20].fileTime1 = 0U;
  c6_info[20].fileTime2 = 0U;
  c6_info[21].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[21].name = "ones";
  c6_info[21].dominantType = "double";
  c6_info[21].resolved = "[B]ones";
  c6_info[21].fileLength = 0U;
  c6_info[21].fileTime1 = 0U;
  c6_info[21].fileTime2 = 0U;
  c6_info[22].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[22].name = "eml_index_class";
  c6_info[22].dominantType = "";
  c6_info[22].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_class.m";
  c6_info[22].fileLength = 909U;
  c6_info[22].fileTime1 = 1192466782U;
  c6_info[22].fileTime2 = 0U;
  c6_info[23].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[23].name = "isempty";
  c6_info[23].dominantType = "double";
  c6_info[23].resolved = "[B]isempty";
  c6_info[23].fileLength = 0U;
  c6_info[23].fileTime1 = 0U;
  c6_info[23].fileTime2 = 0U;
  c6_info[24].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m";
  c6_info[24].name = "isscalar";
  c6_info[24].dominantType = "double";
  c6_info[24].resolved = "[B]isscalar";
  c6_info[24].fileLength = 0U;
  c6_info[24].fileTime1 = 0U;
  c6_info[24].fileTime2 = 0U;
  c6_info[25].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_extremum_sub";
  c6_info[25].name = "lt";
  c6_info[25].dominantType = "double";
  c6_info[25].resolved = "[B]lt";
  c6_info[25].fileLength = 0U;
  c6_info[25].fileTime1 = 0U;
  c6_info[25].fileTime2 = 0U;
  c6_info[26].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_extremum_sub";
  c6_info[26].name = "isnan";
  c6_info[26].dominantType = "double";
  c6_info[26].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/isnan.m";
  c6_info[26].fileLength = 541U;
  c6_info[26].fileTime1 = 1271405588U;
  c6_info[26].fileTime2 = 0U;
  c6_info[27].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_extremum_sub";
  c6_info[27].name = "true";
  c6_info[27].dominantType = "";
  c6_info[27].resolved = "[B]true";
  c6_info[27].fileLength = 0U;
  c6_info[27].fileTime1 = 0U;
  c6_info[27].fileTime2 = 0U;
  c6_info[28].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_min_or_max.m!eml_extremum_sub";
  c6_info[28].name = "eml_index_plus";
  c6_info[28].dominantType = "int32";
  c6_info[28].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_index_plus.m";
  c6_info[28].fileLength = 272U;
  c6_info[28].fileTime1 = 1192466784U;
  c6_info[28].fileTime2 = 0U;
  c6_info[29].context = "";
  c6_info[29].name = "min";
  c6_info[29].dominantType = "double";
  c6_info[29].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/min.m";
  c6_info[29].fileLength = 362U;
  c6_info[29].fileTime1 = 1245102364U;
  c6_info[29].fileTime2 = 0U;
  c6_info[30].context = "";
  c6_info[30].name = "zeros";
  c6_info[30].dominantType = "double";
  c6_info[30].resolved = "[B]zeros";
  c6_info[30].fileLength = 0U;
  c6_info[30].fileTime1 = 0U;
  c6_info[30].fileTime2 = 0U;
  c6_info[31].context = "";
  c6_info[31].name = "times";
  c6_info[31].dominantType = "double";
  c6_info[31].resolved = "[B]times";
  c6_info[31].fileLength = 0U;
  c6_info[31].fileTime1 = 0U;
  c6_info[31].fileTime2 = 0U;
  c6_info[32].context = "";
  c6_info[32].name = "plus";
  c6_info[32].dominantType = "double";
  c6_info[32].resolved = "[B]plus";
  c6_info[32].fileLength = 0U;
  c6_info[32].fileTime1 = 0U;
  c6_info[32].fileTime2 = 0U;
  c6_info[33].context = "";
  c6_info[33].name = "mrdivide";
  c6_info[33].dominantType = "double";
  c6_info[33].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c6_info[33].fileLength = 432U;
  c6_info[33].fileTime1 = 1277748222U;
  c6_info[33].fileTime2 = 0U;
  c6_info[34].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c6_info[34].name = "ge";
  c6_info[34].dominantType = "double";
  c6_info[34].resolved = "[B]ge";
  c6_info[34].fileLength = 0U;
  c6_info[34].fileTime1 = 0U;
  c6_info[34].fileTime2 = 0U;
  c6_info[35].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c6_info[35].name = "rdivide";
  c6_info[35].dominantType = "double";
  c6_info[35].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c6_info[35].fileLength = 403U;
  c6_info[35].fileTime1 = 1245102420U;
  c6_info[35].fileTime2 = 0U;
  c6_info[36].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c6_info[36].name = "eml_div";
  c6_info[36].dominantType = "double";
  c6_info[36].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m";
  c6_info[36].fileLength = 4918U;
  c6_info[36].fileTime1 = 1267063410U;
  c6_info[36].fileTime2 = 0U;
  c6_info[37].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m";
  c6_info[37].name = "isinteger";
  c6_info[37].dominantType = "double";
  c6_info[37].resolved = "[B]isinteger";
  c6_info[37].fileLength = 0U;
  c6_info[37].fileTime1 = 0U;
  c6_info[37].fileTime2 = 0U;
  c6_info[38].context = "";
  c6_info[38].name = "mtimes";
  c6_info[38].dominantType = "double";
  c6_info[38].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c6_info[38].fileLength = 3425U;
  c6_info[38].fileTime1 = 1251031872U;
  c6_info[38].fileTime2 = 0U;
  c6_info[39].context = "";
  c6_info[39].name = "sum";
  c6_info[39].dominantType = "double";
  c6_info[39].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/sum.m";
  c6_info[39].fileLength = 3457U;
  c6_info[39].fileTime1 = 1245102370U;
  c6_info[39].fileTime2 = 0U;
  c6_info[40].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/datafun/sum.m";
  c6_info[40].name = "isequal";
  c6_info[40].dominantType = "double";
  c6_info[40].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m";
  c6_info[40].fileLength = 180U;
  c6_info[40].fileTime1 = 1226577270U;
  c6_info[40].fileTime2 = 0U;
  c6_info[41].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/isequal.m";
  c6_info[41].name = "eml_isequal_core";
  c6_info[41].dominantType = "double";
  c6_info[41].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m";
  c6_info[41].fileLength = 4192U;
  c6_info[41].fileTime1 = 1258064210U;
  c6_info[41].fileTime2 = 0U;
  c6_info[42].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m";
  c6_info[42].name = "islogical";
  c6_info[42].dominantType = "logical";
  c6_info[42].resolved = "[B]islogical";
  c6_info[42].fileLength = 0U;
  c6_info[42].fileTime1 = 0U;
  c6_info[42].fileTime2 = 0U;
  c6_info[43].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m";
  c6_info[43].name = "minus";
  c6_info[43].dominantType = "double";
  c6_info[43].resolved = "[B]minus";
  c6_info[43].fileLength = 0U;
  c6_info[43].fileTime1 = 0U;
  c6_info[43].fileTime2 = 0U;
  c6_info[44].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_isequal_core.m!same_size";
  c6_info[44].name = "ndims";
  c6_info[44].dominantType = "double";
  c6_info[44].resolved = "[B]ndims";
  c6_info[44].fileLength = 0U;
  c6_info[44].fileTime1 = 0U;
  c6_info[44].fileTime2 = 0U;
  c6_info[45].context = "";
  c6_info[45].name = "power";
  c6_info[45].dominantType = "double";
  c6_info[45].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c6_info[45].fileLength = 5380U;
  c6_info[45].fileTime1 = 1228093898U;
  c6_info[45].fileTime2 = 0U;
  c6_info[46].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c6_info[46].name = "eml_scalexp_alloc";
  c6_info[46].dominantType = "double";
  c6_info[46].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m";
  c6_info[46].fileLength = 932U;
  c6_info[46].fileTime1 = 1261951870U;
  c6_info[46].fileTime2 = 0U;
  c6_info[47].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c6_info[47].name = "eml_scalar_floor";
  c6_info[47].dominantType = "double";
  c6_info[47].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m";
  c6_info[47].fileLength = 260U;
  c6_info[47].fileTime1 = 1209330790U;
  c6_info[47].fileTime2 = 0U;
  c6_info[48].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c6_info[48].name = "eml_error";
  c6_info[48].dominantType = "char";
  c6_info[48].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_error.m";
  c6_info[48].fileLength = 315U;
  c6_info[48].fileTime1 = 1213926744U;
  c6_info[48].fileTime2 = 0U;
}

static const mxArray *c6_f_sf_marshall(void *chartInstanceVoid, void *c6_u)
{
  const mxArray *c6_y = NULL;
  boolean_T c6_b_u;
  const mxArray *c6_b_y = NULL;
  SFc6_entalInstanceStruct *chartInstance;
  chartInstance = (SFc6_entalInstanceStruct *)chartInstanceVoid;
  c6_y = NULL;
  c6_b_u = *((boolean_T *)c6_u);
  c6_b_y = NULL;
  sf_mex_assign(&c6_b_y, sf_mex_create("y", &c6_b_u, 11, 0U, 0U, 0U, 0));
  sf_mex_assign(&c6_y, c6_b_y);
  return c6_y;
}

static void c6_emlrt_marshallIn(SFc6_entalInstanceStruct *chartInstance, const
  mxArray *c6_V1, const char_T *c6_name, real_T c6_y[13
  ])
{
  real_T c6_dv6[13];
  int32_T c6_i186;
  sf_mex_import(c6_name, sf_mex_dup(c6_V1), c6_dv6, 1, 0, 0U, 1, 0U, 1, 13);
  for (c6_i186 = 0; c6_i186 < 13; c6_i186 = c6_i186 + 1) {
    c6_y[c6_i186] = c6_dv6[c6_i186];
  }

  sf_mex_destroy(&c6_V1);
}

static real_T c6_b_emlrt_marshallIn(SFc6_entalInstanceStruct *chartInstance,
  const mxArray *c6_v1, const char_T *c6_name)
{
  real_T c6_y;
  real_T c6_d12;
  sf_mex_import(c6_name, sf_mex_dup(c6_v1), &c6_d12, 1, 0, 0U, 0, 0U, 0);
  c6_y = c6_d12;
  sf_mex_destroy(&c6_v1);
  return c6_y;
}

static uint8_T c6_c_emlrt_marshallIn(SFc6_entalInstanceStruct *chartInstance,
  const mxArray *c6_b_is_active_c6_ental, const char_T *
  c6_name)
{
  uint8_T c6_y;
  uint8_T c6_u0;
  sf_mex_import(c6_name, sf_mex_dup(c6_b_is_active_c6_ental), &c6_u0, 1, 3, 0U,
                0, 0U, 0);
  c6_y = c6_u0;
  sf_mex_destroy(&c6_b_is_active_c6_ental);
  return c6_y;
}

static void init_dsm_address_info(SFc6_entalInstanceStruct *chartInstance)
{
}

/* SFunction Glue Code */
void sf_c6_ental_get_check_sum(mxArray *plhs[])
{
  ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(1003438800U);
  ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(954558278U);
  ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2780688891U);
  ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(450955795U);
}

mxArray *sf_c6_ental_get_autoinheritance_info(void)
{
  const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters",
    "outputs" };

  mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,4,
    autoinheritanceFields);

  {
    mxArray *mxChecksum = mxCreateDoubleMatrix(4,1,mxREAL);
    double *pr = mxGetPr(mxChecksum);
    pr[0] = (double)(2128570310U);
    pr[1] = (double)(4268988315U);
    pr[2] = (double)(117340484U);
    pr[3] = (double)(3079835516U);
    mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,25,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,1,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,1,"type",mxType);
    }

    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,2,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,2,"type",mxType);
    }

    mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,3,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,3,"type",mxType);
    }

    mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,4,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,4,"type",mxType);
    }

    mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,5,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,5,"type",mxType);
    }

    mxSetField(mxData,5,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,6,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,6,"type",mxType);
    }

    mxSetField(mxData,6,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,7,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,7,"type",mxType);
    }

    mxSetField(mxData,7,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,8,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,8,"type",mxType);
    }

    mxSetField(mxData,8,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,9,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,9,"type",mxType);
    }

    mxSetField(mxData,9,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,10,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,10,"type",mxType);
    }

    mxSetField(mxData,10,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,11,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,11,"type",mxType);
    }

    mxSetField(mxData,11,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,12,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,12,"type",mxType);
    }

    mxSetField(mxData,12,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,13,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,13,"type",mxType);
    }

    mxSetField(mxData,13,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,14,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,14,"type",mxType);
    }

    mxSetField(mxData,14,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(479);
      pr[1] = (double)(6);
      mxSetField(mxData,15,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,15,"type",mxType);
    }

    mxSetField(mxData,15,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(479);
      pr[1] = (double)(6);
      mxSetField(mxData,16,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,16,"type",mxType);
    }

    mxSetField(mxData,16,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(15);
      pr[1] = (double)(479);
      mxSetField(mxData,17,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,17,"type",mxType);
    }

    mxSetField(mxData,17,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,18,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,18,"type",mxType);
    }

    mxSetField(mxData,18,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,19,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,19,"type",mxType);
    }

    mxSetField(mxData,19,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,20,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,20,"type",mxType);
    }

    mxSetField(mxData,20,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,21,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,21,"type",mxType);
    }

    mxSetField(mxData,21,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,22,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,22,"type",mxType);
    }

    mxSetField(mxData,22,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,23,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,23,"type",mxType);
    }

    mxSetField(mxData,23,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,24,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,24,"type",mxType);
    }

    mxSetField(mxData,24,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
  }

  {
    mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,
                mxREAL));
  }

  {
    const char *dataFields[] = { "size", "type", "complexity" };

    mxArray *mxData = mxCreateStructMatrix(1,5,3,dataFields);

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,0,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,0,"type",mxType);
    }

    mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(1);
      pr[1] = (double)(1);
      mxSetField(mxData,1,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,1,"type",mxType);
    }

    mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,2,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,2,"type",mxType);
    }

    mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,3,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,3,"type",mxType);
    }

    mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0));

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(13);
      pr[1] = (double)(1);
      mxSetField(mxData,4,"size",mxSize);
    }

    {
      const char *typeFields[] = { "base", "fixpt" };

      mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
      mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
      mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
      mxSetField(mxData,4,"type",mxType);
    }

    mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(0));
    mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData);
  }

  return(mxAutoinheritanceInfo);
}

static mxArray *sf_get_sim_state_info_c6_ental(void)
{
  const char *infoFields[] = { "chartChecksum", "varInfo" };

  mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields);
  const char *infoEncStr[] = {
    "100 S1x6'type','srcId','name','auxInfo'{{M[1],M[41],T\"V1\",},{M[1],M[42],T\"V2\",},{M[1],M[43],T\"V3\",},{M[1],M[5],T\"htc1\",},{M[1],M[44],T\"v1\",},{M[8],M[0],T\"is_active_c6_ental\",}}"
  };

  mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 6, 10);
  mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL);
  sf_c6_ental_get_check_sum(&mxChecksum);
  mxSetField(mxInfo, 0, infoFields[0], mxChecksum);
  mxSetField(mxInfo, 0, infoFields[1], mxVarInfo);
  return mxInfo;
}

static void chart_debug_initialization(SimStruct *S, unsigned int
  fullDebuggerInitialization)
{
  if (!sim_mode_is_rtw_gen(S)) {
    SFc6_entalInstanceStruct *chartInstance;
    chartInstance = (SFc6_entalInstanceStruct *) ((ChartInfoStruct *)
      (ssGetUserData(S)))->chartInstance;
    if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) {
      /* do this only if simulation is starting */
      {
        unsigned int chartAlreadyPresent;
        chartAlreadyPresent = sf_debug_initialize_chart(_entalMachineNumber_,
          6,
          1,
          1,
          30,
          0,
          0,
          0,
          0,
          0,
          &(chartInstance->chartNumber),
          &(chartInstance->instanceNumber),
          ssGetPath(S),
          (void *)S);
        if (chartAlreadyPresent==0) {
          /* this is the first instance */
          init_script_number_translation(_entalMachineNumber_,
            chartInstance->chartNumber);
          sf_debug_set_chart_disable_implicit_casting(_entalMachineNumber_,
            chartInstance->chartNumber,1);
          sf_debug_set_chart_event_thresholds(_entalMachineNumber_,
            chartInstance->chartNumber,
            0,
            0,
            0);
          _SFD_SET_DATA_PROPS(0,1,1,0,"A");
          _SFD_SET_DATA_PROPS(1,1,1,0,"B");
          _SFD_SET_DATA_PROPS(2,1,1,0,"C");
          _SFD_SET_DATA_PROPS(3,1,1,0,"D");
          _SFD_SET_DATA_PROPS(4,1,1,0,"E");
          _SFD_SET_DATA_PROPS(5,1,1,0,"beta");
          _SFD_SET_DATA_PROPS(6,1,1,0,"delta");
          _SFD_SET_DATA_PROPS(7,1,1,0,"w1");
          _SFD_SET_DATA_PROPS(8,1,1,0,"w2");
          _SFD_SET_DATA_PROPS(9,1,1,0,"w3");
          _SFD_SET_DATA_PROPS(10,1,1,0,"Tw");
          _SFD_SET_DATA_PROPS(11,1,1,0,"Tt");
          _SFD_SET_DATA_PROPS(12,1,1,0,"Td");
          _SFD_SET_DATA_PROPS(13,1,1,0,"TS");
          _SFD_SET_DATA_PROPS(14,1,1,0,"TTS");
          _SFD_SET_DATA_PROPS(15,1,1,0,"OPv");
          _SFD_SET_DATA_PROPS(16,1,1,0,"OPm");
          _SFD_SET_DATA_PROPS(17,1,1,0,"u");
          _SFD_SET_DATA_PROPS(18,1,1,0,"v");
          _SFD_SET_DATA_PROPS(19,1,1,0,"vv");
          _SFD_SET_DATA_PROPS(20,1,1,0,"vzp");
          _SFD_SET_DATA_PROPS(21,2,0,1,"htc1");
          _SFD_SET_DATA_PROPS(22,2,0,1,"v1");
          _SFD_SET_DATA_PROPS(23,1,1,0,"htc");
          _SFD_SET_DATA_PROPS(24,1,1,0,"minHtc");
          _SFD_SET_DATA_PROPS(25,1,1,0,"maxHtc");
          _SFD_SET_DATA_PROPS(26,2,0,1,"V1");
          _SFD_SET_DATA_PROPS(27,2,0,1,"V2");
          _SFD_SET_DATA_PROPS(28,2,0,1,"V3");
          _SFD_SET_DATA_PROPS(29,1,1,0,"zpozdeni");
          _SFD_STATE_INFO(0,0,2);
          _SFD_CH_SUBSTATE_COUNT(0);
          _SFD_CH_SUBSTATE_DECOMP(0);
        }

        _SFD_CV_INIT_CHART(0,0,0,0);

        {
          _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL);
        }

        _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL);

        /* Initialization of EML Model Coverage */
        _SFD_CV_INIT_EML(0,1,13,0,0,5,0,0,0);
        _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,2624);
        _SFD_CV_INIT_EML_IF(0,0,433,447,-1,792);
        _SFD_CV_INIT_EML_IF(0,1,560,571,-1,680);
        _SFD_CV_INIT_EML_IF(0,2,693,703,-1,780);
        _SFD_CV_INIT_EML_IF(0,3,823,836,-1,-2);
        _SFD_CV_INIT_EML_IF(0,4,986,996,-1,1374);
        _SFD_CV_INIT_EML_IF(0,5,1061,1067,1285,1366);
        _SFD_CV_INIT_EML_IF(0,6,1466,1480,-1,1825);
        _SFD_CV_INIT_EML_IF(0,7,1593,1604,-1,1713);
        _SFD_CV_INIT_EML_IF(0,8,1726,1736,-1,1813);
        _SFD_CV_INIT_EML_IF(0,9,1840,1853,-1,-2);
        _SFD_CV_INIT_EML_IF(0,10,2008,2015,-1,2168);
        _SFD_CV_INIT_EML_IF(0,11,2471,2488,2517,2587);
        _SFD_CV_INIT_EML_IF(0,12,2522,2539,-1,2579);
        _SFD_CV_INIT_EML_FOR(0,0,371,381,1378);
        _SFD_CV_INIT_EML_FOR(0,1,414,425,915);
        _SFD_CV_INIT_EML_FOR(0,2,1404,1414,2172);
        _SFD_CV_INIT_EML_FOR(0,3,1447,1458,1932);
        _SFD_CV_INIT_EML_FOR(0,4,2457,2467,2591);
        _SFD_TRANS_COV_WTS(0,0,0,1,0);
        if (chartAlreadyPresent==0) {
          _SFD_TRANS_COV_MAPS(0,
                              0,NULL,NULL,
                              0,NULL,NULL,
                              1,NULL,NULL,
                              0,NULL,NULL);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(6,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        _SFD_SET_DATA_COMPILED_PROPS(7,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);
        _SFD_SET_DATA_COMPILED_PROPS(8,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);
        _SFD_SET_DATA_COMPILED_PROPS(9,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);
        _SFD_SET_DATA_COMPILED_PROPS(10,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(11,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        _SFD_SET_DATA_COMPILED_PROPS(12,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(13,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        _SFD_SET_DATA_COMPILED_PROPS(14,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);

        {
          unsigned int dimVector[2];
          dimVector[0]= 479;
          dimVector[1]= 6;
          _SFD_SET_DATA_COMPILED_PROPS(15,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_d_sf_marshall);
        }

        {
          unsigned int dimVector[2];
          dimVector[0]= 479;
          dimVector[1]= 6;
          _SFD_SET_DATA_COMPILED_PROPS(16,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_d_sf_marshall);
        }

        {
          unsigned int dimVector[2];
          dimVector[0]= 15;
          dimVector[1]= 479;
          _SFD_SET_DATA_COMPILED_PROPS(17,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_c_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(18,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        _SFD_SET_DATA_COMPILED_PROPS(19,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(20,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(21,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        _SFD_SET_DATA_COMPILED_PROPS(22,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(23,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        _SFD_SET_DATA_COMPILED_PROPS(24,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);
        _SFD_SET_DATA_COMPILED_PROPS(25,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c6_b_sf_marshall);

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(26,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(27,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(28,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          unsigned int dimVector[1];
          dimVector[0]= 13;
          _SFD_SET_DATA_COMPILED_PROPS(29,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c6_sf_marshall);
        }

        {
          real_T *c6_w1;
          real_T *c6_w2;
          real_T *c6_w3;
          real_T *c6_Tw;
          real_T *c6_Td;
          real_T *c6_TTS;
          real_T *c6_vv;
          real_T *c6_v1;
          real_T *c6_minHtc;
          real_T *c6_maxHtc;
          real_T (*c6_A)[13];
          real_T (*c6_B)[13];
          real_T (*c6_C)[13];
          real_T (*c6_D)[13];
          real_T (*c6_E)[13];
          real_T (*c6_beta)[13];
          real_T (*c6_delta)[13];
          real_T (*c6_Tt)[13];
          real_T (*c6_TS)[13];
          real_T (*c6_OPv)[2874];
          real_T (*c6_OPm)[2874];
          real_T (*c6_u)[7185];
          real_T (*c6_v)[13];
          real_T (*c6_vzp)[13];
          real_T (*c6_htc1)[13];
          real_T (*c6_htc)[13];
          real_T (*c6_V1)[13];
          real_T (*c6_V2)[13];
          real_T (*c6_V3)[13];
          real_T (*c6_zpozdeni)[13];
          c6_zpozdeni = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S,
            24);
          c6_V3 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 5);
          c6_V2 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 4);
          c6_V1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 3);
          c6_maxHtc = (real_T *)ssGetInputPortSignal(chartInstance->S, 23);
          c6_minHtc = (real_T *)ssGetInputPortSignal(chartInstance->S, 22);
          c6_htc = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 21);
          c6_v1 = (real_T *)ssGetOutputPortSignal(chartInstance->S, 2);
          c6_htc1 = (real_T (*)[13])ssGetOutputPortSignal(chartInstance->S, 1);
          c6_vzp = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 20);
          c6_vv = (real_T *)ssGetInputPortSignal(chartInstance->S, 19);
          c6_v = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 18);
          c6_u = (real_T (*)[7185])ssGetInputPortSignal(chartInstance->S, 17);
          c6_OPm = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 16);
          c6_OPv = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 15);
          c6_TTS = (real_T *)ssGetInputPortSignal(chartInstance->S, 14);
          c6_TS = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 13);
          c6_Td = (real_T *)ssGetInputPortSignal(chartInstance->S, 12);
          c6_Tt = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 11);
          c6_Tw = (real_T *)ssGetInputPortSignal(chartInstance->S, 10);
          c6_w3 = (real_T *)ssGetInputPortSignal(chartInstance->S, 9);
          c6_w2 = (real_T *)ssGetInputPortSignal(chartInstance->S, 8);
          c6_w1 = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
          c6_delta = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 6);
          c6_beta = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 5);
          c6_E = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 4);
          c6_D = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 3);
          c6_C = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 2);
          c6_B = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 1);
          c6_A = (real_T (*)[13])ssGetInputPortSignal(chartInstance->S, 0);
          _SFD_SET_DATA_VALUE_PTR(0U, *c6_A);
          _SFD_SET_DATA_VALUE_PTR(1U, *c6_B);
          _SFD_SET_DATA_VALUE_PTR(2U, *c6_C);
          _SFD_SET_DATA_VALUE_PTR(3U, *c6_D);
          _SFD_SET_DATA_VALUE_PTR(4U, *c6_E);
          _SFD_SET_DATA_VALUE_PTR(5U, *c6_beta);
          _SFD_SET_DATA_VALUE_PTR(6U, *c6_delta);
          _SFD_SET_DATA_VALUE_PTR(7U, c6_w1);
          _SFD_SET_DATA_VALUE_PTR(8U, c6_w2);
          _SFD_SET_DATA_VALUE_PTR(9U, c6_w3);
          _SFD_SET_DATA_VALUE_PTR(10U, c6_Tw);
          _SFD_SET_DATA_VALUE_PTR(11U, *c6_Tt);
          _SFD_SET_DATA_VALUE_PTR(12U, c6_Td);
          _SFD_SET_DATA_VALUE_PTR(13U, *c6_TS);
          _SFD_SET_DATA_VALUE_PTR(14U, c6_TTS);
          _SFD_SET_DATA_VALUE_PTR(15U, *c6_OPv);
          _SFD_SET_DATA_VALUE_PTR(16U, *c6_OPm);
          _SFD_SET_DATA_VALUE_PTR(17U, *c6_u);
          _SFD_SET_DATA_VALUE_PTR(18U, *c6_v);
          _SFD_SET_DATA_VALUE_PTR(19U, c6_vv);
          _SFD_SET_DATA_VALUE_PTR(20U, *c6_vzp);
          _SFD_SET_DATA_VALUE_PTR(21U, *c6_htc1);
          _SFD_SET_DATA_VALUE_PTR(22U, c6_v1);
          _SFD_SET_DATA_VALUE_PTR(23U, *c6_htc);
          _SFD_SET_DATA_VALUE_PTR(24U, c6_minHtc);
          _SFD_SET_DATA_VALUE_PTR(25U, c6_maxHtc);
          _SFD_SET_DATA_VALUE_PTR(26U, *c6_V1);
          _SFD_SET_DATA_VALUE_PTR(27U, *c6_V2);
          _SFD_SET_DATA_VALUE_PTR(28U, *c6_V3);
          _SFD_SET_DATA_VALUE_PTR(29U, *c6_zpozdeni);
        }
      }
    } else {
      sf_debug_reset_current_state_configuration(_entalMachineNumber_,
        chartInstance->chartNumber,chartInstance->instanceNumber);
    }
  }
}

static void sf_opaque_initialize_c6_ental(void *chartInstanceVar)
{
  chart_debug_initialization(((SFc6_entalInstanceStruct*) chartInstanceVar)->S,0);
  initialize_params_c6_ental((SFc6_entalInstanceStruct*) chartInstanceVar);
  initialize_c6_ental((SFc6_entalInstanceStruct*) chartInstanceVar);
}

static void sf_opaque_enable_c6_ental(void *chartInstanceVar)
{
  enable_c6_ental((SFc6_entalInstanceStruct*) chartInstanceVar);
}

static void sf_opaque_disable_c6_ental(void *chartInstanceVar)
{
  disable_c6_ental((SFc6_entalInstanceStruct*) chartInstanceVar);
}

static void sf_opaque_gateway_c6_ental(void *chartInstanceVar)
{
  sf_c6_ental((SFc6_entalInstanceStruct*) chartInstanceVar);
}

static mxArray* sf_internal_get_sim_state_c6_ental(SimStruct* S)
{
  ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S);
  mxArray *plhs[1] = { NULL };

  mxArray *prhs[4];
  int mxError = 0;
  prhs[0] = mxCreateString("chart_simctx_raw2high");
  prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S));
  prhs[2] = (mxArray*) get_sim_state_c6_ental((SFc6_entalInstanceStruct*)
    chartInfo->chartInstance);         /* raw sim ctx */
  prhs[3] = sf_get_sim_state_info_c6_ental();/* state var info */
  mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate");
  mxDestroyArray(prhs[0]);
  mxDestroyArray(prhs[1]);
  mxDestroyArray(prhs[2]);
  mxDestroyArray(prhs[3]);
  if (mxError || plhs[0] == NULL) {
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n");
  }

  return plhs[0];
}

static void sf_internal_set_sim_state_c6_ental(SimStruct* S, const mxArray *st)
{
  ChartInfoStruct *chartInfo = (ChartInfoStruct*) ssGetUserData(S);
  mxArray *plhs[1] = { NULL };

  mxArray *prhs[4];
  int mxError = 0;
  prhs[0] = mxCreateString("chart_simctx_high2raw");
  prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S));
  prhs[2] = mxDuplicateArray(st);      /* high level simctx */
  prhs[3] = (mxArray*) sf_get_sim_state_info_c6_ental();/* state var info */
  mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate");
  mxDestroyArray(prhs[0]);
  mxDestroyArray(prhs[1]);
  mxDestroyArray(prhs[2]);
  mxDestroyArray(prhs[3]);
  if (mxError || plhs[0] == NULL) {
    sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n");
  }

  set_sim_state_c6_ental((SFc6_entalInstanceStruct*)chartInfo->chartInstance,
    mxDuplicateArray(plhs[0]));
  mxDestroyArray(plhs[0]);
}

static mxArray* sf_opaque_get_sim_state_c6_ental(SimStruct* S)
{
  return sf_internal_get_sim_state_c6_ental(S);
}

static void sf_opaque_set_sim_state_c6_ental(SimStruct* S, const mxArray *st)
{
  sf_internal_set_sim_state_c6_ental(S, st);
}

static void sf_opaque_terminate_c6_ental(void *chartInstanceVar)
{
  if (chartInstanceVar!=NULL) {
    SimStruct *S = ((SFc6_entalInstanceStruct*) chartInstanceVar)->S;
    if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
      sf_clear_rtw_identifier(S);
    }

    finalize_c6_ental((SFc6_entalInstanceStruct*) chartInstanceVar);
    free((void *)chartInstanceVar);
    ssSetUserData(S,NULL);
  }
}

static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar)
{
  compInitSubchartSimstructsFcn_c6_ental((SFc6_entalInstanceStruct*)
    chartInstanceVar);
}

extern unsigned int sf_machine_global_initializer_called(void);
static void mdlProcessParameters_c6_ental(SimStruct *S)
{
  int i;
  for (i=0;i<ssGetNumRunTimeParams(S);i++) {
    if (ssGetSFcnParamTunable(S,i)) {
      ssUpdateDlgParamAsRunTimeParam(S,i);
    }
  }

  if (sf_machine_global_initializer_called()) {
    initialize_params_c6_ental((SFc6_entalInstanceStruct*)(((ChartInfoStruct *)
      ssGetUserData(S))->chartInstance));
  }
}

static void mdlSetWorkWidths_c6_ental(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
    int_T chartIsInlinable =
      (int_T)sf_is_chart_inlinable(S,"ental","ental",6);
    ssSetStateflowIsInlinable(S,chartIsInlinable);
    ssSetRTWCG(S,sf_rtw_info_uint_prop(S,"ental","ental",6,"RTWCG"));
    ssSetEnableFcnIsTrivial(S,1);
    ssSetDisableFcnIsTrivial(S,1);
    ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop(S,"ental","ental",6,
      "gatewayCannotBeInlinedMultipleTimes"));
    if (chartIsInlinable) {
      ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 2, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 3, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 4, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 5, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 6, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 7, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 8, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 9, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 10, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 11, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 12, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 13, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 14, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 15, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 16, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 17, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 18, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 19, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 20, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 21, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 22, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 23, SS_REUSABLE_AND_LOCAL);
      ssSetInputPortOptimOpts(S, 24, SS_REUSABLE_AND_LOCAL);
      sf_mark_chart_expressionable_inputs(S,"ental","ental",6,25);
      sf_mark_chart_reusable_outputs(S,"ental","ental",6,5);
    }

    sf_set_rtw_dwork_info(S,"ental","ental",6);
    ssSetHasSubFunctions(S,!(chartIsInlinable));
  } else {
  }

  ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
  ssSetChecksum0(S,(2576374976U));
  ssSetChecksum1(S,(49994773U));
  ssSetChecksum2(S,(1381608641U));
  ssSetChecksum3(S,(3133666350U));
  ssSetmdlDerivatives(S, NULL);
  ssSetExplicitFCSSCtrl(S,1);
}

static void mdlRTW_c6_ental(SimStruct *S)
{
  if (sim_mode_is_rtw_gen(S)) {
    sf_write_symbol_mapping(S, "ental", "ental",6);
    ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
  }
}

static void mdlStart_c6_ental(SimStruct *S)
{
  SFc6_entalInstanceStruct *chartInstance;
  chartInstance = (SFc6_entalInstanceStruct *)malloc(sizeof
    (SFc6_entalInstanceStruct));
  memset(chartInstance, 0, sizeof(SFc6_entalInstanceStruct));
  if (chartInstance==NULL) {
    sf_mex_error_message("Could not allocate memory for chart instance.");
  }

  chartInstance->chartInfo.chartInstance = chartInstance;
  chartInstance->chartInfo.isEMLChart = 1;
  chartInstance->chartInfo.chartInitialized = 0;
  chartInstance->chartInfo.sFunctionGateway = sf_opaque_gateway_c6_ental;
  chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c6_ental;
  chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c6_ental;
  chartInstance->chartInfo.enableChart = sf_opaque_enable_c6_ental;
  chartInstance->chartInfo.disableChart = sf_opaque_disable_c6_ental;
  chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c6_ental;
  chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c6_ental;
  chartInstance->chartInfo.getSimStateInfo = sf_get_sim_state_info_c6_ental;
  chartInstance->chartInfo.zeroCrossings = NULL;
  chartInstance->chartInfo.outputs = NULL;
  chartInstance->chartInfo.derivatives = NULL;
  chartInstance->chartInfo.mdlRTW = mdlRTW_c6_ental;
  chartInstance->chartInfo.mdlStart = mdlStart_c6_ental;
  chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c6_ental;
  chartInstance->chartInfo.extModeExec = NULL;
  chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL;
  chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
  chartInstance->chartInfo.storeCurrentConfiguration = NULL;
  chartInstance->S = S;
  ssSetUserData(S,(void *)(&(chartInstance->chartInfo)));/* register the chart instance with simstruct */
  init_dsm_address_info(chartInstance);
  if (!sim_mode_is_rtw_gen(S)) {
  }

  sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance);
  chart_debug_initialization(S,1);
}

void c6_ental_method_dispatcher(SimStruct *S, int_T method, void *data)
{
  switch (method) {
   case SS_CALL_MDL_START:
    mdlStart_c6_ental(S);
    break;

   case SS_CALL_MDL_SET_WORK_WIDTHS:
    mdlSetWorkWidths_c6_ental(S);
    break;

   case SS_CALL_MDL_PROCESS_PARAMETERS:
    mdlProcessParameters_c6_ental(S);
    break;

   default:
    /* Unhandled method */
    sf_mex_error_message("Stateflow Internal Error:\n"
                         "Error calling c6_ental_method_dispatcher.\n"
                         "Can't handle method %d.\n", method);
    break;
  }
}
