SystemWfiConfig ()
{
  uint8 Major;
  uint8 Minor;
  uint32 U32MajorMinor;
  uint32 u32EdbStatus;
  struct SIUL2_Type * _1;
  unsigned char _2;
  long unsigned int _3;
  unsigned char _4;
  struct SECURITY_Type * _5;
  long unsigned int _6;
  struct MDM_AP_Type * _7;
  long unsigned int _8;
  struct MDM_AP_Type * _9;
  long unsigned int _10;
  struct MDM_AP_Type * _11;
  long unsigned int _12;
  struct MDM_AP_Type * _13;
  long unsigned int _14;
  struct MDM_AP_Type * _15;
  long unsigned int _16;
  struct MDM_AP_Type * _17;
  long unsigned int _18;
  struct MDM_AP_Type * _19;
  long unsigned int _20;
  struct MDM_AP_Type * _21;
  long unsigned int _22;
  struct MDM_AP_Type * _23;
  long unsigned int _24;
  struct MDM_AP_Type * _25;
  long unsigned int _26;
  struct MDM_AP_Type * _27;
  long unsigned int _28;
  struct MDM_AP_Type * _29;
  long unsigned int _30;
  struct MDM_AP_Type * _31;
  long unsigned int _32;
  struct MDM_AP_Type * _33;
  long unsigned int _34;
  struct MDM_AP_Type * _35;
  long unsigned int _36;
  struct MDM_AP_Type * _37;
  long unsigned int _38;

  <bb 2> :
  # DEBUG BEGIN_STMT
  u32EdbStatus_40 = 0;
  # DEBUG u32EdbStatus => u32EdbStatus_40
  # DEBUG BEGIN_STMT
  _1 = 1074380800B;
  U32MajorMinor_42 ={v} _1->MIDR1;
  # DEBUG U32MajorMinor => U32MajorMinor_42
  # DEBUG BEGIN_STMT
  _2 = (unsigned char) U32MajorMinor_42;
  Minor_43 = _2 & 15;
  # DEBUG Minor => Minor_43
  # DEBUG BEGIN_STMT
  _3 = U32MajorMinor_42 >> 4;
  _4 = (unsigned char) _3;
  Major_44 = _4 & 15;
  # DEBUG Major => Major_44
  # DEBUG BEGIN_STMT
  if (Major_44 == 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 3> :
  if (Minor_43 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _5 = 1074252032B;
  _6 ={v} _5->EXT_DBGSTAT;
  u32EdbStatus_45 = _6 & 1;
  # DEBUG u32EdbStatus => u32EdbStatus_45
  # DEBUG BEGIN_STMT
  if (u32EdbStatus_45 == 0)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _7 = 1372587520B;
  _8 ={v} _7->DAP_EN_CTRL;
  _9 = 1372587520B;
  _10 = _8 & 2147483647;
  _9->DAP_EN_CTRL ={v} _10;
  # DEBUG BEGIN_STMT
  _11 = 1372587520B;
  _12 ={v} _11->DAP_EN_CTRL;
  _13 = 1372587520B;
  _14 = _12 & 3221225471;
  _13->DAP_EN_CTRL ={v} _14;
  # DEBUG BEGIN_STMT
  _15 = 1372587520B;
  _16 ={v} _15->DAP_EN_CTRL;
  _17 = 1372587520B;
  _18 = _16 & 3758096383;
  _17->DAP_EN_CTRL ={v} _18;
  # DEBUG BEGIN_STMT
  _19 = 1372587520B;
  _20 ={v} _19->DAP_EN_CTRL;
  _21 = 1372587520B;
  _22 = _20 & 4026531839;
  _21->DAP_EN_CTRL ={v} _22;
  # DEBUG BEGIN_STMT
  _23 = 1372587520B;
  _24 ={v} _23->CONTROL;
  _25 = 1372587520B;
  _26 = _24 | 256;
  _25->CONTROL ={v} _26;
  # DEBUG BEGIN_STMT
  _27 = 1372587520B;
  _28 ={v} _27->CONTROL;
  _29 = 1372587520B;
  _30 = _28 | 512;
  _29->CONTROL ={v} _30;
  # DEBUG BEGIN_STMT
  _31 = 1372587520B;
  _32 ={v} _31->CONTROL;
  _33 = 1372587520B;
  _34 = _32 | 1024;
  _33->CONTROL ={v} _34;
  # DEBUG BEGIN_STMT
  _35 = 1372587520B;
  _36 ={v} _35->CORTEX_A53_A0_IP_DBG;
  _37 = 1372587520B;
  _38 = _36 | 32;
  _37->CORTEX_A53_A0_IP_DBG ={v} _38;

  <bb 6> :
  # DEBUG BEGIN_STMT
  return;

}


__attribute__((always_inline))
sys_m7_cache_clean ()
{
  uint32 ways;
  uint32 sets;
  uint32 ccsidr;
  struct S32_SCB_Type * _1;
  struct S32_SCB_Type * _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  struct S32_SCB_Type * _8;
  long unsigned int _9;
  long unsigned int ways.1_10;
  long unsigned int sets.2_11;
  struct S32_SCB_Type * _12;
  long unsigned int _13;
  struct S32_SCB_Type * _14;
  long unsigned int _15;
  struct S32_SCB_Type * _16;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ccsidr_21 = 0;
  # DEBUG ccsidr => ccsidr_21
  # DEBUG BEGIN_STMT
  sets_22 = 0;
  # DEBUG sets => sets_22
  # DEBUG BEGIN_STMT
  ways_23 = 0;
  # DEBUG ways => ways_23
  # DEBUG BEGIN_STMT
  _1 = 3758153728B;
  _1->CSSELR ={v} 0;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  _2 = 3758153728B;
  ccsidr_27 ={v} _2->CCSIDR;
  # DEBUG ccsidr => ccsidr_27
  # DEBUG BEGIN_STMT
  _3 = ccsidr_27 >> 13;
  sets_28 = _3 & 32767;
  # DEBUG sets => sets_28

  <bb 3> :
  # sets_17 = PHI <sets_28(2), sets_33(5)>
  # DEBUG sets => sets_17
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = ccsidr_27 >> 3;
  ways_29 = _4 & 1023;
  # DEBUG ways => ways_29

  <bb 4> :
  # ways_18 = PHI <ways_29(3), ways_32(4)>
  # DEBUG ways => ways_18
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = sets_17 << 5;
  _6 = _5 & 16352;
  _7 = ways_18 << 30;
  _8 = 3758153728B;
  _9 = _6 | _7;
  _8->DCCISW ={v} _9;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  ways.1_10 = ways_18;
  ways_32 = ways.1_10 + 4294967295;
  # DEBUG ways => ways_32
  if (ways.1_10 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  sets.2_11 = sets_17;
  sets_33 = sets.2_11 + 4294967295;
  # DEBUG sets => sets_33
  if (sets.2_11 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  _12 = 3758153728B;
  _13 ={v} _12->CSSELR;
  _14 = 3758153728B;
  _15 = _13 | 1;
  _14->CSSELR ={v} _15;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  # DEBUG BEGIN_STMT
  _16 = 3758153728B;
  _16->ICIALLU ={v} 0;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  return;

}


__attribute__((always_inline))
sys_m7_cache_disable ()
{
  struct S32_SCB_Type * _1;
  long unsigned int _2;
  struct S32_SCB_Type * _3;
  long unsigned int _4;
  struct S32_SCB_Type * _5;
  long unsigned int _6;
  struct S32_SCB_Type * _7;
  long unsigned int _8;

  <bb 2> :
  # DEBUG BEGIN_STMT
  sys_m7_cache_clean ();
  # DEBUG BEGIN_STMT
  _1 = 3758153728B;
  _2 ={v} _1->CCR;
  _3 = 3758153728B;
  _4 = _2 & 4294836223;
  _3->CCR ={v} _4;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  # DEBUG BEGIN_STMT
  _5 = 3758153728B;
  _6 ={v} _5->CCR;
  _7 = 3758153728B;
  _8 = _6 & 4294901759;
  _7->CCR ={v} _8;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  return;

}


__attribute__((always_inline))
sys_m7_cache_init ()
{
  uint32 ways;
  uint32 sets;
  uint32 ccsidr;
  struct S32_SCB_Type * _1;
  struct S32_SCB_Type * _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  struct S32_SCB_Type * _8;
  long unsigned int _9;
  long unsigned int ways.3_10;
  long unsigned int sets.4_11;
  struct S32_SCB_Type * _12;
  long unsigned int _13;
  struct S32_SCB_Type * _14;
  long unsigned int _15;
  struct S32_SCB_Type * _16;
  struct S32_SCB_Type * _17;
  long unsigned int _18;
  struct S32_SCB_Type * _19;
  long unsigned int _20;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ccsidr_25 = 0;
  # DEBUG ccsidr => ccsidr_25
  # DEBUG BEGIN_STMT
  sets_26 = 0;
  # DEBUG sets => sets_26
  # DEBUG BEGIN_STMT
  ways_27 = 0;
  # DEBUG ways => ways_27
  # DEBUG BEGIN_STMT
  _1 = 3758153728B;
  _1->CSSELR ={v} 0;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  _2 = 3758153728B;
  ccsidr_31 ={v} _2->CCSIDR;
  # DEBUG ccsidr => ccsidr_31
  # DEBUG BEGIN_STMT
  _3 = ccsidr_31 >> 13;
  sets_32 = _3 & 32767;
  # DEBUG sets => sets_32

  <bb 3> :
  # sets_21 = PHI <sets_32(2), sets_37(5)>
  # DEBUG sets => sets_21
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _4 = ccsidr_31 >> 3;
  ways_33 = _4 & 1023;
  # DEBUG ways => ways_33

  <bb 4> :
  # ways_22 = PHI <ways_33(3), ways_36(4)>
  # DEBUG ways => ways_22
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _5 = sets_21 << 5;
  _6 = _5 & 16352;
  _7 = ways_22 << 30;
  _8 = 3758153728B;
  _9 = _6 | _7;
  _8->DCISW ={v} _9;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  ways.3_10 = ways_22;
  ways_36 = ways.3_10 + 4294967295;
  # DEBUG ways => ways_36
  if (ways.3_10 != 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  sets.4_11 = sets_21;
  sets_37 = sets.4_11 + 4294967295;
  # DEBUG sets => sets_37
  if (sets.4_11 != 0)
    goto <bb 3>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 6> :
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  _12 = 3758153728B;
  _13 ={v} _12->CCR;
  _14 = 3758153728B;
  _15 = _13 | 65536;
  _14->CCR ={v} _15;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  # DEBUG BEGIN_STMT
  _16 = 3758153728B;
  _16->ICIALLU ={v} 0;
  # DEBUG BEGIN_STMT
  _17 = 3758153728B;
  _18 ={v} _17->CCR;
  _19 = 3758153728B;
  _20 = _18 | 131072;
  _19->CCR ={v} _20;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  return;

}


SystemInit ()
{
  uint32 coreId;
  uint8 regionNum;
  uint32 coreMask;
  uint32 i;
  unsigned char _1;
  struct MSCM_Type * _2;
  short unsigned int _3;
  short unsigned int _4;
  struct MSCM_Type * _5;
  short unsigned int _6;
  struct S32_SCB_Type * _7;
  long unsigned int _8;
  struct S32_SCB_Type * _9;
  long unsigned int _10;
  struct S32_SCB_Type * _11;
  struct S32_SCB_Type * _12;
  long unsigned int _13;
  struct S32_SCB_Type * _14;
  long unsigned int _15;
  struct S32_SCB_Type * _16;
  long unsigned int _17;
  long unsigned int _18;
  struct S32_SCB_Type * _19;
  long unsigned int _20;
  long unsigned int _21;
  struct S32_MPU_Type * _22;
  long unsigned int _23;
  int _24;
  struct S32_MPU_Type * _25;
  long unsigned int _26;
  int _27;
  struct S32_MPU_Type * _28;
  long unsigned int _29;
  unsigned char regionNum.0_30;
  struct S32_MPU_Type * _31;
  long unsigned int _32;
  struct S32_MPU_Type * _33;
  long unsigned int _34;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  regionNum_41 = 0;
  # DEBUG regionNum => regionNum_41
  # DEBUG BEGIN_STMT
  _1 = Sys_GetCoreID ();
  coreId_44 = (uint32) _1;
  # DEBUG coreId => coreId_44
  # DEBUG BEGIN_STMT
  switch (coreId_44) <default: <L8> [INV], case 0 ... 3: <L0> [INV], case 4: <L4> [INV], case 5: <L5> [INV], case 6: <L6> [INV], case 7: <L7> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  coreMask_49 = 1;
  # DEBUG coreMask => coreMask_49
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 4> :
<L4>:
  # DEBUG BEGIN_STMT
  coreMask_48 = 2;
  # DEBUG coreMask => coreMask_48
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 5> :
<L5>:
  # DEBUG BEGIN_STMT
  coreMask_47 = 4;
  # DEBUG coreMask => coreMask_47
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 6> :
<L6>:
  # DEBUG BEGIN_STMT
  coreMask_46 = 8;
  # DEBUG coreMask => coreMask_46
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 7> :
<L7>:
  # DEBUG BEGIN_STMT
  coreMask_45 = 16;
  # DEBUG coreMask => coreMask_45
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 8> :
<L8>:
  # DEBUG BEGIN_STMT
  coreMask_50 = 0;
  # DEBUG coreMask => coreMask_50
  # DEBUG BEGIN_STMT

  <bb 9> :
  # coreMask_36 = PHI <coreMask_49(3), coreMask_48(4), coreMask_47(5), coreMask_46(6), coreMask_45(7), coreMask_50(8)>
  # DEBUG coreMask => coreMask_36
  # DEBUG BEGIN_STMT
  i_51 = 0;
  # DEBUG i => i_51
  goto <bb 11>; [INV]

  <bb 10> :
  # DEBUG BEGIN_STMT
  _2 = 1075412992B;
  _3 ={v} _2->IRSPRC[i_35];
  _4 = (short unsigned int) coreMask_36;
  _5 = 1075412992B;
  _6 = _3 | _4;
  _5->IRSPRC[i_35] ={v} _6;
  # DEBUG BEGIN_STMT
  i_72 = i_35 + 1;
  # DEBUG i => i_72

  <bb 11> :
  # i_35 = PHI <i_51(9), i_72(10)>
  # DEBUG i => i_35
  # DEBUG BEGIN_STMT
  if (i_35 <= 239)
    goto <bb 10>; [INV]
  else
    goto <bb 12>; [INV]

  <bb 12> :
  # DEBUG BEGIN_STMT
  NVIC_SetPriorityGrouping (0);
  # DEBUG BEGIN_STMT
  _7 = 3758153728B;
  _8 ={v} _7->CCR;
  _9 = 3758153728B;
  _10 = _8 | 1;
  _9->CCR ={v} _10;
  # DEBUG BEGIN_STMT
  _11 = 3758153728B;
  _11->SHPR3 ={v} 0;
  # DEBUG BEGIN_STMT
  _12 = 3758153728B;
  _13 ={v} _12->CPACR;
  _14 = 3758153728B;
  _15 = _13 | 15728640;
  _14->CPACR ={v} _15;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  # DEBUG BEGIN_STMT
  _16 = 3758153728B;
  _17 ={v} _16->CCR;
  _18 = _17 & 131072;
  if (_18 != 0)
    goto <bb 14>; [INV]
  else
    goto <bb 13>; [INV]

  <bb 13> :
  _19 = 3758153728B;
  _20 ={v} _19->CCR;
  _21 = _20 & 65536;
  if (_21 != 0)
    goto <bb 14>; [INV]
  else
    goto <bb 15>; [INV]

  <bb 14> :
  # DEBUG BEGIN_STMT
  sys_m7_cache_disable ();

  <bb 15> :
  # DEBUG BEGIN_STMT
  regionNum_61 = 0;
  # DEBUG regionNum => regionNum_61
  goto <bb 17>; [INV]

  <bb 16> :
  # DEBUG BEGIN_STMT
  _22 = 3758153728B;
  _23 = (long unsigned int) regionNum_37;
  _22->RNR ={v} _23;
  # DEBUG BEGIN_STMT
  _24 = (int) regionNum_37;
  _25 = 3758153728B;
  _26 = rbar[_24];
  _25->RBAR ={v} _26;
  # DEBUG BEGIN_STMT
  _27 = (int) regionNum_37;
  _28 = 3758153728B;
  _29 = rasr[_27];
  _28->RASR ={v} _29;
  # DEBUG BEGIN_STMT
  regionNum.0_30 = regionNum_37;
  regionNum_70 = regionNum.0_30 + 1;
  # DEBUG regionNum => regionNum_70

  <bb 17> :
  # regionNum_37 = PHI <regionNum_61(15), regionNum_70(16)>
  # DEBUG regionNum => regionNum_37
  # DEBUG BEGIN_STMT
  if (regionNum_37 <= 10)
    goto <bb 16>; [INV]
  else
    goto <bb 18>; [INV]

  <bb 18> :
  # DEBUG BEGIN_STMT
  _31 = 3758153728B;
  _32 ={v} _31->CTRL;
  _33 = 3758153728B;
  _34 = _32 | 1;
  _33->CTRL ={v} _34;
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" ISB");
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" DSB");
  # DEBUG BEGIN_STMT
  sys_m7_cache_init ();
  # DEBUG BEGIN_STMT
  SystemWfiConfig ();
  return;

}


Sys_GetCoreID ()
{
  struct MSCM_Type * _1;
  long unsigned int _2;
  uint8 _4;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = 1075412992B;
  _2 ={v} _1->CPXNUM;
  _4 = (uint8) _2;
  return _4;

}


default_interrupt_routine ()
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  goto <bb 2>; [INV]

}


startup_go_to_user_mode ()
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  return;

}


