/*
 * File: BCMR_DChrgParaCalc.c
 *
 * Code generated for Simulink model 'BCMR_DChrgParaCalc'.
 *
 * Model version                  : 1.703
 * Simulink Coder version         : 8.11 (R2016b) 25-Aug-2016
 * C/C++ source code generated on : Fri Aug 27 14:36:36 2021
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Infineon->TriCore
 * Code generation objectives:
 *    1. MISRA C:2012 guidelines
 *    2. Execution efficiency
 * Validation result: Not run
 */

#include "BCMR_DChrgParaCalc.h"
#include "BCMR_DChrgParaCalc_private.h"

/* Named constants for Chart: '<S55>/HoldOn' */
#define BCMR_DChrgPa_IN_NO_ACTIVE_CHILD ((uint8_T)0U)
#define BCMR_DChrgParaCal_IN_CurrSwitch ((uint8_T)3U)
#define BCMR_DChrgParaCalc_IN_Abnormal ((uint8_T)1U)
#define BCMR_DChrgParaCalc_IN_CalcDcr  ((uint8_T)1U)
#define BCMR_DChrgParaCalc_IN_CalcIcr  ((uint8_T)2U)
#define BCMR_DChrgParaCalc_IN_ChkTable ((uint8_T)1U)
#define BCMR_DChrgParaCalc_IN_CurrCalc ((uint8_T)2U)
#define BCMR_DChrgParaCalc_IN_End      ((uint8_T)4U)
#define BCMR_DChrgParaCalc_IN_HoldOn   ((uint8_T)3U)
#define BCMR_DChrgParaCalc_IN_Init     ((uint8_T)4U)
#define BCMR_DChrgParaCalc_IN_Init_m   ((uint8_T)5U)
#define BCMR_DChrgParaCalc_IN_Init_mc  ((uint8_T)2U)
#define BCMR_DChrgParaCalc_IN_Normal   ((uint8_T)3U)

/* Named constants for Chart: '<S21>/ParaStep' */
#define BCMR_DChrgParaCal_IN_ParaStep10 ((uint8_T)3U)
#define BCMR_DChrgParaCal_IN_ParaStep11 ((uint8_T)4U)
#define BCMR_DChrgParaCal_IN_ParaStep12 ((uint8_T)5U)
#define BCMR_DChrgParaCal_IN_ParaStep13 ((uint8_T)6U)
#define BCMR_DChrgParaCal_IN_ParaStep14 ((uint8_T)7U)
#define BCMR_DChrgParaCalc_IN_Init_k   ((uint8_T)1U)
#define BCMR_DChrgParaCalc_IN_ParaStep1 ((uint8_T)2U)
#define BCMR_DChrgParaCalc_IN_ParaStep2 ((uint8_T)8U)
#define BCMR_DChrgParaCalc_IN_ParaStep3 ((uint8_T)9U)
#define BCMR_DChrgParaCalc_IN_ParaStep4 ((uint8_T)10U)
#define BCMR_DChrgParaCalc_IN_ParaStep5 ((uint8_T)11U)
#define BCMR_DChrgParaCalc_IN_ParaStep6 ((uint8_T)12U)
#define BCMR_DChrgParaCalc_IN_ParaStep7 ((uint8_T)13U)
#define BCMR_DChrgParaCalc_IN_ParaStep8 ((uint8_T)14U)
#define BCMR_DChrgParaCalc_IN_ParaStep9 ((uint8_T)15U)
#define BCMR_DChrg_IN_NO_ACTIVE_CHILD_n ((uint8_T)0U)

/* Named constants for Chart: '<S21>/ParaStep2' */
#define BCMR_DChrgParaC_IN_ParaStep10_g ((uint8_T)3U)
#define BCMR_DChrgParaC_IN_ParaStep11_c ((uint8_T)4U)
#define BCMR_DChrgParaC_IN_ParaStep12_b ((uint8_T)5U)
#define BCMR_DChrgParaC_IN_ParaStep13_j ((uint8_T)6U)
#define BCMR_DChrgParaC_IN_ParaStep14_m ((uint8_T)7U)
#define BCMR_DChrgParaCa_IN_ParaStep1_o ((uint8_T)2U)
#define BCMR_DChrgParaCa_IN_ParaStep2_c ((uint8_T)8U)
#define BCMR_DChrgParaCa_IN_ParaStep3_f ((uint8_T)9U)
#define BCMR_DChrgParaCa_IN_ParaStep4_f ((uint8_T)10U)
#define BCMR_DChrgParaCa_IN_ParaStep5_h ((uint8_T)11U)
#define BCMR_DChrgParaCa_IN_ParaStep6_b ((uint8_T)12U)
#define BCMR_DChrgParaCa_IN_ParaStep7_a ((uint8_T)13U)
#define BCMR_DChrgParaCa_IN_ParaStep8_k ((uint8_T)14U)
#define BCMR_DChrgParaCa_IN_ParaStep9_c ((uint8_T)15U)
#define BCMR_DChrgParaCalc_IN_Init_p   ((uint8_T)1U)
#define BCMR_DChrg_IN_NO_ACTIVE_CHILD_p ((uint8_T)0U)

/* Named constants for Chart: '<S22>/ParaStep1' */
#define BCMR_DChrgParaC_IN_ParaStep10_b ((uint8_T)3U)
#define BCMR_DChrgParaC_IN_ParaStep11_k ((uint8_T)4U)
#define BCMR_DChrgParaC_IN_ParaStep12_l ((uint8_T)5U)
#define BCMR_DChrgParaC_IN_ParaStep13_c ((uint8_T)6U)
#define BCMR_DChrgParaC_IN_ParaStep14_c ((uint8_T)7U)
#define BCMR_DChrgParaCa_IN_ParaStep1_b ((uint8_T)2U)
#define BCMR_DChrgParaCa_IN_ParaStep2_p ((uint8_T)8U)
#define BCMR_DChrgParaCa_IN_ParaStep3_n ((uint8_T)9U)
#define BCMR_DChrgParaCa_IN_ParaStep4_c ((uint8_T)10U)
#define BCMR_DChrgParaCa_IN_ParaStep5_o ((uint8_T)11U)
#define BCMR_DChrgParaCa_IN_ParaStep6_c ((uint8_T)12U)
#define BCMR_DChrgParaCa_IN_ParaStep7_g ((uint8_T)13U)
#define BCMR_DChrgParaCa_IN_ParaStep8_j ((uint8_T)14U)
#define BCMR_DChrgParaCa_IN_ParaStep9_n ((uint8_T)15U)
#define BCMR_DChrgParaCalc_IN_Init_g   ((uint8_T)1U)
#define BCMR_DChrg_IN_NO_ACTIVE_CHILD_b ((uint8_T)0U)

/* Named constants for Chart: '<S2>/Chart' */
#define BCMR_DChrg_IN_NO_ACTIVE_CHILD_g ((uint8_T)0U)

/* Named constants for Chart: '<S20>/CurrFilt' */
#define BCMR_DChrgParaCalc_IN_Charging ((uint8_T)1U)
#define BCMR_DChrgParaCalc_IN_Init_n   ((uint8_T)2U)
#define BCMR_DChrgParaCalc_IN_ZeroCurr ((uint8_T)3U)

/* Exported block signals */
uint8_T BCMR_numCellVoltFullCnt;       /* '<S86>/Switch1' */
uint8_T CurrMethodMax;                 /* '<S55>/HoldOn' */
boolean_T BCMR_bCellVoltFull;          /* '<S66>/Compare' */
boolean_T BCMR_bCellVoltFullTmrRaw;    /* '<S88>/Logical Operator4' */
boolean_T BCMR_bCellVoltFullTmr;       /* '<S70>/Relational Operator2' */
boolean_T BCMR_flgDChrgFulChkRaw;      /* '<S11>/Logical Operator2' */
boolean_T BCMR_bCellVoltFullCnt;       /* '<S82>/Compare' */
boolean_T BCMR_bCellVoltFullTriger;    /* '<S83>/Compare' */
boolean_T equalFlg;                    /* '<S38>/Relational Operator2' */

/* Exported data definition */
#define ASW1_OEM_START_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"

/* Definition for custom storage class: OutputSignal */
volatile real32_T BCMR_ahAccumDChrgAh;
volatile boolean_T BCMR_bAccumAhDChrgFul;
volatile boolean_T BCMR_bDChrgCurrOutputEna;
volatile boolean_T BCMR_bDChrgCurrReqEna;
volatile boolean_T BCMR_bStakeParaOk;
volatile boolean_T BCMR_flgDChrgFulChk;
volatile boolean_T BCMR_flgDChrgPwrRdc;
volatile real32_T BCMR_iBattDCCurrReqFinal;
volatile real32_T BCMR_iDCCurrReqFil2;
volatile real32_T BCMR_iDCCurrReqRaw[2];
volatile real32_T BCMR_iDChrgBattCurrReqCalc;
volatile real32_T BCMR_iDChrgCalcMax;
volatile real32_T BCMR_iDChrgCalcMix2;
volatile real32_T BCMR_iDChrgCurrReqCalc;
volatile real32_T BCMR_iDChrgLoadCurrReqCalc;
volatile uint8_T BCMR_numDChrgTempStepMax;
volatile uint8_T BCMR_numDChrgTempStepMix2;
volatile uint8_T BCMR_numDChrgVoltStepMax;
volatile uint8_T BCMR_numDChrgVoltStepMix2;
volatile uint8_T BCMR_stDChrgCnnt;
volatile real32_T BCMR_tBattTempMaxFil[2];
volatile real32_T BCMR_uCellVoltMaxFil[2];
volatile real32_T BCMR_uDcChrgVoltReqCalc;

#define ASW1_OEM_STOP_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"

/* Block signals (auto storage) */
B_BCMR_DChrgParaCalc_T BCMR_DChrgParaCalc_B;

/* Block states (auto storage) */
DW_BCMR_DChrgParaCalc_T BCMR_DChrgParaCalc_DW;

/* Previous zero-crossings (trigger) states */
PrevZCX_BCMR_DChrgParaCalc_T BCMR_DChrgParaCalc_PrevZCX;

/* External outputs (root outports fed by signals with auto storage) */
ExtY_BCMR_DChrgParaCalc_T BCMR_DChrgParaCalc_Y;

/* Forward declaration for local functions */
static void BCMR_DChrgParaCalc_ParaStep9(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW);
static void BCMR_DChrgParaCalc_Init(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  B_ParaStep_BCMR_DChrgParaCalc_T *localB, DW_ParaStep_BCMR_DChrgParaCal_T
  *localDW);
static void BCMR_DChrgParaCalc_ParaStep10(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep11(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep12(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep13(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep14(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, boolean_T rtu_BCMR_flgDChrgFulChk,
  B_ParaStep_BCMR_DChrgParaCalc_T *localB, DW_ParaStep_BCMR_DChrgParaCal_T
  *localDW);

/* Forward declaration for local functions */
static void BCMR_DChrgParaCalc_ParaStep9_h(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep10_m(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep11_b(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep12_c(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep13_m(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep14_n(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW);

/* Forward declaration for local functions */
static void BCMR_DChrgParaCalc_ParaStep9_c(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep10_e(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep11_k(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep12_k(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep13_k(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW);
static void BCMR_DChrgParaCalc_ParaStep14_h(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW);

/*
 * System reset for atomic system:
 *    '<S55>/HoldOn'
 *    '<S60>/HoldOn'
 */
void BCMR_DChrgParaCalc_HoldOn_Reset(B_HoldOn_BCMR_DChrgParaCalc_T *localB,
  DW_HoldOn_BCMR_DChrgParaCalc_T *localDW)
{
  localDW->is_ChkTable = BCMR_DChrgPa_IN_NO_ACTIVE_CHILD;
  localDW->is_CurrCalc = BCMR_DChrgPa_IN_NO_ACTIVE_CHILD;
  localDW->temporalCounter_i1 = 0U;
  localDW->is_active_c2_BCMR_DChrgParaCalc = 0U;
  localDW->is_c2_BCMR_DChrgParaCalc = BCMR_DChrgPa_IN_NO_ACTIVE_CHILD;
  localDW->StepKeepL = 0U;
  localDW->StepKeepN = 0U;
  localDW->FirstFlg = false;
  localDW->TableChkFlg = false;
  localDW->VoltStepFlg = false;
  localDW->CurrCompare = 0.0F;
  localDW->TempKeepL = 0U;
  localDW->TempKeepN = 0U;
  localB->CurrCalc = 0.0F;
  localB->CurrMethod = 0U;
}

/*
 * Output and update for atomic system:
 *    '<S55>/HoldOn'
 *    '<S60>/HoldOn'
 */
void BCMR_DChrgParaCalc_HoldOn(uint8_T rtu_VoltStepLast, uint8_T
  rtu_VoltStepNext, uint8_T rtu_TempStep, uint8_T rtu_TempStepL, boolean_T
  rtu_BCMR_bDChrgCoolAbnorm, const real32_T rtu_BCMR_iDcChrgCurrNew_T[196],
  const real32_T rtu_BCMR_iDcChrgCurrAbnorm_T[196], real32_T
  rtu_BCMR_tiHoldOnToCurrCalc_C, B_HoldOn_BCMR_DChrgParaCalc_T *localB,
  DW_HoldOn_BCMR_DChrgParaCalc_T *localDW)
{
  boolean_T guard1 = false;
  if (localDW->temporalCounter_i1 < MAX_uint32_T) {
    localDW->temporalCounter_i1++;
  }

  if (localDW->is_active_c2_BCMR_DChrgParaCalc == 0U) {
    localDW->is_active_c2_BCMR_DChrgParaCalc = 1U;
    localDW->FirstFlg = true;
    localDW->is_c2_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_Init;
    localB->CurrMethod = 0U;
  } else {
    guard1 = false;
    switch (localDW->is_c2_BCMR_DChrgParaCalc) {
     case BCMR_DChrgParaCalc_IN_ChkTable:
      if ((rtu_VoltStepLast < rtu_VoltStepNext) || (rtu_TempStep !=
           rtu_TempStepL)) {
        localDW->is_ChkTable = BCMR_DChrgPa_IN_NO_ACTIVE_CHILD;
        localDW->is_c2_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_HoldOn;
        localDW->temporalCounter_i1 = 0U;
        localDW->StepKeepL = rtu_VoltStepLast;
        localDW->StepKeepN = rtu_VoltStepNext;
        localDW->TempKeepL = rtu_TempStepL;
        localDW->TempKeepN = rtu_TempStep;
        localB->CurrMethod = 1U;
      } else {
        if (localDW->is_ChkTable == BCMR_DChrgParaCalc_IN_Init_mc) {
          if (!rtu_BCMR_bDChrgCoolAbnorm) {
            localDW->is_ChkTable = BCMR_DChrgParaCalc_IN_Normal;
            localB->CurrMethod = 14U;
            localB->CurrCalc = rtu_BCMR_iDcChrgCurrNew_T[14 * rtu_VoltStepNext +
              rtu_TempStep];
          } else {
            localDW->is_ChkTable = BCMR_DChrgParaCalc_IN_Abnormal;
            localB->CurrMethod = 15U;
            localB->CurrCalc = rtu_BCMR_iDcChrgCurrAbnorm_T[14 *
              rtu_VoltStepNext + rtu_TempStep];
          }
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_CurrCalc:
      if (localDW->TableChkFlg) {
        localDW->is_CurrCalc = BCMR_DChrgPa_IN_NO_ACTIVE_CHILD;
        localDW->is_c2_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ChkTable;
        localDW->FirstFlg = false;
        localDW->is_ChkTable = BCMR_DChrgParaCalc_IN_Init_mc;
        localB->CurrMethod = 13U;
      } else if ((rtu_VoltStepLast < rtu_VoltStepNext) || (rtu_TempStep !=
                  rtu_TempStepL)) {
        localDW->FirstFlg = false;
        localDW->VoltStepFlg = true;
        localDW->is_CurrCalc = BCMR_DChrgPa_IN_NO_ACTIVE_CHILD;
        localDW->is_c2_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_HoldOn;
        localDW->temporalCounter_i1 = 0U;
        localDW->StepKeepL = rtu_VoltStepLast;
        localDW->StepKeepN = rtu_VoltStepNext;
        localDW->TempKeepL = rtu_TempStepL;
        localDW->TempKeepN = rtu_TempStep;
        localB->CurrMethod = 1U;
      } else {
        switch (localDW->is_CurrCalc) {
         case BCMR_DChrgParaCalc_IN_CalcDcr:
          if (localB->CurrCalc <= localDW->CurrCompare) {
            localDW->is_CurrCalc = BCMR_DChrgParaCalc_IN_End;
            localB->CurrMethod = 10U;
            localDW->TableChkFlg = true;
          } else {
            localB->CurrCalc -= BCMR_rCurrDcr_C;
          }
          break;

         case BCMR_DChrgParaCalc_IN_CalcIcr:
          if (localB->CurrCalc >= localDW->CurrCompare) {
            localDW->FirstFlg = false;
            localDW->is_CurrCalc = BCMR_DChrgParaCalc_IN_End;
            localB->CurrMethod = 10U;
            localDW->TableChkFlg = true;
          } else {
            localB->CurrCalc += BCMR_rCurrIcr_C;
          }
          break;

         case BCMR_DChrgParaCal_IN_CurrSwitch:
          if (localB->CurrCalc < localDW->CurrCompare) {
            localDW->is_CurrCalc = BCMR_DChrgParaCalc_IN_CalcIcr;
            localB->CurrMethod = 8U;
            localB->CurrCalc += BCMR_rCurrIcr_C;
          } else {
            if (localB->CurrCalc >= localDW->CurrCompare) {
              localDW->is_CurrCalc = BCMR_DChrgParaCalc_IN_CalcDcr;
              localB->CurrMethod = 9U;
              localB->CurrCalc -= BCMR_rCurrDcr_C;
            }
          }
          break;

         case BCMR_DChrgParaCalc_IN_End:
          break;

         default:
          if (localB->CurrMethod == 4) {
            localDW->is_CurrCalc = BCMR_DChrgParaCal_IN_CurrSwitch;
            if (rtu_BCMR_bDChrgCoolAbnorm) {
              localDW->CurrCompare = rtu_BCMR_iDcChrgCurrAbnorm_T[14 *
                localDW->StepKeepN + localDW->TempKeepN];
              localB->CurrMethod = 6U;
            } else {
              localDW->CurrCompare = rtu_BCMR_iDcChrgCurrNew_T[14 *
                localDW->StepKeepN + localDW->TempKeepN];
              localB->CurrMethod = 5U;
            }
          }
          break;
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_HoldOn:
      if (localDW->temporalCounter_i1 >= (uint32_T)ceil
          (rtu_BCMR_tiHoldOnToCurrCalc_C / 0.01F - 1.0E-10F)) {
        localDW->is_c2_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_CurrCalc;
        localDW->TableChkFlg = false;
        localDW->is_CurrCalc = BCMR_DChrgParaCalc_IN_Init_m;
        localB->CurrMethod = 3U;
        if (!localDW->FirstFlg) {
          if (localDW->VoltStepFlg) {
            localDW->VoltStepFlg = false;
          } else if (rtu_BCMR_bDChrgCoolAbnorm) {
            localB->CurrCalc = rtu_BCMR_iDcChrgCurrAbnorm_T[14 *
              localDW->StepKeepL + localDW->TempKeepL];
          } else {
            localB->CurrCalc = rtu_BCMR_iDcChrgCurrNew_T[14 * localDW->StepKeepL
              + localDW->TempKeepL];
          }

          guard1 = true;
        } else {
          if (localDW->FirstFlg) {
            localB->CurrCalc = 0.0F;
            guard1 = true;
          }
        }
      }
      break;

     default:
      if (rtu_VoltStepLast <= rtu_VoltStepNext) {
        localDW->is_c2_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_HoldOn;
        localDW->temporalCounter_i1 = 0U;
        localDW->StepKeepL = rtu_VoltStepLast;
        localDW->StepKeepN = rtu_VoltStepNext;
        localDW->TempKeepL = rtu_TempStepL;
        localDW->TempKeepN = rtu_TempStep;
        localB->CurrMethod = 1U;
      }
      break;
    }

    if (guard1) {
      localB->CurrMethod = 4U;
    }
  }
}

/* Function for Chart: '<S21>/ParaStep' */
static void BCMR_DChrgParaCalc_ParaStep9(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[8]) && (localDW->temporalCounter_i1 >=
       (uint32_T)ceil(BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
    localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep10;
    localDW->temporalCounter_i1 = 0U;
    localB->ParaStep = rtu_BCMR_ParaStep_A[9];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                    guard1 = true;
                  } else {
                    guard8 = true;
                  }
                } else {
                  guard11 = true;
                }
              } else {
                guard13 = true;
              }
            } else {
              guard15 = true;
            }
          } else {
            guard16 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard14 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else {
            guard14 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep8;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep' */
static void BCMR_DChrgParaCalc_Init(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  B_ParaStep_BCMR_DChrgParaCalc_T *localB, DW_ParaStep_BCMR_DChrgParaCal_T
  *localDW)
{
  if ((rtu_BattTemp < rtu_BCMR_BattPara_A[0]) && (localDW->temporalCounter_i1 >=
       300U)) {
    localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
    localDW->temporalCounter_i1 = 0U;
    localB->ParaStep = rtu_BCMR_ParaStep_A[0];
  } else {
    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[0]) {
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[1]) {
        if (rtu_BattTemp >= rtu_BCMR_BattPara_A[2]) {
          if (rtu_BattTemp >= rtu_BCMR_BattPara_A[3]) {
            if (rtu_BattTemp >= rtu_BCMR_BattPara_A[4]) {
              if (rtu_BattTemp >= rtu_BCMR_BattPara_A[5]) {
                if (rtu_BattTemp >= rtu_BCMR_BattPara_A[6]) {
                  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[7]) {
                    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[8]) {
                      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[9]) {
                        if (rtu_BattTemp >= rtu_BCMR_BattPara_A[10]) {
                          if (rtu_BattTemp >= rtu_BCMR_BattPara_A[11]) {
                            if (rtu_BattTemp >= rtu_BCMR_BattPara_A[12]) {
                              if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[13]) &&
                                  (localDW->temporalCounter_i1 >= (uint32_T)ceil
                                   (BCMR_tiDChrgFulWait_C / 0.01F - 1.0E-10F))) {
                                localDW->is_c4_BCMR_DChrgParaCalc =
                                  BCMR_DChrgParaCalc_IN_Init_k;
                                localDW->temporalCounter_i1 = 0U;
                                localB->ParaStep = 0U;
                              } else {
                                localDW->is_c4_BCMR_DChrgParaCalc =
                                  BCMR_DChrgParaCal_IN_ParaStep14;
                                localDW->temporalCounter_i1 = 0U;
                                localB->ParaStep = rtu_BCMR_ParaStep_A[13];
                              }
                            } else {
                              localDW->is_c4_BCMR_DChrgParaCalc =
                                BCMR_DChrgParaCal_IN_ParaStep13;
                              localDW->temporalCounter_i1 = 0U;
                              localB->ParaStep = rtu_BCMR_ParaStep_A[12];
                            }
                          } else {
                            localDW->is_c4_BCMR_DChrgParaCalc =
                              BCMR_DChrgParaCal_IN_ParaStep12;
                            localDW->temporalCounter_i1 = 0U;
                            localB->ParaStep = rtu_BCMR_ParaStep_A[11];
                          }
                        } else {
                          localDW->is_c4_BCMR_DChrgParaCalc =
                            BCMR_DChrgParaCal_IN_ParaStep11;
                          localDW->temporalCounter_i1 = 0U;
                          localB->ParaStep = rtu_BCMR_ParaStep_A[10];
                        }
                      } else {
                        localDW->is_c4_BCMR_DChrgParaCalc =
                          BCMR_DChrgParaCal_IN_ParaStep10;
                        localDW->temporalCounter_i1 = 0U;
                        localB->ParaStep = rtu_BCMR_ParaStep_A[9];
                      }
                    } else {
                      localDW->is_c4_BCMR_DChrgParaCalc =
                        BCMR_DChrgParaCalc_IN_ParaStep9;
                      localDW->temporalCounter_i1 = 0U;
                      localB->ParaStep = rtu_BCMR_ParaStep_A[8];
                    }
                  } else {
                    localDW->is_c4_BCMR_DChrgParaCalc =
                      BCMR_DChrgParaCalc_IN_ParaStep8;
                    localDW->temporalCounter_i1 = 0U;
                    localB->ParaStep = rtu_BCMR_ParaStep_A[7];
                  }
                } else {
                  localDW->is_c4_BCMR_DChrgParaCalc =
                    BCMR_DChrgParaCalc_IN_ParaStep7;
                  localDW->temporalCounter_i1 = 0U;
                  localB->ParaStep = rtu_BCMR_ParaStep_A[6];
                }
              } else {
                localDW->is_c4_BCMR_DChrgParaCalc =
                  BCMR_DChrgParaCalc_IN_ParaStep6;
                localDW->temporalCounter_i1 = 0U;
                localB->ParaStep = rtu_BCMR_ParaStep_A[5];
              }
            } else {
              localDW->is_c4_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCalc_IN_ParaStep5;
              localDW->temporalCounter_i1 = 0U;
              localB->ParaStep = rtu_BCMR_ParaStep_A[4];
            }
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[2];
        }
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep' */
static void BCMR_DChrgParaCalc_ParaStep10(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[9]) && (localDW->temporalCounter_i1 >=
       (uint32_T)ceil(BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
    localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep11;
    localDW->temporalCounter_i1 = 0U;
    localB->ParaStep = rtu_BCMR_ParaStep_A[10];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                      guard1 = true;
                    } else {
                      guard11 = true;
                    }
                  } else {
                    guard14 = true;
                  }
                } else {
                  guard17 = true;
                }
              } else {
                guard19 = true;
              }
            } else {
              guard21 = true;
            }
          } else {
            guard22 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep8;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard20 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard16 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard17 = true;
          } else {
            guard18 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep9;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[8];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep' */
static void BCMR_DChrgParaCalc_ParaStep11(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[10]) && (localDW->temporalCounter_i1 >=
       (uint32_T)ceil(BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
    localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep12;
    localDW->temporalCounter_i1 = 0U;
    localB->ParaStep = rtu_BCMR_ParaStep_A[11];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        guard23 = false;
        guard24 = false;
        guard25 = false;
        guard26 = false;
        guard27 = false;
        guard28 = false;
        guard29 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                        guard1 = true;
                      } else {
                        guard14 = true;
                      }
                    } else {
                      guard18 = true;
                    }
                  } else {
                    guard21 = true;
                  }
                } else {
                  guard24 = true;
                }
              } else {
                guard26 = true;
              }
            } else {
              guard28 = true;
            }
          } else {
            guard29 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep9;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }

        if (guard29) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard28 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C)
          {
            guard27 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep8;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[7];
          }
        }

        if (guard28) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard26 = true;
          } else {
            guard27 = true;
          }
        }

        if (guard27) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard25 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard23 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard26) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard24 = true;
          } else {
            guard25 = true;
          }
        }

        if (guard25) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard22 = true;
          } else {
            guard23 = true;
          }
        }

        if (guard24) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else {
            guard22 = true;
          }
        }

        if (guard23) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard20 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard17 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else {
            guard19 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard16 = true;
          } else {
            guard17 = true;
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard11 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep10;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[9];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep' */
static void BCMR_DChrgParaCalc_ParaStep12(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[11]) && (localDW->temporalCounter_i1 >=
       (uint32_T)ceil(BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
    localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep13;
    localDW->temporalCounter_i1 = 0U;
    localB->ParaStep = rtu_BCMR_ParaStep_A[12];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        guard23 = false;
        guard24 = false;
        guard25 = false;
        guard26 = false;
        guard27 = false;
        guard28 = false;
        guard29 = false;
        guard30 = false;
        guard31 = false;
        guard32 = false;
        guard33 = false;
        guard34 = false;
        guard35 = false;
        guard36 = false;
        guard37 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                          guard1 = true;
                        } else {
                          guard18 = true;
                        }
                      } else {
                        guard22 = true;
                      }
                    } else {
                      guard26 = true;
                    }
                  } else {
                    guard29 = true;
                  }
                } else {
                  guard32 = true;
                }
              } else {
                guard34 = true;
              }
            } else {
              guard36 = true;
            }
          } else {
            guard37 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep10;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }

        if (guard37) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            guard36 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C)
          {
            guard35 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep9;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[8];
          }
        }

        if (guard36) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard34 = true;
          } else {
            guard35 = true;
          }
        }

        if (guard35) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard33 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C)
          {
            guard31 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep8;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[7];
          }
        }

        if (guard34) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard32 = true;
          } else {
            guard33 = true;
          }
        }

        if (guard33) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard30 = true;
          } else {
            guard31 = true;
          }
        }

        if (guard32) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard29 = true;
          } else {
            guard30 = true;
          }
        }

        if (guard31) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard28 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard25 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard30) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard27 = true;
          } else {
            guard28 = true;
          }
        }

        if (guard29) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard26 = true;
          } else {
            guard27 = true;
          }
        }

        if (guard28) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard24 = true;
          } else {
            guard25 = true;
          }
        }

        if (guard27) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard23 = true;
          } else {
            guard24 = true;
          }
        }

        if (guard26) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard22 = true;
          } else {
            guard23 = true;
          }
        }

        if (guard25) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard17 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard24) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard20 = true;
          } else {
            guard21 = true;
          }
        }

        if (guard23) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else {
            guard19 = true;
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard16 = true;
          } else {
            guard17 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard14 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard11 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep11;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[10];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep' */
static void BCMR_DChrgParaCalc_ParaStep13(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  boolean_T guard38 = false;
  boolean_T guard39 = false;
  boolean_T guard40 = false;
  boolean_T guard41 = false;
  boolean_T guard42 = false;
  boolean_T guard43 = false;
  boolean_T guard44 = false;
  boolean_T guard45 = false;
  boolean_T guard46 = false;
  if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[12]) && (localDW->temporalCounter_i1 >=
       (uint32_T)ceil(BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
    localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep14;
    localDW->temporalCounter_i1 = 0U;
    localB->ParaStep = rtu_BCMR_ParaStep_A[13];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[11] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        guard23 = false;
        guard24 = false;
        guard25 = false;
        guard26 = false;
        guard27 = false;
        guard28 = false;
        guard29 = false;
        guard30 = false;
        guard31 = false;
        guard32 = false;
        guard33 = false;
        guard34 = false;
        guard35 = false;
        guard36 = false;
        guard37 = false;
        guard38 = false;
        guard39 = false;
        guard40 = false;
        guard41 = false;
        guard42 = false;
        guard43 = false;
        guard44 = false;
        guard45 = false;
        guard46 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                            rtu_BCMR_HysRng_C) {
                          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                            guard1 = true;
                          } else {
                            guard22 = true;
                          }
                        } else {
                          guard27 = true;
                        }
                      } else {
                        guard31 = true;
                      }
                    } else {
                      guard35 = true;
                    }
                  } else {
                    guard38 = true;
                  }
                } else {
                  guard41 = true;
                }
              } else {
                guard43 = true;
              }
            } else {
              guard45 = true;
            }
          } else {
            guard46 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          guard46 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep11;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[10];
        }

        if (guard46) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
            guard45 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C)
          {
            guard44 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep10;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[9];
          }
        }

        if (guard45) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            guard43 = true;
          } else {
            guard44 = true;
          }
        }

        if (guard44) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            guard42 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C)
          {
            guard40 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep9;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[8];
          }
        }

        if (guard43) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard41 = true;
          } else {
            guard42 = true;
          }
        }

        if (guard42) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard39 = true;
          } else {
            guard40 = true;
          }
        }

        if (guard41) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard38 = true;
          } else {
            guard39 = true;
          }
        }

        if (guard40) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard37 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C)
          {
            guard34 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep8;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[7];
          }
        }

        if (guard39) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard36 = true;
          } else {
            guard37 = true;
          }
        }

        if (guard38) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard35 = true;
          } else {
            guard36 = true;
          }
        }

        if (guard37) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard33 = true;
          } else {
            guard34 = true;
          }
        }

        if (guard36) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard32 = true;
          } else {
            guard33 = true;
          }
        }

        if (guard35) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard31 = true;
          } else {
            guard32 = true;
          }
        }

        if (guard34) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard30 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard26 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard33) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard29 = true;
          } else {
            guard30 = true;
          }
        }

        if (guard32) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard28 = true;
          } else {
            guard29 = true;
          }
        }

        if (guard31) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard27 = true;
          } else {
            guard28 = true;
          }
        }

        if (guard30) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard25 = true;
          } else {
            guard26 = true;
          }
        }

        if (guard29) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard24 = true;
          } else {
            guard25 = true;
          }
        }

        if (guard28) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard23 = true;
          } else {
            guard24 = true;
          }
        }

        if (guard27) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard22 = true;
          } else {
            guard23 = true;
          }
        }

        if (guard26) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard17 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard25) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard20 = true;
          } else {
            guard21 = true;
          }
        }

        if (guard24) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard23) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else {
            guard19 = true;
          }
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard18 = true;
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard16 = true;
          } else {
            guard17 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard14 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard11 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep12;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[11];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep' */
static void BCMR_DChrgParaCalc_ParaStep14(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, boolean_T rtu_BCMR_flgDChrgFulChk,
  B_ParaStep_BCMR_DChrgParaCalc_T *localB, DW_ParaStep_BCMR_DChrgParaCal_T
  *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  boolean_T guard38 = false;
  boolean_T guard39 = false;
  boolean_T guard40 = false;
  boolean_T guard41 = false;
  boolean_T guard42 = false;
  boolean_T guard43 = false;
  boolean_T guard44 = false;
  boolean_T guard45 = false;
  boolean_T guard46 = false;
  boolean_T guard47 = false;
  boolean_T guard48 = false;
  boolean_T guard49 = false;
  boolean_T guard50 = false;
  boolean_T guard51 = false;
  boolean_T guard52 = false;
  boolean_T guard53 = false;
  boolean_T guard54 = false;
  boolean_T guard55 = false;
  boolean_T guard56 = false;
  if (rtu_BattTemp < rtu_BCMR_BattPara_A[12] - rtu_BCMR_HysRng_C) {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[11] - rtu_BCMR_HysRng_C) {
      guard1 = false;
      guard2 = false;
      guard3 = false;
      guard4 = false;
      guard5 = false;
      guard6 = false;
      guard7 = false;
      guard8 = false;
      guard9 = false;
      guard10 = false;
      guard11 = false;
      guard12 = false;
      guard13 = false;
      guard14 = false;
      guard15 = false;
      guard16 = false;
      guard17 = false;
      guard18 = false;
      guard19 = false;
      guard20 = false;
      guard21 = false;
      guard22 = false;
      guard23 = false;
      guard24 = false;
      guard25 = false;
      guard26 = false;
      guard27 = false;
      guard28 = false;
      guard29 = false;
      guard30 = false;
      guard31 = false;
      guard32 = false;
      guard33 = false;
      guard34 = false;
      guard35 = false;
      guard36 = false;
      guard37 = false;
      guard38 = false;
      guard39 = false;
      guard40 = false;
      guard41 = false;
      guard42 = false;
      guard43 = false;
      guard44 = false;
      guard45 = false;
      guard46 = false;
      guard47 = false;
      guard48 = false;
      guard49 = false;
      guard50 = false;
      guard51 = false;
      guard52 = false;
      guard53 = false;
      guard54 = false;
      guard55 = false;
      guard56 = false;
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                            rtu_BCMR_HysRng_C) {
                          if ((rtu_BattTemp < rtu_BCMR_BattPara_A[0]) &&
                              (localDW->temporalCounter_i1 >= (uint32_T)ceil
                               (BCMR_tiDChrgFulWait_C / 0.01F - 1.0E-10F))) {
                            guard1 = true;
                          } else {
                            guard27 = true;
                          }
                        } else {
                          guard32 = true;
                        }
                      } else {
                        guard37 = true;
                      }
                    } else {
                      guard41 = true;
                    }
                  } else {
                    guard45 = true;
                  }
                } else {
                  guard48 = true;
                }
              } else {
                guard51 = true;
              }
            } else {
              guard53 = true;
            }
          } else {
            guard55 = true;
          }
        } else {
          guard56 = true;
        }
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
        guard56 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep12;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[11];
      }

      if (guard56) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          guard55 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          guard54 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep11;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[10];
        }
      }

      if (guard55) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard53 = true;
        } else {
          guard54 = true;
        }
      }

      if (guard54) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard52 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard50 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep10;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }
      }

      if (guard53) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard51 = true;
        } else {
          guard52 = true;
        }
      }

      if (guard52) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard49 = true;
        } else {
          guard50 = true;
        }
      }

      if (guard51) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard48 = true;
        } else {
          guard49 = true;
        }
      }

      if (guard50) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard47 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard44 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep9;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }
      }

      if (guard49) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard46 = true;
        } else {
          guard47 = true;
        }
      }

      if (guard48) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard45 = true;
        } else {
          guard46 = true;
        }
      }

      if (guard47) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard43 = true;
        } else {
          guard44 = true;
        }
      }

      if (guard46) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard42 = true;
        } else {
          guard43 = true;
        }
      }

      if (guard45) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard41 = true;
        } else {
          guard42 = true;
        }
      }

      if (guard44) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard40 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard36 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep8;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }
      }

      if (guard43) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard39 = true;
        } else {
          guard40 = true;
        }
      }

      if (guard42) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard38 = true;
        } else {
          guard39 = true;
        }
      }

      if (guard41) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else {
          guard38 = true;
        }
      }

      if (guard40) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard35 = true;
        } else {
          guard36 = true;
        }
      }

      if (guard39) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard34 = true;
        } else {
          guard35 = true;
        }
      }

      if (guard38) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard33 = true;
        } else {
          guard34 = true;
        }
      }

      if (guard37) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard32 = true;
        } else {
          guard33 = true;
        }
      }

      if (guard36) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard31 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard26 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }
      }

      if (guard35) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard30 = true;
        } else {
          guard31 = true;
        }
      }

      if (guard34) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          guard30 = true;
        }
      }

      if (guard33) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard28 = true;
        } else {
          guard29 = true;
        }
      }

      if (guard32) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard27 = true;
        } else {
          guard28 = true;
        }
      }

      if (guard31) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard25 = true;
        } else {
          guard26 = true;
        }
      }

      if (guard30) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard24 = true;
        } else {
          guard25 = true;
        }
      }

      if (guard29) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard23 = true;
        } else {
          guard24 = true;
        }
      }

      if (guard28) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          guard23 = true;
        }
      }

      if (guard27) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard22 = true;
        }
      }

      if (guard26) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard21 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard17 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[5];
        }
      }

      if (guard25) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard20 = true;
        } else {
          guard21 = true;
        }
      }

      if (guard24) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard19 = true;
        } else {
          guard20 = true;
        }
      }

      if (guard23) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard18 = true;
        } else {
          guard19 = true;
        }
      }

      if (guard22) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard18 = true;
        }
      }

      if (guard21) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          guard17 = true;
        }
      }

      if (guard20) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard15 = true;
        } else {
          guard16 = true;
        }
      }

      if (guard19) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard14 = true;
        } else {
          guard15 = true;
        }
      }

      if (guard18) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard14 = true;
        }
      }

      if (guard17) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard13 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard10 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[4];
        }
      }

      if (guard16) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard12 = true;
        } else {
          guard13 = true;
        }
      }

      if (guard15) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard11 = true;
        } else {
          guard12 = true;
        }
      }

      if (guard14) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard11 = true;
        }
      }

      if (guard13) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard9 = true;
        } else {
          guard10 = true;
        }
      }

      if (guard12) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard8 = true;
        } else {
          guard9 = true;
        }
      }

      if (guard11) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard8 = true;
        }
      }

      if (guard10) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard7 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard5 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[3];
        }
      }

      if (guard9) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard6 = true;
        } else {
          guard7 = true;
        }
      }

      if (guard8) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard6 = true;
        }
      }

      if (guard7) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard4 = true;
        } else {
          guard5 = true;
        }
      }

      if (guard6) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard4 = true;
        }
      }

      if (guard5) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard3 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard2 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[2];
        }
      }

      if (guard4) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard3 = true;
        }
      }

      if (guard3) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard2 = true;
        }
      }

      if (guard2) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[1];
        }
      }

      if (guard1) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[0];
      }
    } else {
      localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCal_IN_ParaStep13;
      localDW->temporalCounter_i1 = 0U;
      localB->ParaStep = rtu_BCMR_ParaStep_A[12];
    }
  } else {
    if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[13]) &&
        ((localDW->temporalCounter_i1 >= (uint32_T)ceil(BCMR_tiDChrgFulWait_C /
           0.01F - 1.0E-10F)) && rtu_BCMR_flgDChrgFulChk)) {
      localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_Init_k;
      localDW->temporalCounter_i1 = 0U;
      localB->ParaStep = 0U;
    }
  }
}

/*
 * System reset for atomic system:
 *    '<S21>/ParaStep'
 *    '<S22>/ParaStep'
 */
void BCMR_DChrgParaCa_ParaStep_Reset(B_ParaStep_BCMR_DChrgParaCalc_T *localB,
  DW_ParaStep_BCMR_DChrgParaCal_T *localDW)
{
  localDW->temporalCounter_i1 = 0U;
  localDW->is_active_c4_BCMR_DChrgParaCalc = 0U;
  localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrg_IN_NO_ACTIVE_CHILD_n;
  localB->ParaStep = 0U;
}

/*
 * Output and update for atomic system:
 *    '<S21>/ParaStep'
 *    '<S22>/ParaStep'
 */
void BCMR_DChrgParaCalc_ParaStep(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, boolean_T rtu_BCMR_flgDChrgFulChk,
  B_ParaStep_BCMR_DChrgParaCalc_T *localB, DW_ParaStep_BCMR_DChrgParaCal_T
  *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  if (localDW->temporalCounter_i1 < MAX_uint32_T) {
    localDW->temporalCounter_i1++;
  }

  if (localDW->is_active_c4_BCMR_DChrgParaCalc == 0U) {
    localDW->is_active_c4_BCMR_DChrgParaCalc = 1U;
    localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_Init_k;
    localDW->temporalCounter_i1 = 0U;
    localB->ParaStep = 0U;
  } else {
    guard1 = false;
    guard2 = false;
    guard3 = false;
    guard4 = false;
    guard5 = false;
    guard6 = false;
    guard7 = false;
    guard8 = false;
    guard9 = false;
    guard10 = false;
    guard11 = false;
    guard12 = false;
    guard13 = false;
    guard14 = false;
    guard15 = false;
    guard16 = false;
    guard17 = false;
    guard18 = false;
    guard19 = false;
    guard20 = false;
    guard21 = false;
    guard22 = false;
    guard23 = false;
    guard24 = false;
    switch (localDW->is_c4_BCMR_DChrgParaCalc) {
     case BCMR_DChrgParaCalc_IN_Init_k:
      BCMR_DChrgParaCalc_Init(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, localB, localDW);
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep1:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[0]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
      break;

     case BCMR_DChrgParaCal_IN_ParaStep10:
      BCMR_DChrgParaCalc_ParaStep10(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaCal_IN_ParaStep11:
      BCMR_DChrgParaCalc_ParaStep11(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaCal_IN_ParaStep12:
      BCMR_DChrgParaCalc_ParaStep12(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaCal_IN_ParaStep13:
      BCMR_DChrgParaCalc_ParaStep13(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaCal_IN_ParaStep14:
      BCMR_DChrgParaCalc_ParaStep14(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, rtu_BCMR_flgDChrgFulChk, localB,
        localDW);
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep2:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[1]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
          localDW->temporalCounter_i1 = 0U;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep3:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[2]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[0];
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep4:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[3]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[4];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
              localDW->is_c4_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCalc_IN_ParaStep1;
              localDW->temporalCounter_i1 = 0U;
              localB->ParaStep = rtu_BCMR_ParaStep_A[0];
            } else {
              localDW->is_c4_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCalc_IN_ParaStep2;
              localDW->temporalCounter_i1 = 0U;
              localB->ParaStep = rtu_BCMR_ParaStep_A[1];
            }
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep5:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[4]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[5];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                guard1 = true;
              } else {
                guard5 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
            {
              guard5 = true;
            } else {
              localDW->is_c4_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCalc_IN_ParaStep3;
              localDW->temporalCounter_i1 = 0U;
              localB->ParaStep = rtu_BCMR_ParaStep_A[2];
            }
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep6:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[5]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[6];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                  guard2 = true;
                } else {
                  guard9 = true;
                }
              } else {
                guard12 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
            {
              guard12 = true;
            } else {
              localDW->is_c4_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCalc_IN_ParaStep4;
              localDW->temporalCounter_i1 = 0U;
              localB->ParaStep = rtu_BCMR_ParaStep_A[3];
            }
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep7:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[6]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep8;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                    guard3 = true;
                  } else {
                    guard13 = true;
                  }
                } else {
                  guard17 = true;
                }
              } else {
                guard20 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
            {
              guard20 = true;
            } else {
              localDW->is_c4_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCalc_IN_ParaStep5;
              localDW->temporalCounter_i1 = 0U;
              localB->ParaStep = rtu_BCMR_ParaStep_A[4];
            }
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep6;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }
      }
      break;

     case BCMR_DChrgParaCalc_IN_ParaStep8:
      if ((rtu_BattTemp >= rtu_BCMR_BattPara_A[7]) &&
          (localDW->temporalCounter_i1 >= (uint32_T)ceil
           (BCMR_tiCurrHysTimeDelay_C / 0.01F - 1.0E-10F))) {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep9;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[8];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                      guard4 = true;
                    } else {
                      guard18 = true;
                    }
                  } else {
                    guard21 = true;
                  }
                } else {
                  guard23 = true;
                }
              } else {
                guard24 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
            {
              guard24 = true;
            } else {
              localDW->is_c4_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCalc_IN_ParaStep6;
              localDW->temporalCounter_i1 = 0U;
              localB->ParaStep = rtu_BCMR_ParaStep_A[5];
            }
          } else {
            localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep7;
            localDW->temporalCounter_i1 = 0U;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }
      }
      break;

     default:
      BCMR_DChrgParaCalc_ParaStep9(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;
    }

    if (guard24) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
        guard23 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
        guard22 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep5;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[4];
      }
    }

    if (guard23) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard21 = true;
      } else {
        guard22 = true;
      }
    }

    if (guard22) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard19 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard16 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      }
    }

    if (guard21) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard18 = true;
      } else {
        guard19 = true;
      }
    }

    if (guard20) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard17 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard14 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep4;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      }
    }

    if (guard19) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard15 = true;
      } else {
        guard16 = true;
      }
    }

    if (guard18) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard15 = true;
      }
    }

    if (guard17) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard13 = true;
      } else {
        guard14 = true;
      }
    }

    if (guard16) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard11 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard8 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard15) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard11 = true;
      }
    }

    if (guard14) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard10 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard7 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard13) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        guard10 = true;
      }
    }

    if (guard12) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard9 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard6 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep3;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard11) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard8 = true;
      }
    }

    if (guard10) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        guard7 = true;
      }
    }

    if (guard9) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard2 = true;
      } else {
        guard6 = true;
      }
    }

    if (guard8) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard7) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard6) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard2 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard5) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard1 = true;
      } else {
        localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep2;
        localDW->temporalCounter_i1 = 0U;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard4) {
      localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
      localDW->temporalCounter_i1 = 0U;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard3) {
      localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
      localDW->temporalCounter_i1 = 0U;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard2) {
      localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
      localDW->temporalCounter_i1 = 0U;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard1) {
      localDW->is_c4_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_ParaStep1;
      localDW->temporalCounter_i1 = 0U;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }
  }
}

/* Function for Chart: '<S21>/ParaStep2' */
static void BCMR_DChrgParaCalc_ParaStep9_h(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[8]) {
    localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_g;
    localB->ParaStep = rtu_BCMR_ParaStep_A[9];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                    guard1 = true;
                  } else {
                    guard8 = true;
                  }
                } else {
                  guard11 = true;
                }
              } else {
                guard13 = true;
              }
            } else {
              guard15 = true;
            }
          } else {
            guard16 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard14 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else {
            guard14 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_k;
        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep2' */
static void BCMR_DChrgParaCalc_ParaStep10_m(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[9]) {
    localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_c;
    localB->ParaStep = rtu_BCMR_ParaStep_A[10];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                      guard1 = true;
                    } else {
                      guard11 = true;
                    }
                  } else {
                    guard14 = true;
                  }
                } else {
                  guard17 = true;
                }
              } else {
                guard19 = true;
              }
            } else {
              guard21 = true;
            }
          } else {
            guard22 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_k;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard20 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard16 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard17 = true;
          } else {
            guard18 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[8];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep2' */
static void BCMR_DChrgParaCalc_ParaStep11_b(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[10]) {
    localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep12_b;
    localB->ParaStep = rtu_BCMR_ParaStep_A[11];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        guard23 = false;
        guard24 = false;
        guard25 = false;
        guard26 = false;
        guard27 = false;
        guard28 = false;
        guard29 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                        guard1 = true;
                      } else {
                        guard14 = true;
                      }
                    } else {
                      guard18 = true;
                    }
                  } else {
                    guard21 = true;
                  }
                } else {
                  guard24 = true;
                }
              } else {
                guard26 = true;
              }
            } else {
              guard28 = true;
            }
          } else {
            guard29 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }

        if (guard29) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard28 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C)
          {
            guard27 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_k;
            localB->ParaStep = rtu_BCMR_ParaStep_A[7];
          }
        }

        if (guard28) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard26 = true;
          } else {
            guard27 = true;
          }
        }

        if (guard27) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard25 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard23 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard26) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard24 = true;
          } else {
            guard25 = true;
          }
        }

        if (guard25) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard22 = true;
          } else {
            guard23 = true;
          }
        }

        if (guard24) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else {
            guard22 = true;
          }
        }

        if (guard23) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard20 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard17 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else {
            guard19 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard16 = true;
          } else {
            guard17 = true;
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard11 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_g;
        localB->ParaStep = rtu_BCMR_ParaStep_A[9];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep2' */
static void BCMR_DChrgParaCalc_ParaStep12_c(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[11]) {
    localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep13_j;
    localB->ParaStep = rtu_BCMR_ParaStep_A[12];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        guard23 = false;
        guard24 = false;
        guard25 = false;
        guard26 = false;
        guard27 = false;
        guard28 = false;
        guard29 = false;
        guard30 = false;
        guard31 = false;
        guard32 = false;
        guard33 = false;
        guard34 = false;
        guard35 = false;
        guard36 = false;
        guard37 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                          guard1 = true;
                        } else {
                          guard18 = true;
                        }
                      } else {
                        guard22 = true;
                      }
                    } else {
                      guard26 = true;
                    }
                  } else {
                    guard29 = true;
                  }
                } else {
                  guard32 = true;
                }
              } else {
                guard34 = true;
              }
            } else {
              guard36 = true;
            }
          } else {
            guard37 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_g;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }

        if (guard37) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            guard36 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C)
          {
            guard35 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[8];
          }
        }

        if (guard36) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard34 = true;
          } else {
            guard35 = true;
          }
        }

        if (guard35) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard33 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C)
          {
            guard31 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_k;
            localB->ParaStep = rtu_BCMR_ParaStep_A[7];
          }
        }

        if (guard34) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard32 = true;
          } else {
            guard33 = true;
          }
        }

        if (guard33) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard30 = true;
          } else {
            guard31 = true;
          }
        }

        if (guard32) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard29 = true;
          } else {
            guard30 = true;
          }
        }

        if (guard31) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard28 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard25 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard30) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard27 = true;
          } else {
            guard28 = true;
          }
        }

        if (guard29) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard26 = true;
          } else {
            guard27 = true;
          }
        }

        if (guard28) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard24 = true;
          } else {
            guard25 = true;
          }
        }

        if (guard27) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard23 = true;
          } else {
            guard24 = true;
          }
        }

        if (guard26) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard22 = true;
          } else {
            guard23 = true;
          }
        }

        if (guard25) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard17 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard24) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard20 = true;
          } else {
            guard21 = true;
          }
        }

        if (guard23) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else {
            guard19 = true;
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard16 = true;
          } else {
            guard17 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard14 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard11 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[10];
      }
    }
  }
}

/* Function for Chart: '<S21>/ParaStep2' */
static void BCMR_DChrgParaCalc_ParaStep13_m(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  boolean_T guard38 = false;
  boolean_T guard39 = false;
  boolean_T guard40 = false;
  boolean_T guard41 = false;
  boolean_T guard42 = false;
  boolean_T guard43 = false;
  boolean_T guard44 = false;
  boolean_T guard45 = false;
  boolean_T guard46 = false;
  if (rtu_BattTemp < rtu_BCMR_BattPara_A[11] - rtu_BCMR_HysRng_C) {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
      guard1 = false;
      guard2 = false;
      guard3 = false;
      guard4 = false;
      guard5 = false;
      guard6 = false;
      guard7 = false;
      guard8 = false;
      guard9 = false;
      guard10 = false;
      guard11 = false;
      guard12 = false;
      guard13 = false;
      guard14 = false;
      guard15 = false;
      guard16 = false;
      guard17 = false;
      guard18 = false;
      guard19 = false;
      guard20 = false;
      guard21 = false;
      guard22 = false;
      guard23 = false;
      guard24 = false;
      guard25 = false;
      guard26 = false;
      guard27 = false;
      guard28 = false;
      guard29 = false;
      guard30 = false;
      guard31 = false;
      guard32 = false;
      guard33 = false;
      guard34 = false;
      guard35 = false;
      guard36 = false;
      guard37 = false;
      guard38 = false;
      guard39 = false;
      guard40 = false;
      guard41 = false;
      guard42 = false;
      guard43 = false;
      guard44 = false;
      guard45 = false;
      guard46 = false;
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                          guard1 = true;
                        } else {
                          guard22 = true;
                        }
                      } else {
                        guard27 = true;
                      }
                    } else {
                      guard31 = true;
                    }
                  } else {
                    guard35 = true;
                  }
                } else {
                  guard38 = true;
                }
              } else {
                guard41 = true;
              }
            } else {
              guard43 = true;
            }
          } else {
            guard45 = true;
          }
        } else {
          guard46 = true;
        }
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
        guard46 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[10];
      }

      if (guard46) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard45 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard44 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_g;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }
      }

      if (guard45) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard43 = true;
        } else {
          guard44 = true;
        }
      }

      if (guard44) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard42 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard40 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }
      }

      if (guard43) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard41 = true;
        } else {
          guard42 = true;
        }
      }

      if (guard42) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard39 = true;
        } else {
          guard40 = true;
        }
      }

      if (guard41) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard38 = true;
        } else {
          guard39 = true;
        }
      }

      if (guard40) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard34 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_k;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }
      }

      if (guard39) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard36 = true;
        } else {
          guard37 = true;
        }
      }

      if (guard38) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard35 = true;
        } else {
          guard36 = true;
        }
      }

      if (guard37) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard33 = true;
        } else {
          guard34 = true;
        }
      }

      if (guard36) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard32 = true;
        } else {
          guard33 = true;
        }
      }

      if (guard35) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard31 = true;
        } else {
          guard32 = true;
        }
      }

      if (guard34) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard30 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard26 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }
      }

      if (guard33) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          guard30 = true;
        }
      }

      if (guard32) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard28 = true;
        } else {
          guard29 = true;
        }
      }

      if (guard31) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard27 = true;
        } else {
          guard28 = true;
        }
      }

      if (guard30) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard25 = true;
        } else {
          guard26 = true;
        }
      }

      if (guard29) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard24 = true;
        } else {
          guard25 = true;
        }
      }

      if (guard28) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard23 = true;
        } else {
          guard24 = true;
        }
      }

      if (guard27) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          guard23 = true;
        }
      }

      if (guard26) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard21 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard17 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[5];
        }
      }

      if (guard25) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard20 = true;
        } else {
          guard21 = true;
        }
      }

      if (guard24) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard19 = true;
        } else {
          guard20 = true;
        }
      }

      if (guard23) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard18 = true;
        } else {
          guard19 = true;
        }
      }

      if (guard22) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard18 = true;
        }
      }

      if (guard21) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          guard17 = true;
        }
      }

      if (guard20) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard15 = true;
        } else {
          guard16 = true;
        }
      }

      if (guard19) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard14 = true;
        } else {
          guard15 = true;
        }
      }

      if (guard18) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard14 = true;
        }
      }

      if (guard17) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard13 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard10 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
          localB->ParaStep = rtu_BCMR_ParaStep_A[4];
        }
      }

      if (guard16) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard12 = true;
        } else {
          guard13 = true;
        }
      }

      if (guard15) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard11 = true;
        } else {
          guard12 = true;
        }
      }

      if (guard14) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard11 = true;
        }
      }

      if (guard13) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard9 = true;
        } else {
          guard10 = true;
        }
      }

      if (guard12) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard8 = true;
        } else {
          guard9 = true;
        }
      }

      if (guard11) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard8 = true;
        }
      }

      if (guard10) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard7 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard5 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
          localB->ParaStep = rtu_BCMR_ParaStep_A[3];
        }
      }

      if (guard9) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard6 = true;
        } else {
          guard7 = true;
        }
      }

      if (guard8) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard6 = true;
        }
      }

      if (guard7) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard4 = true;
        } else {
          guard5 = true;
        }
      }

      if (guard6) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard4 = true;
        }
      }

      if (guard5) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard3 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard2 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
          localB->ParaStep = rtu_BCMR_ParaStep_A[2];
        }
      }

      if (guard4) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard3 = true;
        }
      }

      if (guard3) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard2 = true;
        }
      }

      if (guard2) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[1];
        }
      }

      if (guard1) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
        localB->ParaStep = rtu_BCMR_ParaStep_A[0];
      }
    } else {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep12_b;
      localB->ParaStep = rtu_BCMR_ParaStep_A[11];
    }
  } else {
    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[12]) {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep14_m;
      localB->ParaStep = rtu_BCMR_ParaStep_A[13];
    }
  }
}

/* Function for Chart: '<S21>/ParaStep2' */
static void BCMR_DChrgParaCalc_ParaStep14_n(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  boolean_T guard38 = false;
  boolean_T guard39 = false;
  boolean_T guard40 = false;
  boolean_T guard41 = false;
  boolean_T guard42 = false;
  boolean_T guard43 = false;
  boolean_T guard44 = false;
  boolean_T guard45 = false;
  boolean_T guard46 = false;
  boolean_T guard47 = false;
  boolean_T guard48 = false;
  boolean_T guard49 = false;
  boolean_T guard50 = false;
  boolean_T guard51 = false;
  boolean_T guard52 = false;
  boolean_T guard53 = false;
  boolean_T guard54 = false;
  boolean_T guard55 = false;
  boolean_T guard56 = false;
  if (rtu_BattTemp < rtu_BCMR_BattPara_A[12] - rtu_BCMR_HysRng_C) {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[11] - rtu_BCMR_HysRng_C) {
      guard1 = false;
      guard2 = false;
      guard3 = false;
      guard4 = false;
      guard5 = false;
      guard6 = false;
      guard7 = false;
      guard8 = false;
      guard9 = false;
      guard10 = false;
      guard11 = false;
      guard12 = false;
      guard13 = false;
      guard14 = false;
      guard15 = false;
      guard16 = false;
      guard17 = false;
      guard18 = false;
      guard19 = false;
      guard20 = false;
      guard21 = false;
      guard22 = false;
      guard23 = false;
      guard24 = false;
      guard25 = false;
      guard26 = false;
      guard27 = false;
      guard28 = false;
      guard29 = false;
      guard30 = false;
      guard31 = false;
      guard32 = false;
      guard33 = false;
      guard34 = false;
      guard35 = false;
      guard36 = false;
      guard37 = false;
      guard38 = false;
      guard39 = false;
      guard40 = false;
      guard41 = false;
      guard42 = false;
      guard43 = false;
      guard44 = false;
      guard45 = false;
      guard46 = false;
      guard47 = false;
      guard48 = false;
      guard49 = false;
      guard50 = false;
      guard51 = false;
      guard52 = false;
      guard53 = false;
      guard54 = false;
      guard55 = false;
      guard56 = false;
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                            rtu_BCMR_HysRng_C) {
                          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                            guard1 = true;
                          } else {
                            guard27 = true;
                          }
                        } else {
                          guard32 = true;
                        }
                      } else {
                        guard37 = true;
                      }
                    } else {
                      guard41 = true;
                    }
                  } else {
                    guard45 = true;
                  }
                } else {
                  guard48 = true;
                }
              } else {
                guard51 = true;
              }
            } else {
              guard53 = true;
            }
          } else {
            guard55 = true;
          }
        } else {
          guard56 = true;
        }
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
        guard56 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep12_b;
        localB->ParaStep = rtu_BCMR_ParaStep_A[11];
      }

      if (guard56) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          guard55 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          guard54 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[10];
        }
      }

      if (guard55) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard53 = true;
        } else {
          guard54 = true;
        }
      }

      if (guard54) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard52 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard50 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_g;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }
      }

      if (guard53) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard51 = true;
        } else {
          guard52 = true;
        }
      }

      if (guard52) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard49 = true;
        } else {
          guard50 = true;
        }
      }

      if (guard51) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard48 = true;
        } else {
          guard49 = true;
        }
      }

      if (guard50) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard47 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard44 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }
      }

      if (guard49) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard46 = true;
        } else {
          guard47 = true;
        }
      }

      if (guard48) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard45 = true;
        } else {
          guard46 = true;
        }
      }

      if (guard47) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard43 = true;
        } else {
          guard44 = true;
        }
      }

      if (guard46) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard42 = true;
        } else {
          guard43 = true;
        }
      }

      if (guard45) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard41 = true;
        } else {
          guard42 = true;
        }
      }

      if (guard44) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard40 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard36 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_k;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }
      }

      if (guard43) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard39 = true;
        } else {
          guard40 = true;
        }
      }

      if (guard42) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard38 = true;
        } else {
          guard39 = true;
        }
      }

      if (guard41) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else {
          guard38 = true;
        }
      }

      if (guard40) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard35 = true;
        } else {
          guard36 = true;
        }
      }

      if (guard39) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard34 = true;
        } else {
          guard35 = true;
        }
      }

      if (guard38) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard33 = true;
        } else {
          guard34 = true;
        }
      }

      if (guard37) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard32 = true;
        } else {
          guard33 = true;
        }
      }

      if (guard36) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard31 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard26 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }
      }

      if (guard35) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard30 = true;
        } else {
          guard31 = true;
        }
      }

      if (guard34) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          guard30 = true;
        }
      }

      if (guard33) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard28 = true;
        } else {
          guard29 = true;
        }
      }

      if (guard32) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard27 = true;
        } else {
          guard28 = true;
        }
      }

      if (guard31) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard25 = true;
        } else {
          guard26 = true;
        }
      }

      if (guard30) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard24 = true;
        } else {
          guard25 = true;
        }
      }

      if (guard29) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard23 = true;
        } else {
          guard24 = true;
        }
      }

      if (guard28) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          guard23 = true;
        }
      }

      if (guard27) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard22 = true;
        }
      }

      if (guard26) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard21 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard17 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[5];
        }
      }

      if (guard25) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard20 = true;
        } else {
          guard21 = true;
        }
      }

      if (guard24) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard19 = true;
        } else {
          guard20 = true;
        }
      }

      if (guard23) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard18 = true;
        } else {
          guard19 = true;
        }
      }

      if (guard22) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard18 = true;
        }
      }

      if (guard21) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          guard17 = true;
        }
      }

      if (guard20) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard15 = true;
        } else {
          guard16 = true;
        }
      }

      if (guard19) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard14 = true;
        } else {
          guard15 = true;
        }
      }

      if (guard18) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard14 = true;
        }
      }

      if (guard17) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard13 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard10 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
          localB->ParaStep = rtu_BCMR_ParaStep_A[4];
        }
      }

      if (guard16) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard12 = true;
        } else {
          guard13 = true;
        }
      }

      if (guard15) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard11 = true;
        } else {
          guard12 = true;
        }
      }

      if (guard14) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard11 = true;
        }
      }

      if (guard13) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard9 = true;
        } else {
          guard10 = true;
        }
      }

      if (guard12) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard8 = true;
        } else {
          guard9 = true;
        }
      }

      if (guard11) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard8 = true;
        }
      }

      if (guard10) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard7 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard5 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
          localB->ParaStep = rtu_BCMR_ParaStep_A[3];
        }
      }

      if (guard9) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard6 = true;
        } else {
          guard7 = true;
        }
      }

      if (guard8) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard6 = true;
        }
      }

      if (guard7) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard4 = true;
        } else {
          guard5 = true;
        }
      }

      if (guard6) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard4 = true;
        }
      }

      if (guard5) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard3 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard2 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
          localB->ParaStep = rtu_BCMR_ParaStep_A[2];
        }
      }

      if (guard4) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard3 = true;
        }
      }

      if (guard3) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard2 = true;
        }
      }

      if (guard2) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[1];
        }
      }

      if (guard1) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
        localB->ParaStep = rtu_BCMR_ParaStep_A[0];
      }
    } else {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep13_j;
      localB->ParaStep = rtu_BCMR_ParaStep_A[12];
    }
  } else {
    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[13]) {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_Init_p;
      localB->ParaStep = 0U;
    }
  }
}

/* System reset for atomic system: '<S21>/ParaStep2' */
void BCMR_DChrgParaC_ParaStep2_Reset(B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  localDW->is_active_c1_BCMR_DChrgParaCalc = 0U;
  localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrg_IN_NO_ACTIVE_CHILD_p;
  localB->ParaStep = 0U;
}

/* Output and update for atomic system: '<S21>/ParaStep2' */
void BCMR_DChrgParaCalc_ParaStep2(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep2_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep2_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  if (localDW->is_active_c1_BCMR_DChrgParaCalc == 0U) {
    localDW->is_active_c1_BCMR_DChrgParaCalc = 1U;
    localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_Init_p;
    localB->ParaStep = 0U;
  } else {
    guard1 = false;
    guard2 = false;
    guard3 = false;
    guard4 = false;
    guard5 = false;
    guard6 = false;
    guard7 = false;
    guard8 = false;
    guard9 = false;
    guard10 = false;
    guard11 = false;
    guard12 = false;
    guard13 = false;
    guard14 = false;
    guard15 = false;
    guard16 = false;
    guard17 = false;
    guard18 = false;
    guard19 = false;
    guard20 = false;
    guard21 = false;
    guard22 = false;
    guard23 = false;
    guard24 = false;
    switch (localDW->is_c1_BCMR_DChrgParaCalc) {
     case BCMR_DChrgParaCalc_IN_Init_p:
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
        localB->ParaStep = rtu_BCMR_ParaStep_A[0];
      } else {
        if (rtu_BattTemp >= rtu_BCMR_BattPara_A[0]) {
          if (rtu_BattTemp >= rtu_BCMR_BattPara_A[1]) {
            if (rtu_BattTemp >= rtu_BCMR_BattPara_A[2]) {
              if (rtu_BattTemp >= rtu_BCMR_BattPara_A[3]) {
                if (rtu_BattTemp >= rtu_BCMR_BattPara_A[4]) {
                  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[5]) {
                    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[6]) {
                      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[7]) {
                        if (rtu_BattTemp >= rtu_BCMR_BattPara_A[8]) {
                          if (rtu_BattTemp >= rtu_BCMR_BattPara_A[9]) {
                            if (rtu_BattTemp >= rtu_BCMR_BattPara_A[10]) {
                              if (rtu_BattTemp >= rtu_BCMR_BattPara_A[11]) {
                                if (rtu_BattTemp >= rtu_BCMR_BattPara_A[12]) {
                                  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[13]) {
                                    localDW->is_c1_BCMR_DChrgParaCalc =
                                      BCMR_DChrgParaCalc_IN_Init_p;
                                    localB->ParaStep = 0U;
                                  } else {
                                    localDW->is_c1_BCMR_DChrgParaCalc =
                                      BCMR_DChrgParaC_IN_ParaStep14_m;
                                    localB->ParaStep = rtu_BCMR_ParaStep_A[13];
                                  }
                                } else {
                                  localDW->is_c1_BCMR_DChrgParaCalc =
                                    BCMR_DChrgParaC_IN_ParaStep13_j;
                                  localB->ParaStep = rtu_BCMR_ParaStep_A[12];
                                }
                              } else {
                                localDW->is_c1_BCMR_DChrgParaCalc =
                                  BCMR_DChrgParaC_IN_ParaStep12_b;
                                localB->ParaStep = rtu_BCMR_ParaStep_A[11];
                              }
                            } else {
                              localDW->is_c1_BCMR_DChrgParaCalc =
                                BCMR_DChrgParaC_IN_ParaStep11_c;
                              localB->ParaStep = rtu_BCMR_ParaStep_A[10];
                            }
                          } else {
                            localDW->is_c1_BCMR_DChrgParaCalc =
                              BCMR_DChrgParaC_IN_ParaStep10_g;
                            localB->ParaStep = rtu_BCMR_ParaStep_A[9];
                          }
                        } else {
                          localDW->is_c1_BCMR_DChrgParaCalc =
                            BCMR_DChrgParaCa_IN_ParaStep9_c;
                          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
                        }
                      } else {
                        localDW->is_c1_BCMR_DChrgParaCalc =
                          BCMR_DChrgParaCa_IN_ParaStep8_k;
                        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
                      }
                    } else {
                      localDW->is_c1_BCMR_DChrgParaCalc =
                        BCMR_DChrgParaCa_IN_ParaStep7_a;
                      localB->ParaStep = rtu_BCMR_ParaStep_A[6];
                    }
                  } else {
                    localDW->is_c1_BCMR_DChrgParaCalc =
                      BCMR_DChrgParaCa_IN_ParaStep6_b;
                    localB->ParaStep = rtu_BCMR_ParaStep_A[5];
                  }
                } else {
                  localDW->is_c1_BCMR_DChrgParaCalc =
                    BCMR_DChrgParaCa_IN_ParaStep5_h;
                  localB->ParaStep = rtu_BCMR_ParaStep_A[4];
                }
              } else {
                localDW->is_c1_BCMR_DChrgParaCalc =
                  BCMR_DChrgParaCa_IN_ParaStep4_f;
                localB->ParaStep = rtu_BCMR_ParaStep_A[3];
              }
            } else {
              localDW->is_c1_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep3_f;
              localB->ParaStep = rtu_BCMR_ParaStep_A[2];
            }
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep1_o:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[0]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
      break;

     case BCMR_DChrgParaC_IN_ParaStep10_g:
      BCMR_DChrgParaCalc_ParaStep10_m(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep11_c:
      BCMR_DChrgParaCalc_ParaStep11_b(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep12_b:
      BCMR_DChrgParaCalc_ParaStep12_c(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep13_j:
      BCMR_DChrgParaCalc_ParaStep13_m(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep14_m:
      BCMR_DChrgParaCalc_ParaStep14_n(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaCa_IN_ParaStep2_c:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[1]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep3_f:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[2]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
            localB->ParaStep = rtu_BCMR_ParaStep_A[0];
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep4_f:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[3]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
        localB->ParaStep = rtu_BCMR_ParaStep_A[4];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
              localDW->is_c1_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep1_o;
              localB->ParaStep = rtu_BCMR_ParaStep_A[0];
            } else {
              localDW->is_c1_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep2_c;
              localB->ParaStep = rtu_BCMR_ParaStep_A[1];
            }
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep5_h:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[4]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
        localB->ParaStep = rtu_BCMR_ParaStep_A[5];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                guard1 = true;
              } else {
                guard5 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
            {
              guard5 = true;
            } else {
              localDW->is_c1_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep3_f;
              localB->ParaStep = rtu_BCMR_ParaStep_A[2];
            }
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep6_b:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[5]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
        localB->ParaStep = rtu_BCMR_ParaStep_A[6];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                  guard2 = true;
                } else {
                  guard9 = true;
                }
              } else {
                guard12 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
            {
              guard12 = true;
            } else {
              localDW->is_c1_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep4_f;
              localB->ParaStep = rtu_BCMR_ParaStep_A[3];
            }
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep7_a:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[6]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_k;
        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                    guard3 = true;
                  } else {
                    guard13 = true;
                  }
                } else {
                  guard17 = true;
                }
              } else {
                guard20 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
            {
              guard20 = true;
            } else {
              localDW->is_c1_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep5_h;
              localB->ParaStep = rtu_BCMR_ParaStep_A[4];
            }
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_b;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep8_k:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[7]) {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[8];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                      guard4 = true;
                    } else {
                      guard18 = true;
                    }
                  } else {
                    guard21 = true;
                  }
                } else {
                  guard23 = true;
                }
              } else {
                guard24 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
            {
              guard24 = true;
            } else {
              localDW->is_c1_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep6_b;
              localB->ParaStep = rtu_BCMR_ParaStep_A[5];
            }
          } else {
            localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_a;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }
      }
      break;

     default:
      BCMR_DChrgParaCalc_ParaStep9_h(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;
    }

    if (guard24) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
        guard23 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
        guard22 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_h;
        localB->ParaStep = rtu_BCMR_ParaStep_A[4];
      }
    }

    if (guard23) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard21 = true;
      } else {
        guard22 = true;
      }
    }

    if (guard22) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard19 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard16 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      }
    }

    if (guard21) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard18 = true;
      } else {
        guard19 = true;
      }
    }

    if (guard20) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard17 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard14 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_f;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      }
    }

    if (guard19) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard15 = true;
      } else {
        guard16 = true;
      }
    }

    if (guard18) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard15 = true;
      }
    }

    if (guard17) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard13 = true;
      } else {
        guard14 = true;
      }
    }

    if (guard16) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard11 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard8 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard15) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard11 = true;
      }
    }

    if (guard14) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard10 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard7 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard13) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        guard10 = true;
      }
    }

    if (guard12) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard9 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard6 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_f;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard11) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard8 = true;
      }
    }

    if (guard10) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        guard7 = true;
      }
    }

    if (guard9) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard2 = true;
      } else {
        guard6 = true;
      }
    }

    if (guard8) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard7) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard6) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard2 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard5) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard1 = true;
      } else {
        localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard4) {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard3) {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard2) {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard1) {
      localDW->is_c1_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_o;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }
  }
}

/* Function for Chart: '<S22>/ParaStep1' */
static void BCMR_DChrgParaCalc_ParaStep9_c(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[8]) {
    localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_b;
    localB->ParaStep = rtu_BCMR_ParaStep_A[9];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                    guard1 = true;
                  } else {
                    guard8 = true;
                  }
                } else {
                  guard11 = true;
                }
              } else {
                guard13 = true;
              }
            } else {
              guard15 = true;
            }
          } else {
            guard16 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard14 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else {
            guard14 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_j;
        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
      }
    }
  }
}

/* Function for Chart: '<S22>/ParaStep1' */
static void BCMR_DChrgParaCalc_ParaStep10_e(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[9]) {
    localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_k;
    localB->ParaStep = rtu_BCMR_ParaStep_A[10];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                      guard1 = true;
                    } else {
                      guard11 = true;
                    }
                  } else {
                    guard14 = true;
                  }
                } else {
                  guard17 = true;
                }
              } else {
                guard19 = true;
              }
            } else {
              guard21 = true;
            }
          } else {
            guard22 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_j;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard20 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard16 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard17 = true;
          } else {
            guard18 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_n;
        localB->ParaStep = rtu_BCMR_ParaStep_A[8];
      }
    }
  }
}

/* Function for Chart: '<S22>/ParaStep1' */
static void BCMR_DChrgParaCalc_ParaStep11_k(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[10]) {
    localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep12_l;
    localB->ParaStep = rtu_BCMR_ParaStep_A[11];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        guard23 = false;
        guard24 = false;
        guard25 = false;
        guard26 = false;
        guard27 = false;
        guard28 = false;
        guard29 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                        guard1 = true;
                      } else {
                        guard14 = true;
                      }
                    } else {
                      guard18 = true;
                    }
                  } else {
                    guard21 = true;
                  }
                } else {
                  guard24 = true;
                }
              } else {
                guard26 = true;
              }
            } else {
              guard28 = true;
            }
          } else {
            guard29 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_n;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }

        if (guard29) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard28 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C)
          {
            guard27 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_j;
            localB->ParaStep = rtu_BCMR_ParaStep_A[7];
          }
        }

        if (guard28) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard26 = true;
          } else {
            guard27 = true;
          }
        }

        if (guard27) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard25 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard23 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard26) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard24 = true;
          } else {
            guard25 = true;
          }
        }

        if (guard25) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard22 = true;
          } else {
            guard23 = true;
          }
        }

        if (guard24) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else {
            guard22 = true;
          }
        }

        if (guard23) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard20 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard17 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else {
            guard19 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard16 = true;
          } else {
            guard17 = true;
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard11 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_b;
        localB->ParaStep = rtu_BCMR_ParaStep_A[9];
      }
    }
  }
}

/* Function for Chart: '<S22>/ParaStep1' */
static void BCMR_DChrgParaCalc_ParaStep12_k(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[11]) {
    localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep13_c;
    localB->ParaStep = rtu_BCMR_ParaStep_A[12];
  } else {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
        guard1 = false;
        guard2 = false;
        guard3 = false;
        guard4 = false;
        guard5 = false;
        guard6 = false;
        guard7 = false;
        guard8 = false;
        guard9 = false;
        guard10 = false;
        guard11 = false;
        guard12 = false;
        guard13 = false;
        guard14 = false;
        guard15 = false;
        guard16 = false;
        guard17 = false;
        guard18 = false;
        guard19 = false;
        guard20 = false;
        guard21 = false;
        guard22 = false;
        guard23 = false;
        guard24 = false;
        guard25 = false;
        guard26 = false;
        guard27 = false;
        guard28 = false;
        guard29 = false;
        guard30 = false;
        guard31 = false;
        guard32 = false;
        guard33 = false;
        guard34 = false;
        guard35 = false;
        guard36 = false;
        guard37 = false;
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                          guard1 = true;
                        } else {
                          guard18 = true;
                        }
                      } else {
                        guard22 = true;
                      }
                    } else {
                      guard26 = true;
                    }
                  } else {
                    guard29 = true;
                  }
                } else {
                  guard32 = true;
                }
              } else {
                guard34 = true;
              }
            } else {
              guard36 = true;
            }
          } else {
            guard37 = true;
          }
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }

        if (guard37) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            guard36 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C)
          {
            guard35 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_n;
            localB->ParaStep = rtu_BCMR_ParaStep_A[8];
          }
        }

        if (guard36) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard34 = true;
          } else {
            guard35 = true;
          }
        }

        if (guard35) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
            guard33 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C)
          {
            guard31 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_j;
            localB->ParaStep = rtu_BCMR_ParaStep_A[7];
          }
        }

        if (guard34) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard32 = true;
          } else {
            guard33 = true;
          }
        }

        if (guard33) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard30 = true;
          } else {
            guard31 = true;
          }
        }

        if (guard32) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard29 = true;
          } else {
            guard30 = true;
          }
        }

        if (guard31) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            guard28 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C)
          {
            guard25 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }

        if (guard30) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard27 = true;
          } else {
            guard28 = true;
          }
        }

        if (guard29) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard26 = true;
          } else {
            guard27 = true;
          }
        }

        if (guard28) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard24 = true;
          } else {
            guard25 = true;
          }
        }

        if (guard27) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard23 = true;
          } else {
            guard24 = true;
          }
        }

        if (guard26) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard22 = true;
          } else {
            guard23 = true;
          }
        }

        if (guard25) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            guard21 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
          {
            guard17 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }

        if (guard24) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard20 = true;
          } else {
            guard21 = true;
          }
        }

        if (guard23) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard19 = true;
          } else {
            guard20 = true;
          }
        }

        if (guard22) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard18 = true;
          } else {
            guard19 = true;
          }
        }

        if (guard21) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard16 = true;
          } else {
            guard17 = true;
          }
        }

        if (guard20) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard15 = true;
          } else {
            guard16 = true;
          }
        }

        if (guard19) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard14 = true;
          } else {
            guard15 = true;
          }
        }

        if (guard18) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard14 = true;
          }
        }

        if (guard17) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            guard13 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
          {
            guard10 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }

        if (guard16) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard12 = true;
          } else {
            guard13 = true;
          }
        }

        if (guard15) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard11 = true;
          } else {
            guard12 = true;
          }
        }

        if (guard14) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard11 = true;
          }
        }

        if (guard13) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard9 = true;
          } else {
            guard10 = true;
          }
        }

        if (guard12) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard8 = true;
          } else {
            guard9 = true;
          }
        }

        if (guard11) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard8 = true;
          }
        }

        if (guard10) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            guard7 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
          {
            guard5 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }

        if (guard9) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard6 = true;
          } else {
            guard7 = true;
          }
        }

        if (guard8) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard6 = true;
          }
        }

        if (guard7) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard4 = true;
          } else {
            guard5 = true;
          }
        }

        if (guard6) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard4 = true;
          }
        }

        if (guard5) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            guard3 = true;
          } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
          {
            guard2 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }

        if (guard4) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard3 = true;
          }
        }

        if (guard3) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            guard2 = true;
          }
        }

        if (guard2) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            guard1 = true;
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }

        if (guard1) {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_k;
        localB->ParaStep = rtu_BCMR_ParaStep_A[10];
      }
    }
  }
}

/* Function for Chart: '<S22>/ParaStep1' */
static void BCMR_DChrgParaCalc_ParaStep13_k(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  boolean_T guard38 = false;
  boolean_T guard39 = false;
  boolean_T guard40 = false;
  boolean_T guard41 = false;
  boolean_T guard42 = false;
  boolean_T guard43 = false;
  boolean_T guard44 = false;
  boolean_T guard45 = false;
  boolean_T guard46 = false;
  if (rtu_BattTemp < rtu_BCMR_BattPara_A[11] - rtu_BCMR_HysRng_C) {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
      guard1 = false;
      guard2 = false;
      guard3 = false;
      guard4 = false;
      guard5 = false;
      guard6 = false;
      guard7 = false;
      guard8 = false;
      guard9 = false;
      guard10 = false;
      guard11 = false;
      guard12 = false;
      guard13 = false;
      guard14 = false;
      guard15 = false;
      guard16 = false;
      guard17 = false;
      guard18 = false;
      guard19 = false;
      guard20 = false;
      guard21 = false;
      guard22 = false;
      guard23 = false;
      guard24 = false;
      guard25 = false;
      guard26 = false;
      guard27 = false;
      guard28 = false;
      guard29 = false;
      guard30 = false;
      guard31 = false;
      guard32 = false;
      guard33 = false;
      guard34 = false;
      guard35 = false;
      guard36 = false;
      guard37 = false;
      guard38 = false;
      guard39 = false;
      guard40 = false;
      guard41 = false;
      guard42 = false;
      guard43 = false;
      guard44 = false;
      guard45 = false;
      guard46 = false;
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                          guard1 = true;
                        } else {
                          guard22 = true;
                        }
                      } else {
                        guard27 = true;
                      }
                    } else {
                      guard31 = true;
                    }
                  } else {
                    guard35 = true;
                  }
                } else {
                  guard38 = true;
                }
              } else {
                guard41 = true;
              }
            } else {
              guard43 = true;
            }
          } else {
            guard45 = true;
          }
        } else {
          guard46 = true;
        }
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
        guard46 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_k;
        localB->ParaStep = rtu_BCMR_ParaStep_A[10];
      }

      if (guard46) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard45 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard44 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }
      }

      if (guard45) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard43 = true;
        } else {
          guard44 = true;
        }
      }

      if (guard44) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard42 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard40 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_n;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }
      }

      if (guard43) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard41 = true;
        } else {
          guard42 = true;
        }
      }

      if (guard42) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard39 = true;
        } else {
          guard40 = true;
        }
      }

      if (guard41) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard38 = true;
        } else {
          guard39 = true;
        }
      }

      if (guard40) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard34 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_j;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }
      }

      if (guard39) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard36 = true;
        } else {
          guard37 = true;
        }
      }

      if (guard38) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard35 = true;
        } else {
          guard36 = true;
        }
      }

      if (guard37) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard33 = true;
        } else {
          guard34 = true;
        }
      }

      if (guard36) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard32 = true;
        } else {
          guard33 = true;
        }
      }

      if (guard35) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard31 = true;
        } else {
          guard32 = true;
        }
      }

      if (guard34) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard30 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard26 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }
      }

      if (guard33) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          guard30 = true;
        }
      }

      if (guard32) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard28 = true;
        } else {
          guard29 = true;
        }
      }

      if (guard31) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard27 = true;
        } else {
          guard28 = true;
        }
      }

      if (guard30) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard25 = true;
        } else {
          guard26 = true;
        }
      }

      if (guard29) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard24 = true;
        } else {
          guard25 = true;
        }
      }

      if (guard28) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard23 = true;
        } else {
          guard24 = true;
        }
      }

      if (guard27) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          guard23 = true;
        }
      }

      if (guard26) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard21 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard17 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[5];
        }
      }

      if (guard25) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard20 = true;
        } else {
          guard21 = true;
        }
      }

      if (guard24) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard19 = true;
        } else {
          guard20 = true;
        }
      }

      if (guard23) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard18 = true;
        } else {
          guard19 = true;
        }
      }

      if (guard22) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard18 = true;
        }
      }

      if (guard21) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          guard17 = true;
        }
      }

      if (guard20) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard15 = true;
        } else {
          guard16 = true;
        }
      }

      if (guard19) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard14 = true;
        } else {
          guard15 = true;
        }
      }

      if (guard18) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard14 = true;
        }
      }

      if (guard17) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard13 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard10 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
          localB->ParaStep = rtu_BCMR_ParaStep_A[4];
        }
      }

      if (guard16) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard12 = true;
        } else {
          guard13 = true;
        }
      }

      if (guard15) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard11 = true;
        } else {
          guard12 = true;
        }
      }

      if (guard14) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard11 = true;
        }
      }

      if (guard13) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard9 = true;
        } else {
          guard10 = true;
        }
      }

      if (guard12) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard8 = true;
        } else {
          guard9 = true;
        }
      }

      if (guard11) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard8 = true;
        }
      }

      if (guard10) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard7 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard5 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[3];
        }
      }

      if (guard9) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard6 = true;
        } else {
          guard7 = true;
        }
      }

      if (guard8) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard6 = true;
        }
      }

      if (guard7) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard4 = true;
        } else {
          guard5 = true;
        }
      }

      if (guard6) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard4 = true;
        }
      }

      if (guard5) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard3 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard2 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
          localB->ParaStep = rtu_BCMR_ParaStep_A[2];
        }
      }

      if (guard4) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard3 = true;
        }
      }

      if (guard3) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard2 = true;
        }
      }

      if (guard2) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
          localB->ParaStep = rtu_BCMR_ParaStep_A[1];
        }
      }

      if (guard1) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
        localB->ParaStep = rtu_BCMR_ParaStep_A[0];
      }
    } else {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep12_l;
      localB->ParaStep = rtu_BCMR_ParaStep_A[11];
    }
  } else {
    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[12]) {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep14_c;
      localB->ParaStep = rtu_BCMR_ParaStep_A[13];
    }
  }
}

/* Function for Chart: '<S22>/ParaStep1' */
static void BCMR_DChrgParaCalc_ParaStep14_h(real32_T rtu_BattTemp, const
  real32_T rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14],
  real32_T rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  boolean_T guard25 = false;
  boolean_T guard26 = false;
  boolean_T guard27 = false;
  boolean_T guard28 = false;
  boolean_T guard29 = false;
  boolean_T guard30 = false;
  boolean_T guard31 = false;
  boolean_T guard32 = false;
  boolean_T guard33 = false;
  boolean_T guard34 = false;
  boolean_T guard35 = false;
  boolean_T guard36 = false;
  boolean_T guard37 = false;
  boolean_T guard38 = false;
  boolean_T guard39 = false;
  boolean_T guard40 = false;
  boolean_T guard41 = false;
  boolean_T guard42 = false;
  boolean_T guard43 = false;
  boolean_T guard44 = false;
  boolean_T guard45 = false;
  boolean_T guard46 = false;
  boolean_T guard47 = false;
  boolean_T guard48 = false;
  boolean_T guard49 = false;
  boolean_T guard50 = false;
  boolean_T guard51 = false;
  boolean_T guard52 = false;
  boolean_T guard53 = false;
  boolean_T guard54 = false;
  boolean_T guard55 = false;
  boolean_T guard56 = false;
  if (rtu_BattTemp < rtu_BCMR_BattPara_A[12] - rtu_BCMR_HysRng_C) {
    if (rtu_BattTemp < rtu_BCMR_BattPara_A[11] - rtu_BCMR_HysRng_C) {
      guard1 = false;
      guard2 = false;
      guard3 = false;
      guard4 = false;
      guard5 = false;
      guard6 = false;
      guard7 = false;
      guard8 = false;
      guard9 = false;
      guard10 = false;
      guard11 = false;
      guard12 = false;
      guard13 = false;
      guard14 = false;
      guard15 = false;
      guard16 = false;
      guard17 = false;
      guard18 = false;
      guard19 = false;
      guard20 = false;
      guard21 = false;
      guard22 = false;
      guard23 = false;
      guard24 = false;
      guard25 = false;
      guard26 = false;
      guard27 = false;
      guard28 = false;
      guard29 = false;
      guard30 = false;
      guard31 = false;
      guard32 = false;
      guard33 = false;
      guard34 = false;
      guard35 = false;
      guard36 = false;
      guard37 = false;
      guard38 = false;
      guard39 = false;
      guard40 = false;
      guard41 = false;
      guard42 = false;
      guard43 = false;
      guard44 = false;
      guard45 = false;
      guard46 = false;
      guard47 = false;
      guard48 = false;
      guard49 = false;
      guard50 = false;
      guard51 = false;
      guard52 = false;
      guard53 = false;
      guard54 = false;
      guard55 = false;
      guard56 = false;
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] -
                        rtu_BCMR_HysRng_C) {
                      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] -
                          rtu_BCMR_HysRng_C) {
                        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] -
                            rtu_BCMR_HysRng_C) {
                          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                            guard1 = true;
                          } else {
                            guard27 = true;
                          }
                        } else {
                          guard32 = true;
                        }
                      } else {
                        guard37 = true;
                      }
                    } else {
                      guard41 = true;
                    }
                  } else {
                    guard45 = true;
                  }
                } else {
                  guard48 = true;
                }
              } else {
                guard51 = true;
              }
            } else {
              guard53 = true;
            }
          } else {
            guard55 = true;
          }
        } else {
          guard56 = true;
        }
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[10] - rtu_BCMR_HysRng_C) {
        guard56 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep12_l;
        localB->ParaStep = rtu_BCMR_ParaStep_A[11];
      }

      if (guard56) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          guard55 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[9] - rtu_BCMR_HysRng_C) {
          guard54 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep11_k;
          localB->ParaStep = rtu_BCMR_ParaStep_A[10];
        }
      }

      if (guard55) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard53 = true;
        } else {
          guard54 = true;
        }
      }

      if (guard54) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard52 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[8] - rtu_BCMR_HysRng_C) {
          guard50 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep10_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[9];
        }
      }

      if (guard53) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard51 = true;
        } else {
          guard52 = true;
        }
      }

      if (guard52) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard49 = true;
        } else {
          guard50 = true;
        }
      }

      if (guard51) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard48 = true;
        } else {
          guard49 = true;
        }
      }

      if (guard50) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard47 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[7] - rtu_BCMR_HysRng_C) {
          guard44 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_n;
          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
        }
      }

      if (guard49) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard46 = true;
        } else {
          guard47 = true;
        }
      }

      if (guard48) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard45 = true;
        } else {
          guard46 = true;
        }
      }

      if (guard47) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard43 = true;
        } else {
          guard44 = true;
        }
      }

      if (guard46) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard42 = true;
        } else {
          guard43 = true;
        }
      }

      if (guard45) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard41 = true;
        } else {
          guard42 = true;
        }
      }

      if (guard44) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard40 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          guard36 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_j;
          localB->ParaStep = rtu_BCMR_ParaStep_A[7];
        }
      }

      if (guard43) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard39 = true;
        } else {
          guard40 = true;
        }
      }

      if (guard42) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard38 = true;
        } else {
          guard39 = true;
        }
      }

      if (guard41) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard37 = true;
        } else {
          guard38 = true;
        }
      }

      if (guard40) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard35 = true;
        } else {
          guard36 = true;
        }
      }

      if (guard39) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard34 = true;
        } else {
          guard35 = true;
        }
      }

      if (guard38) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard33 = true;
        } else {
          guard34 = true;
        }
      }

      if (guard37) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard32 = true;
        } else {
          guard33 = true;
        }
      }

      if (guard36) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard31 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          guard26 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
          localB->ParaStep = rtu_BCMR_ParaStep_A[6];
        }
      }

      if (guard35) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard30 = true;
        } else {
          guard31 = true;
        }
      }

      if (guard34) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard29 = true;
        } else {
          guard30 = true;
        }
      }

      if (guard33) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard28 = true;
        } else {
          guard29 = true;
        }
      }

      if (guard32) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard27 = true;
        } else {
          guard28 = true;
        }
      }

      if (guard31) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard25 = true;
        } else {
          guard26 = true;
        }
      }

      if (guard30) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard24 = true;
        } else {
          guard25 = true;
        }
      }

      if (guard29) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard23 = true;
        } else {
          guard24 = true;
        }
      }

      if (guard28) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard22 = true;
        } else {
          guard23 = true;
        }
      }

      if (guard27) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard22 = true;
        }
      }

      if (guard26) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard21 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          guard17 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[5];
        }
      }

      if (guard25) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard20 = true;
        } else {
          guard21 = true;
        }
      }

      if (guard24) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard19 = true;
        } else {
          guard20 = true;
        }
      }

      if (guard23) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard18 = true;
        } else {
          guard19 = true;
        }
      }

      if (guard22) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard18 = true;
        }
      }

      if (guard21) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard16 = true;
        } else {
          guard17 = true;
        }
      }

      if (guard20) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard15 = true;
        } else {
          guard16 = true;
        }
      }

      if (guard19) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard14 = true;
        } else {
          guard15 = true;
        }
      }

      if (guard18) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard14 = true;
        }
      }

      if (guard17) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard13 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          guard10 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
          localB->ParaStep = rtu_BCMR_ParaStep_A[4];
        }
      }

      if (guard16) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard12 = true;
        } else {
          guard13 = true;
        }
      }

      if (guard15) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard11 = true;
        } else {
          guard12 = true;
        }
      }

      if (guard14) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard11 = true;
        }
      }

      if (guard13) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard9 = true;
        } else {
          guard10 = true;
        }
      }

      if (guard12) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard8 = true;
        } else {
          guard9 = true;
        }
      }

      if (guard11) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard8 = true;
        }
      }

      if (guard10) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard7 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          guard5 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
          localB->ParaStep = rtu_BCMR_ParaStep_A[3];
        }
      }

      if (guard9) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard6 = true;
        } else {
          guard7 = true;
        }
      }

      if (guard8) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard6 = true;
        }
      }

      if (guard7) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard4 = true;
        } else {
          guard5 = true;
        }
      }

      if (guard6) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard4 = true;
        }
      }

      if (guard5) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard3 = true;
        } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          guard2 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
          localB->ParaStep = rtu_BCMR_ParaStep_A[2];
        }
      }

      if (guard4) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard3 = true;
        }
      }

      if (guard3) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          guard2 = true;
        }
      }

      if (guard2) {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          guard1 = true;
        } else {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
          localB->ParaStep = rtu_BCMR_ParaStep_A[1];
        }
      }

      if (guard1) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
        localB->ParaStep = rtu_BCMR_ParaStep_A[0];
      }
    } else {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaC_IN_ParaStep13_c;
      localB->ParaStep = rtu_BCMR_ParaStep_A[12];
    }
  } else {
    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[13]) {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_Init_g;
      localB->ParaStep = 0U;
    }
  }
}

/* System reset for atomic system: '<S22>/ParaStep1' */
void BCMR_DChrgParaC_ParaStep1_Reset(B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  localDW->is_active_c18_BCMR_DChrgParaCal = 0U;
  localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrg_IN_NO_ACTIVE_CHILD_b;
  localB->ParaStep = 0U;
}

/* Output and update for atomic system: '<S22>/ParaStep1' */
void BCMR_DChrgParaCalc_ParaStep1(real32_T rtu_BattTemp, const real32_T
  rtu_BCMR_BattPara_A[14], const uint8_T rtu_BCMR_ParaStep_A[14], real32_T
  rtu_BCMR_HysRng_C, B_ParaStep1_BCMR_DChrgParaCal_T *localB,
  DW_ParaStep1_BCMR_DChrgParaCa_T *localDW)
{
  boolean_T guard1 = false;
  boolean_T guard2 = false;
  boolean_T guard3 = false;
  boolean_T guard4 = false;
  boolean_T guard5 = false;
  boolean_T guard6 = false;
  boolean_T guard7 = false;
  boolean_T guard8 = false;
  boolean_T guard9 = false;
  boolean_T guard10 = false;
  boolean_T guard11 = false;
  boolean_T guard12 = false;
  boolean_T guard13 = false;
  boolean_T guard14 = false;
  boolean_T guard15 = false;
  boolean_T guard16 = false;
  boolean_T guard17 = false;
  boolean_T guard18 = false;
  boolean_T guard19 = false;
  boolean_T guard20 = false;
  boolean_T guard21 = false;
  boolean_T guard22 = false;
  boolean_T guard23 = false;
  boolean_T guard24 = false;
  if (localDW->is_active_c18_BCMR_DChrgParaCal == 0U) {
    localDW->is_active_c18_BCMR_DChrgParaCal = 1U;
    localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCalc_IN_Init_g;
    localB->ParaStep = 0U;
  } else {
    guard1 = false;
    guard2 = false;
    guard3 = false;
    guard4 = false;
    guard5 = false;
    guard6 = false;
    guard7 = false;
    guard8 = false;
    guard9 = false;
    guard10 = false;
    guard11 = false;
    guard12 = false;
    guard13 = false;
    guard14 = false;
    guard15 = false;
    guard16 = false;
    guard17 = false;
    guard18 = false;
    guard19 = false;
    guard20 = false;
    guard21 = false;
    guard22 = false;
    guard23 = false;
    guard24 = false;
    switch (localDW->is_c18_BCMR_DChrgParaCalc) {
     case BCMR_DChrgParaCalc_IN_Init_g:
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
        localB->ParaStep = rtu_BCMR_ParaStep_A[0];
      } else {
        if (rtu_BattTemp >= rtu_BCMR_BattPara_A[0]) {
          if (rtu_BattTemp >= rtu_BCMR_BattPara_A[1]) {
            if (rtu_BattTemp >= rtu_BCMR_BattPara_A[2]) {
              if (rtu_BattTemp >= rtu_BCMR_BattPara_A[3]) {
                if (rtu_BattTemp >= rtu_BCMR_BattPara_A[4]) {
                  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[5]) {
                    if (rtu_BattTemp >= rtu_BCMR_BattPara_A[6]) {
                      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[7]) {
                        if (rtu_BattTemp >= rtu_BCMR_BattPara_A[8]) {
                          if (rtu_BattTemp >= rtu_BCMR_BattPara_A[9]) {
                            if (rtu_BattTemp >= rtu_BCMR_BattPara_A[10]) {
                              if (rtu_BattTemp >= rtu_BCMR_BattPara_A[11]) {
                                if (rtu_BattTemp >= rtu_BCMR_BattPara_A[12]) {
                                  if (rtu_BattTemp >= rtu_BCMR_BattPara_A[13]) {
                                    localDW->is_c18_BCMR_DChrgParaCalc =
                                      BCMR_DChrgParaCalc_IN_Init_g;
                                    localB->ParaStep = 0U;
                                  } else {
                                    localDW->is_c18_BCMR_DChrgParaCalc =
                                      BCMR_DChrgParaC_IN_ParaStep14_c;
                                    localB->ParaStep = rtu_BCMR_ParaStep_A[13];
                                  }
                                } else {
                                  localDW->is_c18_BCMR_DChrgParaCalc =
                                    BCMR_DChrgParaC_IN_ParaStep13_c;
                                  localB->ParaStep = rtu_BCMR_ParaStep_A[12];
                                }
                              } else {
                                localDW->is_c18_BCMR_DChrgParaCalc =
                                  BCMR_DChrgParaC_IN_ParaStep12_l;
                                localB->ParaStep = rtu_BCMR_ParaStep_A[11];
                              }
                            } else {
                              localDW->is_c18_BCMR_DChrgParaCalc =
                                BCMR_DChrgParaC_IN_ParaStep11_k;
                              localB->ParaStep = rtu_BCMR_ParaStep_A[10];
                            }
                          } else {
                            localDW->is_c18_BCMR_DChrgParaCalc =
                              BCMR_DChrgParaC_IN_ParaStep10_b;
                            localB->ParaStep = rtu_BCMR_ParaStep_A[9];
                          }
                        } else {
                          localDW->is_c18_BCMR_DChrgParaCalc =
                            BCMR_DChrgParaCa_IN_ParaStep9_n;
                          localB->ParaStep = rtu_BCMR_ParaStep_A[8];
                        }
                      } else {
                        localDW->is_c18_BCMR_DChrgParaCalc =
                          BCMR_DChrgParaCa_IN_ParaStep8_j;
                        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
                      }
                    } else {
                      localDW->is_c18_BCMR_DChrgParaCalc =
                        BCMR_DChrgParaCa_IN_ParaStep7_g;
                      localB->ParaStep = rtu_BCMR_ParaStep_A[6];
                    }
                  } else {
                    localDW->is_c18_BCMR_DChrgParaCalc =
                      BCMR_DChrgParaCa_IN_ParaStep6_c;
                    localB->ParaStep = rtu_BCMR_ParaStep_A[5];
                  }
                } else {
                  localDW->is_c18_BCMR_DChrgParaCalc =
                    BCMR_DChrgParaCa_IN_ParaStep5_o;
                  localB->ParaStep = rtu_BCMR_ParaStep_A[4];
                }
              } else {
                localDW->is_c18_BCMR_DChrgParaCalc =
                  BCMR_DChrgParaCa_IN_ParaStep4_c;
                localB->ParaStep = rtu_BCMR_ParaStep_A[3];
              }
            } else {
              localDW->is_c18_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep3_n;
              localB->ParaStep = rtu_BCMR_ParaStep_A[2];
            }
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep1_b:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[0]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
      break;

     case BCMR_DChrgParaC_IN_ParaStep10_b:
      BCMR_DChrgParaCalc_ParaStep10_e(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep11_k:
      BCMR_DChrgParaCalc_ParaStep11_k(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep12_l:
      BCMR_DChrgParaCalc_ParaStep12_k(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep13_c:
      BCMR_DChrgParaCalc_ParaStep13_k(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaC_IN_ParaStep14_c:
      BCMR_DChrgParaCalc_ParaStep14_h(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;

     case BCMR_DChrgParaCa_IN_ParaStep2_p:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[1]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
          localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
          localB->ParaStep = rtu_BCMR_ParaStep_A[0];
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep3_n:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[2]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
            localB->ParaStep = rtu_BCMR_ParaStep_A[0];
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
            localB->ParaStep = rtu_BCMR_ParaStep_A[1];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep4_c:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[3]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
        localB->ParaStep = rtu_BCMR_ParaStep_A[4];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
              localDW->is_c18_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep1_b;
              localB->ParaStep = rtu_BCMR_ParaStep_A[0];
            } else {
              localDW->is_c18_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep2_p;
              localB->ParaStep = rtu_BCMR_ParaStep_A[1];
            }
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
            localB->ParaStep = rtu_BCMR_ParaStep_A[2];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep5_o:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[4]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[5];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                guard1 = true;
              } else {
                guard5 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
            {
              guard5 = true;
            } else {
              localDW->is_c18_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep3_n;
              localB->ParaStep = rtu_BCMR_ParaStep_A[2];
            }
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[3];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep6_c:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[5]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
        localB->ParaStep = rtu_BCMR_ParaStep_A[6];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                  guard2 = true;
                } else {
                  guard9 = true;
                }
              } else {
                guard12 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C)
            {
              guard12 = true;
            } else {
              localDW->is_c18_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep4_c;
              localB->ParaStep = rtu_BCMR_ParaStep_A[3];
            }
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
            localB->ParaStep = rtu_BCMR_ParaStep_A[4];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep7_g:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[6]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep8_j;
        localB->ParaStep = rtu_BCMR_ParaStep_A[7];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                    guard3 = true;
                  } else {
                    guard13 = true;
                  }
                } else {
                  guard17 = true;
                }
              } else {
                guard20 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C)
            {
              guard20 = true;
            } else {
              localDW->is_c18_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep5_o;
              localB->ParaStep = rtu_BCMR_ParaStep_A[4];
            }
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep6_c;
            localB->ParaStep = rtu_BCMR_ParaStep_A[5];
          }
        }
      }
      break;

     case BCMR_DChrgParaCa_IN_ParaStep8_j:
      if (rtu_BattTemp >= rtu_BCMR_BattPara_A[7]) {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep9_n;
        localB->ParaStep = rtu_BCMR_ParaStep_A[8];
      } else {
        if (rtu_BattTemp < rtu_BCMR_BattPara_A[6] - rtu_BCMR_HysRng_C) {
          if (rtu_BattTemp < rtu_BCMR_BattPara_A[5] - rtu_BCMR_HysRng_C) {
            if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C) {
              if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
                if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
                  if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C)
                  {
                    if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
                      guard4 = true;
                    } else {
                      guard18 = true;
                    }
                  } else {
                    guard21 = true;
                  }
                } else {
                  guard23 = true;
                }
              } else {
                guard24 = true;
              }
            } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[4] - rtu_BCMR_HysRng_C)
            {
              guard24 = true;
            } else {
              localDW->is_c18_BCMR_DChrgParaCalc =
                BCMR_DChrgParaCa_IN_ParaStep6_c;
              localB->ParaStep = rtu_BCMR_ParaStep_A[5];
            }
          } else {
            localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep7_g;
            localB->ParaStep = rtu_BCMR_ParaStep_A[6];
          }
        }
      }
      break;

     default:
      BCMR_DChrgParaCalc_ParaStep9_c(rtu_BattTemp, rtu_BCMR_BattPara_A,
        rtu_BCMR_ParaStep_A, rtu_BCMR_HysRng_C, localB, localDW);
      break;
    }

    if (guard24) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
        guard23 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[3] - rtu_BCMR_HysRng_C) {
        guard22 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep5_o;
        localB->ParaStep = rtu_BCMR_ParaStep_A[4];
      }
    }

    if (guard23) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard21 = true;
      } else {
        guard22 = true;
      }
    }

    if (guard22) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard19 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard16 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      }
    }

    if (guard21) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard18 = true;
      } else {
        guard19 = true;
      }
    }

    if (guard20) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard17 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[2] - rtu_BCMR_HysRng_C) {
        guard14 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep4_c;
        localB->ParaStep = rtu_BCMR_ParaStep_A[3];
      }
    }

    if (guard19) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard15 = true;
      } else {
        guard16 = true;
      }
    }

    if (guard18) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard15 = true;
      }
    }

    if (guard17) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard13 = true;
      } else {
        guard14 = true;
      }
    }

    if (guard16) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard11 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard8 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard15) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard11 = true;
      }
    }

    if (guard14) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard10 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard7 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard13) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        guard10 = true;
      }
    }

    if (guard12) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard9 = true;
      } else if (rtu_BattTemp < rtu_BCMR_BattPara_A[1] - rtu_BCMR_HysRng_C) {
        guard6 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep3_n;
        localB->ParaStep = rtu_BCMR_ParaStep_A[2];
      }
    }

    if (guard11) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        guard8 = true;
      }
    }

    if (guard10) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        guard7 = true;
      }
    }

    if (guard9) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard2 = true;
      } else {
        guard6 = true;
      }
    }

    if (guard8) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard4 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard7) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard3 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard6) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard2 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard5) {
      if (rtu_BattTemp < rtu_BCMR_BattPara_A[0]) {
        guard1 = true;
      } else {
        localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep2_p;
        localB->ParaStep = rtu_BCMR_ParaStep_A[1];
      }
    }

    if (guard4) {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard3) {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard2) {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }

    if (guard1) {
      localDW->is_c18_BCMR_DChrgParaCalc = BCMR_DChrgParaCa_IN_ParaStep1_b;
      localB->ParaStep = rtu_BCMR_ParaStep_A[0];
    }
  }
}

/* Model step function */
void BCMR_DChrgParaCalc_step(void)
{
  real32_T rtb_Switch5_o;
  boolean_T rtb_Compare_lm;
  boolean_T rtb_Compare_bbb;
  boolean_T rtb_Compare_j;
  real32_T rtb_Product_n;
  real32_T rtb_Abs3;
  real32_T rtb_Abs2;
  boolean_T rtb_LogicalOperator3_l;
  boolean_T rtb_LogicalOperator3_i;
  uint16_T rtb_Switch2_j;
  uint16_T rtb_Switch2_h;
  real32_T rtb_Switch1_ol[196];
  real32_T rtb_Switch2_a[196];
  real32_T Switch1_b[14];
  real32_T Switch1_c[14];
  int32_T i;
  real32_T rtb_DcChrgCurrAbnorm2_idx_1;
  real32_T rtb_DcChrgCurrAbnorm2_idx_0;
  real32_T rtb_Product_m_idx_0;
  real32_T u1;
  BCMR_stDChrgCnnt = (uint8_T)BCMR_bDChrgCnnt;
  if ((BSPR_uCellVoltMax < BCMR_uCellVoltHiValVld_C) && (BSPR_uCellVoltMax >
       BCMR_uCellVoltLoValVld_C)) {
    rtb_DcChrgCurrAbnorm2_idx_0 = BSPR_uCellVoltMax;
  } else {
    rtb_DcChrgCurrAbnorm2_idx_0 = BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE;
  }

  if (BSPR_tCellTempMin < BCMR_tBattTempSelcLmtDwn_C) {
    rtb_Switch5_o = BSPR_tCellTempMin;
  } else {
    rtb_Switch5_o = BSPR_tCellTempMax;
  }

  rtb_Compare_lm = (rtb_Switch5_o < BCMR_tBattTempSelcLmtDwn_C);
  rtb_Compare_bbb = (rtb_Switch5_o >= BCMR_tBattTempSelcLmtUp_C);
  if (rtb_Compare_lm) {
    rtb_Product_m_idx_0 = BCMR_tiDChrgParaBase_C;
  } else {
    rtb_Product_m_idx_0 = 0.0F;
  }

  if (BCMR_tiBattTempSwitch_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_m) {
    rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiBattTempSwitch_C;
  } else {
    rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_m;
  }

  rtb_Switch5_o = (rtb_Product_m_idx_0 + rtb_DcChrgCurrAbnorm2_idx_1) *
    (real32_T)rtb_Compare_lm;
  BCMR_DChrgParaCalc_DW.Delay_DSTATE_m = rtb_Switch5_o;
  if (rtb_Compare_bbb) {
    rtb_Product_n = BCMR_tiDChrgParaBase_C;
  } else {
    rtb_Product_n = 0.0F;
  }

  if (BCMR_tiBattTempSwitch_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_e) {
    rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiBattTempSwitch_C;
  } else {
    rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_e;
  }

  rtb_Product_n = (rtb_Product_n + rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)
    rtb_Compare_bbb;
  rtb_Compare_lm = (rtb_Product_n > BCMR_tiBattTempSwitch_C);
  BCMR_DChrgParaCalc_DW.Delay_DSTATE_e = rtb_Product_n;
  for (i = 0; i < 14; i++) {
    if (rtb_Switch5_o > BCMR_tiBattTempSwitch_C) {
      Switch1_c[i] = BCMR_uDcChrgCellVolt1_A[i];
    } else if (rtb_Compare_lm) {
      Switch1_c[i] = BCMR_uDcChrgCellVolt3_A[i];
    } else {
      Switch1_c[i] = BCMR_uDcChrgCellVolt2_A[i];
    }
  }

  if (BCMR_cntCoolDFC_CW > 6) {
    rtb_Compare_lm = ((DFC_CoolPerfPlaus_ASW & 24) == 24);
  } else {
    rtb_Compare_lm = true;
  }

  for (i = 0; i < 14; i++) {
    if (rtb_Compare_lm) {
      Switch1_b[i] = BCMR_tDcChrgCellTemp2_A[i];
    } else {
      Switch1_b[i] = BCMR_tDcChrgCellTemp1_A[i];
    }
  }

  rtb_Compare_bbb = ((COMR_valAcmDist >= BCMR_kmAcmDist_C) && COMR_flgAcmDistVld);
  BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE = rtb_DcChrgCurrAbnorm2_idx_0;
  if (BCMR_bDChrgWkup) {
    if (!BCMR_DChrgParaCalc_DW.DcChgParaCalc_MODE) {
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_g = 0.0F;
      BCMR_DChrgParaCalc_DW.is_active_c3_BCMR_DChrgParaCalc = 0U;
      BCMR_DChrgParaCalc_B.BCMR_rSocInit = 0.0F;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_o = 0.0F;
      BCMR_DChrgParaCalc_DW.Delay2_DSTATE_ch = false;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_ol = false;
      BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE = 0.0F;
      BCMR_DChrgParaCalc_DW.Delay2_DSTATE_p = false;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_i = false;
      BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_k = 0.0F;
      BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_f = 0U;
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE_o = true;
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE_i = true;
      BCMR_DChrgParaCalc_DW.StateName_o = false;
      BCMR_DChrgParaCalc_DW.StateName_c = false;
      BCMR_DChrgParaCalc_DW.StateName = 0U;
      BCMR_DChrgParaCalc_DW.StateName_co = false;
      BCMR_DChrgParaCalc_DW.StateName_l = 0U;
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE_d = true;
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE_k = true;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_ej = 0.0F;
      BCMR_DChrgParaCalc_DW.DcChgParaCalc_MODE = true;
    }

    rtb_Compare_j = (BSPR_iBattCurr <= -5.0F);
    if (rtb_Compare_j) {
      rtb_Switch5_o = BCMR_tiDChrgParaBase_C;
    } else {
      rtb_Switch5_o = 0.0F;
    }

    if (BCMR_tiDChrgDetParaDebs_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_g) {
      rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiDChrgDetParaDebs_C;
    } else {
      rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_g;
    }

    rtb_Switch5_o = (rtb_Switch5_o + rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)
      rtb_Compare_j;
    BCMR_bDChrgCurrOutputEna = (rtb_Switch5_o >= BCMR_tiDChrgDetParaDebs_C);
    BCMR_DChrgParaCalc_DW.Delay_DSTATE_g = rtb_Switch5_o;
    if (BCMR_bDChrgCurrOutputEna && (BCMR_DChrgParaCalc_PrevZCX.Chart_Trig_ZCE
         != POS_ZCSIG) && (BCMR_DChrgParaCalc_DW.is_active_c3_BCMR_DChrgParaCalc
         == 0U)) {
      BCMR_DChrgParaCalc_DW.is_active_c3_BCMR_DChrgParaCalc = 1U;
      BCMR_DChrgParaCalc_B.BCMR_rSocInit = BSER_rSoc;
    }

    BCMR_DChrgParaCalc_PrevZCX.Chart_Trig_ZCE = BCMR_bDChrgCurrOutputEna;
    if (BCMR_bDChrgCurrOutputEna) {
      if (!BCMR_DChrgParaCalc_DW.AccumAhCalc_MODE) {
        BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE_h = 0.0F;
        BCMR_DChrgParaCalc_DW.AccumAhCalc_MODE = true;
      }

      rtb_Switch5_o = BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE_h + (real32_T)fabs
        (BSPR_iBattCurr);
      rtb_Product_n = 2.77777781E-6F * rtb_Switch5_o;
      if (BCMR_DChrgParaCalc_DW.IC_FirstOutputTime) {
        BCMR_DChrgParaCalc_DW.IC_FirstOutputTime = false;
        rtb_Product_n = 0.0F;
      }

      BCMR_ahAccumDChrgAh = rtb_Product_n;
      BCMR_bAccumAhDChrgFul = (0.01F * BCMR_DChrgParaCalc_B.BCMR_rSocInit *
        BCMR_ahDChgBattNominalCapa_C + BCMR_ahAccumDChrgAh >= 0.9F *
        BCMR_ahDChgBattNominalCapa_C);
      BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE_h = rtb_Switch5_o;
    } else {
      if (BCMR_DChrgParaCalc_DW.AccumAhCalc_MODE) {
        BCMR_DChrgParaCalc_DW.AccumAhCalc_MODE = false;
      }
    }

    rtb_Compare_j = ((COMR_stVcuFalutLvl == 2) || (DSMR_stFaultRank == 2));
    if (rtb_Compare_j) {
      rtb_Switch5_o = BCMR_tiDChrgParaBase_C;
    } else {
      rtb_Switch5_o = 0.0F;
    }

    if (BCMR_tiDChrgDetParaDebs_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_o) {
      rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiDChrgDetParaDebs_C;
    } else {
      rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_o;
    }

    rtb_Switch5_o = (rtb_Switch5_o + rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)
      rtb_Compare_j;
    BCMR_flgDChrgPwrRdc = (rtb_Switch5_o > BCMR_tiDChrgDetParaDebs_C);
    BCMR_DChrgParaCalc_DW.Delay_DSTATE_o = rtb_Switch5_o;
    if (rtb_Compare_lm) {
      rtb_Switch5_o = BCMR_vDcChrgFullCellVoltCool_C;
    } else {
      rtb_Switch5_o = BCMR_vDcChrgFullCellVolt_C;
    }

    BCMR_bCellVoltFull = (rtb_DcChrgCurrAbnorm2_idx_0 - rtb_Switch5_o >= 0.0F);
    rtb_Compare_j = ((rtb_DcChrgCurrAbnorm2_idx_0 - rtb_Switch5_o) -
                     BCMR_uDcChrgFullCellVoltOff_C >= 0.0F);
    rtb_LogicalOperator3_l = !BCMR_DChrgParaCalc_DW.Delay1_DSTATE_o;
    BCMR_DChrgParaCalc_DW.Delay1_DSTATE_o = BCMR_bDChrgFul;
    rtb_LogicalOperator3_i = !BCMR_DChrgParaCalc_DW.Delay1_DSTATE_i;
    BCMR_DChrgParaCalc_DW.Delay1_DSTATE_i = rtb_Compare_j;
    if (rtb_LogicalOperator3_l && BCMR_bDChrgFul) {
      BCMR_numCellVoltFullCnt = 0U;
    } else {
      BCMR_numCellVoltFullCnt = (uint8_T)((uint32_T)(rtb_LogicalOperator3_i &&
        rtb_Compare_j) + BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_f);
    }

    BCMR_bCellVoltFullCnt = (BCMR_numCellVoltFullCnt >= BCMR_numCellVoltFull_C);
    BCMR_bCellVoltFullTriger = (BCMR_numCellVoltFullCnt >=
      BCMR_numCellVoltFullThree_C);
    BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_f = BCMR_numCellVoltFullCnt;
    rtb_LogicalOperator3_l = ((BSPR_uBattVolt >= BCMR_uDChrgVolfFul_C) ||
      (BCMR_bCellVoltFull && ((real32_T)fabs(BSPR_iBattCurr) <
      BCMR_iDChrgCurrCutOff_C)) || (BCMR_bCellVoltFullCnt &&
      BCMR_bDChrgFulChkTenEna_C));
    if (BCMR_DChrgParaCalc_DW.StateName_c) {
      rtb_Switch2_j = 0U;
    } else {
      rtb_Switch2_j = BCMR_DChrgParaCalc_DW.StateName;
    }

    if (rtb_LogicalOperator3_l) {
      rtb_Switch2_j = (uint16_T)((uint32_T)BCMR_tiDChrgFullBase_C +
        rtb_Switch2_j);
      if (!(rtb_Switch2_j <= 60000)) {
        rtb_Switch2_j = 60000U;
      }
    } else if (rtb_Switch2_j >= BCMR_tiDChrgFullBase_C) {
      rtb_Switch2_j = (uint16_T)((uint32_T)rtb_Switch2_j -
        BCMR_tiDChrgFullBase_C);
    } else {
      rtb_Switch2_j = 0U;
    }

    rtb_Compare_j = (rtb_Switch2_j > BCMR_tiDChrgFullDebs_C);
    if (BCMR_DChrgParaCalc_DW.StateName_co) {
      rtb_Switch2_h = 0U;
    } else {
      rtb_Switch2_h = BCMR_DChrgParaCalc_DW.StateName_l;
    }

    if (!rtb_LogicalOperator3_l) {
      rtb_Switch2_h = (uint16_T)((uint32_T)BCMR_tiDChrgFullBase_C +
        rtb_Switch2_h);
      if (!(rtb_Switch2_h <= 60000)) {
        rtb_Switch2_h = 60000U;
      }
    } else if (rtb_Switch2_h >= BCMR_tiDChrgFullBase_C) {
      rtb_Switch2_h = (uint16_T)((uint32_T)rtb_Switch2_h -
        BCMR_tiDChrgFullBase_C);
    } else {
      rtb_Switch2_h = 0U;
    }

    rtb_LogicalOperator3_i = (rtb_Switch2_h > BCMR_tiDChrgFullDebs_C);
    if (!BCMR_DChrgParaCalc_DW.StateName_o) {
      rtb_LogicalOperator3_l = (rtb_Compare_j ||
        BCMR_DChrgParaCalc_DW.StateName_o);
    } else {
      rtb_LogicalOperator3_l = ((!rtb_LogicalOperator3_i) &&
        BCMR_DChrgParaCalc_DW.StateName_o);
    }

    BCMR_DChrgParaCalc_DW.StateName_o = rtb_LogicalOperator3_l;
    BCMR_DChrgParaCalc_DW.StateName_c = rtb_Compare_j;
    BCMR_DChrgParaCalc_DW.StateName = rtb_Switch2_j;
    BCMR_DChrgParaCalc_DW.StateName_co = rtb_LogicalOperator3_i;
    BCMR_DChrgParaCalc_DW.StateName_l = rtb_Switch2_h;
    rtb_Compare_j = !BCMR_DChrgParaCalc_DW.Delay1_DSTATE_d;
    BCMR_DChrgParaCalc_DW.Delay1_DSTATE_d =
      BCMR_DChrgParaCalc_DW.Delay2_DSTATE_ch;
    BCMR_bCellVoltFullTmrRaw = ((BCMR_DChrgParaCalc_DW.Delay_DSTATE_ol ||
      BCMR_bCellVoltFullTriger) && (!(BCMR_bDChrgFul ||
      BCMR_DChrgParaCalc_DW.Delay2_DSTATE_ch)));
    if (rtb_Compare_j && BCMR_DChrgParaCalc_DW.Delay2_DSTATE_ch) {
      rtb_Switch5_o = 0.0F;
    } else {
      if (BCMR_bCellVoltFullTmrRaw) {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = 0.0F;
      }

      rtb_Switch5_o = rtb_DcChrgCurrAbnorm2_idx_1 +
        BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE;
    }

    BCMR_bCellVoltFullTmr = (rtb_Switch5_o > BCMR_tiCellVoltFullCnt_C);
    BCMR_flgDChrgFulChkRaw = (rtb_LogicalOperator3_l || (BCMR_bCellVoltFullTmr &&
      BCMR_bDChrgFulChkThreeEna_C));
    rtb_Compare_j = !BCMR_DChrgParaCalc_DW.Delay1_DSTATE_k;
    BCMR_DChrgParaCalc_DW.Delay1_DSTATE_k =
      BCMR_DChrgParaCalc_DW.Delay2_DSTATE_p;
    BCMR_flgDChrgFulChk = ((BCMR_DChrgParaCalc_DW.Delay_DSTATE_i ||
      BCMR_flgDChrgFulChkRaw) && (!BCMR_DChrgParaCalc_DW.Delay2_DSTATE_p));
    if (rtb_Compare_j && BCMR_DChrgParaCalc_DW.Delay2_DSTATE_p) {
      rtb_Product_n = 0.0F;
    } else {
      if (BCMR_flgDChrgFulChk) {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = 0.0F;
      }

      rtb_Product_n = rtb_DcChrgCurrAbnorm2_idx_1 +
        BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_k;
    }

    BCMR_DChrgParaCalc_DW.Delay2_DSTATE_ch = BCMR_bCellVoltFullTmr;
    BCMR_DChrgParaCalc_DW.Delay_DSTATE_ol = BCMR_bCellVoltFullTmrRaw;
    BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE = rtb_Switch5_o;
    BCMR_DChrgParaCalc_DW.Delay2_DSTATE_p = (rtb_Product_n >
      BCMR_tiDChgFullPreHold_C);
    BCMR_DChrgParaCalc_DW.Delay_DSTATE_i = BCMR_flgDChrgFulChk;
    BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_k = rtb_Product_n;
    BCMR_bDChrgCurrReqEna = ((BCMR_stDChrgDebugOut != 24) &&
      (BCMR_stDChrgDebugOut >= BCMR_numCurrCalcEna) && (BCMR_stDChrgDebugOut <
      34));
    if (BCMR_bDChrgCurrReqEna) {
      if (!BCMR_DChrgParaCalc_DW.CurrReqCalc_MODE) {
        BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE = 1000.0F;
        BCMR_DChrgParaCalc_DW.Delay2_DSTATE = 0U;
        BCMR_DChrgParaCalc_DW.Delay3_DSTATE = 0U;
        BCMR_DChrgParaCalc_DW.Delay2_DSTATE_c = 0U;
        BCMR_DChrgParaCalc_DW.Delay3_DSTATE_o = 0U;
        BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_a = true;
        BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_h = true;
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE[0] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[0] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE[1] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[1] = 0.0F;
        BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_n = true;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_ml = 0.0F;
        BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_c = true;
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_e = 0.0F;
        BCMR_DChrgParaCa_ParaStep_Reset(&BCMR_DChrgParaCalc_B.sf_ParaStep,
          &BCMR_DChrgParaCalc_DW.sf_ParaStep);
        BCMR_DChrgParaC_ParaStep2_Reset(&BCMR_DChrgParaCalc_B.sf_ParaStep2,
          &BCMR_DChrgParaCalc_DW.sf_ParaStep2);
        BCMR_DChrgParaCa_ParaStep_Reset(&BCMR_DChrgParaCalc_B.sf_ParaStep_c,
          &BCMR_DChrgParaCalc_DW.sf_ParaStep_c);
        BCMR_DChrgParaC_ParaStep1_Reset(&BCMR_DChrgParaCalc_B.sf_ParaStep1,
          &BCMR_DChrgParaCalc_DW.sf_ParaStep1);
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_p = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[0] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[0] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[0] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[1] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[1] = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[1] = 0.0F;
        BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_c = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE = 1.0F;
        BCMR_DChrgParaCalc_DW.is_active_c7_BCMR_DChrgParaCalc = 0U;
        BCMR_DChrgParaCalc_DW.is_c7_BCMR_DChrgParaCalc =
          BCMR_DChrg_IN_NO_ACTIVE_CHILD_g;
        BCMR_iBattDCCurrReqFinal = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_my = 0.0F;
        BCMR_DChrgParaCalc_DW.Delay_DSTATE_ea = 0.0F;
        BCMR_DChrgParaCalc_DW.CurrReqCalc_MODE = true;
      }

      BCMR_DChrgParaCalc_ParaStep(rtb_DcChrgCurrAbnorm2_idx_0, Switch1_c, ((
        const uint8_T *)&(BCMR_uCellVoltStep_A[0])), BCMR_uCellVoltHysRng_C,
        BCMR_flgDChrgFulChk, &BCMR_DChrgParaCalc_B.sf_ParaStep,
        &BCMR_DChrgParaCalc_DW.sf_ParaStep);
      BCMR_numDChrgVoltStepMax = BCMR_DChrgParaCalc_B.sf_ParaStep.ParaStep;
      BCMR_DChrgParaCalc_ParaStep2(BSPR_tCellTempMax, Switch1_b, ((const uint8_T
        *)&(BCMR_uCellTempStep_A[0])), BCMR_uCellTempHysRng_C,
        &BCMR_DChrgParaCalc_B.sf_ParaStep2, &BCMR_DChrgParaCalc_DW.sf_ParaStep2);
      BCMR_numDChrgTempStepMax = BCMR_DChrgParaCalc_B.sf_ParaStep2.ParaStep;
      if (!BCMR_DChrgParaCalc_DW.CurrPro_MODE) {
        BCMR_DChrgParaCalc_HoldOn_Reset(&BCMR_DChrgParaCalc_B.sf_HoldOn,
          &BCMR_DChrgParaCalc_DW.sf_HoldOn);
        BCMR_DChrgParaCalc_DW.CurrPro_MODE = true;
      }

      for (i = 0; i < 196; i++) {
        if (rtb_Compare_bbb) {
          rtb_Switch1_ol[i] = BCMR_iDcChrgCurrOld_T[i];
          rtb_Switch2_a[i] = BCMR_iDcChrgCurrOldAbnorm_T[i];
        } else {
          rtb_Switch1_ol[i] = BCMR_iDcChrgCurrNew_T[i];
          rtb_Switch2_a[i] = BCMR_iDcChrgCurrAbnorm_T[i];
        }
      }

      BCMR_DChrgParaCalc_HoldOn(BCMR_DChrgParaCalc_DW.Delay2_DSTATE,
        BCMR_numDChrgVoltStepMax, BCMR_numDChrgTempStepMax,
        BCMR_DChrgParaCalc_DW.Delay3_DSTATE, rtb_Compare_lm, rtb_Switch1_ol,
        rtb_Switch2_a, BCMR_tiDChrgFulParaDebs_C + BCMR_tiHoldOnToCurrCalcOff_C,
        &BCMR_DChrgParaCalc_B.sf_HoldOn, &BCMR_DChrgParaCalc_DW.sf_HoldOn);
      if (BCMR_cntSoh_CW > 7) {
        rtb_DcChrgCurrAbnorm2_idx_1 = 0.01F * BSER_rSoh;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = 1.0F;
      }

      BCMR_iDChrgCalcMax = BCMR_ahDChgBattNominalCapa_C *
        BCMR_DChrgParaCalc_B.sf_HoldOn.CurrCalc * rtb_DcChrgCurrAbnorm2_idx_1;
      CurrMethodMax = BCMR_DChrgParaCalc_B.sf_HoldOn.CurrMethod;
      BCMR_DChrgParaCalc_ParaStep(rtb_DcChrgCurrAbnorm2_idx_0, Switch1_c, ((
        const uint8_T *)&(BCMR_uCellVoltStep_A[0])), BCMR_uCellVoltHysRng_C,
        BCMR_flgDChrgFulChk, &BCMR_DChrgParaCalc_B.sf_ParaStep_c,
        &BCMR_DChrgParaCalc_DW.sf_ParaStep_c);
      BCMR_numDChrgVoltStepMix2 = BCMR_DChrgParaCalc_B.sf_ParaStep_c.ParaStep;
      BCMR_DChrgParaCalc_ParaStep1(BSPR_tCellTempMin, Switch1_b, ((const uint8_T
        *)&(BCMR_uCellTempStep_A[0])), BCMR_uCellTempHysRng_C,
        &BCMR_DChrgParaCalc_B.sf_ParaStep1, &BCMR_DChrgParaCalc_DW.sf_ParaStep1);
      BCMR_numDChrgTempStepMix2 = BCMR_DChrgParaCalc_B.sf_ParaStep1.ParaStep;
      if (!BCMR_DChrgParaCalc_DW.CurrPro_MODE_m) {
        BCMR_DChrgParaCalc_HoldOn_Reset(&BCMR_DChrgParaCalc_B.sf_HoldOn_i,
          &BCMR_DChrgParaCalc_DW.sf_HoldOn_i);
        BCMR_DChrgParaCalc_DW.CurrPro_MODE_m = true;
      }

      for (i = 0; i < 196; i++) {
        if (rtb_Compare_bbb) {
          rtb_Switch1_ol[i] = BCMR_iDcChrgCurrOld_T[i];
          rtb_Switch2_a[i] = BCMR_iDcChrgCurrOldAbnorm_T[i];
        } else {
          rtb_Switch1_ol[i] = BCMR_iDcChrgCurrNew_T[i];
          rtb_Switch2_a[i] = BCMR_iDcChrgCurrAbnorm_T[i];
        }
      }

      BCMR_DChrgParaCalc_HoldOn(BCMR_DChrgParaCalc_DW.Delay2_DSTATE_c,
        BCMR_numDChrgVoltStepMix2, BCMR_numDChrgTempStepMix2,
        BCMR_DChrgParaCalc_DW.Delay3_DSTATE_o, rtb_Compare_lm, rtb_Switch1_ol,
        rtb_Switch2_a, BCMR_tiDChrgFulParaDebs_C + BCMR_tiHoldOnToCurrCalcOff_C,
        &BCMR_DChrgParaCalc_B.sf_HoldOn_i, &BCMR_DChrgParaCalc_DW.sf_HoldOn_i);
      if (BCMR_cntSoh_CW > 7) {
        rtb_DcChrgCurrAbnorm2_idx_1 = 0.01F * BSER_rSoh;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = 1.0F;
      }

      BCMR_iDChrgCalcMix2 = BCMR_ahDChgBattNominalCapa_C *
        BCMR_DChrgParaCalc_B.sf_HoldOn_i.CurrCalc * rtb_DcChrgCurrAbnorm2_idx_1;
      if (BCMR_iDChrgCalcMax >= BCMR_iDChrgCalcMix2) {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_iDChrgCalcMax;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_iDChrgCalcMix2;
      }

      if (BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE <= rtb_DcChrgCurrAbnorm2_idx_1)
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE;
      }

      rtb_Product_n = rtb_DcChrgCurrAbnorm2_idx_1 - BCMR_iCurrDcr_C;
      if (BCMR_iDChrgCalcMax <= BCMR_iDChrgCalcMix2) {
        rtb_Switch5_o = BCMR_iDChrgCalcMax;
      } else {
        rtb_Switch5_o = BCMR_iDChrgCalcMix2;
      }

      equalFlg = (rtb_Product_n >= rtb_Switch5_o);
      if (equalFlg) {
        rtb_Switch5_o = rtb_Product_n;
      }

      if (BCMR_bDChrgCurrReqEna) {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = 0.0F;
      }

      if (BCMR_tiDChrgCurrReqCalDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_p) {
        rtb_Product_n = BCMR_tiDChrgCurrReqCalDly_C;
      } else {
        rtb_Product_n = BCMR_DChrgParaCalc_DW.Delay_DSTATE_p;
      }

      rtb_Product_n = (rtb_DcChrgCurrAbnorm2_idx_1 + rtb_Product_n) * (real32_T)
        BCMR_bDChrgCurrReqEna;
      rtb_Compare_j = (rtb_Product_n > BCMR_tiDChrgCurrReqCalDly_C);
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_p = rtb_Product_n;
      rtb_LogicalOperator3_l = ((real32_T)fabs(BSPR_tCellTempMax -
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE[0]) >= BCMR_tBattTempMaxFil_C);
      rtb_LogicalOperator3_i = ((real32_T)fabs(BSPR_tCellTempMin -
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE[1]) >= BCMR_tBattTempMaxFil_C);
      if (rtb_LogicalOperator3_l) {
        rtb_Product_n = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Product_n = 0.0F;
      }

      if (BCMR_tiBattTempMaxFilDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[0])
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiBattTempMaxFilDly_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[0];
      }

      rtb_Abs3 = (rtb_Product_n + rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)
        rtb_LogicalOperator3_l;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[0] = rtb_Abs3;
      rtb_Product_n = rtb_Abs3;
      if (rtb_LogicalOperator3_i) {
        rtb_Abs3 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Abs3 = 0.0F;
      }

      if (BCMR_tiBattTempMaxFilDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[1])
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiBattTempMaxFilDly_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[1];
      }

      rtb_Abs3 = (rtb_Abs3 + rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)
        rtb_LogicalOperator3_i;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_k[1] = rtb_Abs3;
      if (BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_a) {
        BCMR_tBattTempMaxFil[0] = BSPR_tCellTempMax;
        BCMR_tBattTempMaxFil[1] = BSPR_tCellTempMin;
      } else {
        if (rtb_Product_n > BCMR_tiBattTempMaxFilDly_C) {
          BCMR_tBattTempMaxFil[0] = BSPR_tCellTempMax;
        } else {
          BCMR_tBattTempMaxFil[0] = BCMR_DChrgParaCalc_DW.Delay1_DSTATE[0];
        }

        if (rtb_Abs3 > BCMR_tiBattTempMaxFilDly_C) {
          BCMR_tBattTempMaxFil[1] = BSPR_tCellTempMin;
        } else {
          BCMR_tBattTempMaxFil[1] = BCMR_DChrgParaCalc_DW.Delay1_DSTATE[1];
        }
      }

      rtb_LogicalOperator3_l = (rtb_DcChrgCurrAbnorm2_idx_0 -
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[0] >= BCMR_uCellVoltMaxIncFil_C);
      if (rtb_LogicalOperator3_l) {
        rtb_Abs2 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Abs2 = 0.0F;
      }

      if (BCMR_tiCellVoltMaxFilDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[0])
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiCellVoltMaxFilDly_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[0];
      }

      rtb_Abs3 = (rtb_Abs2 + rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)
        rtb_LogicalOperator3_l;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[0] = rtb_Abs3;
      rtb_LogicalOperator3_l = (rtb_DcChrgCurrAbnorm2_idx_0 -
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[0] <= BCMR_uCellVoltMaxDecFil_C);
      if (rtb_LogicalOperator3_l) {
        rtb_Abs2 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Abs2 = 0.0F;
      }

      if (BCMR_tiCellVoltMaxFilDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[0])
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiCellVoltMaxFilDly_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[0];
      }

      rtb_DcChrgCurrAbnorm2_idx_1 = (rtb_Abs2 + rtb_DcChrgCurrAbnorm2_idx_1) *
        (real32_T)rtb_LogicalOperator3_l;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[0] = rtb_DcChrgCurrAbnorm2_idx_1;
      rtb_Product_n = rtb_Abs3;
      rtb_Product_m_idx_0 = rtb_DcChrgCurrAbnorm2_idx_1;
      rtb_LogicalOperator3_l = (rtb_DcChrgCurrAbnorm2_idx_0 -
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[1] >= BCMR_uCellVoltMaxIncFil_C);
      if (rtb_LogicalOperator3_l) {
        rtb_Abs2 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Abs2 = 0.0F;
      }

      if (BCMR_tiCellVoltMaxFilDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[1])
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiCellVoltMaxFilDly_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[1];
      }

      rtb_Abs3 = (rtb_Abs2 + rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)
        rtb_LogicalOperator3_l;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_h[1] = rtb_Abs3;
      rtb_LogicalOperator3_l = (rtb_DcChrgCurrAbnorm2_idx_0 -
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[1] <= BCMR_uCellVoltMaxDecFil_C);
      if (rtb_LogicalOperator3_l) {
        rtb_Abs2 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Abs2 = 0.0F;
      }

      if (BCMR_tiCellVoltMaxFilDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[1])
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiCellVoltMaxFilDly_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[1];
      }

      rtb_DcChrgCurrAbnorm2_idx_1 = (rtb_Abs2 + rtb_DcChrgCurrAbnorm2_idx_1) *
        (real32_T)rtb_LogicalOperator3_l;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_c[1] = rtb_DcChrgCurrAbnorm2_idx_1;
      if (BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_h) {
        BCMR_uCellVoltMaxFil[0] = rtb_DcChrgCurrAbnorm2_idx_0;
        BCMR_uCellVoltMaxFil[1] = rtb_DcChrgCurrAbnorm2_idx_0;
      } else {
        if (rtb_Product_n > BCMR_tiCellVoltMaxFilDly_C) {
          BCMR_uCellVoltMaxFil[0] = rtb_DcChrgCurrAbnorm2_idx_0;
        } else if (rtb_Product_m_idx_0 > BCMR_tiCellVoltMaxFilDly_C) {
          BCMR_uCellVoltMaxFil[0] = rtb_DcChrgCurrAbnorm2_idx_0;
        } else {
          BCMR_uCellVoltMaxFil[0] = BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[0];
        }

        if (rtb_Abs3 > BCMR_tiCellVoltMaxFilDly_C) {
          BCMR_uCellVoltMaxFil[1] = rtb_DcChrgCurrAbnorm2_idx_0;
        } else if (rtb_DcChrgCurrAbnorm2_idx_1 > BCMR_tiCellVoltMaxFilDly_C) {
          BCMR_uCellVoltMaxFil[1] = rtb_DcChrgCurrAbnorm2_idx_0;
        } else {
          BCMR_uCellVoltMaxFil[1] = BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[1];
        }
      }

      if (rtb_Compare_lm) {
        if (rtb_Compare_bbb) {
          rtb_DcChrgCurrAbnorm2_idx_0 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[0], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[0], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltOld_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrOldAbnormMAP_T[0])),
             rtCP_DcChrgCurrAbnorm_maxIndex, 17U);
          rtb_DcChrgCurrAbnorm2_idx_1 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[1], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[1], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltOld_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrOldAbnormMAP_T[0])),
             rtCP_DcChrgCurrAbnorm_maxIndex, 17U);
        } else {
          rtb_DcChrgCurrAbnorm2_idx_0 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[0], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[0], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltNew_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrAbnormMAP_T[0])),
             rtCP_DcChrgCurrAbnorm1_maxIndex, 17U);
          rtb_DcChrgCurrAbnorm2_idx_1 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[1], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[1], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltNew_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrAbnormMAP_T[0])),
             rtCP_DcChrgCurrAbnorm1_maxIndex, 17U);
        }

        BCMR_iDCCurrReqRaw[0] = rtb_DcChrgCurrAbnorm2_idx_0;
        BCMR_iDCCurrReqRaw[1] = rtb_DcChrgCurrAbnorm2_idx_1;
      } else {
        if (rtb_Compare_bbb) {
          rtb_DcChrgCurrAbnorm2_idx_0 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[0], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[0], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltOld_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrOldMAP_T[0])), rtCP_DcChrgCurrAbnorm2_maxIndex,
             17U);
          rtb_DcChrgCurrAbnorm2_idx_1 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[1], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[1], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltOld_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrOldMAP_T[0])), rtCP_DcChrgCurrAbnorm2_maxIndex,
             17U);
        } else {
          rtb_DcChrgCurrAbnorm2_idx_0 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[0], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[0], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltNew_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrNewMAP_T[0])), rtCP_DcChrgCurrAbnorm3_maxIndex,
             17U);
          rtb_DcChrgCurrAbnorm2_idx_1 = look2_iflf_binlcapw
            (BCMR_tTempDisMapY_A[plook_u32f_bincka(BCMR_tBattTempMaxFil[1], ((
                const real32_T *)&(BCMR_tTempDisMapX_A[0])), 16U)],
             BCMR_uCellVoltMaxFil[1], ((const real32_T *)
              &(BCMR_tDcChrgCellTemp_A[0])), ((const real32_T *)
              &(BCMR_uDcChrgCellVoltNew_A[0])), ((const real32_T *)
              &(BCMR_iDcChrgCurrNewMAP_T[0])), rtCP_DcChrgCurrAbnorm3_maxIndex,
             17U);
        }

        BCMR_iDCCurrReqRaw[0] = rtb_DcChrgCurrAbnorm2_idx_0;
        BCMR_iDCCurrReqRaw[1] = rtb_DcChrgCurrAbnorm2_idx_1;
      }

      rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_ahDChgBattNominalCapa_C *
        BCMR_iDCCurrReqRaw[0];
      rtb_DcChrgCurrAbnorm2_idx_0 = BCMR_ahDChgBattNominalCapa_C *
        BCMR_iDCCurrReqRaw[1];
      if (rtb_DcChrgCurrAbnorm2_idx_1 <= rtb_DcChrgCurrAbnorm2_idx_0) {
        rtb_DcChrgCurrAbnorm2_idx_0 = rtb_DcChrgCurrAbnorm2_idx_1;
      }

      if (!(BCMR_DChrgParaCalc_DW.Delay_DSTATE > 0.0F)) {
        rtb_DcChrgCurrAbnorm2_idx_0 = (rtb_DcChrgCurrAbnorm2_idx_0 -
          BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_c) * BCMR_iDCCurrFil_C +
          BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_c;
      }

      BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_c = rtb_DcChrgCurrAbnorm2_idx_0;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE = 0.0F;
      if (BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_n) {
        BCMR_iDCCurrReqFil2 = rtb_DcChrgCurrAbnorm2_idx_0;
      } else if ((real32_T)fabs(rtb_DcChrgCurrAbnorm2_idx_0 -
                  BCMR_DChrgParaCalc_DW.Delay_DSTATE_ml) >= BCMR_iDCCurrDiff_C)
      {
        BCMR_iDCCurrReqFil2 = rtb_DcChrgCurrAbnorm2_idx_0;
      } else {
        BCMR_iDCCurrReqFil2 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_ml;
      }

      if (BSPR_iBattCurr <= 0.0F) {
        rtb_DcChrgCurrAbnorm2_idx_1 = BSPR_iBattCurr;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = 0.0F;
      }

      rtb_DcChrgCurrAbnorm2_idx_0 = (real32_T)fabs(rtb_DcChrgCurrAbnorm2_idx_1);
      if (BCMR_DChrgParaCalc_DW.is_active_c7_BCMR_DChrgParaCalc == 0U) {
        BCMR_DChrgParaCalc_DW.is_active_c7_BCMR_DChrgParaCalc = 1U;
        BCMR_DChrgParaCalc_DW.is_c7_BCMR_DChrgParaCalc =
          BCMR_DChrgParaCalc_IN_Init_n;
        BCMR_iBattDCCurrReqFinal = 0.0F;
      } else {
        switch (BCMR_DChrgParaCalc_DW.is_c7_BCMR_DChrgParaCalc) {
         case BCMR_DChrgParaCalc_IN_Charging:
          if (BCMR_bDChrgStopEna) {
            BCMR_DChrgParaCalc_DW.is_c7_BCMR_DChrgParaCalc =
              BCMR_DChrgParaCalc_IN_ZeroCurr;
            BCMR_iBattDCCurrReqFinal = 0.0F;
          } else if (rtb_Compare_j) {
            rtb_Product_n = BCMR_iDCCurrReqFil2 - BCMR_iBattDCCurrReqFinal;
            if (rtb_Product_n < BCMR_iDCCurrDecThrd_C) {
              rtb_Product_n = BCMR_iBattDCCurrReqFinal - BCMR_iDCCurrDecStep_C;
              if (rtb_Product_n >= BCMR_iDCCurrReqFil2) {
                BCMR_iBattDCCurrReqFinal = rtb_Product_n;
              } else {
                BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
              }
            } else if (rtb_Product_n > BCMR_iDCCurrIncThrd_C) {
              if (BCMR_bCurrIncDeltaLimEna_C) {
                rtb_Product_n = BCMR_iBattDCCurrReqFinal + BCMR_iDCCurrIncStep_C;
                if (rtb_Product_n <= BCMR_iDCCurrReqFil2) {
                  BCMR_iBattDCCurrReqFinal = rtb_Product_n;
                } else {
                  BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
                }

                u1 = (real32_T)rtb_DcChrgCurrAbnorm2_idx_0 +
                  BCMR_iDCCurrDeltaLim_C;
                if (!(BCMR_iBattDCCurrReqFinal <= u1)) {
                  BCMR_iBattDCCurrReqFinal = (real32_T)u1;
                }
              } else {
                rtb_Product_n = BCMR_iBattDCCurrReqFinal + BCMR_iDCCurrIncStep_C;
                if (rtb_Product_n <= BCMR_iDCCurrReqFil2) {
                  BCMR_iBattDCCurrReqFinal = rtb_Product_n;
                } else {
                  BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
                }
              }
            } else {
              BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
            }
          } else {
            BCMR_iBattDCCurrReqFinal = 0.0F;
          }
          break;

         case BCMR_DChrgParaCalc_IN_Init_n:
          if (rtb_Compare_j) {
            BCMR_DChrgParaCalc_DW.is_c7_BCMR_DChrgParaCalc =
              BCMR_DChrgParaCalc_IN_Charging;
            BCMR_iBattDCCurrReqFinal = 0.0F;
            rtb_Product_n = BCMR_iDCCurrReqFil2 - BCMR_iBattDCCurrReqFinal;
            if (rtb_Product_n < BCMR_iDCCurrDecThrd_C) {
              rtb_Product_n = BCMR_iBattDCCurrReqFinal - BCMR_iDCCurrDecStep_C;
              if (rtb_Product_n >= BCMR_iDCCurrReqFil2) {
                BCMR_iBattDCCurrReqFinal = rtb_Product_n;
              } else {
                BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
              }
            } else if (rtb_Product_n > BCMR_iDCCurrIncThrd_C) {
              if (BCMR_bCurrIncDeltaLimEna_C) {
                rtb_Product_n = BCMR_iBattDCCurrReqFinal + BCMR_iDCCurrIncStep_C;
                if (rtb_Product_n <= BCMR_iDCCurrReqFil2) {
                  BCMR_iBattDCCurrReqFinal = rtb_Product_n;
                } else {
                  BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
                }

                u1 = (real32_T)rtb_DcChrgCurrAbnorm2_idx_0 +
                  BCMR_iDCCurrDeltaLim_C;
                if (!(BCMR_iBattDCCurrReqFinal <= u1)) {
                  BCMR_iBattDCCurrReqFinal = (real32_T)u1;
                }
              } else {
                rtb_Product_n = BCMR_iBattDCCurrReqFinal + BCMR_iDCCurrIncStep_C;
                if (rtb_Product_n <= BCMR_iDCCurrReqFil2) {
                  BCMR_iBattDCCurrReqFinal = rtb_Product_n;
                } else {
                  BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
                }
              }
            } else {
              BCMR_iBattDCCurrReqFinal = BCMR_iDCCurrReqFil2;
            }
          }
          break;
        }
      }

      if (BCMR_bCurrCalSelect_C) {
        rtb_Product_n = rtb_Switch5_o;
      } else {
        rtb_Product_n = BCMR_iBattDCCurrReqFinal;
      }

      if (BCMR_flgDChrgPwrRdc) {
        rtb_Product_n = (real32_T)((real32_T)BCMR_pctBmsPwrRdc_C * rtb_Product_n);
      }

      if ((!BCMR_G1E0PlatformSwPara_C) && (COMR_stObcElecLck != 1)) {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_iDCCurElecUnLckLim_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = rtb_Product_n;
      }

      if (rtb_DcChrgCurrAbnorm2_idx_1 <= rtb_Product_n) {
        BCMR_DChrgParaCalc_B.MinMax2 = rtb_DcChrgCurrAbnorm2_idx_1;
      } else {
        BCMR_DChrgParaCalc_B.MinMax2 = rtb_Product_n;
      }

      rtb_DcChrgCurrAbnorm2_idx_0 = 1000.0F * COMR_pwrChrgLdReq;
      rtb_Compare_lm = ((real32_T)fabs(rtb_DcChrgCurrAbnorm2_idx_0 -
        BCMR_DChrgParaCalc_DW.Delay1_DSTATE_e) >= COMR_pwrChrgLdReqFil_C);
      if (rtb_Compare_lm) {
        rtb_Product_m_idx_0 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Product_m_idx_0 = 0.0F;
      }

      if (COMR_tipwrChrgLdReqFilDly_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_my)
      {
        rtb_DcChrgCurrAbnorm2_idx_1 = COMR_tipwrChrgLdReqFilDly_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_my;
      }

      rtb_Product_n = (rtb_Product_m_idx_0 + rtb_DcChrgCurrAbnorm2_idx_1) *
        (real32_T)rtb_Compare_lm;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_my = rtb_Product_n;
      if ((!BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_c) && (!(rtb_Product_n >
            COMR_tipwrChrgLdReqFilDly_C))) {
        rtb_DcChrgCurrAbnorm2_idx_0 = BCMR_DChrgParaCalc_DW.Delay1_DSTATE_e;
      }

      if (BSPR_tCellTempMin >= BCMR_tDchrgLoadLmt_C) {
        rtb_DcChrgCurrAbnorm2_idx_1 = rtb_DcChrgCurrAbnorm2_idx_0;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = 0.0F;
      }

      if (BSPR_uPackVolt > 0.0F) {
        rtb_Product_n = BSPR_uPackVolt;
      } else {
        rtb_Product_n = 408.0F;
      }

      BCMR_DChrgParaCalc_B.Gain1 = rtb_DcChrgCurrAbnorm2_idx_1 / rtb_Product_n *
        BCMR_rDchrgLoadCoef_C;
      rtb_Product_n = BCMR_DChrgParaCalc_B.MinMax2 + BCMR_DChrgParaCalc_B.Gain1;
      rtb_Abs3 = (real32_T)fabs(COMR_iDcChrgMinCurrOutputPmtdCml);
      rtb_Compare_lm = (BCMR_stDChrgMode == 3);
      if (rtb_Compare_lm) {
        rtb_Product_m_idx_0 = BCMR_tiDChrgParaBase_C;
      } else {
        rtb_Product_m_idx_0 = 0.0F;
      }

      if (BCMR_tiDcChrgPwrCCSDebs_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_ea) {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiDcChrgPwrCCSDebs_C;
      } else {
        rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_ea;
      }

      rtb_Product_m_idx_0 = (rtb_Product_m_idx_0 + rtb_DcChrgCurrAbnorm2_idx_1) *
        (real32_T)rtb_Compare_lm;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_ea = rtb_Product_m_idx_0;
      rtb_Abs2 = (real32_T)fabs(COMR_iDcChrgMaxCurrOutputPmtdCml);
      if (BCMR_numCcsPwrSelc_C > 2) {
        rtb_Product_m_idx_0 = rtb_Abs2;
      } else {
        if (rtb_Product_m_idx_0 > BCMR_tiDcChrgPwrCCSDebs_C) {
          if (COMR_tiDcChrgTimeActualCcs > BCMR_pCcsPwrSelc_C) {
            rtb_Product_m_idx_0 = COMR_tiDcChrgTimeActualCcs;
          } else {
            rtb_Product_m_idx_0 = rtb_Abs3;
          }
        } else {
          rtb_Product_m_idx_0 = rtb_Abs3;
        }

        rtb_Product_m_idx_0 = (real32_T)fabs(rtb_Product_m_idx_0);
        if (BSPR_uPackVolt > 0.0F) {
          rtb_DcChrgCurrAbnorm2_idx_1 = BSPR_uPackVolt;
        } else {
          rtb_DcChrgCurrAbnorm2_idx_1 = 408.0F;
        }

        rtb_Product_m_idx_0 = 1000.0F * rtb_Product_m_idx_0 /
          rtb_DcChrgCurrAbnorm2_idx_1;
      }

      if (BCMR_G1E0PlatformSwPara_C) {
        if (rtb_Abs2 >= rtb_Abs3) {
          rtb_Abs3 = rtb_Abs2;
        }

        if (rtb_Product_n <= rtb_Abs3) {
          BCMR_DChrgParaCalc_B.Switch2 = rtb_Product_n;
        } else {
          BCMR_DChrgParaCalc_B.Switch2 = rtb_Abs3;
        }
      } else if (BCMR_stDChrgMode == 2) {
        if (rtb_Abs2 <= rtb_Product_m_idx_0) {
          rtb_Product_m_idx_0 = rtb_Abs2;
        }

        if (rtb_Product_m_idx_0 <= rtb_Product_n) {
          BCMR_DChrgParaCalc_B.Switch2 = rtb_Product_m_idx_0;
        } else {
          BCMR_DChrgParaCalc_B.Switch2 = rtb_Product_n;
        }
      } else {
        if (rtb_Product_n <= rtb_Product_m_idx_0) {
          rtb_Product_m_idx_0 = rtb_Product_n;
        }

        rtb_DcChrgCurrAbnorm2_idx_1 = (real32_T)fabs(COMR_iDcChrgOutputCurrCcs);
        if (rtb_Product_m_idx_0 <= rtb_DcChrgCurrAbnorm2_idx_1) {
          BCMR_DChrgParaCalc_B.Switch2 = rtb_Product_m_idx_0;
        } else {
          BCMR_DChrgParaCalc_B.Switch2 = rtb_DcChrgCurrAbnorm2_idx_1;
        }
      }

      BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE = rtb_Switch5_o;
      BCMR_DChrgParaCalc_DW.Delay2_DSTATE = BCMR_numDChrgVoltStepMax;
      BCMR_DChrgParaCalc_DW.Delay3_DSTATE = BCMR_numDChrgTempStepMax;
      BCMR_DChrgParaCalc_DW.Delay2_DSTATE_c = BCMR_numDChrgVoltStepMix2;
      BCMR_DChrgParaCalc_DW.Delay3_DSTATE_o = BCMR_numDChrgTempStepMix2;
      BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_a = false;
      BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_h = false;
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE[0] = BCMR_tBattTempMaxFil[0];
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[0] = BCMR_uCellVoltMaxFil[0];
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE[1] = BCMR_tBattTempMaxFil[1];
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE_p[1] = BCMR_uCellVoltMaxFil[1];
      BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_n = false;
      BCMR_DChrgParaCalc_DW.Delay_DSTATE_ml = BCMR_iDCCurrReqFil2;
      BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_c = false;
      BCMR_DChrgParaCalc_DW.Delay1_DSTATE_e = rtb_DcChrgCurrAbnorm2_idx_0;
    } else {
      if (BCMR_DChrgParaCalc_DW.CurrReqCalc_MODE) {
        if (BCMR_DChrgParaCalc_DW.CurrPro_MODE) {
          BCMR_iDChrgCalcMax = 0.0F;
          CurrMethodMax = 0U;
          BCMR_DChrgParaCalc_DW.CurrPro_MODE = false;
        }

        if (BCMR_DChrgParaCalc_DW.CurrPro_MODE_m) {
          BCMR_iDChrgCalcMix2 = 0.0F;
          BCMR_DChrgParaCalc_DW.CurrPro_MODE_m = false;
        }

        BCMR_DChrgParaCalc_B.Switch2 = 0.0F;
        BCMR_DChrgParaCalc_B.MinMax2 = 0.0F;
        BCMR_DChrgParaCalc_B.Gain1 = 0.0F;
        BCMR_DChrgParaCalc_DW.CurrReqCalc_MODE = false;
      }
    }

    BCMR_DChrgParaCalc_Y.BCMR_ahAccumDChrgAh_i = BCMR_ahAccumDChrgAh;
    BCMR_iDChrgBattCurrReqCalc = BCMR_DChrgParaCalc_B.MinMax2;
    BCMR_iDChrgCurrReqCalc = BCMR_DChrgParaCalc_B.Switch2;
    BCMR_iDChrgLoadCurrReqCalc = BCMR_DChrgParaCalc_B.Gain1;
    if (COMR_uDcChrgMaxVoltOutputPmtdCml >= COMR_uDcChrgMinVoltOutputPmtdCml) {
      rtb_Product_n = COMR_uDcChrgMaxVoltOutputPmtdCml;
    } else {
      rtb_Product_n = COMR_uDcChrgMinVoltOutputPmtdCml;
    }

    if (!(rtb_Product_n <= BCMR_uDChrgVoltReq_C)) {
      rtb_Product_n = BCMR_uDChrgVoltReq_C;
    }

    rtb_DcChrgCurrAbnorm2_idx_1 = BSPR_uBattVolt + BCMR_uBattVoltOff_C;
    if (rtb_Product_n <= rtb_DcChrgCurrAbnorm2_idx_1) {
      BCMR_DChrgParaCalc_B.MinMax = rtb_Product_n;
    } else {
      BCMR_DChrgParaCalc_B.MinMax = rtb_DcChrgCurrAbnorm2_idx_1;
    }

    rtb_DcChrgCurrAbnorm2_idx_0 = (real32_T)fabs(BCMR_DChrgParaCalc_B.MinMax);
    rtb_Compare_lm = (((real32_T)fabs(COMR_uDcChrgMaxVoltOutputPmtdCml) >=
                       rtb_DcChrgCurrAbnorm2_idx_0) &&
                      (rtb_DcChrgCurrAbnorm2_idx_0 >= (real32_T)fabs
                       (COMR_uDcChrgMinVoltOutputPmtdCml)) &&
                      (!(COMR_uDcChrgMaxVoltOutputPmtdCml <=
                         BMCR_uDChrgerVoltMish_C)));
    if (rtb_Compare_lm) {
      rtb_Product_m_idx_0 = BCMR_tiDChrgParaBase_C;
    } else {
      rtb_Product_m_idx_0 = 0.0F;
    }

    if (BCMR_tiDChrgDetParaDebs_C <= BCMR_DChrgParaCalc_DW.Delay_DSTATE_ej) {
      rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_tiDChrgDetParaDebs_C;
    } else {
      rtb_DcChrgCurrAbnorm2_idx_1 = BCMR_DChrgParaCalc_DW.Delay_DSTATE_ej;
    }

    rtb_DcChrgCurrAbnorm2_idx_0 = (rtb_Product_m_idx_0 +
      rtb_DcChrgCurrAbnorm2_idx_1) * (real32_T)rtb_Compare_lm;
    BCMR_bStakeParaOk = (rtb_DcChrgCurrAbnorm2_idx_0 > BCMR_tiDChrgDetParaDebs_C);
    BCMR_DChrgParaCalc_DW.Delay_DSTATE_ej = rtb_DcChrgCurrAbnorm2_idx_0;
    BCMR_DChrgParaCalc_Y.BCMR_bAccumAhDChrgFul_f = BCMR_bAccumAhDChrgFul;
    BCMR_uDcChrgVoltReqCalc = BCMR_DChrgParaCalc_B.MinMax;
  } else {
    if (BCMR_DChrgParaCalc_DW.DcChgParaCalc_MODE) {
      if (BCMR_DChrgParaCalc_DW.AccumAhCalc_MODE) {
        BCMR_DChrgParaCalc_DW.AccumAhCalc_MODE = false;
      }

      if (BCMR_DChrgParaCalc_DW.CurrReqCalc_MODE) {
        if (BCMR_DChrgParaCalc_DW.CurrPro_MODE) {
          BCMR_iDChrgCalcMax = 0.0F;
          CurrMethodMax = 0U;
          BCMR_DChrgParaCalc_DW.CurrPro_MODE = false;
        }

        if (BCMR_DChrgParaCalc_DW.CurrPro_MODE_m) {
          BCMR_iDChrgCalcMix2 = 0.0F;
          BCMR_DChrgParaCalc_DW.CurrPro_MODE_m = false;
        }

        BCMR_DChrgParaCalc_B.Switch2 = 0.0F;
        BCMR_DChrgParaCalc_B.MinMax2 = 0.0F;
        BCMR_DChrgParaCalc_B.Gain1 = 0.0F;
        BCMR_DChrgParaCalc_DW.CurrReqCalc_MODE = false;
      }

      BCMR_iDChrgCurrReqCalc = 0.0F;
      BCMR_bStakeParaOk = false;
      BCMR_iDChrgBattCurrReqCalc = 0.0F;
      BCMR_iDChrgLoadCurrReqCalc = 0.0F;
      BCMR_DChrgParaCalc_Y.BCMR_ahAccumDChrgAh_i = 0.0F;
      BCMR_flgDChrgFulChk = false;
      BCMR_bDChrgCurrReqEna = false;
      BCMR_bDChrgCurrOutputEna = false;
      BCMR_DChrgParaCalc_DW.DcChgParaCalc_MODE = false;
    }

    BCMR_uDcChrgVoltReqCalc = 0.0F;
  }
}

/* Model initialize function */
void BCMR_DChrgParaCalc_initialize(void)
{
  /* Registration code */

  /* block I/O */

  /* custom signals */
  BCMR_uDcChrgVoltReqCalc = 0.0F;
  BCMR_iDChrgBattCurrReqCalc = 0.0F;
  BCMR_iDChrgCurrReqCalc = 0.0F;
  BCMR_iDChrgLoadCurrReqCalc = 0.0F;
  BCMR_stDChrgCnnt = ((uint8_T)0U);
  BCMR_bDChrgCurrReqEna = false;
  BCMR_bDChrgCurrOutputEna = false;
  BCMR_bStakeParaOk = false;
  BCMR_flgDChrgFulChk = false;

  /* external outputs */
  (void) memset((void *)&BCMR_DChrgParaCalc_Y, 0,
                sizeof(ExtY_BCMR_DChrgParaCalc_T));
  BCMR_DChrgParaCalc_Y.BCMR_ahAccumDChrgAh_i = 0.0F;
  BCMR_DChrgParaCalc_DW.IC_FirstOutputTime = true;
  BCMR_DChrgParaCalc_PrevZCX.Chart_Trig_ZCE = POS_ZCSIG;
  BCMR_DChrgParaCalc_DW.Delay1_DSTATE_o = true;
  BCMR_DChrgParaCalc_DW.Delay1_DSTATE_i = true;
  BCMR_DChrgParaCalc_DW.Delay1_DSTATE_d = true;
  BCMR_DChrgParaCalc_DW.Delay1_DSTATE_k = true;
  BCMR_DChrgParaCalc_DW.UnitDelay4_DSTATE = 1000.0F;
  BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_a = true;
  BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_h = true;
  BCMR_DChrgParaCalc_DW.UnitDelay_DSTATE_n = true;
  BCMR_DChrgParaCalc_DW.UnitDelay1_DSTATE_c = true;
  BCMR_DChrgParaCalc_DW.Delay_DSTATE = 1.0F;
}

/*
 * File trailer for generated code.
 *
 * [EOF]
 */
