/* Include files */

#include "ental_sfun.h"
#include "c1_ental.h"
#include "c2_ental.h"
#include "c3_ental.h"
#include "c4_ental.h"
#include "c5_ental.h"
#include "c6_ental.h"
#include "c7_ental.h"
#include "c8_ental.h"
#include "c9_ental.h"
#include "c10_ental.h"
#include "c11_ental.h"
#include "c12_ental.h"
#include "c13_ental.h"
#include "c14_ental.h"
#include "c15_ental.h"
#include "c16_ental.h"
#include "c17_ental.h"
#include "c18_ental.h"
#include "c21_ental.h"
#include "c81_ental.h"
#include "c94_ental.h"

/* Type Definitions */

/* Named Constants */

/* Variable Declarations */

/* Variable Definitions */
int32_T _sfEvent_;
uint32_T _entalMachineNumber_;
real_T _sfTime_;

/* Function Declarations */

/* Function Definitions */
void ental_initializer(void)
{
  _sfEvent_ = CALL_EVENT;
}

void ental_terminator(void)
{
}

/* SFunction Glue Code */
unsigned int sf_ental_method_dispatcher(SimStruct *simstructPtr, unsigned int
  chartFileNumber, const char* specsCksum, int_T method, void *data)
{
  if (chartFileNumber==1) {
    c1_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==2) {
    c2_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==3) {
    c3_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==4) {
    c4_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==5) {
    c5_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==6) {
    c6_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==7) {
    c7_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==8) {
    c8_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==9) {
    c9_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==10) {
    c10_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==11) {
    c11_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==12) {
    c12_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==13) {
    c13_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==14) {
    c14_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==15) {
    c15_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==16) {
    c16_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==17) {
    c17_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==18) {
    c18_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==21) {
    c21_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==81) {
    c81_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  if (chartFileNumber==94) {
    c94_ental_method_dispatcher(simstructPtr, method, data);
    return 1;
  }

  return 0;
}

unsigned int sf_ental_process_check_sum_call( int nlhs, mxArray * plhs[], int
  nrhs, const mxArray * prhs[] )
{

#ifdef MATLAB_MEX_FILE

  char commandName[20];
  if (nrhs<1 || !mxIsChar(prhs[0]) )
    return 0;

  /* Possible call to get the checksum */
  mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char));
  commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
  if (strcmp(commandName,"sf_get_check_sum"))
    return 0;
  plhs[0] = mxCreateDoubleMatrix( 1,4,mxREAL);
  if (nrhs>1 && mxIsChar(prhs[1])) {
    mxGetString(prhs[1], commandName,sizeof(commandName)/sizeof(char));
    commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
    if (!strcmp(commandName,"machine")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(1077497743U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(1811242668U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2735172046U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(2164972372U);
    } else if (!strcmp(commandName,"exportedFcn")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0U);
    } else if (!strcmp(commandName,"makefile")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(280059829U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(2540218940U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(89407523U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(178022757U);
    } else if (nrhs==3 && !strcmp(commandName,"chart")) {
      unsigned int chartFileNumber;
      chartFileNumber = (unsigned int)mxGetScalar(prhs[2]);
      switch (chartFileNumber) {
       case 1:
        {
          extern void sf_c1_ental_get_check_sum(mxArray *plhs[]);
          sf_c1_ental_get_check_sum(plhs);
          break;
        }

       case 2:
        {
          extern void sf_c2_ental_get_check_sum(mxArray *plhs[]);
          sf_c2_ental_get_check_sum(plhs);
          break;
        }

       case 3:
        {
          extern void sf_c3_ental_get_check_sum(mxArray *plhs[]);
          sf_c3_ental_get_check_sum(plhs);
          break;
        }

       case 4:
        {
          extern void sf_c4_ental_get_check_sum(mxArray *plhs[]);
          sf_c4_ental_get_check_sum(plhs);
          break;
        }

       case 5:
        {
          extern void sf_c5_ental_get_check_sum(mxArray *plhs[]);
          sf_c5_ental_get_check_sum(plhs);
          break;
        }

       case 6:
        {
          extern void sf_c6_ental_get_check_sum(mxArray *plhs[]);
          sf_c6_ental_get_check_sum(plhs);
          break;
        }

       case 7:
        {
          extern void sf_c7_ental_get_check_sum(mxArray *plhs[]);
          sf_c7_ental_get_check_sum(plhs);
          break;
        }

       case 8:
        {
          extern void sf_c8_ental_get_check_sum(mxArray *plhs[]);
          sf_c8_ental_get_check_sum(plhs);
          break;
        }

       case 9:
        {
          extern void sf_c9_ental_get_check_sum(mxArray *plhs[]);
          sf_c9_ental_get_check_sum(plhs);
          break;
        }

       case 10:
        {
          extern void sf_c10_ental_get_check_sum(mxArray *plhs[]);
          sf_c10_ental_get_check_sum(plhs);
          break;
        }

       case 11:
        {
          extern void sf_c11_ental_get_check_sum(mxArray *plhs[]);
          sf_c11_ental_get_check_sum(plhs);
          break;
        }

       case 12:
        {
          extern void sf_c12_ental_get_check_sum(mxArray *plhs[]);
          sf_c12_ental_get_check_sum(plhs);
          break;
        }

       case 13:
        {
          extern void sf_c13_ental_get_check_sum(mxArray *plhs[]);
          sf_c13_ental_get_check_sum(plhs);
          break;
        }

       case 14:
        {
          extern void sf_c14_ental_get_check_sum(mxArray *plhs[]);
          sf_c14_ental_get_check_sum(plhs);
          break;
        }

       case 15:
        {
          extern void sf_c15_ental_get_check_sum(mxArray *plhs[]);
          sf_c15_ental_get_check_sum(plhs);
          break;
        }

       case 16:
        {
          extern void sf_c16_ental_get_check_sum(mxArray *plhs[]);
          sf_c16_ental_get_check_sum(plhs);
          break;
        }

       case 17:
        {
          extern void sf_c17_ental_get_check_sum(mxArray *plhs[]);
          sf_c17_ental_get_check_sum(plhs);
          break;
        }

       case 18:
        {
          extern void sf_c18_ental_get_check_sum(mxArray *plhs[]);
          sf_c18_ental_get_check_sum(plhs);
          break;
        }

       case 21:
        {
          extern void sf_c21_ental_get_check_sum(mxArray *plhs[]);
          sf_c21_ental_get_check_sum(plhs);
          break;
        }

       case 81:
        {
          extern void sf_c81_ental_get_check_sum(mxArray *plhs[]);
          sf_c81_ental_get_check_sum(plhs);
          break;
        }

       case 94:
        {
          extern void sf_c94_ental_get_check_sum(mxArray *plhs[]);
          sf_c94_ental_get_check_sum(plhs);
          break;
        }

       default:
        ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(0.0);
        ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(0.0);
      }
    } else if (!strcmp(commandName,"target")) {
      ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(2985224750U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(302652852U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2173512830U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1574125905U);
    } else {
      return 0;
    }
  } else {
    ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(1807948703U);
    ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(2568481849U);
    ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(677232365U);
    ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(4063781583U);
  }

  return 1;

#else

  return 0;

#endif

}

unsigned int sf_ental_autoinheritance_info( int nlhs, mxArray * plhs[], int nrhs,
  const mxArray * prhs[] )
{

#ifdef MATLAB_MEX_FILE

  char commandName[32];
  if (nrhs<2 || !mxIsChar(prhs[0]) )
    return 0;

  /* Possible call to get the autoinheritance_info */
  mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char));
  commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
  if (strcmp(commandName,"get_autoinheritance_info"))
    return 0;

  {
    unsigned int chartFileNumber;
    chartFileNumber = (unsigned int)mxGetScalar(prhs[1]);
    switch (chartFileNumber) {
     case 1:
      {
        extern mxArray *sf_c1_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c1_ental_get_autoinheritance_info();
        break;
      }

     case 2:
      {
        extern mxArray *sf_c2_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c2_ental_get_autoinheritance_info();
        break;
      }

     case 3:
      {
        extern mxArray *sf_c3_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c3_ental_get_autoinheritance_info();
        break;
      }

     case 4:
      {
        extern mxArray *sf_c4_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c4_ental_get_autoinheritance_info();
        break;
      }

     case 5:
      {
        extern mxArray *sf_c5_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c5_ental_get_autoinheritance_info();
        break;
      }

     case 6:
      {
        extern mxArray *sf_c6_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c6_ental_get_autoinheritance_info();
        break;
      }

     case 7:
      {
        extern mxArray *sf_c7_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c7_ental_get_autoinheritance_info();
        break;
      }

     case 8:
      {
        extern mxArray *sf_c8_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c8_ental_get_autoinheritance_info();
        break;
      }

     case 9:
      {
        extern mxArray *sf_c9_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c9_ental_get_autoinheritance_info();
        break;
      }

     case 10:
      {
        extern mxArray *sf_c10_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c10_ental_get_autoinheritance_info();
        break;
      }

     case 11:
      {
        extern mxArray *sf_c11_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c11_ental_get_autoinheritance_info();
        break;
      }

     case 12:
      {
        extern mxArray *sf_c12_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c12_ental_get_autoinheritance_info();
        break;
      }

     case 13:
      {
        extern mxArray *sf_c13_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c13_ental_get_autoinheritance_info();
        break;
      }

     case 14:
      {
        extern mxArray *sf_c14_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c14_ental_get_autoinheritance_info();
        break;
      }

     case 15:
      {
        extern mxArray *sf_c15_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c15_ental_get_autoinheritance_info();
        break;
      }

     case 16:
      {
        extern mxArray *sf_c16_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c16_ental_get_autoinheritance_info();
        break;
      }

     case 17:
      {
        extern mxArray *sf_c17_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c17_ental_get_autoinheritance_info();
        break;
      }

     case 18:
      {
        extern mxArray *sf_c18_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c18_ental_get_autoinheritance_info();
        break;
      }

     case 21:
      {
        extern mxArray *sf_c21_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c21_ental_get_autoinheritance_info();
        break;
      }

     case 81:
      {
        extern mxArray *sf_c81_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c81_ental_get_autoinheritance_info();
        break;
      }

     case 94:
      {
        extern mxArray *sf_c94_ental_get_autoinheritance_info(void);
        plhs[0] = sf_c94_ental_get_autoinheritance_info();
        break;
      }

     default:
      plhs[0] = mxCreateDoubleMatrix(0,0,mxREAL);
    }
  }

  return 1;

#else

  return 0;

#endif

}

unsigned int sf_ental_get_eml_resolved_functions_info( int nlhs, mxArray * plhs[],
  int nrhs, const mxArray * prhs[] )
{

#ifdef MATLAB_MEX_FILE

  char commandName[64];
  if (nrhs<2 || !mxIsChar(prhs[0]))
    return 0;

  /* Possible call to get the get_eml_resolved_functions_info */
  mxGetString(prhs[0], commandName,sizeof(commandName)/sizeof(char));
  commandName[(sizeof(commandName)/sizeof(char)-1)] = '\0';
  if (strcmp(commandName,"get_eml_resolved_functions_info"))
    return 0;

  {
    unsigned int chartFileNumber;
    chartFileNumber = (unsigned int)mxGetScalar(prhs[1]);
    switch (chartFileNumber) {
     case 1:
      {
        extern const mxArray *sf_c1_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c1_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 2:
      {
        extern const mxArray *sf_c2_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c2_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 3:
      {
        extern const mxArray *sf_c3_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c3_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 4:
      {
        extern const mxArray *sf_c4_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c4_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 5:
      {
        extern const mxArray *sf_c5_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c5_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 6:
      {
        extern const mxArray *sf_c6_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c6_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 7:
      {
        extern const mxArray *sf_c7_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c7_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 8:
      {
        extern const mxArray *sf_c8_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c8_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 9:
      {
        extern const mxArray *sf_c9_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c9_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 10:
      {
        extern const mxArray *sf_c10_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c10_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 11:
      {
        extern const mxArray *sf_c11_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c11_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 12:
      {
        extern const mxArray *sf_c12_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c12_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 13:
      {
        extern const mxArray *sf_c13_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c13_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 14:
      {
        extern const mxArray *sf_c14_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c14_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 15:
      {
        extern const mxArray *sf_c15_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c15_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 16:
      {
        extern const mxArray *sf_c16_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c16_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 17:
      {
        extern const mxArray *sf_c17_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c17_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 18:
      {
        extern const mxArray *sf_c18_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c18_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 21:
      {
        extern const mxArray *sf_c21_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c21_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 81:
      {
        extern const mxArray *sf_c81_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c81_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     case 94:
      {
        extern const mxArray *sf_c94_ental_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c94_ental_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

     default:
      plhs[0] = mxCreateDoubleMatrix(0,0,mxREAL);
    }
  }

  return 1;

#else

  return 0;

#endif

}

void ental_debug_initialize(void)
{
  _entalMachineNumber_ = sf_debug_initialize_machine("ental","sfun",0,21,0,0,0);
  sf_debug_set_machine_event_thresholds(_entalMachineNumber_,0,0);
  sf_debug_set_machine_data_thresholds(_entalMachineNumber_,0);
}

void ental_register_exported_symbols(SimStruct* S)
{
}
