/* Include files */

#include "blascompat32.h"
#include "ental_sfun.h"
#include "c3_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 *c3_debug_family_names[33] = { "M", "N", "L", "dx", "D", "dz",
  "ry", "dx2", "k", "lam", "htc_nat", "htc_r", "DX", "QX", "DZ", "QZ", "j", "i",
  "tt", "q0", "nargin", "nargout", "u", "lambda", "matV", "matM", "V", "qqV",
  "qqM", "Tw", "Tinf", "TS", "uu" };

/* Function Declarations */
static void initialize_c3_ental(SFc3_entalInstanceStruct *chartInstance);
static void initialize_params_c3_ental(SFc3_entalInstanceStruct *chartInstance);
static void enable_c3_ental(SFc3_entalInstanceStruct *chartInstance);
static void disable_c3_ental(SFc3_entalInstanceStruct *chartInstance);
static void c3_update_debugger_state_c3_ental(SFc3_entalInstanceStruct
  *chartInstance);
static const mxArray *get_sim_state_c3_ental(SFc3_entalInstanceStruct
  *chartInstance);
static void set_sim_state_c3_ental(SFc3_entalInstanceStruct *chartInstance,
  const mxArray *c3_st);
static void finalize_c3_ental(SFc3_entalInstanceStruct *chartInstance);
static void sf_c3_ental(SFc3_entalInstanceStruct *chartInstance);
static void c3_c3_ental(SFc3_entalInstanceStruct *chartInstance);
static void compInitSubchartSimstructsFcn_c3_ental(SFc3_entalInstanceStruct
  *chartInstance);
static void init_script_number_translation(uint32_T c3_machineNumber, uint32_T
  c3_chartNumber);
static real_T c3_mpower(SFc3_entalInstanceStruct *chartInstance, real_T c3_a);
static real_T c3_power(SFc3_entalInstanceStruct *chartInstance, real_T c3_a,
  real_T c3_b);
static void c3_eml_error(SFc3_entalInstanceStruct *chartInstance);
static real_T c3_round(SFc3_entalInstanceStruct *chartInstance, real_T c3_x);
static real_T c3_b_mpower(SFc3_entalInstanceStruct *chartInstance, real_T c3_a);
static real_T c3_c_mpower(SFc3_entalInstanceStruct *chartInstance, real_T c3_a);
static const mxArray *c3_sf_marshall(void *chartInstanceVoid, void *c3_u);
static const mxArray *c3_b_sf_marshall(void *chartInstanceVoid, void *c3_u);
static const mxArray *c3_c_sf_marshall(void *chartInstanceVoid, void *c3_u);
static const mxArray *c3_d_sf_marshall(void *chartInstanceVoid, void *c3_u);
static const mxArray *c3_e_sf_marshall(void *chartInstanceVoid, void *c3_u);
static const mxArray *c3_f_sf_marshall(void *chartInstanceVoid, void *c3_u);
static void c3_info_helper(c3_ResolvedFunctionInfo c3_info[35]);
static const mxArray *c3_g_sf_marshall(void *chartInstanceVoid, void *c3_u);
static void c3_emlrt_marshallIn(SFc3_entalInstanceStruct *chartInstance, const
  mxArray *c3_uu, const char_T *c3_name, real_T c3_y[7185]);
static uint8_T c3_b_emlrt_marshallIn(SFc3_entalInstanceStruct *chartInstance,
  const mxArray *c3_b_is_active_c3_ental, const char_T *c3_name);
static void init_dsm_address_info(SFc3_entalInstanceStruct *chartInstance);

/* Function Definitions */
static void initialize_c3_ental(SFc3_entalInstanceStruct *chartInstance)
{
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  chartInstance->c3_is_active_c3_ental = 0U;
}

static void initialize_params_c3_ental(SFc3_entalInstanceStruct *chartInstance)
{
}

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

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

static void c3_update_debugger_state_c3_ental(SFc3_entalInstanceStruct
  *chartInstance)
{
}

static const mxArray *get_sim_state_c3_ental(SFc3_entalInstanceStruct
  *chartInstance)
{
  const mxArray *c3_st = NULL;
  const mxArray *c3_y = NULL;
  int32_T c3_i0;
  real_T c3_hoistedGlobal[7185];
  int32_T c3_i1;
  real_T c3_u[7185];
  const mxArray *c3_b_y = NULL;
  uint8_T c3_b_hoistedGlobal;
  uint8_T c3_b_u;
  const mxArray *c3_c_y = NULL;
  real_T (*c3_uu)[7185];
  c3_uu = (real_T (*)[7185])ssGetOutputPortSignal(chartInstance->S, 1);
  c3_st = NULL;
  c3_y = NULL;
  sf_mex_assign(&c3_y, sf_mex_createcellarray(2));
  for (c3_i0 = 0; c3_i0 < 7185; c3_i0 = c3_i0 + 1) {
    c3_hoistedGlobal[c3_i0] = (*c3_uu)[c3_i0];
  }

  for (c3_i1 = 0; c3_i1 < 7185; c3_i1 = c3_i1 + 1) {
    c3_u[c3_i1] = c3_hoistedGlobal[c3_i1];
  }

  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", c3_u, 0, 0U, 1U, 0U, 2, 15, 479));
  sf_mex_setcell(c3_y, 0, c3_b_y);
  c3_b_hoistedGlobal = chartInstance->c3_is_active_c3_ental;
  c3_b_u = c3_b_hoistedGlobal;
  c3_c_y = NULL;
  sf_mex_assign(&c3_c_y, sf_mex_create("y", &c3_b_u, 3, 0U, 0U, 0U, 0));
  sf_mex_setcell(c3_y, 1, c3_c_y);
  sf_mex_assign(&c3_st, c3_y);
  return c3_st;
}

static void set_sim_state_c3_ental(SFc3_entalInstanceStruct *chartInstance,
  const mxArray *c3_st)
{
  const mxArray *c3_u;
  real_T c3_dv0[7185];
  int32_T c3_i2;
  real_T (*c3_uu)[7185];
  c3_uu = (real_T (*)[7185])ssGetOutputPortSignal(chartInstance->S, 1);
  chartInstance->c3_doneDoubleBufferReInit = TRUE;
  c3_u = sf_mex_dup(c3_st);
  c3_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c3_u, 0)), "uu",
                      c3_dv0);
  for (c3_i2 = 0; c3_i2 < 7185; c3_i2 = c3_i2 + 1) {
    (*c3_uu)[c3_i2] = c3_dv0[c3_i2];
  }

  chartInstance->c3_is_active_c3_ental = c3_b_emlrt_marshallIn(chartInstance,
    sf_mex_dup(sf_mex_getcell(c3_u, 1)),
    "is_active_c3_ental");
  sf_mex_destroy(&c3_u);
  c3_update_debugger_state_c3_ental(chartInstance);
  sf_mex_destroy(&c3_st);
}

static void finalize_c3_ental(SFc3_entalInstanceStruct *chartInstance)
{
}

static void sf_c3_ental(SFc3_entalInstanceStruct *chartInstance)
{
  int32_T c3_i3;
  int32_T c3_i4;
  int32_T c3_i5;
  int32_T c3_i6;
  int32_T c3_i7;
  int32_T c3_i8;
  int32_T c3_i9;
  int32_T c3_previousEvent;
  real_T *c3_V;
  real_T *c3_Tw;
  real_T *c3_Tinf;
  real_T *c3_TS;
  real_T (*c3_qqM)[479];
  real_T (*c3_qqV)[479];
  real_T (*c3_matM)[2874];
  real_T (*c3_matV)[2874];
  real_T (*c3_lambda)[1600];
  real_T (*c3_uu)[7185];
  real_T (*c3_u)[7185];
  c3_TS = (real_T *)ssGetInputPortSignal(chartInstance->S, 9);
  c3_Tinf = (real_T *)ssGetInputPortSignal(chartInstance->S, 8);
  c3_Tw = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
  c3_qqM = (real_T (*)[479])ssGetInputPortSignal(chartInstance->S, 6);
  c3_qqV = (real_T (*)[479])ssGetInputPortSignal(chartInstance->S, 5);
  c3_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 4);
  c3_matM = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 3);
  c3_matV = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 2);
  c3_lambda = (real_T (*)[1600])ssGetInputPortSignal(chartInstance->S, 1);
  c3_uu = (real_T (*)[7185])ssGetOutputPortSignal(chartInstance->S, 1);
  c3_u = (real_T (*)[7185])ssGetInputPortSignal(chartInstance->S, 0);
  _sfTime_ = (real_T)ssGetT(chartInstance->S);
  _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 2);
  for (c3_i3 = 0; c3_i3 < 7185; c3_i3 = c3_i3 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_u)[c3_i3], 0U);
  }

  for (c3_i4 = 0; c3_i4 < 7185; c3_i4 = c3_i4 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_uu)[c3_i4], 1U);
  }

  for (c3_i5 = 0; c3_i5 < 1600; c3_i5 = c3_i5 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_lambda)[c3_i5], 2U);
  }

  for (c3_i6 = 0; c3_i6 < 2874; c3_i6 = c3_i6 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_matV)[c3_i6], 3U);
  }

  for (c3_i7 = 0; c3_i7 < 2874; c3_i7 = c3_i7 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_matM)[c3_i7], 4U);
  }

  _SFD_DATA_RANGE_CHECK(*c3_V, 5U);
  for (c3_i8 = 0; c3_i8 < 479; c3_i8 = c3_i8 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_qqV)[c3_i8], 6U);
  }

  for (c3_i9 = 0; c3_i9 < 479; c3_i9 = c3_i9 + 1) {
    _SFD_DATA_RANGE_CHECK((*c3_qqM)[c3_i9], 7U);
  }

  _SFD_DATA_RANGE_CHECK(*c3_Tw, 8U);
  _SFD_DATA_RANGE_CHECK(*c3_Tinf, 9U);
  _SFD_DATA_RANGE_CHECK(*c3_TS, 10U);
  c3_previousEvent = _sfEvent_;
  _sfEvent_ = CALL_EVENT;
  c3_c3_ental(chartInstance);
  _sfEvent_ = c3_previousEvent;
  sf_debug_check_for_state_inconsistency(_entalMachineNumber_,
    chartInstance->chartNumber, chartInstance->instanceNumber);
}

static void c3_c3_ental(SFc3_entalInstanceStruct *chartInstance)
{
  int32_T c3_i10;
  static real_T c3_hoistedGlobal[7185];
  int32_T c3_i11;
  real_T c3_b_hoistedGlobal[1600];
  int32_T c3_i12;
  real_T c3_c_hoistedGlobal[2874];
  int32_T c3_i13;
  real_T c3_d_hoistedGlobal[2874];
  real_T c3_e_hoistedGlobal;
  int32_T c3_i14;
  real_T c3_f_hoistedGlobal[479];
  int32_T c3_i15;
  real_T c3_g_hoistedGlobal[479];
  real_T c3_h_hoistedGlobal;
  real_T c3_i_hoistedGlobal;
  real_T c3_j_hoistedGlobal;
  int32_T c3_i16;
  static real_T c3_u[7185];
  int32_T c3_i17;
  real_T c3_lambda[1600];
  int32_T c3_i18;
  real_T c3_matV[2874];
  int32_T c3_i19;
  real_T c3_matM[2874];
  real_T c3_V;
  int32_T c3_i20;
  real_T c3_qqV[479];
  int32_T c3_i21;
  real_T c3_qqM[479];
  real_T c3_Tw;
  real_T c3_Tinf;
  real_T c3_TS;
  uint32_T c3_debug_family_var_map[33];
  static const char *c3_sv0[33] = { "M", "N", "L", "dx", "D", "dz", "ry", "dx2",
    "k", "lam", "htc_nat", "htc_r", "DX", "QX", "DZ",
    "QZ", "j", "i", "tt", "q0", "nargin", "nargout", "u", "lambda", "matV",
    "matM", "V", "qqV", "qqM"
    , "Tw", "Tinf", "TS", "uu" };

  real_T c3_M;
  real_T c3_N;
  real_T c3_L;
  real_T c3_dx;
  real_T c3_D;
  real_T c3_dz[478];
  real_T c3_ry[478];
  real_T c3_dx2;
  real_T c3_k;
  real_T c3_lam;
  real_T c3_htc_nat;
  real_T c3_htc_r;
  real_T c3_DX;
  real_T c3_QX;
  real_T c3_DZ;
  real_T c3_QZ;
  real_T c3_j;
  real_T c3_i;
  real_T c3_tt;
  real_T c3_q0;
  real_T c3_b_htc_r[479];
  real_T c3_b_htc_nat[479];
  real_T c3_nargin = 10.0;
  real_T c3_nargout = 1.0;
  static real_T c3_uu[7185];
  int32_T c3_i22;
  int32_T c3_i23;
  real_T c3_b_k;
  real_T c3_B;
  real_T c3_y;
  real_T c3_b_y;
  real_T c3_c_y;
  real_T c3_d_y;
  int32_T c3_i24;
  real_T c3_A[478];
  int32_T c3_i25;
  real_T c3_x[478];
  int32_T c3_i26;
  real_T c3_b_x[478];
  int32_T c3_i27;
  real_T c3_c_x[478];
  int32_T c3_i28;
  int32_T c3_i29;
  real_T c3_b;
  real_T c3_b_b;
  real_T c3_e_y;
  real_T c3_c_b;
  real_T c3_f_y;
  real_T c3_a;
  real_T c3_g_y;
  real_T c3_b_a;
  real_T c3_h_y;
  real_T c3_c_a;
  real_T c3_d_b;
  real_T c3_i_y;
  real_T c3_d_a;
  real_T c3_e_b;
  real_T c3_f_b;
  real_T c3_j_y;
  real_T c3_e_a;
  real_T c3_k_y;
  real_T c3_f_a;
  real_T c3_g_b;
  real_T c3_l_y;
  real_T c3_b_A;
  real_T c3_b_B;
  real_T c3_d_x;
  real_T c3_m_y;
  real_T c3_e_x;
  real_T c3_n_y;
  real_T c3_f_x;
  real_T c3_o_y;
  real_T c3_p_y;
  real_T c3_h_b;
  real_T c3_q_y;
  real_T c3_g_a;
  real_T c3_i_b;
  real_T c3_r_y;
  real_T c3_c_A;
  real_T c3_g_x;
  real_T c3_h_x;
  real_T c3_i_x;
  real_T c3_d_A;
  real_T c3_c_B;
  real_T c3_j_x;
  real_T c3_s_y;
  real_T c3_k_x;
  real_T c3_t_y;
  real_T c3_l_x;
  real_T c3_u_y;
  real_T c3_v_y;
  real_T c3_e_A;
  real_T c3_d_B;
  real_T c3_m_x;
  real_T c3_w_y;
  real_T c3_n_x;
  real_T c3_x_y;
  real_T c3_o_x;
  real_T c3_y_y;
  real_T c3_ab_y;
  real_T c3_h_a;
  real_T c3_j_b;
  real_T c3_bb_y;
  real_T c3_i_a;
  real_T c3_k_b;
  real_T c3_f_A;
  real_T c3_e_B;
  real_T c3_p_x;
  real_T c3_cb_y;
  real_T c3_q_x;
  real_T c3_db_y;
  real_T c3_r_x;
  real_T c3_eb_y;
  real_T c3_fb_y;
  real_T c3_g_A;
  real_T c3_f_B;
  real_T c3_s_x;
  real_T c3_gb_y;
  real_T c3_t_x;
  real_T c3_hb_y;
  real_T c3_u_x;
  real_T c3_ib_y;
  real_T c3_jb_y;
  real_T c3_j_a;
  real_T c3_l_b;
  real_T c3_kb_y;
  real_T c3_k_a;
  real_T c3_m_b;
  real_T c3_n_b;
  real_T c3_o_b;
  real_T c3_lb_y;
  real_T c3_p_b;
  real_T c3_mb_y;
  real_T c3_l_a;
  real_T c3_nb_y;
  real_T c3_m_a;
  real_T c3_ob_y;
  real_T c3_n_a;
  real_T c3_q_b;
  real_T c3_pb_y;
  real_T c3_o_a;
  real_T c3_r_b;
  real_T c3_s_b;
  real_T c3_qb_y;
  real_T c3_p_a;
  real_T c3_rb_y;
  real_T c3_q_a;
  real_T c3_t_b;
  real_T c3_sb_y;
  real_T c3_h_A;
  real_T c3_g_B;
  real_T c3_v_x;
  real_T c3_tb_y;
  real_T c3_w_x;
  real_T c3_ub_y;
  real_T c3_x_x;
  real_T c3_vb_y;
  real_T c3_wb_y;
  real_T c3_u_b;
  real_T c3_xb_y;
  real_T c3_r_a;
  real_T c3_v_b;
  real_T c3_yb_y;
  real_T c3_i_A;
  real_T c3_y_x;
  real_T c3_ab_x;
  real_T c3_bb_x;
  real_T c3_j_A;
  real_T c3_h_B;
  real_T c3_cb_x;
  real_T c3_ac_y;
  real_T c3_db_x;
  real_T c3_bc_y;
  real_T c3_eb_x;
  real_T c3_cc_y;
  real_T c3_dc_y;
  real_T c3_k_A;
  real_T c3_i_B;
  real_T c3_fb_x;
  real_T c3_ec_y;
  real_T c3_gb_x;
  real_T c3_fc_y;
  real_T c3_hb_x;
  real_T c3_gc_y;
  real_T c3_hc_y;
  real_T c3_s_a;
  real_T c3_w_b;
  real_T c3_ic_y;
  real_T c3_t_a;
  real_T c3_x_b;
  real_T c3_l_A;
  real_T c3_j_B;
  real_T c3_ib_x;
  real_T c3_jc_y;
  real_T c3_jb_x;
  real_T c3_kc_y;
  real_T c3_kb_x;
  real_T c3_lc_y;
  real_T c3_mc_y;
  real_T c3_m_A;
  real_T c3_k_B;
  real_T c3_lb_x;
  real_T c3_nc_y;
  real_T c3_mb_x;
  real_T c3_oc_y;
  real_T c3_nb_x;
  real_T c3_pc_y;
  real_T c3_qc_y;
  real_T c3_u_a;
  real_T c3_y_b;
  real_T c3_rc_y;
  real_T c3_v_a;
  real_T c3_ab_b;
  int32_T c3_i30;
  int32_T c3_i31;
  real_T c3_b_j;
  real_T c3_b_i;
  real_T c3_bb_b;
  real_T c3_sc_y;
  real_T c3_w_a;
  real_T c3_cb_b;
  real_T c3_tc_y;
  real_T c3_n_A;
  real_T c3_ob_x;
  real_T c3_pb_x;
  real_T c3_qb_x;
  real_T c3_o_A;
  real_T c3_l_B;
  real_T c3_rb_x;
  real_T c3_uc_y;
  real_T c3_sb_x;
  real_T c3_vc_y;
  real_T c3_tb_x;
  real_T c3_wc_y;
  real_T c3_xc_y;
  real_T c3_p_A;
  real_T c3_m_B;
  real_T c3_ub_x;
  real_T c3_yc_y;
  real_T c3_vb_x;
  real_T c3_ad_y;
  real_T c3_wb_x;
  real_T c3_bd_y;
  real_T c3_cd_y;
  real_T c3_x_a;
  real_T c3_db_b;
  real_T c3_dd_y;
  real_T c3_y_a;
  real_T c3_eb_b;
  real_T c3_fb_b;
  real_T c3_ed_y;
  real_T c3_ab_a;
  real_T c3_gb_b;
  real_T c3_fd_y;
  real_T c3_q_A;
  real_T c3_xb_x;
  real_T c3_yb_x;
  real_T c3_ac_x;
  real_T c3_r_A;
  real_T c3_n_B;
  real_T c3_bc_x;
  real_T c3_gd_y;
  real_T c3_cc_x;
  real_T c3_hd_y;
  real_T c3_dc_x;
  real_T c3_id_y;
  real_T c3_jd_y;
  real_T c3_s_A;
  real_T c3_o_B;
  real_T c3_ec_x;
  real_T c3_kd_y;
  real_T c3_fc_x;
  real_T c3_ld_y;
  real_T c3_gc_x;
  real_T c3_md_y;
  real_T c3_nd_y;
  real_T c3_bb_a;
  real_T c3_hb_b;
  real_T c3_od_y;
  real_T c3_cb_a;
  real_T c3_ib_b;
  real_T c3_jb_b;
  real_T c3_pd_y;
  real_T c3_db_a;
  real_T c3_kb_b;
  real_T c3_qd_y;
  real_T c3_t_A;
  real_T c3_hc_x;
  real_T c3_ic_x;
  real_T c3_jc_x;
  real_T c3_u_A;
  real_T c3_p_B;
  real_T c3_kc_x;
  real_T c3_rd_y;
  real_T c3_lc_x;
  real_T c3_sd_y;
  real_T c3_mc_x;
  real_T c3_td_y;
  real_T c3_ud_y;
  real_T c3_v_A;
  real_T c3_q_B;
  real_T c3_nc_x;
  real_T c3_vd_y;
  real_T c3_oc_x;
  real_T c3_wd_y;
  real_T c3_pc_x;
  real_T c3_xd_y;
  real_T c3_yd_y;
  real_T c3_eb_a;
  real_T c3_lb_b;
  real_T c3_ae_y;
  real_T c3_fb_a;
  real_T c3_mb_b;
  real_T c3_r_B;
  real_T c3_be_y;
  real_T c3_ce_y;
  real_T c3_de_y;
  real_T c3_nb_b;
  real_T c3_ee_y;
  real_T c3_gb_a;
  real_T c3_ob_b;
  real_T c3_fe_y;
  real_T c3_pb_b;
  real_T c3_ge_y;
  real_T c3_w_A;
  real_T c3_s_B;
  real_T c3_qc_x;
  real_T c3_he_y;
  real_T c3_rc_x;
  real_T c3_ie_y;
  real_T c3_sc_x;
  real_T c3_je_y;
  real_T c3_ke_y;
  real_T c3_hb_a;
  real_T c3_le_y;
  real_T c3_qb_b;
  real_T c3_me_y;
  real_T c3_rb_b;
  real_T c3_ne_y;
  real_T c3_x_A;
  real_T c3_t_B;
  real_T c3_tc_x;
  real_T c3_oe_y;
  real_T c3_uc_x;
  real_T c3_pe_y;
  real_T c3_vc_x;
  real_T c3_qe_y;
  real_T c3_re_y;
  real_T c3_ib_a;
  real_T c3_se_y;
  real_T c3_sb_b;
  real_T c3_te_y;
  real_T c3_tb_b;
  real_T c3_ue_y;
  real_T c3_jb_a;
  real_T c3_ve_y;
  real_T c3_kb_a;
  real_T c3_we_y;
  real_T c3_lb_a;
  real_T c3_ub_b;
  real_T c3_xe_y;
  real_T c3_mb_a;
  real_T c3_vb_b;
  real_T c3_ye_y;
  real_T c3_wb_b;
  real_T c3_af_y;
  real_T c3_xb_b;
  real_T c3_bf_y;
  real_T c3_nb_a;
  real_T c3_cf_y;
  real_T c3_ob_a;
  real_T c3_yb_b;
  real_T c3_df_y;
  real_T c3_y_A;
  real_T c3_u_B;
  real_T c3_wc_x;
  real_T c3_ef_y;
  real_T c3_xc_x;
  real_T c3_ff_y;
  real_T c3_yc_x;
  real_T c3_gf_y;
  real_T c3_hf_y;
  real_T c3_ac_b;
  real_T c3_if_y;
  real_T c3_bc_b;
  real_T c3_jf_y;
  real_T c3_cc_b;
  real_T c3_kf_y;
  real_T c3_pb_a;
  real_T c3_lf_y;
  real_T c3_qb_a;
  real_T c3_mf_y;
  real_T c3_rb_a;
  real_T c3_dc_b;
  real_T c3_nf_y;
  real_T c3_sb_a;
  real_T c3_ec_b;
  real_T c3_of_y;
  real_T c3_fc_b;
  real_T c3_pf_y;
  real_T c3_gc_b;
  real_T c3_qf_y;
  real_T c3_tb_a;
  real_T c3_rf_y;
  real_T c3_ub_a;
  real_T c3_hc_b;
  real_T c3_sf_y;
  real_T c3_ab_A;
  real_T c3_v_B;
  real_T c3_ad_x;
  real_T c3_tf_y;
  real_T c3_bd_x;
  real_T c3_uf_y;
  real_T c3_cd_x;
  real_T c3_vf_y;
  real_T c3_wf_y;
  real_T c3_vb_a;
  real_T c3_ic_b;
  real_T c3_xf_y;
  real_T c3_bb_A;
  real_T c3_dd_x;
  real_T c3_ed_x;
  real_T c3_fd_x;
  real_T c3_cb_A;
  real_T c3_w_B;
  real_T c3_gd_x;
  real_T c3_yf_y;
  real_T c3_hd_x;
  real_T c3_ag_y;
  real_T c3_id_x;
  real_T c3_bg_y;
  real_T c3_cg_y;
  real_T c3_db_A;
  real_T c3_x_B;
  real_T c3_jd_x;
  real_T c3_dg_y;
  real_T c3_kd_x;
  real_T c3_eg_y;
  real_T c3_ld_x;
  real_T c3_fg_y;
  real_T c3_gg_y;
  real_T c3_wb_a;
  real_T c3_jc_b;
  real_T c3_hg_y;
  real_T c3_xb_a;
  real_T c3_kc_b;
  real_T c3_lc_b;
  real_T c3_ig_y;
  real_T c3_yb_a;
  real_T c3_mc_b;
  real_T c3_jg_y;
  real_T c3_nc_b;
  real_T c3_kg_y;
  real_T c3_eb_A;
  real_T c3_y_B;
  real_T c3_md_x;
  real_T c3_lg_y;
  real_T c3_nd_x;
  real_T c3_mg_y;
  real_T c3_od_x;
  real_T c3_ng_y;
  real_T c3_og_y;
  real_T c3_ac_a;
  real_T c3_pg_y;
  real_T c3_oc_b;
  real_T c3_qg_y;
  real_T c3_pc_b;
  real_T c3_rg_y;
  real_T c3_fb_A;
  real_T c3_ab_B;
  real_T c3_pd_x;
  real_T c3_sg_y;
  real_T c3_qd_x;
  real_T c3_tg_y;
  real_T c3_rd_x;
  real_T c3_ug_y;
  real_T c3_vg_y;
  real_T c3_bc_a;
  real_T c3_wg_y;
  real_T c3_qc_b;
  real_T c3_xg_y;
  real_T c3_rc_b;
  real_T c3_yg_y;
  real_T c3_cc_a;
  real_T c3_ah_y;
  real_T c3_dc_a;
  real_T c3_bh_y;
  real_T c3_ec_a;
  real_T c3_sc_b;
  real_T c3_ch_y;
  real_T c3_fc_a;
  real_T c3_tc_b;
  real_T c3_dh_y;
  real_T c3_uc_b;
  real_T c3_eh_y;
  real_T c3_vc_b;
  real_T c3_fh_y;
  real_T c3_gc_a;
  real_T c3_gh_y;
  real_T c3_hc_a;
  real_T c3_wc_b;
  real_T c3_hh_y;
  real_T c3_gb_A;
  real_T c3_bb_B;
  real_T c3_sd_x;
  real_T c3_ih_y;
  real_T c3_td_x;
  real_T c3_jh_y;
  real_T c3_ud_x;
  real_T c3_kh_y;
  real_T c3_lh_y;
  real_T c3_xc_b;
  real_T c3_mh_y;
  real_T c3_yc_b;
  real_T c3_nh_y;
  real_T c3_ad_b;
  real_T c3_oh_y;
  real_T c3_ic_a;
  real_T c3_ph_y;
  real_T c3_jc_a;
  real_T c3_qh_y;
  real_T c3_kc_a;
  real_T c3_bd_b;
  real_T c3_rh_y;
  real_T c3_lc_a;
  real_T c3_cd_b;
  real_T c3_sh_y;
  real_T c3_dd_b;
  real_T c3_th_y;
  real_T c3_ed_b;
  real_T c3_uh_y;
  real_T c3_mc_a;
  real_T c3_vh_y;
  real_T c3_nc_a;
  real_T c3_fd_b;
  real_T c3_wh_y;
  real_T c3_hb_A;
  real_T c3_cb_B;
  real_T c3_vd_x;
  real_T c3_xh_y;
  real_T c3_wd_x;
  real_T c3_yh_y;
  real_T c3_xd_x;
  real_T c3_ai_y;
  real_T c3_bi_y;
  real_T c3_oc_a;
  real_T c3_gd_b;
  real_T c3_ci_y;
  real_T c3_ib_A;
  real_T c3_yd_x;
  real_T c3_ae_x;
  real_T c3_be_x;
  real_T c3_jb_A;
  real_T c3_db_B;
  real_T c3_ce_x;
  real_T c3_di_y;
  real_T c3_de_x;
  real_T c3_ei_y;
  real_T c3_ee_x;
  real_T c3_fi_y;
  real_T c3_gi_y;
  real_T c3_kb_A;
  real_T c3_eb_B;
  real_T c3_fe_x;
  real_T c3_hi_y;
  real_T c3_ge_x;
  real_T c3_ii_y;
  real_T c3_he_x;
  real_T c3_ji_y;
  real_T c3_ki_y;
  real_T c3_pc_a;
  real_T c3_hd_b;
  real_T c3_li_y;
  real_T c3_qc_a;
  real_T c3_id_b;
  int32_T c3_i32;
  real_T *c3_b_V;
  real_T *c3_b_Tw;
  real_T *c3_b_Tinf;
  real_T *c3_b_TS;
  real_T (*c3_b_uu)[7185];
  real_T (*c3_b_qqM)[479];
  real_T (*c3_b_qqV)[479];
  real_T (*c3_b_matM)[2874];
  real_T (*c3_b_matV)[2874];
  real_T (*c3_b_lambda)[1600];
  real_T (*c3_b_u)[7185];
  c3_b_TS = (real_T *)ssGetInputPortSignal(chartInstance->S, 9);
  c3_b_Tinf = (real_T *)ssGetInputPortSignal(chartInstance->S, 8);
  c3_b_Tw = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
  c3_b_qqM = (real_T (*)[479])ssGetInputPortSignal(chartInstance->S, 6);
  c3_b_qqV = (real_T (*)[479])ssGetInputPortSignal(chartInstance->S, 5);
  c3_b_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 4);
  c3_b_matM = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 3);
  c3_b_matV = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 2);
  c3_b_lambda = (real_T (*)[1600])ssGetInputPortSignal(chartInstance->S, 1);
  c3_b_uu = (real_T (*)[7185])ssGetOutputPortSignal(chartInstance->S, 1);
  c3_b_u = (real_T (*)[7185])ssGetInputPortSignal(chartInstance->S, 0);
  _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 2);
  for (c3_i10 = 0; c3_i10 < 7185; c3_i10 = c3_i10 + 1) {
    c3_hoistedGlobal[c3_i10] = (*c3_b_u)[c3_i10];
  }

  for (c3_i11 = 0; c3_i11 < 1600; c3_i11 = c3_i11 + 1) {
    c3_b_hoistedGlobal[c3_i11] = (*c3_b_lambda)[c3_i11];
  }

  for (c3_i12 = 0; c3_i12 < 2874; c3_i12 = c3_i12 + 1) {
    c3_c_hoistedGlobal[c3_i12] = (*c3_b_matV)[c3_i12];
  }

  for (c3_i13 = 0; c3_i13 < 2874; c3_i13 = c3_i13 + 1) {
    c3_d_hoistedGlobal[c3_i13] = (*c3_b_matM)[c3_i13];
  }

  c3_e_hoistedGlobal = *c3_b_V;
  for (c3_i14 = 0; c3_i14 < 479; c3_i14 = c3_i14 + 1) {
    c3_f_hoistedGlobal[c3_i14] = (*c3_b_qqV)[c3_i14];
  }

  for (c3_i15 = 0; c3_i15 < 479; c3_i15 = c3_i15 + 1) {
    c3_g_hoistedGlobal[c3_i15] = (*c3_b_qqM)[c3_i15];
  }

  c3_h_hoistedGlobal = *c3_b_Tw;
  c3_i_hoistedGlobal = *c3_b_Tinf;
  c3_j_hoistedGlobal = *c3_b_TS;
  for (c3_i16 = 0; c3_i16 < 7185; c3_i16 = c3_i16 + 1) {
    c3_u[c3_i16] = c3_hoistedGlobal[c3_i16];
  }

  for (c3_i17 = 0; c3_i17 < 1600; c3_i17 = c3_i17 + 1) {
    c3_lambda[c3_i17] = c3_b_hoistedGlobal[c3_i17];
  }

  for (c3_i18 = 0; c3_i18 < 2874; c3_i18 = c3_i18 + 1) {
    c3_matV[c3_i18] = c3_c_hoistedGlobal[c3_i18];
  }

  for (c3_i19 = 0; c3_i19 < 2874; c3_i19 = c3_i19 + 1) {
    c3_matM[c3_i19] = c3_d_hoistedGlobal[c3_i19];
  }

  c3_V = c3_e_hoistedGlobal;
  for (c3_i20 = 0; c3_i20 < 479; c3_i20 = c3_i20 + 1) {
    c3_qqV[c3_i20] = c3_f_hoistedGlobal[c3_i20];
  }

  for (c3_i21 = 0; c3_i21 < 479; c3_i21 = c3_i21 + 1) {
    c3_qqM[c3_i21] = c3_g_hoistedGlobal[c3_i21];
  }

  c3_Tw = c3_h_hoistedGlobal;
  c3_Tinf = c3_i_hoistedGlobal;
  c3_TS = c3_j_hoistedGlobal;
  sf_debug_symbol_scope_push_eml(0U, 33U, 35U, c3_sv0, c3_debug_family_var_map);
  sf_debug_symbol_scope_add_eml(&c3_M, c3_b_sf_marshall, 0U);
  sf_debug_symbol_scope_add_eml(&c3_N, c3_b_sf_marshall, 1U);
  sf_debug_symbol_scope_add_eml(&c3_L, c3_b_sf_marshall, 2U);
  sf_debug_symbol_scope_add_eml(&c3_dx, c3_b_sf_marshall, 3U);
  sf_debug_symbol_scope_add_eml(&c3_D, c3_b_sf_marshall, 4U);
  sf_debug_symbol_scope_add_eml(c3_dz, c3_f_sf_marshall, 5U);
  sf_debug_symbol_scope_add_eml(c3_ry, c3_f_sf_marshall, 6U);
  sf_debug_symbol_scope_add_eml(&c3_dx2, c3_b_sf_marshall, 7U);
  sf_debug_symbol_scope_add_eml(&c3_k, c3_b_sf_marshall, 8U);
  sf_debug_symbol_scope_add_eml(&c3_lam, c3_b_sf_marshall, 9U);
  sf_debug_symbol_scope_add_eml(&c3_htc_nat, c3_b_sf_marshall, MAX_uint32_T);
  sf_debug_symbol_scope_add_eml(&c3_htc_r, c3_b_sf_marshall, MAX_uint32_T);
  sf_debug_symbol_scope_add_eml(&c3_DX, c3_b_sf_marshall, 12U);
  sf_debug_symbol_scope_add_eml(&c3_QX, c3_b_sf_marshall, 13U);
  sf_debug_symbol_scope_add_eml(&c3_DZ, c3_b_sf_marshall, 14U);
  sf_debug_symbol_scope_add_eml(&c3_QZ, c3_b_sf_marshall, 15U);
  sf_debug_symbol_scope_add_eml(&c3_j, c3_b_sf_marshall, 16U);
  sf_debug_symbol_scope_add_eml(&c3_i, c3_b_sf_marshall, 17U);
  sf_debug_symbol_scope_add_eml(&c3_tt, c3_b_sf_marshall, 18U);
  sf_debug_symbol_scope_add_eml(&c3_q0, c3_b_sf_marshall, 19U);
  sf_debug_symbol_scope_add_eml(c3_b_htc_r, c3_c_sf_marshall, MAX_uint32_T);
  sf_debug_symbol_scope_add_eml(c3_b_htc_nat, c3_c_sf_marshall, MAX_uint32_T);
  sf_debug_symbol_scope_add_eml(&c3_nargin, c3_b_sf_marshall, 20U);
  sf_debug_symbol_scope_add_eml(&c3_nargout, c3_b_sf_marshall, 21U);
  sf_debug_symbol_scope_add_eml(c3_u, c3_sf_marshall, 22U);
  sf_debug_symbol_scope_add_eml(c3_lambda, c3_e_sf_marshall, 23U);
  sf_debug_symbol_scope_add_eml(c3_matV, c3_d_sf_marshall, 24U);
  sf_debug_symbol_scope_add_eml(c3_matM, c3_d_sf_marshall, 25U);
  sf_debug_symbol_scope_add_eml(&c3_V, c3_b_sf_marshall, 26U);
  sf_debug_symbol_scope_add_eml(c3_qqV, c3_c_sf_marshall, 27U);
  sf_debug_symbol_scope_add_eml(c3_qqM, c3_c_sf_marshall, 28U);
  sf_debug_symbol_scope_add_eml(&c3_Tw, c3_b_sf_marshall, 29U);
  sf_debug_symbol_scope_add_eml(&c3_Tinf, c3_b_sf_marshall, 30U);
  sf_debug_symbol_scope_add_eml(&c3_TS, c3_b_sf_marshall, 31U);
  sf_debug_symbol_scope_add_eml(c3_uu, c3_sf_marshall, 32U);
  CV_EML_FCN(0, 0);

  /* M=15; N=479; */
  _SFD_EML_CALL(0, 5);
  c3_M = 15.0;
  c3_N = 479.0;
  _SFD_EML_CALL(0, 6);
  c3_L = 0.25;

  /* delka v m */
  _SFD_EML_CALL(0, 7);
  c3_dx = 0.017857142857142856;
  _SFD_EML_CALL(0, 8);
  c3_D = 8.0;
  _SFD_EML_CALL(0, 9);
  for (c3_i22 = 0; c3_i22 < 478; c3_i22 = c3_i22 + 1) {
    c3_dz[c3_i22] = 0.0;
  }

  _SFD_EML_CALL(0, 9);
  for (c3_i23 = 0; c3_i23 < 478; c3_i23 = c3_i23 + 1) {
    c3_ry[c3_i23] = 0.0;
  }

  _SFD_EML_CALL(0, 10);
  c3_dx2 = 0.00031887755102040814;
  _SFD_EML_CALL(0, 12);
  c3_k = 1.0;
  _SFD_EML_CALL(0, 13);
  c3_dz[0] = c3_matV[1] - c3_matV[0];
  c3_k = 2.0;
  c3_b_k = 2.0;
  while (c3_b_k <= 478.0) {
    c3_k = c3_b_k;
    CV_EML_FOR(0, 0, 1);
    _SFD_EML_CALL(0, 15);
    c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)_SFD_INTEGER_CHECK("k",
      c3_k), 1, 478, 1, 0) - 1] = c3_matV[
      _SFD_EML_ARRAY_BOUNDS_CHECK("matV", (int32_T)_SFD_INTEGER_CHECK("k+1",
      c3_k + 1.0), 1, 479, 1, 0) - 1] - c3_matV[
      _SFD_EML_ARRAY_BOUNDS_CHECK("matV", (int32_T)_SFD_INTEGER_CHECK("k", c3_k),
      1, 479, 1, 0) - 1];
    _SFD_EML_CALL(0, 16);
    c3_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)_SFD_INTEGER_CHECK(
      "k", c3_k), 1, 478, 1, 0) - 1] + c3_dz[
      _SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)_SFD_INTEGER_CHECK("k-1", c3_k
      - 1.0), 1, 478, 1, 0) - 1];
    c3_y = c3_B;
    c3_b_y = c3_y;
    c3_c_y = c3_b_y;
    c3_d_y = 2.0 / c3_c_y;
    c3_ry[_SFD_EML_ARRAY_BOUNDS_CHECK("ry", (int32_T)_SFD_INTEGER_CHECK("k",
      c3_k), 1, 478, 1, 0) - 1] = c3_d_y;
    c3_b_k = c3_b_k + 1.0;
    sf_mex_listen_for_ctrl_c(chartInstance->S);
  }

  CV_EML_FOR(0, 0, 0);
  _SFD_EML_CALL(0, 18);
  for (c3_i24 = 0; c3_i24 < 478; c3_i24 = c3_i24 + 1) {
    c3_A[c3_i24] = c3_dz[c3_i24];
  }

  for (c3_i25 = 0; c3_i25 < 478; c3_i25 = c3_i25 + 1) {
    c3_x[c3_i25] = c3_A[c3_i25];
  }

  for (c3_i26 = 0; c3_i26 < 478; c3_i26 = c3_i26 + 1) {
    c3_b_x[c3_i26] = c3_x[c3_i26];
  }

  for (c3_i27 = 0; c3_i27 < 478; c3_i27 = c3_i27 + 1) {
    c3_c_x[c3_i27] = c3_b_x[c3_i27];
  }

  for (c3_i28 = 0; c3_i28 < 478; c3_i28 = c3_i28 + 1) {
    c3_dz[c3_i28] = c3_c_x[c3_i28] / 1000.0;
  }

  _SFD_EML_CALL(0, 19);
  for (c3_i29 = 0; c3_i29 < 7185; c3_i29 = c3_i29 + 1) {
    c3_uu[c3_i29] = 0.0;
  }

  /*  spodni okraje */
  _SFD_EML_CALL(0, 22);
  c3_lam = c3_lambda[_SFD_EML_ARRAY_BOUNDS_CHECK("lambda", (int32_T)
    _SFD_INTEGER_CHECK("round(u(1,N))", c3_round(chartInstance, c3_u[
    7170])), 1, 1600, 1, 0) - 1];
  _SFD_EML_CALL(0, 23);
  c3_b = c3_b_mpower(chartInstance, c3_u[7170] - c3_Tinf);
  c3_htc_nat = 0.84 * c3_b;
  sf_debug_symbol_switch(10U, 10U);
  _SFD_EML_CALL(0, 24);
  c3_b_b = c3_u[7170] + 273.15;
  c3_e_y = 0.0003375 * c3_b_b;
  c3_c_b = c3_mpower(chartInstance, c3_u[7170] + 273.15);
  c3_f_y = 4.017857143E-7 * c3_c_b;
  c3_a = (0.78828571429 + c3_e_y) - c3_f_y;
  c3_g_y = c3_a * 5.67051;
  c3_b_a = c3_g_y;
  c3_h_y = c3_b_a * 1.0E-8;
  c3_c_a = c3_h_y;
  c3_d_b = c3_mpower(chartInstance, c3_u[7170] + 273.15) + c3_mpower
    (chartInstance, c3_Tinf + 273.15);
  c3_i_y = c3_c_a * c3_d_b;
  c3_d_a = c3_i_y;
  c3_e_b = (c3_u[7170] + 273.15) + (c3_Tinf + 273.15);
  c3_htc_r = c3_d_a * c3_e_b;
  sf_debug_symbol_switch(11U, 11U);
  _SFD_EML_CALL(0, 25);
  c3_f_b = c3_htc_nat + c3_htc_r;
  c3_j_y = 2.0 * c3_f_b;
  c3_e_a = c3_j_y;
  c3_k_y = c3_e_a * 0.017857142857142856;
  c3_f_a = c3_k_y;
  c3_g_b = c3_Tinf - c3_u[7170];
  c3_l_y = c3_f_a * c3_g_b;
  c3_b_A = c3_l_y;
  c3_b_B = c3_lam;
  c3_d_x = c3_b_A;
  c3_m_y = c3_b_B;
  c3_e_x = c3_d_x;
  c3_n_y = c3_m_y;
  c3_f_x = c3_e_x;
  c3_o_y = c3_n_y;
  c3_p_y = c3_f_x / c3_o_y;
  c3_h_b = c3_u[7170];
  c3_q_y = 2.0 * c3_h_b;
  c3_DX = ((c3_p_y + c3_u[7171]) - c3_q_y) + c3_u[7171];
  _SFD_EML_CALL(0, 26);
  c3_g_a = c3_lam;
  c3_i_b = c3_DX;
  c3_r_y = c3_g_a * c3_i_b;
  c3_c_A = c3_r_y;
  c3_g_x = c3_c_A;
  c3_h_x = c3_g_x;
  c3_i_x = c3_h_x;
  c3_QX = c3_i_x / 0.00031887755102040814;
  _SFD_EML_CALL(0, 27);
  c3_d_A = c3_u[7155] - c3_u[7170];
  c3_c_B = c3_dz[477];
  c3_j_x = c3_d_A;
  c3_s_y = c3_c_B;
  c3_k_x = c3_j_x;
  c3_t_y = c3_s_y;
  c3_l_x = c3_k_x;
  c3_u_y = c3_t_y;
  c3_v_y = c3_l_x / c3_u_y;
  c3_e_A = c3_u[7155] - c3_u[7170];
  c3_d_B = c3_dz[477];
  c3_m_x = c3_e_A;
  c3_w_y = c3_d_B;
  c3_n_x = c3_m_x;
  c3_x_y = c3_w_y;
  c3_o_x = c3_n_x;
  c3_y_y = c3_x_y;
  c3_ab_y = c3_o_x / c3_y_y;
  c3_DZ = c3_v_y + c3_ab_y;
  _SFD_EML_CALL(0, 28);
  c3_h_a = c3_lam;
  c3_j_b = c3_DZ;
  c3_bb_y = c3_h_a * c3_j_b;
  c3_i_a = c3_bb_y;
  c3_k_b = c3_ry[477];
  c3_QZ = c3_i_a * c3_k_b;
  _SFD_EML_CALL(0, 29);
  c3_uu[7170] = c3_QX + c3_QZ;
  _SFD_EML_CALL(0, 30);
  c3_f_A = c3_TS - c3_u[0];
  c3_e_B = c3_dz[0];
  c3_p_x = c3_f_A;
  c3_cb_y = c3_e_B;
  c3_q_x = c3_p_x;
  c3_db_y = c3_cb_y;
  c3_r_x = c3_q_x;
  c3_eb_y = c3_db_y;
  c3_fb_y = c3_r_x / c3_eb_y;
  c3_g_A = c3_TS - c3_u[0];
  c3_f_B = c3_dz[0];
  c3_s_x = c3_g_A;
  c3_gb_y = c3_f_B;
  c3_t_x = c3_s_x;
  c3_hb_y = c3_gb_y;
  c3_u_x = c3_t_x;
  c3_ib_y = c3_hb_y;
  c3_jb_y = c3_u_x / c3_ib_y;
  c3_DZ = c3_fb_y + c3_jb_y;

  /* vstup */
  _SFD_EML_CALL(0, 31);
  c3_j_a = c3_lam;
  c3_l_b = c3_DZ;
  c3_kb_y = c3_j_a * c3_l_b;
  c3_k_a = c3_kb_y;
  c3_m_b = c3_ry[1];
  c3_QZ = c3_k_a * c3_m_b;
  _SFD_EML_CALL(0, 32);
  c3_uu[0] = c3_QZ;
  _SFD_EML_CALL(0, 34);
  c3_lam = c3_lambda[_SFD_EML_ARRAY_BOUNDS_CHECK("lambda", (int32_T)
    _SFD_INTEGER_CHECK("round(u(M,N))", c3_round(chartInstance, c3_u[
    7184])), 1, 1600, 1, 0) - 1];
  _SFD_EML_CALL(0, 35);
  c3_n_b = c3_b_mpower(chartInstance, c3_u[7184] - c3_Tinf);
  c3_htc_nat = 0.84 * c3_n_b;
  sf_debug_symbol_switch(10U, 10U);
  _SFD_EML_CALL(0, 36);
  c3_o_b = c3_u[7184] + 273.15;
  c3_lb_y = 0.0003375 * c3_o_b;
  c3_p_b = c3_mpower(chartInstance, c3_u[7184] + 273.15);
  c3_mb_y = 4.017857143E-7 * c3_p_b;
  c3_l_a = (0.78828571429 + c3_lb_y) - c3_mb_y;
  c3_nb_y = c3_l_a * 5.67051;
  c3_m_a = c3_nb_y;
  c3_ob_y = c3_m_a * 1.0E-8;
  c3_n_a = c3_ob_y;
  c3_q_b = c3_mpower(chartInstance, c3_u[7184] + 273.15) + c3_mpower
    (chartInstance, c3_Tinf + 273.15);
  c3_pb_y = c3_n_a * c3_q_b;
  c3_o_a = c3_pb_y;
  c3_r_b = (c3_u[7184] + 273.15) + (c3_Tinf + 273.15);
  c3_htc_r = c3_o_a * c3_r_b;
  sf_debug_symbol_switch(11U, 11U);
  _SFD_EML_CALL(0, 37);
  c3_s_b = c3_htc_nat + c3_htc_r;
  c3_qb_y = 2.0 * c3_s_b;
  c3_p_a = c3_qb_y;
  c3_rb_y = c3_p_a * 0.017857142857142856;
  c3_q_a = c3_rb_y;
  c3_t_b = c3_Tinf - c3_u[7184];
  c3_sb_y = c3_q_a * c3_t_b;
  c3_h_A = c3_sb_y;
  c3_g_B = c3_lam;
  c3_v_x = c3_h_A;
  c3_tb_y = c3_g_B;
  c3_w_x = c3_v_x;
  c3_ub_y = c3_tb_y;
  c3_x_x = c3_w_x;
  c3_vb_y = c3_ub_y;
  c3_wb_y = c3_x_x / c3_vb_y;
  c3_u_b = c3_u[7184];
  c3_xb_y = 2.0 * c3_u_b;
  c3_DX = ((c3_wb_y + c3_u[7183]) - c3_xb_y) + c3_u[7183];
  _SFD_EML_CALL(0, 38);
  c3_r_a = c3_lam;
  c3_v_b = c3_DX;
  c3_yb_y = c3_r_a * c3_v_b;
  c3_i_A = c3_yb_y;
  c3_y_x = c3_i_A;
  c3_ab_x = c3_y_x;
  c3_bb_x = c3_ab_x;
  c3_QX = c3_bb_x / 0.00031887755102040814;
  _SFD_EML_CALL(0, 39);
  c3_j_A = c3_u[7169] - c3_u[7184];
  c3_h_B = c3_dz[477];
  c3_cb_x = c3_j_A;
  c3_ac_y = c3_h_B;
  c3_db_x = c3_cb_x;
  c3_bc_y = c3_ac_y;
  c3_eb_x = c3_db_x;
  c3_cc_y = c3_bc_y;
  c3_dc_y = c3_eb_x / c3_cc_y;
  c3_k_A = c3_u[7169] - c3_u[7184];
  c3_i_B = c3_dz[477];
  c3_fb_x = c3_k_A;
  c3_ec_y = c3_i_B;
  c3_gb_x = c3_fb_x;
  c3_fc_y = c3_ec_y;
  c3_hb_x = c3_gb_x;
  c3_gc_y = c3_fc_y;
  c3_hc_y = c3_hb_x / c3_gc_y;
  c3_DZ = c3_dc_y + c3_hc_y;
  _SFD_EML_CALL(0, 40);
  c3_s_a = c3_lam;
  c3_w_b = c3_DZ;
  c3_ic_y = c3_s_a * c3_w_b;
  c3_t_a = c3_ic_y;
  c3_x_b = c3_ry[477];
  c3_QZ = c3_t_a * c3_x_b;
  _SFD_EML_CALL(0, 41);
  c3_uu[7184] = c3_QX + c3_QZ;
  _SFD_EML_CALL(0, 42);
  c3_l_A = c3_TS - c3_u[14];
  c3_j_B = c3_dz[0];
  c3_ib_x = c3_l_A;
  c3_jc_y = c3_j_B;
  c3_jb_x = c3_ib_x;
  c3_kc_y = c3_jc_y;
  c3_kb_x = c3_jb_x;
  c3_lc_y = c3_kc_y;
  c3_mc_y = c3_kb_x / c3_lc_y;
  c3_m_A = c3_TS - c3_u[14];
  c3_k_B = c3_dz[0];
  c3_lb_x = c3_m_A;
  c3_nc_y = c3_k_B;
  c3_mb_x = c3_lb_x;
  c3_oc_y = c3_nc_y;
  c3_nb_x = c3_mb_x;
  c3_pc_y = c3_oc_y;
  c3_qc_y = c3_nb_x / c3_pc_y;
  c3_DZ = c3_mc_y + c3_qc_y;

  /* vstup   */
  _SFD_EML_CALL(0, 43);
  c3_u_a = c3_lam;
  c3_y_b = c3_DZ;
  c3_rc_y = c3_u_a * c3_y_b;
  c3_v_a = c3_rc_y;
  c3_ab_b = c3_ry[1];
  c3_QZ = c3_v_a * c3_ab_b;
  _SFD_EML_CALL(0, 44);
  c3_uu[14] = c3_QZ;
  _SFD_EML_CALL(0, 46);
  for (c3_i30 = 0; c3_i30 < 479; c3_i30 = c3_i30 + 1) {
    c3_b_htc_r[c3_i30] = 0.0;
  }

  sf_debug_symbol_switch(11U, 20U);
  _SFD_EML_CALL(0, 46);
  for (c3_i31 = 0; c3_i31 < 479; c3_i31 = c3_i31 + 1) {
    c3_b_htc_nat[c3_i31] = c3_b_htc_r[c3_i31];
  }

  sf_debug_symbol_switch(10U, 21U);
  c3_j = 2.0;
  c3_b_j = 2.0;
  while (c3_b_j <= 478.0) {
    c3_j = c3_b_j;
    CV_EML_FOR(0, 1, 1);
    c3_i = 2.0;
    c3_b_i = 2.0;
    while (c3_b_i <= 14.0) {
      c3_i = c3_b_i;
      CV_EML_FOR(0, 2, 1);

      /*      UVNITR ZPO     */
      _SFD_EML_CALL(0, 50);
      c3_lam = c3_lambda[_SFD_EML_ARRAY_BOUNDS_CHECK("lambda", (int32_T)
        _SFD_INTEGER_CHECK("round(u(i,j))", c3_round(chartInstance, c3_u[(
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i", c3_i),
        1, 15, 1, 0) - 1) + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u",
        (int32_T)_SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)])), 1, 1600,
        1, 0) - 1];
      _SFD_EML_CALL(0, 51);
      c3_bb_b = c3_u[(_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("i", c3_i), 1, 15, 1, 0) - 1) + 15 * (
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j", c3_j),
        1, 479, 2, 0) - 1)];
      c3_sc_y = 2.0 * c3_bb_b;
      c3_DX = (c3_u[(_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                 _SFD_INTEGER_CHECK("i-1", c3_i - 1.0), 1, 15, 1, 0) - 1) + 15 *
               (
                _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j",
                  c3_j), 1, 479, 2, 0) - 1)] - c3_sc_y) + c3_u[(
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i+1", c3_i
        + 1.0), 1, 15, 1, 0) - 1) + 15 * (
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j", c3_j),
        1, 479, 2, 0) - 1)];
      _SFD_EML_CALL(0, 52);
      c3_w_a = c3_lam;
      c3_cb_b = c3_DX;
      c3_tc_y = c3_w_a * c3_cb_b;
      c3_n_A = c3_tc_y;
      c3_ob_x = c3_n_A;
      c3_pb_x = c3_ob_x;
      c3_qb_x = c3_pb_x;
      c3_QX = c3_qb_x / 0.00031887755102040814;
      _SFD_EML_CALL(0, 53);
      c3_o_A = c3_u[(_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("i", c3_i), 1, 15, 1, 0) - 1) + 15 * (
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j-1", c3_j
        - 1.0), 1, 479, 2, 0) - 1)] - c3_u[(
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i", c3_i),
        1, 15, 1, 0) - 1) + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u",
                                   (int32_T)_SFD_INTEGER_CHECK("j", c3_j), 1,
        479, 2, 0) - 1)];
      c3_l_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
        _SFD_INTEGER_CHECK("j-1", c3_j - 1.0), 1, 478, 1, 0) - 1];
      c3_rb_x = c3_o_A;
      c3_uc_y = c3_l_B;
      c3_sb_x = c3_rb_x;
      c3_vc_y = c3_uc_y;
      c3_tb_x = c3_sb_x;
      c3_wc_y = c3_vc_y;
      c3_xc_y = c3_tb_x / c3_wc_y;
      c3_p_A = c3_u[(_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("i", c3_i), 1, 15, 1, 0) - 1) + 15 * (
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j+1", c3_j
        + 1.0), 1, 479, 2, 0) - 1)] - c3_u[(
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i", c3_i),
        1, 15, 1, 0) - 1) + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u",
                                   (int32_T)_SFD_INTEGER_CHECK("j", c3_j), 1,
        479, 2, 0) - 1)];
      c3_m_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
        _SFD_INTEGER_CHECK("j", c3_j), 1, 478, 1, 0) - 1];
      c3_ub_x = c3_p_A;
      c3_yc_y = c3_m_B;
      c3_vb_x = c3_ub_x;
      c3_ad_y = c3_yc_y;
      c3_wb_x = c3_vb_x;
      c3_bd_y = c3_ad_y;
      c3_cd_y = c3_wb_x / c3_bd_y;
      c3_DZ = c3_xc_y + c3_cd_y;
      _SFD_EML_CALL(0, 54);
      c3_x_a = c3_lam;
      c3_db_b = c3_DZ;
      c3_dd_y = c3_x_a * c3_db_b;
      c3_y_a = c3_dd_y;
      c3_eb_b = c3_ry[_SFD_EML_ARRAY_BOUNDS_CHECK("ry", (int32_T)
        _SFD_INTEGER_CHECK("j", c3_j), 1, 478, 1, 0) - 1];
      c3_QZ = c3_y_a * c3_eb_b;
      _SFD_EML_CALL(0, 55);
      c3_uu[(_SFD_EML_ARRAY_BOUNDS_CHECK("uu", (int32_T)_SFD_INTEGER_CHECK("i",
               c3_i), 1, 15, 1, 0) - 1) + 15 * (
        _SFD_EML_ARRAY_BOUNDS_CHECK("uu", (int32_T)_SFD_INTEGER_CHECK("j", c3_j),
        1, 479, 2, 0) - 1)] = c3_QX + c3_QZ;

      /* konec */
      _SFD_EML_CALL(0, 57);
      c3_lam = c3_lambda[_SFD_EML_ARRAY_BOUNDS_CHECK("lambda", (int32_T)
        _SFD_INTEGER_CHECK("round(u(i,N))", c3_round(chartInstance, c3_u[
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i", c3_i),
        1, 15, 1, 0) + 7169])), 1, 1600, 1, 0) - 1];
      _SFD_EML_CALL(0, 58);
      c3_fb_b = c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("i", c3_i), 1, 15, 1, 0) + 7169];
      c3_ed_y = 2.0 * c3_fb_b;
      c3_DX = (c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK
                ("i-1", c3_i - 1.0), 1, 15, 1, 0) + 7169] - c3_ed_y) +
        c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i+1",
        c3_i + 1.0), 1, 15, 1, 0) + 7169];
      _SFD_EML_CALL(0, 59);
      c3_ab_a = c3_lam;
      c3_gb_b = c3_DX;
      c3_fd_y = c3_ab_a * c3_gb_b;
      c3_q_A = c3_fd_y;
      c3_xb_x = c3_q_A;
      c3_yb_x = c3_xb_x;
      c3_ac_x = c3_yb_x;
      c3_QX = c3_ac_x / 0.00031887755102040814;
      _SFD_EML_CALL(0, 60);
      c3_r_A = c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK
        ("i", c3_i), 1, 15, 1, 0) + 7154] - c3_u[
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i", c3_i),
        1, 15, 1, 0) + 7169];
      c3_n_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
        _SFD_INTEGER_CHECK("j-1", c3_j - 1.0), 1, 478, 1, 0) - 1];
      c3_bc_x = c3_r_A;
      c3_gd_y = c3_n_B;
      c3_cc_x = c3_bc_x;
      c3_hd_y = c3_gd_y;
      c3_dc_x = c3_cc_x;
      c3_id_y = c3_hd_y;
      c3_jd_y = c3_dc_x / c3_id_y;
      c3_s_A = c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK
        ("i", c3_i), 1, 15, 1, 0) + 7154] - c3_u[
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i", c3_i),
        1, 15, 1, 0) + 7169];
      c3_o_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
        _SFD_INTEGER_CHECK("j", c3_j), 1, 478, 1, 0) - 1];
      c3_ec_x = c3_s_A;
      c3_kd_y = c3_o_B;
      c3_fc_x = c3_ec_x;
      c3_ld_y = c3_kd_y;
      c3_gc_x = c3_fc_x;
      c3_md_y = c3_ld_y;
      c3_nd_y = c3_gc_x / c3_md_y;
      c3_DZ = c3_jd_y + c3_nd_y;
      _SFD_EML_CALL(0, 61);
      c3_bb_a = c3_lam;
      c3_hb_b = c3_DZ;
      c3_od_y = c3_bb_a * c3_hb_b;
      c3_cb_a = c3_od_y;
      c3_ib_b = c3_ry[477];
      c3_QZ = c3_cb_a * c3_ib_b;
      _SFD_EML_CALL(0, 62);
      c3_uu[_SFD_EML_ARRAY_BOUNDS_CHECK("uu", (int32_T)_SFD_INTEGER_CHECK("i",
        c3_i), 1, 15, 1, 0) + 7169] = c3_QX + c3_QZ;

      /* vstup ------------------------------------------- */
      _SFD_EML_CALL(0, 64);
      c3_lam = c3_lambda[_SFD_EML_ARRAY_BOUNDS_CHECK("lambda", (int32_T)
        _SFD_INTEGER_CHECK("round(u(i,1))", c3_round(chartInstance, c3_u[
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i", c3_i),
        1, 15, 1, 0) - 1])), 1, 1600, 1, 0) - 1];
      _SFD_EML_CALL(0, 65);
      c3_jb_b = c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("i", c3_i), 1, 15, 1, 0) - 1];
      c3_pd_y = 2.0 * c3_jb_b;
      c3_DX = (c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK
                ("i-1", c3_i - 1.0), 1, 15, 1, 0) - 1] - c3_pd_y) + c3_u[
        _SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("i+1", c3_i
        + 1.0), 1, 15, 1, 0) - 1];
      _SFD_EML_CALL(0, 66);
      c3_db_a = c3_lam;
      c3_kb_b = c3_DX;
      c3_qd_y = c3_db_a * c3_kb_b;
      c3_t_A = c3_qd_y;
      c3_hc_x = c3_t_A;
      c3_ic_x = c3_hc_x;
      c3_jc_x = c3_ic_x;
      c3_QX = c3_jc_x / 0.00031887755102040814;
      _SFD_EML_CALL(0, 67);
      c3_u_A = c3_TS - c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("i", c3_i), 1, 15, 1, 0) - 1];
      c3_p_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
        _SFD_INTEGER_CHECK("j-1", c3_j - 1.0), 1, 478, 1, 0) - 1];
      c3_kc_x = c3_u_A;
      c3_rd_y = c3_p_B;
      c3_lc_x = c3_kc_x;
      c3_sd_y = c3_rd_y;
      c3_mc_x = c3_lc_x;
      c3_td_y = c3_sd_y;
      c3_ud_y = c3_mc_x / c3_td_y;
      c3_v_A = c3_TS - c3_u[_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("i", c3_i), 1, 15, 1, 0) - 1];
      c3_q_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
        _SFD_INTEGER_CHECK("j", c3_j), 1, 478, 1, 0) - 1];
      c3_nc_x = c3_v_A;
      c3_vd_y = c3_q_B;
      c3_oc_x = c3_nc_x;
      c3_wd_y = c3_vd_y;
      c3_pc_x = c3_oc_x;
      c3_xd_y = c3_wd_y;
      c3_yd_y = c3_pc_x / c3_xd_y;
      c3_DZ = c3_ud_y + c3_yd_y;
      _SFD_EML_CALL(0, 68);
      c3_eb_a = c3_lam;
      c3_lb_b = c3_DZ;
      c3_ae_y = c3_eb_a * c3_lb_b;
      c3_fb_a = c3_ae_y;
      c3_mb_b = c3_ry[1];
      c3_QZ = c3_fb_a * c3_mb_b;
      _SFD_EML_CALL(0, 69);
      c3_uu[_SFD_EML_ARRAY_BOUNDS_CHECK("uu", (int32_T)_SFD_INTEGER_CHECK("i",
        c3_i), 1, 15, 1, 0) - 1] = c3_QX + c3_QZ;
      c3_b_i = c3_b_i + 1.0;
      sf_mex_listen_for_ctrl_c(chartInstance->S);
    }

    CV_EML_FOR(0, 2, 0);

    /* strana VR */
    _SFD_EML_CALL(0, 72);
    c3_lam = c3_lambda[_SFD_EML_ARRAY_BOUNDS_CHECK("lambda", (int32_T)
      _SFD_INTEGER_CHECK("round(u(M,j))", c3_round(chartInstance, c3_u[
      14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK(
      "j", c3_j), 1, 479, 2, 0) - 1)])), 1, 1600, 1, 0) - 1];
    _SFD_EML_CALL(0, 73);
    c3_r_B = c3_V;
    c3_be_y = c3_r_B;
    c3_ce_y = c3_be_y;
    c3_de_y = c3_ce_y;
    c3_tt = 1.0 / c3_de_y;
    _SFD_EML_CALL(0, 74);
    if (CV_EML_IF(0, 0, c3_matV[_SFD_EML_ARRAY_BOUNDS_CHECK("matV", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 478] == 1.0)) {
      _SFD_EML_CALL(0, 75);
      c3_nb_b = c3_c_mpower(chartInstance, c3_tt);
      c3_ee_y = -8.0 * c3_nb_b;
      c3_gb_a = c3_ee_y;
      c3_q0 = c3_gb_a * 1.0E+6;
      _SFD_EML_CALL(0, 76);
      c3_ob_b = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
      c3_fe_y = 2.0 * c3_ob_b;
      c3_pb_b = c3_q0;
      c3_ge_y = 2.0 * c3_pb_b;
      c3_w_A = c3_ge_y;
      c3_s_B = c3_lam;
      c3_qc_x = c3_w_A;
      c3_he_y = c3_s_B;
      c3_rc_x = c3_qc_x;
      c3_ie_y = c3_he_y;
      c3_sc_x = c3_rc_x;
      c3_je_y = c3_ie_y;
      c3_ke_y = c3_sc_x / c3_je_y;
      c3_hb_a = c3_ke_y;
      c3_le_y = c3_hb_a * 0.017857142857142856;
      c3_DX = ((c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                  _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] - c3_fe_y)
               +
               c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                 _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) + c3_le_y;
    } else {
      _SFD_EML_CALL(0, 77);
      if (CV_EML_IF(0, 1, c3_matV[_SFD_EML_ARRAY_BOUNDS_CHECK("matV", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 478] == 2.0)) {
        _SFD_EML_CALL(0, 78);
        if (CV_EML_IF(0, 2, c3_matV[_SFD_EML_ARRAY_BOUNDS_CHECK("matV", (int32_T)
              _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 957] == 0.0)) {
          _SFD_EML_CALL(0, 79);
          c3_qb_b = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
          c3_me_y = 2.0 * c3_qb_b;
          c3_rb_b = c3_qqV[_SFD_EML_ARRAY_BOUNDS_CHECK("qqV", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1];
          c3_ne_y = 2.0 * c3_rb_b;
          c3_x_A = c3_ne_y;
          c3_t_B = c3_lam;
          c3_tc_x = c3_x_A;
          c3_oe_y = c3_t_B;
          c3_uc_x = c3_tc_x;
          c3_pe_y = c3_oe_y;
          c3_vc_x = c3_uc_x;
          c3_qe_y = c3_pe_y;
          c3_re_y = c3_vc_x / c3_qe_y;
          c3_ib_a = c3_re_y;
          c3_se_y = c3_ib_a * 0.017857142857142856;
          c3_DX = ((c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                      _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] -
                    c3_me_y) +
                   c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                     _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) +
            c3_se_y;
        } else {
          _SFD_EML_CALL(0, 81);
          c3_sb_b = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15;
          c3_te_y = 0.0003375 * c3_sb_b;
          c3_tb_b = c3_mpower(chartInstance, c3_u[14 + 15 *
                              (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479,
            2, 0) - 1)] + 273.15);
          c3_ue_y = 4.017857143E-7 * c3_tb_b;
          c3_jb_a = (0.78828571429 + c3_te_y) - c3_ue_y;
          c3_ve_y = c3_jb_a * 5.67051;
          c3_kb_a = c3_ve_y;
          c3_we_y = c3_kb_a * 1.0E-8;
          c3_lb_a = c3_we_y;
          c3_ub_b = c3_mpower(chartInstance, c3_u[14 + 15 *
                              (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479,
            2, 0) - 1)] + 273.15) + c3_mpower(chartInstance, c3_Tinf + 273.15);
          c3_xe_y = c3_lb_a * c3_ub_b;
          c3_mb_a = c3_xe_y;
          c3_vb_b = (c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15) +
            (c3_Tinf + 273.15);
          c3_ye_y = c3_mb_a * c3_vb_b;
          c3_b_htc_r[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] = c3_ye_y;
          sf_debug_symbol_switch(11U, 20U);
          _SFD_EML_CALL(0, 82);
          c3_wb_b = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
          c3_af_y = 2.0 * c3_wb_b;
          c3_xb_b = c3_matV[_SFD_EML_ARRAY_BOUNDS_CHECK("matV", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 1915] + c3_b_htc_r[
            _SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)_SFD_INTEGER_CHECK("j",
            c3_j), 1, 479, 1, 0) - 1];
          c3_bf_y = 2.0 * c3_xb_b;
          c3_nb_a = c3_bf_y;
          c3_cf_y = c3_nb_a * 0.017857142857142856;
          c3_ob_a = c3_cf_y;
          c3_yb_b = c3_Tw - c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u",
            (int32_T)_SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
          c3_df_y = c3_ob_a * c3_yb_b;
          c3_y_A = c3_df_y;
          c3_u_B = c3_lam;
          c3_wc_x = c3_y_A;
          c3_ef_y = c3_u_B;
          c3_xc_x = c3_wc_x;
          c3_ff_y = c3_ef_y;
          c3_yc_x = c3_xc_x;
          c3_gf_y = c3_ff_y;
          c3_hf_y = c3_yc_x / c3_gf_y;
          c3_DX = ((c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                      _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] -
                    c3_af_y) +
                   c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                     _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) +
            c3_hf_y;
        }
      } else {
        _SFD_EML_CALL(0, 85);
        c3_ac_b = c3_b_mpower(chartInstance, c3_u[14 + 15 *
                              (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479
          , 2, 0) - 1)] - c3_Tinf);
        c3_if_y = 0.84 * c3_ac_b;
        c3_b_htc_nat[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_nat", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] = c3_if_y;
        sf_debug_symbol_switch(10U, 21U);
        _SFD_EML_CALL(0, 86);
        c3_bc_b = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15;
        c3_jf_y = 0.0003375 * c3_bc_b;
        c3_cc_b = c3_mpower(chartInstance, c3_u[14 + 15 *
                            (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479,
          2, 0) - 1)] + 273.15);
        c3_kf_y = 4.017857143E-7 * c3_cc_b;
        c3_pb_a = (0.78828571429 + c3_jf_y) - c3_kf_y;
        c3_lf_y = c3_pb_a * 5.67051;
        c3_qb_a = c3_lf_y;
        c3_mf_y = c3_qb_a * 1.0E-8;
        c3_rb_a = c3_mf_y;
        c3_dc_b = c3_mpower(chartInstance, c3_u[14 + 15 *
                            (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479,
          2, 0) - 1)] + 273.15) + c3_mpower(chartInstance, c3_Tinf + 273.15);
        c3_nf_y = c3_rb_a * c3_dc_b;
        c3_sb_a = c3_nf_y;
        c3_ec_b = (c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15) +
          (c3_Tinf + 273.15);
        c3_of_y = c3_sb_a * c3_ec_b;
        c3_b_htc_r[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] = c3_of_y;
        sf_debug_symbol_switch(11U, 20U);
        _SFD_EML_CALL(0, 87);
        c3_fc_b = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
        c3_pf_y = 2.0 * c3_fc_b;
        c3_gc_b = c3_b_htc_nat[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_nat", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] +
          c3_b_htc_r[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1];
        c3_qf_y = 2.0 * c3_gc_b;
        c3_tb_a = c3_qf_y;
        c3_rf_y = c3_tb_a * 0.017857142857142856;
        c3_ub_a = c3_rf_y;
        c3_hc_b = c3_Tinf - c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u",
          (int32_T)_SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
        c3_sf_y = c3_ub_a * c3_hc_b;
        c3_ab_A = c3_sf_y;
        c3_v_B = c3_lam;
        c3_ad_x = c3_ab_A;
        c3_tf_y = c3_v_B;
        c3_bd_x = c3_ad_x;
        c3_uf_y = c3_tf_y;
        c3_cd_x = c3_bd_x;
        c3_vf_y = c3_uf_y;
        c3_wf_y = c3_cd_x / c3_vf_y;
        c3_DX = ((c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                    _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] - c3_pf_y)
                 +
                 c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                   _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) + c3_wf_y;
      }
    }

    _SFD_EML_CALL(0, 89);
    c3_vb_a = c3_lam;
    c3_ic_b = c3_DX;
    c3_xf_y = c3_vb_a * c3_ic_b;
    c3_bb_A = c3_xf_y;
    c3_dd_x = c3_bb_A;
    c3_ed_x = c3_dd_x;
    c3_fd_x = c3_ed_x;
    c3_QX = c3_fd_x / 0.00031887755102040814;
    _SFD_EML_CALL(0, 90);
    c3_cb_A = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
      _SFD_INTEGER_CHECK("j-1", c3_j - 1.0), 1, 479, 2, 0) - 1)] -
      c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
      _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
    c3_w_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)_SFD_INTEGER_CHECK
      ("j-1", c3_j - 1.0), 1, 478, 1, 0) - 1];
    c3_gd_x = c3_cb_A;
    c3_yf_y = c3_w_B;
    c3_hd_x = c3_gd_x;
    c3_ag_y = c3_yf_y;
    c3_id_x = c3_hd_x;
    c3_bg_y = c3_ag_y;
    c3_cg_y = c3_id_x / c3_bg_y;
    c3_db_A = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
      _SFD_INTEGER_CHECK("j+1", c3_j + 1.0), 1, 479, 2, 0) - 1)] -
      c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
      _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
    c3_x_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)_SFD_INTEGER_CHECK
      ("j", c3_j), 1, 478, 1, 0) - 1];
    c3_jd_x = c3_db_A;
    c3_dg_y = c3_x_B;
    c3_kd_x = c3_jd_x;
    c3_eg_y = c3_dg_y;
    c3_ld_x = c3_kd_x;
    c3_fg_y = c3_eg_y;
    c3_gg_y = c3_ld_x / c3_fg_y;
    c3_DZ = c3_cg_y + c3_gg_y;
    _SFD_EML_CALL(0, 91);
    c3_wb_a = c3_lam;
    c3_jc_b = c3_DZ;
    c3_hg_y = c3_wb_a * c3_jc_b;
    c3_xb_a = c3_hg_y;
    c3_kc_b = c3_ry[_SFD_EML_ARRAY_BOUNDS_CHECK("ry", (int32_T)
      _SFD_INTEGER_CHECK("j", c3_j), 1, 478, 1, 0) - 1];
    c3_QZ = c3_xb_a * c3_kc_b;
    _SFD_EML_CALL(0, 92);
    c3_uu[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("uu", (int32_T)
      _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] = c3_QX + c3_QZ;

    /* strana MR */
    _SFD_EML_CALL(0, 95);
    c3_lam = c3_lambda[_SFD_EML_ARRAY_BOUNDS_CHECK("lambda", (int32_T)
      _SFD_INTEGER_CHECK("round(u(1,j))", c3_round(chartInstance, c3_u[
      15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j",
      c3_j), 1, 479, 2, 0) - 1)])), 1, 1600, 1, 0) - 1];
    _SFD_EML_CALL(0, 96);
    if (CV_EML_IF(0, 3, c3_matM[_SFD_EML_ARRAY_BOUNDS_CHECK("matM", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 478] == 1.0)) {
      _SFD_EML_CALL(0, 97);
      c3_lc_b = c3_c_mpower(chartInstance, c3_tt);
      c3_ig_y = -8.0 * c3_lc_b;
      c3_yb_a = c3_ig_y;
      c3_q0 = c3_yb_a * 1.0E+6;
      _SFD_EML_CALL(0, 98);
      c3_mc_b = c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
        _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
      c3_jg_y = 2.0 * c3_mc_b;
      c3_nc_b = c3_q0;
      c3_kg_y = 2.0 * c3_nc_b;
      c3_eb_A = c3_kg_y;
      c3_y_B = c3_lam;
      c3_md_x = c3_eb_A;
      c3_lg_y = c3_y_B;
      c3_nd_x = c3_md_x;
      c3_mg_y = c3_lg_y;
      c3_od_x = c3_nd_x;
      c3_ng_y = c3_mg_y;
      c3_og_y = c3_od_x / c3_ng_y;
      c3_ac_a = c3_og_y;
      c3_pg_y = c3_ac_a * 0.017857142857142856;
      c3_DX = ((c3_u[1 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                  _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] - c3_jg_y)
               +
               c3_u[1 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                 _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) + c3_pg_y;
    } else {
      _SFD_EML_CALL(0, 99);
      if (CV_EML_IF(0, 4, c3_matM[_SFD_EML_ARRAY_BOUNDS_CHECK("matM", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 478] == 2.0)) {
        _SFD_EML_CALL(0, 100);
        if (CV_EML_IF(0, 5, c3_matM[_SFD_EML_ARRAY_BOUNDS_CHECK("matM", (int32_T)
              _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 957] == 0.0)) {
          _SFD_EML_CALL(0, 101);
          c3_oc_b = c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
          c3_qg_y = 2.0 * c3_oc_b;
          c3_pc_b = c3_qqM[_SFD_EML_ARRAY_BOUNDS_CHECK("qqM", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1];
          c3_rg_y = 2.0 * c3_pc_b;
          c3_fb_A = c3_rg_y;
          c3_ab_B = c3_lam;
          c3_pd_x = c3_fb_A;
          c3_sg_y = c3_ab_B;
          c3_qd_x = c3_pd_x;
          c3_tg_y = c3_sg_y;
          c3_rd_x = c3_qd_x;
          c3_ug_y = c3_tg_y;
          c3_vg_y = c3_rd_x / c3_ug_y;
          c3_bc_a = c3_vg_y;
          c3_wg_y = c3_bc_a * 0.017857142857142856;
          c3_DX = ((c3_u[1 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                      _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] -
                    c3_qg_y) +
                   c3_u[1 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                     _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) +
            c3_wg_y;
        } else {
          _SFD_EML_CALL(0, 103);
          c3_qc_b = c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15;
          c3_xg_y = 0.0003375 * c3_qc_b;
          c3_rc_b = c3_mpower(chartInstance, c3_u[15 *
                              (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0)
                               - 1)] + 273.15);
          c3_yg_y = 4.017857143E-7 * c3_rc_b;
          c3_cc_a = (0.78828571429 + c3_xg_y) - c3_yg_y;
          c3_ah_y = c3_cc_a * 5.67051;
          c3_dc_a = c3_ah_y;
          c3_bh_y = c3_dc_a * 1.0E-8;
          c3_ec_a = c3_bh_y;
          c3_sc_b = c3_mpower(chartInstance, c3_u[15 *
                              (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0)
                               - 1)] + 273.15) + c3_mpower(chartInstance,
            c3_Tinf + 273.15);
          c3_ch_y = c3_ec_a * c3_sc_b;
          c3_fc_a = c3_ch_y;
          c3_tc_b = (c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15) + (
            c3_Tinf + 273.15);
          c3_dh_y = c3_fc_a * c3_tc_b;
          c3_b_htc_r[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] = c3_dh_y;
          sf_debug_symbol_switch(11U, 20U);
          _SFD_EML_CALL(0, 104);
          c3_uc_b = c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
          c3_eh_y = 2.0 * c3_uc_b;
          c3_vc_b = c3_matM[_SFD_EML_ARRAY_BOUNDS_CHECK("matM", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) + 1915] + c3_b_htc_r[
            _SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)_SFD_INTEGER_CHECK("j",
            c3_j), 1, 479, 1, 0) - 1];
          c3_fh_y = 2.0 * c3_vc_b;
          c3_gc_a = c3_fh_y;
          c3_gh_y = c3_gc_a * 0.017857142857142856;
          c3_hc_a = c3_gh_y;
          c3_wc_b = c3_Tw - c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
            _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
          c3_hh_y = c3_hc_a * c3_wc_b;
          c3_gb_A = c3_hh_y;
          c3_bb_B = c3_lam;
          c3_sd_x = c3_gb_A;
          c3_ih_y = c3_bb_B;
          c3_td_x = c3_sd_x;
          c3_jh_y = c3_ih_y;
          c3_ud_x = c3_td_x;
          c3_kh_y = c3_jh_y;
          c3_lh_y = c3_ud_x / c3_kh_y;
          c3_DX = ((c3_u[1 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                      _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] -
                    c3_eh_y) +
                   c3_u[1 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                     _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) +
            c3_lh_y;
        }
      } else {
        _SFD_EML_CALL(0, 107);
        c3_xc_b = c3_b_mpower(chartInstance, c3_u[15 *
                              (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2,
          0) - 1)] - c3_Tinf);
        c3_mh_y = 0.84 * c3_xc_b;
        c3_b_htc_nat[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_nat", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] = c3_mh_y;
        sf_debug_symbol_switch(10U, 21U);
        _SFD_EML_CALL(0, 108);
        c3_yc_b = c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15;
        c3_nh_y = 0.0003375 * c3_yc_b;
        c3_ad_b = c3_mpower(chartInstance, c3_u[15 *
                            (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0)
                             - 1)] + 273.15);
        c3_oh_y = 4.017857143E-7 * c3_ad_b;
        c3_ic_a = (0.78828571429 + c3_nh_y) - c3_oh_y;
        c3_ph_y = c3_ic_a * 5.67051;
        c3_jc_a = c3_ph_y;
        c3_qh_y = c3_jc_a * 1.0E-8;
        c3_kc_a = c3_qh_y;
        c3_bd_b = c3_mpower(chartInstance, c3_u[15 *
                            (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0)
                             - 1)] + 273.15) + c3_mpower(chartInstance, c3_Tinf
          + 273.15);
        c3_rh_y = c3_kc_a * c3_bd_b;
        c3_lc_a = c3_rh_y;
        c3_cd_b = (c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] + 273.15) + (
          c3_Tinf + 273.15);
        c3_sh_y = c3_lc_a * c3_cd_b;
        c3_b_htc_r[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] = c3_sh_y;
        sf_debug_symbol_switch(11U, 20U);
        _SFD_EML_CALL(0, 109);
        c3_dd_b = c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
        c3_th_y = 2.0 * c3_dd_b;
        c3_ed_b = c3_b_htc_nat[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_nat", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1] +
          c3_b_htc_r[_SFD_EML_ARRAY_BOUNDS_CHECK("htc_r", (int32_T)
          _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 1, 0) - 1];
        c3_uh_y = 2.0 * c3_ed_b;
        c3_mc_a = c3_uh_y;
        c3_vh_y = c3_mc_a * 0.017857142857142856;
        c3_nc_a = c3_vh_y;
        c3_fd_b = c3_Tinf - c3_u[14 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u",
          (int32_T)_SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)];
        c3_wh_y = c3_nc_a * c3_fd_b;
        c3_hb_A = c3_wh_y;
        c3_cb_B = c3_lam;
        c3_vd_x = c3_hb_A;
        c3_xh_y = c3_cb_B;
        c3_wd_x = c3_vd_x;
        c3_yh_y = c3_xh_y;
        c3_xd_x = c3_wd_x;
        c3_ai_y = c3_yh_y;
        c3_bi_y = c3_xd_x / c3_ai_y;
        c3_DX = ((c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                    _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)] - c3_th_y)
                 +
                 c3_u[13 + 15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
                   _SFD_INTEGER_CHECK("j", c3_j), 1, 479, 2, 0) - 1)]) + c3_bi_y;
      }
    }

    _SFD_EML_CALL(0, 111);
    c3_oc_a = c3_lam;
    c3_gd_b = c3_DX;
    c3_ci_y = c3_oc_a * c3_gd_b;
    c3_ib_A = c3_ci_y;
    c3_yd_x = c3_ib_A;
    c3_ae_x = c3_yd_x;
    c3_be_x = c3_ae_x;
    c3_QX = c3_be_x / 0.00031887755102040814;
    _SFD_EML_CALL(0, 112);
    c3_jb_A = c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
      _SFD_INTEGER_CHECK("j-1", c3_j - 1.0), 1, 479, 2, 0) - 1)] - c3_u[15
      * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j", c3_j),
          1, 479, 2, 0) - 1)];
    c3_db_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
      _SFD_INTEGER_CHECK("j-1", c3_j - 1.0), 1, 478, 1, 0) - 1];
    c3_ce_x = c3_jb_A;
    c3_di_y = c3_db_B;
    c3_de_x = c3_ce_x;
    c3_ei_y = c3_di_y;
    c3_ee_x = c3_de_x;
    c3_fi_y = c3_ei_y;
    c3_gi_y = c3_ee_x / c3_fi_y;
    c3_kb_A = c3_u[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)
      _SFD_INTEGER_CHECK("j+1", c3_j + 1.0), 1, 479, 2, 0) - 1)] - c3_u[15
      * (_SFD_EML_ARRAY_BOUNDS_CHECK("u", (int32_T)_SFD_INTEGER_CHECK("j", c3_j),
          1, 479, 2, 0) - 1)];
    c3_eb_B = c3_dz[_SFD_EML_ARRAY_BOUNDS_CHECK("dz", (int32_T)
      _SFD_INTEGER_CHECK("j", c3_j), 1, 478, 1, 0) - 1];
    c3_fe_x = c3_kb_A;
    c3_hi_y = c3_eb_B;
    c3_ge_x = c3_fe_x;
    c3_ii_y = c3_hi_y;
    c3_he_x = c3_ge_x;
    c3_ji_y = c3_ii_y;
    c3_ki_y = c3_he_x / c3_ji_y;
    c3_DZ = c3_gi_y + c3_ki_y;
    _SFD_EML_CALL(0, 113);
    c3_pc_a = c3_lam;
    c3_hd_b = c3_DZ;
    c3_li_y = c3_pc_a * c3_hd_b;
    c3_qc_a = c3_li_y;
    c3_id_b = c3_ry[_SFD_EML_ARRAY_BOUNDS_CHECK("ry", (int32_T)
      _SFD_INTEGER_CHECK("j", c3_j), 1, 478, 1, 0) - 1];
    c3_QZ = c3_qc_a * c3_id_b;
    _SFD_EML_CALL(0, 114);
    c3_uu[15 * (_SFD_EML_ARRAY_BOUNDS_CHECK("uu", (int32_T)_SFD_INTEGER_CHECK(
      "j", c3_j), 1, 479, 2, 0) - 1)] = c3_QX + c3_QZ;
    c3_b_j = c3_b_j + 1.0;
    sf_mex_listen_for_ctrl_c(chartInstance->S);
  }

  CV_EML_FOR(0, 1, 0);
  _SFD_EML_CALL(0, -114);
  sf_debug_symbol_scope_pop();
  for (c3_i32 = 0; c3_i32 < 7185; c3_i32 = c3_i32 + 1) {
    (*c3_b_uu)[c3_i32] = c3_uu[c3_i32];
  }

  _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 2);
}

static void compInitSubchartSimstructsFcn_c3_ental(SFc3_entalInstanceStruct
  *chartInstance)
{
}

static void init_script_number_translation(uint32_T c3_machineNumber, uint32_T
  c3_chartNumber)
{
}

static real_T c3_mpower(SFc3_entalInstanceStruct *chartInstance, real_T c3_a)
{
  return c3_power(chartInstance, c3_a, 2.0);
}

static real_T c3_power(SFc3_entalInstanceStruct *chartInstance, real_T c3_a,
  real_T c3_b)
{
  real_T c3_ak;
  real_T c3_bk;
  real_T c3_x;
  real_T c3_b_x;
  c3_ak = c3_a;
  c3_bk = c3_b;
  if (c3_ak < 0.0) {
    c3_x = c3_bk;
    c3_b_x = c3_x;
    c3_b_x = muDoubleScalarFloor(c3_b_x);
    if (c3_b_x != c3_bk) {
      c3_eml_error(chartInstance);
      goto label_1;
    }
  }

 label_1:
  ;
  return muDoubleScalarPower(c3_ak, c3_bk);
}

static void c3_eml_error(SFc3_entalInstanceStruct *chartInstance)
{
  int32_T c3_i33;
  static char_T c3_cv0[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 c3_u[32];
  const mxArray *c3_y = NULL;
  int32_T c3_i34;
  static char_T c3_cv1[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 c3_b_u[102];
  const mxArray *c3_b_y = NULL;
  for (c3_i33 = 0; c3_i33 < 32; c3_i33 = c3_i33 + 1) {
    c3_u[c3_i33] = c3_cv0[c3_i33];
  }

  c3_y = NULL;
  sf_mex_assign(&c3_y, sf_mex_create("y", c3_u, 10, 0U, 1U, 0U, 2, 1, 32));
  for (c3_i34 = 0; c3_i34 < 102; c3_i34 = c3_i34 + 1) {
    c3_b_u[c3_i34] = c3_cv1[c3_i34];
  }

  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", c3_b_u, 10, 0U, 1U, 0U, 2, 1, 102));
  sf_mex_call_debug("error", 0U, 2U, 14, c3_y, 14, c3_b_y);
}

static real_T c3_round(SFc3_entalInstanceStruct *chartInstance, real_T c3_x)
{
  real_T c3_b_x;
  real_T c3_c_x;
  real_T c3_d_x;
  c3_b_x = c3_x;
  c3_c_x = c3_b_x;
  c3_b_x = c3_c_x;
  c3_d_x = c3_b_x;
  if (c3_d_x < 0.0) {
    return muDoubleScalarCeil(c3_d_x - 0.5);
  } else {
    return muDoubleScalarFloor(c3_d_x + 0.5);
  }
}

static real_T c3_b_mpower(SFc3_entalInstanceStruct *chartInstance, real_T c3_a)
{
  return c3_power(chartInstance, c3_a, 0.5);
}

static real_T c3_c_mpower(SFc3_entalInstanceStruct *chartInstance, real_T c3_a)
{
  return c3_power(chartInstance, c3_a, -0.5);
}

static const mxArray *c3_sf_marshall(void *chartInstanceVoid, void *c3_u)
{
  const mxArray *c3_y = NULL;
  int32_T c3_i35;
  int32_T c3_i36;
  int32_T c3_i37;
  real_T c3_b_u[7185];
  int32_T c3_i38;
  int32_T c3_i39;
  int32_T c3_i40;
  real_T c3_c_u[7185];
  const mxArray *c3_b_y = NULL;
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)chartInstanceVoid;
  c3_y = NULL;
  c3_i35 = 0;
  for (c3_i36 = 0; c3_i36 < 479; c3_i36 = c3_i36 + 1) {
    for (c3_i37 = 0; c3_i37 < 15; c3_i37 = c3_i37 + 1) {
      c3_b_u[c3_i37 + c3_i35] = (*((real_T (*)[7185])c3_u))[c3_i37 + c3_i35];
    }

    c3_i35 = c3_i35 + 15;
  }

  c3_i38 = 0;
  for (c3_i39 = 0; c3_i39 < 479; c3_i39 = c3_i39 + 1) {
    for (c3_i40 = 0; c3_i40 < 15; c3_i40 = c3_i40 + 1) {
      c3_c_u[c3_i40 + c3_i38] = c3_b_u[c3_i40 + c3_i38];
    }

    c3_i38 = c3_i38 + 15;
  }

  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", c3_c_u, 0, 0U, 1U, 0U, 2, 15, 479));
  sf_mex_assign(&c3_y, c3_b_y);
  return c3_y;
}

static const mxArray *c3_b_sf_marshall(void *chartInstanceVoid, void *c3_u)
{
  const mxArray *c3_y = NULL;
  real_T c3_b_u;
  const mxArray *c3_b_y = NULL;
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)chartInstanceVoid;
  c3_y = NULL;
  c3_b_u = *((real_T *)c3_u);
  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", &c3_b_u, 0, 0U, 0U, 0U, 0));
  sf_mex_assign(&c3_y, c3_b_y);
  return c3_y;
}

static const mxArray *c3_c_sf_marshall(void *chartInstanceVoid, void *c3_u)
{
  const mxArray *c3_y = NULL;
  int32_T c3_i41;
  real_T c3_b_u[479];
  int32_T c3_i42;
  real_T c3_c_u[479];
  const mxArray *c3_b_y = NULL;
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)chartInstanceVoid;
  c3_y = NULL;
  for (c3_i41 = 0; c3_i41 < 479; c3_i41 = c3_i41 + 1) {
    c3_b_u[c3_i41] = (*((real_T (*)[479])c3_u))[c3_i41];
  }

  for (c3_i42 = 0; c3_i42 < 479; c3_i42 = c3_i42 + 1) {
    c3_c_u[c3_i42] = c3_b_u[c3_i42];
  }

  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", c3_c_u, 0, 0U, 1U, 0U, 2, 1, 479));
  sf_mex_assign(&c3_y, c3_b_y);
  return c3_y;
}

static const mxArray *c3_d_sf_marshall(void *chartInstanceVoid, void *c3_u)
{
  const mxArray *c3_y = NULL;
  int32_T c3_i43;
  int32_T c3_i44;
  int32_T c3_i45;
  real_T c3_b_u[2874];
  int32_T c3_i46;
  int32_T c3_i47;
  int32_T c3_i48;
  real_T c3_c_u[2874];
  const mxArray *c3_b_y = NULL;
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)chartInstanceVoid;
  c3_y = NULL;
  c3_i43 = 0;
  for (c3_i44 = 0; c3_i44 < 6; c3_i44 = c3_i44 + 1) {
    for (c3_i45 = 0; c3_i45 < 479; c3_i45 = c3_i45 + 1) {
      c3_b_u[c3_i45 + c3_i43] = (*((real_T (*)[2874])c3_u))[c3_i45 + c3_i43];
    }

    c3_i43 = c3_i43 + 479;
  }

  c3_i46 = 0;
  for (c3_i47 = 0; c3_i47 < 6; c3_i47 = c3_i47 + 1) {
    for (c3_i48 = 0; c3_i48 < 479; c3_i48 = c3_i48 + 1) {
      c3_c_u[c3_i48 + c3_i46] = c3_b_u[c3_i48 + c3_i46];
    }

    c3_i46 = c3_i46 + 479;
  }

  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", c3_c_u, 0, 0U, 1U, 0U, 2, 479, 6));
  sf_mex_assign(&c3_y, c3_b_y);
  return c3_y;
}

static const mxArray *c3_e_sf_marshall(void *chartInstanceVoid, void *c3_u)
{
  const mxArray *c3_y = NULL;
  int32_T c3_i49;
  real_T c3_b_u[1600];
  int32_T c3_i50;
  real_T c3_c_u[1600];
  const mxArray *c3_b_y = NULL;
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)chartInstanceVoid;
  c3_y = NULL;
  for (c3_i49 = 0; c3_i49 < 1600; c3_i49 = c3_i49 + 1) {
    c3_b_u[c3_i49] = (*((real_T (*)[1600])c3_u))[c3_i49];
  }

  for (c3_i50 = 0; c3_i50 < 1600; c3_i50 = c3_i50 + 1) {
    c3_c_u[c3_i50] = c3_b_u[c3_i50];
  }

  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", c3_c_u, 0, 0U, 1U, 0U, 2, 1, 1600));
  sf_mex_assign(&c3_y, c3_b_y);
  return c3_y;
}

static const mxArray *c3_f_sf_marshall(void *chartInstanceVoid, void *c3_u)
{
  const mxArray *c3_y = NULL;
  int32_T c3_i51;
  real_T c3_b_u[478];
  int32_T c3_i52;
  real_T c3_c_u[478];
  const mxArray *c3_b_y = NULL;
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)chartInstanceVoid;
  c3_y = NULL;
  for (c3_i51 = 0; c3_i51 < 478; c3_i51 = c3_i51 + 1) {
    c3_b_u[c3_i51] = (*((real_T (*)[478])c3_u))[c3_i51];
  }

  for (c3_i52 = 0; c3_i52 < 478; c3_i52 = c3_i52 + 1) {
    c3_c_u[c3_i52] = c3_b_u[c3_i52];
  }

  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", c3_c_u, 0, 0U, 1U, 0U, 2, 1, 478));
  sf_mex_assign(&c3_y, c3_b_y);
  return c3_y;
}

const mxArray *sf_c3_ental_get_eml_resolved_functions_info(void)
{
  const mxArray *c3_nameCaptureInfo = NULL;
  c3_ResolvedFunctionInfo c3_info[35];
  const mxArray *c3_m0 = NULL;
  int32_T c3_i53;
  c3_ResolvedFunctionInfo *c3_r0;
  c3_nameCaptureInfo = NULL;
  c3_info_helper(c3_info);
  sf_mex_assign(&c3_m0, sf_mex_createstruct("nameCaptureInfo", 1, 35));
  for (c3_i53 = 0; c3_i53 < 35; c3_i53 = c3_i53 + 1) {
    c3_r0 = &c3_info[c3_i53];
    sf_mex_addfield(c3_m0, sf_mex_create("nameCaptureInfo", c3_r0->context, 15,
      0U, 0U, 0U, 2, 1, strlen(c3_r0->context)), "context",
                    "nameCaptureInfo", c3_i53);
    sf_mex_addfield(c3_m0, sf_mex_create("nameCaptureInfo", c3_r0->name, 15, 0U,
      0U, 0U, 2, 1, strlen(c3_r0->name)), "name",
                    "nameCaptureInfo", c3_i53);
    sf_mex_addfield(c3_m0, sf_mex_create("nameCaptureInfo", c3_r0->dominantType,
      15, 0U, 0U, 0U, 2, 1, strlen(c3_r0->dominantType)),
                    "dominantType", "nameCaptureInfo", c3_i53);
    sf_mex_addfield(c3_m0, sf_mex_create("nameCaptureInfo", c3_r0->resolved, 15,
      0U, 0U, 0U, 2, 1, strlen(c3_r0->resolved)), "resolved"
                    , "nameCaptureInfo", c3_i53);
    sf_mex_addfield(c3_m0, sf_mex_create("nameCaptureInfo", &c3_r0->fileLength,
      7, 0U, 0U, 0U, 0), "fileLength", "nameCaptureInfo",
                    c3_i53);
    sf_mex_addfield(c3_m0, sf_mex_create("nameCaptureInfo", &c3_r0->fileTime1, 7,
      0U, 0U, 0U, 0), "fileTime1", "nameCaptureInfo", c3_i53
                    );
    sf_mex_addfield(c3_m0, sf_mex_create("nameCaptureInfo", &c3_r0->fileTime2, 7,
      0U, 0U, 0U, 0), "fileTime2", "nameCaptureInfo", c3_i53
                    );
  }

  sf_mex_assign(&c3_nameCaptureInfo, c3_m0);
  return c3_nameCaptureInfo;
}

static void c3_info_helper(c3_ResolvedFunctionInfo c3_info[35])
{
  c3_info[0].context = "";
  c3_info[0].name = "size";
  c3_info[0].dominantType = "double";
  c3_info[0].resolved = "[B]size";
  c3_info[0].fileLength = 0U;
  c3_info[0].fileTime1 = 0U;
  c3_info[0].fileTime2 = 0U;
  c3_info[1].context = "";
  c3_info[1].name = "minus";
  c3_info[1].dominantType = "double";
  c3_info[1].resolved = "[B]minus";
  c3_info[1].fileLength = 0U;
  c3_info[1].fileTime1 = 0U;
  c3_info[1].fileTime2 = 0U;
  c3_info[2].context = "";
  c3_info[2].name = "mrdivide";
  c3_info[2].dominantType = "double";
  c3_info[2].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c3_info[2].fileLength = 432U;
  c3_info[2].fileTime1 = 1277748222U;
  c3_info[2].fileTime2 = 0U;
  c3_info[3].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c3_info[3].name = "nargin";
  c3_info[3].dominantType = "";
  c3_info[3].resolved = "[B]nargin";
  c3_info[3].fileLength = 0U;
  c3_info[3].fileTime1 = 0U;
  c3_info[3].fileTime2 = 0U;
  c3_info[4].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c3_info[4].name = "ge";
  c3_info[4].dominantType = "double";
  c3_info[4].resolved = "[B]ge";
  c3_info[4].fileLength = 0U;
  c3_info[4].fileTime1 = 0U;
  c3_info[4].fileTime2 = 0U;
  c3_info[5].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c3_info[5].name = "isscalar";
  c3_info[5].dominantType = "double";
  c3_info[5].resolved = "[B]isscalar";
  c3_info[5].fileLength = 0U;
  c3_info[5].fileTime1 = 0U;
  c3_info[5].fileTime2 = 0U;
  c3_info[6].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p";
  c3_info[6].name = "rdivide";
  c3_info[6].dominantType = "double";
  c3_info[6].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c3_info[6].fileLength = 403U;
  c3_info[6].fileTime1 = 1245102420U;
  c3_info[6].fileTime2 = 0U;
  c3_info[7].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c3_info[7].name = "gt";
  c3_info[7].dominantType = "double";
  c3_info[7].resolved = "[B]gt";
  c3_info[7].fileLength = 0U;
  c3_info[7].fileTime1 = 0U;
  c3_info[7].fileTime2 = 0U;
  c3_info[8].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c3_info[8].name = "isa";
  c3_info[8].dominantType = "double";
  c3_info[8].resolved = "[B]isa";
  c3_info[8].fileLength = 0U;
  c3_info[8].fileTime1 = 0U;
  c3_info[8].fileTime2 = 0U;
  c3_info[9].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m";
  c3_info[9].name = "eml_div";
  c3_info[9].dominantType = "double";
  c3_info[9].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m";
  c3_info[9].fileLength = 4918U;
  c3_info[9].fileTime1 = 1267063410U;
  c3_info[9].fileTime2 = 0U;
  c3_info[10].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m";
  c3_info[10].name = "isinteger";
  c3_info[10].dominantType = "double";
  c3_info[10].resolved = "[B]isinteger";
  c3_info[10].fileLength = 0U;
  c3_info[10].fileTime1 = 0U;
  c3_info[10].fileTime2 = 0U;
  c3_info[11].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m!eml_fldiv";
  c3_info[11].name = "isreal";
  c3_info[11].dominantType = "double";
  c3_info[11].resolved = "[B]isreal";
  c3_info[11].fileLength = 0U;
  c3_info[11].fileTime1 = 0U;
  c3_info[11].fileTime2 = 0U;
  c3_info[12].context = "";
  c3_info[12].name = "zeros";
  c3_info[12].dominantType = "double";
  c3_info[12].resolved = "[B]zeros";
  c3_info[12].fileLength = 0U;
  c3_info[12].fileTime1 = 0U;
  c3_info[12].fileTime2 = 0U;
  c3_info[13].context = "";
  c3_info[13].name = "mpower";
  c3_info[13].dominantType = "double";
  c3_info[13].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c3_info[13].fileLength = 3710U;
  c3_info[13].fileTime1 = 1238434288U;
  c3_info[13].fileTime2 = 0U;
  c3_info[14].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c3_info[14].name = "ndims";
  c3_info[14].dominantType = "double";
  c3_info[14].resolved = "[B]ndims";
  c3_info[14].fileLength = 0U;
  c3_info[14].fileTime1 = 0U;
  c3_info[14].fileTime2 = 0U;
  c3_info[15].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c3_info[15].name = "eq";
  c3_info[15].dominantType = "double";
  c3_info[15].resolved = "[B]eq";
  c3_info[15].fileLength = 0U;
  c3_info[15].fileTime1 = 0U;
  c3_info[15].fileTime2 = 0U;
  c3_info[16].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m";
  c3_info[16].name = "power";
  c3_info[16].dominantType = "double";
  c3_info[16].resolved = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c3_info[16].fileLength = 5380U;
  c3_info[16].fileTime1 = 1228093898U;
  c3_info[16].fileTime2 = 0U;
  c3_info[17].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c3_info[17].name = "eml_scalar_eg";
  c3_info[17].dominantType = "double";
  c3_info[17].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m";
  c3_info[17].fileLength = 3068U;
  c3_info[17].fileTime1 = 1240262010U;
  c3_info[17].fileTime2 = 0U;
  c3_info[18].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m!any_enums";
  c3_info[18].name = "false";
  c3_info[18].dominantType = "";
  c3_info[18].resolved = "[B]false";
  c3_info[18].fileLength = 0U;
  c3_info[18].fileTime1 = 0U;
  c3_info[18].fileTime2 = 0U;
  c3_info[19].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m";
  c3_info[19].name = "isstruct";
  c3_info[19].dominantType = "double";
  c3_info[19].resolved = "[B]isstruct";
  c3_info[19].fileLength = 0U;
  c3_info[19].fileTime1 = 0U;
  c3_info[19].fileTime2 = 0U;
  c3_info[20].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m!zerosum";
  c3_info[20].name = "class";
  c3_info[20].dominantType = "double";
  c3_info[20].resolved = "[B]class";
  c3_info[20].fileLength = 0U;
  c3_info[20].fileTime1 = 0U;
  c3_info[20].fileTime2 = 0U;
  c3_info[21].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m!zerosum";
  c3_info[21].name = "cast";
  c3_info[21].dominantType = "double";
  c3_info[21].resolved = "[B]cast";
  c3_info[21].fileLength = 0U;
  c3_info[21].fileTime1 = 0U;
  c3_info[21].fileTime2 = 0U;
  c3_info[22].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m!zerosum";
  c3_info[22].name = "plus";
  c3_info[22].dominantType = "double";
  c3_info[22].resolved = "[B]plus";
  c3_info[22].fileLength = 0U;
  c3_info[22].fileTime1 = 0U;
  c3_info[22].fileTime2 = 0U;
  c3_info[23].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c3_info[23].name = "eml_scalexp_alloc";
  c3_info[23].dominantType = "double";
  c3_info[23].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m";
  c3_info[23].fileLength = 932U;
  c3_info[23].fileTime1 = 1261951870U;
  c3_info[23].fileTime2 = 0U;
  c3_info[24].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m";
  c3_info[24].name = "not";
  c3_info[24].dominantType = "logical";
  c3_info[24].resolved = "[B]not";
  c3_info[24].fileLength = 0U;
  c3_info[24].fileTime1 = 0U;
  c3_info[24].fileTime2 = 0U;
  c3_info[25].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c3_info[25].name = "lt";
  c3_info[25].dominantType = "double";
  c3_info[25].resolved = "[B]lt";
  c3_info[25].fileLength = 0U;
  c3_info[25].fileTime1 = 0U;
  c3_info[25].fileTime2 = 0U;
  c3_info[26].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c3_info[26].name = "eml_scalar_floor";
  c3_info[26].dominantType = "double";
  c3_info[26].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m";
  c3_info[26].fileLength = 260U;
  c3_info[26].fileTime1 = 1209330790U;
  c3_info[26].fileTime2 = 0U;
  c3_info[27].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c3_info[27].name = "ne";
  c3_info[27].dominantType = "double";
  c3_info[27].resolved = "[B]ne";
  c3_info[27].fileLength = 0U;
  c3_info[27].fileTime1 = 0U;
  c3_info[27].fileTime2 = 0U;
  c3_info[28].context = "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m";
  c3_info[28].name = "eml_error";
  c3_info[28].dominantType = "char";
  c3_info[28].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_error.m";
  c3_info[28].fileLength = 315U;
  c3_info[28].fileTime1 = 1213926744U;
  c3_info[28].fileTime2 = 0U;
  c3_info[29].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_error.m";
  c3_info[29].name = "strcmp";
  c3_info[29].dominantType = "char";
  c3_info[29].resolved = "[B]strcmp";
  c3_info[29].fileLength = 0U;
  c3_info[29].fileTime1 = 0U;
  c3_info[29].fileTime2 = 0U;
  c3_info[30].context = "";
  c3_info[30].name = "round";
  c3_info[30].dominantType = "double";
  c3_info[30].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/round.m";
  c3_info[30].fileLength = 331U;
  c3_info[30].fileTime1 = 1203448036U;
  c3_info[30].fileTime2 = 0U;
  c3_info[31].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/round.m";
  c3_info[31].name = "eml_scalar_round";
  c3_info[31].dominantType = "double";
  c3_info[31].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_round.m";
  c3_info[31].fileLength = 523U;
  c3_info[31].fileTime1 = 1203448008U;
  c3_info[31].fileTime2 = 0U;
  c3_info[32].context =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_round.m";
  c3_info[32].name = "isfloat";
  c3_info[32].dominantType = "double";
  c3_info[32].resolved = "[B]isfloat";
  c3_info[32].fileLength = 0U;
  c3_info[32].fileTime1 = 0U;
  c3_info[32].fileTime2 = 0U;
  c3_info[33].context = "";
  c3_info[33].name = "mtimes";
  c3_info[33].dominantType = "double";
  c3_info[33].resolved =
    "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mtimes.m";
  c3_info[33].fileLength = 3425U;
  c3_info[33].fileTime1 = 1251031872U;
  c3_info[33].fileTime2 = 0U;
  c3_info[34].context = "";
  c3_info[34].name = "uminus";
  c3_info[34].dominantType = "double";
  c3_info[34].resolved = "[B]uminus";
  c3_info[34].fileLength = 0U;
  c3_info[34].fileTime1 = 0U;
  c3_info[34].fileTime2 = 0U;
}

static const mxArray *c3_g_sf_marshall(void *chartInstanceVoid, void *c3_u)
{
  const mxArray *c3_y = NULL;
  boolean_T c3_b_u;
  const mxArray *c3_b_y = NULL;
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)chartInstanceVoid;
  c3_y = NULL;
  c3_b_u = *((boolean_T *)c3_u);
  c3_b_y = NULL;
  sf_mex_assign(&c3_b_y, sf_mex_create("y", &c3_b_u, 11, 0U, 0U, 0U, 0));
  sf_mex_assign(&c3_y, c3_b_y);
  return c3_y;
}

static void c3_emlrt_marshallIn(SFc3_entalInstanceStruct *chartInstance, const
  mxArray *c3_uu, const char_T *c3_name, real_T c3_y[
  7185])
{
  real_T c3_dv1[7185];
  int32_T c3_i54;
  sf_mex_import(c3_name, sf_mex_dup(c3_uu), c3_dv1, 1, 0, 0U, 1, 0U, 2, 15, 479);
  for (c3_i54 = 0; c3_i54 < 7185; c3_i54 = c3_i54 + 1) {
    c3_y[c3_i54] = c3_dv1[c3_i54];
  }

  sf_mex_destroy(&c3_uu);
}

static uint8_T c3_b_emlrt_marshallIn(SFc3_entalInstanceStruct *chartInstance,
  const mxArray *c3_b_is_active_c3_ental, const char_T *
  c3_name)
{
  uint8_T c3_y;
  uint8_T c3_u0;
  sf_mex_import(c3_name, sf_mex_dup(c3_b_is_active_c3_ental), &c3_u0, 1, 3, 0U,
                0, 0U, 0);
  c3_y = c3_u0;
  sf_mex_destroy(&c3_b_is_active_c3_ental);
  return c3_y;
}

static void init_dsm_address_info(SFc3_entalInstanceStruct *chartInstance)
{
}

/* SFunction Glue Code */
void sf_c3_ental_get_check_sum(mxArray *plhs[])
{
  ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3972337413U);
  ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(1486499505U);
  ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2444517600U);
  ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(513012286U);
}

mxArray *sf_c3_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)(3294092197U);
    pr[1] = (double)(3618817561U);
    pr[2] = (double)(3916039286U);
    pr[3] = (double)(67928243U);
    mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
  }

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

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

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(15);
      pr[1] = (double)(479);
      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)(1600);
      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)(479);
      pr[1] = (double)(6);
      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)(479);
      pr[1] = (double)(6);
      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)(1);
      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)(1);
      pr[1] = (double)(479);
      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)(1);
      pr[1] = (double)(479);
      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));
    mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
  }

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

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

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

    {
      mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
      double *pr = mxGetPr(mxSize);
      pr[0] = (double)(15);
      pr[1] = (double)(479);
      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));
    mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData);
  }

  return(mxAutoinheritanceInfo);
}

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

  mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields);
  const char *infoEncStr[] = {
    "100 S1x2'type','srcId','name','auxInfo'{{M[1],M[5],T\"uu\",},{M[8],M[0],T\"is_active_c3_ental\",}}"
  };

  mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 2, 10);
  mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL);
  sf_c3_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)) {
    SFc3_entalInstanceStruct *chartInstance;
    chartInstance = (SFc3_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_,
          3,
          1,
          1,
          11,
          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,"u");
          _SFD_SET_DATA_PROPS(1,2,0,1,"uu");
          _SFD_SET_DATA_PROPS(2,1,1,0,"lambda");
          _SFD_SET_DATA_PROPS(3,1,1,0,"matV");
          _SFD_SET_DATA_PROPS(4,1,1,0,"matM");
          _SFD_SET_DATA_PROPS(5,1,1,0,"V");
          _SFD_SET_DATA_PROPS(6,1,1,0,"qqV");
          _SFD_SET_DATA_PROPS(7,1,1,0,"qqM");
          _SFD_SET_DATA_PROPS(8,1,1,0,"Tw");
          _SFD_SET_DATA_PROPS(9,1,1,0,"Tinf");
          _SFD_SET_DATA_PROPS(10,1,1,0,"TS");
          _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,6,0,0,3,0,0,0);
        _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,4243);
        _SFD_CV_INIT_EML_IF(0,0,2207,2222,2306,3053);
        _SFD_CV_INIT_EML_IF(0,1,2306,2325,2721,3053);
        _SFD_CV_INIT_EML_IF(0,2,2334,2349,2418,2716);
        _SFD_CV_INIT_EML_IF(0,3,3260,3275,3355,4094);
        _SFD_CV_INIT_EML_IF(0,4,3355,3374,3762,4094);
        _SFD_CV_INIT_EML_IF(0,5,3383,3398,3463,3757);
        _SFD_CV_INIT_EML_FOR(0,0,215,227,292);
        _SFD_CV_INIT_EML_FOR(0,1,1387,1399,4243);
        _SFD_CV_INIT_EML_FOR(0,2,1403,1415,2140);
        _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[2];
          dimVector[0]= 15;
          dimVector[1]= 479;
          _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,2,&(dimVector[0]),0,0,0,0.0,
            1.0,0,0,(MexFcnForType)c3_sf_marshall);
        }

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

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

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

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

        _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
          (MexFcnForType)c3_b_sf_marshall);

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

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

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

        {
          real_T *c3_V;
          real_T *c3_Tw;
          real_T *c3_Tinf;
          real_T *c3_TS;
          real_T (*c3_u)[7185];
          real_T (*c3_uu)[7185];
          real_T (*c3_lambda)[1600];
          real_T (*c3_matV)[2874];
          real_T (*c3_matM)[2874];
          real_T (*c3_qqV)[479];
          real_T (*c3_qqM)[479];
          c3_TS = (real_T *)ssGetInputPortSignal(chartInstance->S, 9);
          c3_Tinf = (real_T *)ssGetInputPortSignal(chartInstance->S, 8);
          c3_Tw = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
          c3_qqM = (real_T (*)[479])ssGetInputPortSignal(chartInstance->S, 6);
          c3_qqV = (real_T (*)[479])ssGetInputPortSignal(chartInstance->S, 5);
          c3_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 4);
          c3_matM = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 3);
          c3_matV = (real_T (*)[2874])ssGetInputPortSignal(chartInstance->S, 2);
          c3_lambda = (real_T (*)[1600])ssGetInputPortSignal(chartInstance->S, 1);
          c3_uu = (real_T (*)[7185])ssGetOutputPortSignal(chartInstance->S, 1);
          c3_u = (real_T (*)[7185])ssGetInputPortSignal(chartInstance->S, 0);
          _SFD_SET_DATA_VALUE_PTR(0U, *c3_u);
          _SFD_SET_DATA_VALUE_PTR(1U, *c3_uu);
          _SFD_SET_DATA_VALUE_PTR(2U, *c3_lambda);
          _SFD_SET_DATA_VALUE_PTR(3U, *c3_matV);
          _SFD_SET_DATA_VALUE_PTR(4U, *c3_matM);
          _SFD_SET_DATA_VALUE_PTR(5U, c3_V);
          _SFD_SET_DATA_VALUE_PTR(6U, *c3_qqV);
          _SFD_SET_DATA_VALUE_PTR(7U, *c3_qqM);
          _SFD_SET_DATA_VALUE_PTR(8U, c3_Tw);
          _SFD_SET_DATA_VALUE_PTR(9U, c3_Tinf);
          _SFD_SET_DATA_VALUE_PTR(10U, c3_TS);
        }
      }
    } else {
      sf_debug_reset_current_state_configuration(_entalMachineNumber_,
        chartInstance->chartNumber,chartInstance->instanceNumber);
    }
  }
}

static void sf_opaque_initialize_c3_ental(void *chartInstanceVar)
{
  chart_debug_initialization(((SFc3_entalInstanceStruct*) chartInstanceVar)->S,0);
  initialize_params_c3_ental((SFc3_entalInstanceStruct*) chartInstanceVar);
  initialize_c3_ental((SFc3_entalInstanceStruct*) chartInstanceVar);
}

static void sf_opaque_enable_c3_ental(void *chartInstanceVar)
{
  enable_c3_ental((SFc3_entalInstanceStruct*) chartInstanceVar);
}

static void sf_opaque_disable_c3_ental(void *chartInstanceVar)
{
  disable_c3_ental((SFc3_entalInstanceStruct*) chartInstanceVar);
}

static void sf_opaque_gateway_c3_ental(void *chartInstanceVar)
{
  sf_c3_ental((SFc3_entalInstanceStruct*) chartInstanceVar);
}

static mxArray* sf_internal_get_sim_state_c3_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_c3_ental((SFc3_entalInstanceStruct*)
    chartInfo->chartInstance);         /* raw sim ctx */
  prhs[3] = sf_get_sim_state_info_c3_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_c3_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_c3_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_c3_ental((SFc3_entalInstanceStruct*)chartInfo->chartInstance,
    mxDuplicateArray(plhs[0]));
  mxDestroyArray(plhs[0]);
}

static mxArray* sf_opaque_get_sim_state_c3_ental(SimStruct* S)
{
  return sf_internal_get_sim_state_c3_ental(S);
}

static void sf_opaque_set_sim_state_c3_ental(SimStruct* S, const mxArray *st)
{
  sf_internal_set_sim_state_c3_ental(S, st);
}

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

    finalize_c3_ental((SFc3_entalInstanceStruct*) chartInstanceVar);
    free((void *)chartInstanceVar);
    ssSetUserData(S,NULL);
  }
}

static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar)
{
  compInitSubchartSimstructsFcn_c3_ental((SFc3_entalInstanceStruct*)
    chartInstanceVar);
}

extern unsigned int sf_machine_global_initializer_called(void);
static void mdlProcessParameters_c3_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_c3_ental((SFc3_entalInstanceStruct*)(((ChartInfoStruct *)
      ssGetUserData(S))->chartInstance));
  }
}

static void mdlSetWorkWidths_c3_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",3);
    ssSetStateflowIsInlinable(S,chartIsInlinable);
    ssSetRTWCG(S,sf_rtw_info_uint_prop(S,"ental","ental",3,"RTWCG"));
    ssSetEnableFcnIsTrivial(S,1);
    ssSetDisableFcnIsTrivial(S,1);
    ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop(S,"ental","ental",3,
      "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);
      sf_mark_chart_expressionable_inputs(S,"ental","ental",3,10);
      sf_mark_chart_reusable_outputs(S,"ental","ental",3,1);
    }

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

  ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
  ssSetChecksum0(S,(994378867U));
  ssSetChecksum1(S,(1802164346U));
  ssSetChecksum2(S,(2317431181U));
  ssSetChecksum3(S,(2988826237U));
  ssSetmdlDerivatives(S, NULL);
  ssSetExplicitFCSSCtrl(S,1);
}

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

static void mdlStart_c3_ental(SimStruct *S)
{
  SFc3_entalInstanceStruct *chartInstance;
  chartInstance = (SFc3_entalInstanceStruct *)malloc(sizeof
    (SFc3_entalInstanceStruct));
  memset(chartInstance, 0, sizeof(SFc3_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_c3_ental;
  chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c3_ental;
  chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c3_ental;
  chartInstance->chartInfo.enableChart = sf_opaque_enable_c3_ental;
  chartInstance->chartInfo.disableChart = sf_opaque_disable_c3_ental;
  chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c3_ental;
  chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c3_ental;
  chartInstance->chartInfo.getSimStateInfo = sf_get_sim_state_info_c3_ental;
  chartInstance->chartInfo.zeroCrossings = NULL;
  chartInstance->chartInfo.outputs = NULL;
  chartInstance->chartInfo.derivatives = NULL;
  chartInstance->chartInfo.mdlRTW = mdlRTW_c3_ental;
  chartInstance->chartInfo.mdlStart = mdlStart_c3_ental;
  chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c3_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 c3_ental_method_dispatcher(SimStruct *S, int_T method, void *data)
{
  switch (method) {
   case SS_CALL_MDL_START:
    mdlStart_c3_ental(S);
    break;

   case SS_CALL_MDL_SET_WORK_WIDTHS:
    mdlSetWorkWidths_c3_ental(S);
    break;

   case SS_CALL_MDL_PROCESS_PARAMETERS:
    mdlProcessParameters_c3_ental(S);
    break;

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