/* Include files */

#include "Hunt_crossley_Ident_sfun.h"
#include "c1_Hunt_crossley_Ident.h"
#include "c2_Hunt_crossley_Ident.h"
#include "c3_Hunt_crossley_Ident.h"
#include "c4_Hunt_crossley_Ident.h"
#include "c5_Hunt_crossley_Ident.h"
#include "c6_Hunt_crossley_Ident.h"
#include "c7_Hunt_crossley_Ident.h"
#include "c8_Hunt_crossley_Ident.h"
#include "c10_Hunt_crossley_Ident.h"

/* Type Definitions */

/* Named Constants */

/* Variable Declarations */

/* Variable Definitions */
uint32_T _Hunt_crossley_IdentMachineNumber_;
real_T _sfTime_;

/* Function Declarations */

/* Function Definitions */
void Hunt_crossley_Ident_initializer(void)
{
}

void Hunt_crossley_Ident_terminator(void)
{
}

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

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

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

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

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

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

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

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

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

  return 0;
}

unsigned int sf_Hunt_crossley_Ident_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)(2164364093U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(390727287U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(2844688944U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(3139109972U);
    } 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)(3730777359U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(924426626U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(3287003485U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1259996079U);
    } else if (nrhs==3 && !strcmp(commandName,"chart")) {
      unsigned int chartFileNumber;
      chartFileNumber = (unsigned int)mxGetScalar(prhs[2]);
      switch (chartFileNumber) {
       case 1:
        {
          extern void sf_c1_Hunt_crossley_Ident_get_check_sum(mxArray *plhs[]);
          sf_c1_Hunt_crossley_Ident_get_check_sum(plhs);
          break;
        }

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

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

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

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

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

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

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

       case 10:
        {
          extern void sf_c10_Hunt_crossley_Ident_get_check_sum(mxArray *plhs[]);
          sf_c10_Hunt_crossley_Ident_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)(3564696471U);
      ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(678668628U);
      ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(1090454852U);
      ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(3896867807U);
    } else {
      return 0;
    }
  } else {
    ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(3624972297U);
    ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(2351491857U);
    ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(685677045U);
    ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(13800342U);
  }

  return 1;

#else

  return 0;

#endif

}

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

#ifdef MATLAB_MEX_FILE

  char commandName[32];
  char aiChksum[64];
  if (nrhs<3 || !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;
  mxGetString(prhs[2], aiChksum,sizeof(aiChksum)/sizeof(char));
  aiChksum[(sizeof(aiChksum)/sizeof(char)-1)] = '\0';

  {
    unsigned int chartFileNumber;
    chartFileNumber = (unsigned int)mxGetScalar(prhs[1]);
    switch (chartFileNumber) {
     case 1:
      {
        if (strcmp(aiChksum, "91yIviWir9tYzN9YsdpGYE") == 0) {
          extern mxArray *sf_c1_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c1_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 2:
      {
        if (strcmp(aiChksum, "dCXm7A98W3VwVyOee6vVb") == 0) {
          extern mxArray *sf_c2_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c2_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 3:
      {
        if (strcmp(aiChksum, "SfuC4iKkkW89Mm1S7e4fDH") == 0) {
          extern mxArray *sf_c3_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c3_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 4:
      {
        if (strcmp(aiChksum, "dWXSE15wOXgMzB8UXv9ZCF") == 0) {
          extern mxArray *sf_c4_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c4_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 5:
      {
        if (strcmp(aiChksum, "WjnvnzAXbDuwO8cpWQaObD") == 0) {
          extern mxArray *sf_c5_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c5_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 6:
      {
        if (strcmp(aiChksum, "EZLJXcKGz2Po7s7NfYqsFB") == 0) {
          extern mxArray *sf_c6_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c6_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 7:
      {
        if (strcmp(aiChksum, "EZLJXcKGz2Po7s7NfYqsFB") == 0) {
          extern mxArray *sf_c7_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c7_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 8:
      {
        if (strcmp(aiChksum, "f3OAC6X2kNiAo0UyfWeacC") == 0) {
          extern mxArray *sf_c8_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c8_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

     case 10:
      {
        if (strcmp(aiChksum, "U037p1TYKPerbnjYL1wVAB") == 0) {
          extern mxArray *sf_c10_Hunt_crossley_Ident_get_autoinheritance_info
            (void);
          plhs[0] = sf_c10_Hunt_crossley_Ident_get_autoinheritance_info();
          break;
        }

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

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

  return 1;

#else

  return 0;

#endif

}

unsigned int sf_Hunt_crossley_Ident_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_Hunt_crossley_Ident_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c1_Hunt_crossley_Ident_get_eml_resolved_functions_info();
        plhs[0] = mxDuplicateArray(persistentMxArray);
        mxDestroyArray(persistentMxArray);
        break;
      }

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

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

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

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

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

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

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

     case 10:
      {
        extern const mxArray
          *sf_c10_Hunt_crossley_Ident_get_eml_resolved_functions_info(void);
        mxArray *persistentMxArray = (mxArray *)
          sf_c10_Hunt_crossley_Ident_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 Hunt_crossley_Ident_debug_initialize(void)
{
  _Hunt_crossley_IdentMachineNumber_ = sf_debug_initialize_machine(
    "Hunt_crossley_Ident","sfun",0,9,0,0,0);
  sf_debug_set_machine_event_thresholds(_Hunt_crossley_IdentMachineNumber_,0,0);
  sf_debug_set_machine_data_thresholds(_Hunt_crossley_IdentMachineNumber_,0);
}

void Hunt_crossley_Ident_register_exported_symbols(SimStruct* S)
{
}

static mxArray* sRtwOptimizationInfoStruct= NULL;
mxArray* load_Hunt_crossley_Ident_optimization_info(void)
{
  if (sRtwOptimizationInfoStruct==NULL) {
    sRtwOptimizationInfoStruct = sf_load_rtw_optimization_info(
      "Hunt_crossley_Ident", "Hunt_crossley_Ident");
    mexMakeArrayPersistent(sRtwOptimizationInfoStruct);
  }

  return(sRtwOptimizationInfoStruct);
}

void unload_Hunt_crossley_Ident_optimization_info(void)
{
  if (sRtwOptimizationInfoStruct!=NULL) {
    mxDestroyArray(sRtwOptimizationInfoStruct);
    sRtwOptimizationInfoStruct = NULL;
  }
}
