task_1s ()
{
  int _1;
  _Bool _2;
  int _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  CAN_Task_1000ms ();
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = gb.led_flag;
  _2 = _1 == 0;
  _3 = (int) _2;
  led_onoff (_3);
  return;

}


task_200ms ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  CAN_Task_200ms ();
  # DEBUG BEGIN_STMT
  PWM_for_dirve_mode ();
  return;

}


task_100ms ()
{
  unsigned char test_pwm.1_1;
  unsigned char _2;
  long unsigned int C_100ms.4_3;
  long unsigned int _4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  test_pwm.1_1 = test_pwm;
  if (test_pwm.1_1 <= 99)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  _2 = test_pwm.1_1 + 1;
  test_pwm = _2;
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  test_pwm = 0;

  <bb 5> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  C_100ms.4_3 = C_100ms;
  _4 = C_100ms.4_3 + 1;
  C_100ms = _4;
  # DEBUG BEGIN_STMT
  CAN_Task_100ms ();
  return;

}


task_50ms ()
{
  <bb 2> [local count: 1073741824]:
  task_1ms (); [tail call]
  return;

}


task_20ms ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  CAN_Task_20ms ();
  return;

}


task_10ms ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  CAN_Task_10ms ();
  return;

}


task_5ms ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  CAN_Task_5ms ();
  return;

}


task_2ms ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  ECU3_KATECH_Logic_2ms ();
  return;

}


task_1ms ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  return;

}


task_500us ()
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  can_tx_check ();
  # DEBUG BEGIN_STMT
  can_main_ECU3 ();
  return;

}


main ()
{
  u64 tick_200ms;
  u64 tick_5ms;
  u64 tick_500us;
  u64 tick_1ms;
  u64 tick_1sec;
  u64 tick_2ms;
  u64 tick_50ms;
  u64 tick_20ms;
  u64 tick_10ms;
  u64 tick_100ms;
  char ch;
  unsigned int _1;
  int _2;
  long unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  long unsigned int _11;
  long unsigned int _12;
  long unsigned int _13;
  long unsigned int _14;
  long unsigned int _15;
  long unsigned int _16;
  long unsigned int _17;
  long unsigned int _18;
  long unsigned int _19;
  long unsigned int _20;
  long unsigned int _21;
  long unsigned int _22;

  <bb 2> [local count: 107374]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  Gvar_init ();
  # DEBUG BEGIN_STMT
  Clock_Ip_Init (&Mcu_aClockConfigPB[0]);
  # DEBUG BEGIN_STMT
  Siul2_Port_Ip_Init (78, &g_pin_mux_InitConfigArr0);
  # DEBUG BEGIN_STMT
  IntCtrl_Ip_Init (&IntCtrlConfig_0);
  # DEBUG BEGIN_STMT
  IntCtrl_Ip_ConfigIrqRouting (&intRouteConfig);
  # DEBUG BEGIN_STMT
  Uart_Init ();
  # DEBUG BEGIN_STMT
  _1 = gb.pwm_max_tick;
  pwm_init (_1);
  # DEBUG BEGIN_STMT
  Adc_Init ();
  # DEBUG BEGIN_STMT
  i2c1_init ();
  # DEBUG BEGIN_STMT
  i2c0_init ();
  # DEBUG BEGIN_STMT
  SPI_init ();
  # DEBUG BEGIN_STMT
  Pit_Ip_Init (0, &PIT_0_InitConfig_PB);
  # DEBUG BEGIN_STMT
  Pit_Ip_InitChannel (0, &PIT_0_ChannelConfig_PB[0]);
  # DEBUG BEGIN_STMT
  Pit_Ip_EnableChannelInterrupt (0, 0);
  # DEBUG BEGIN_STMT
  Pit_Ip_StartChannel (0, 0, 20000);
  # DEBUG BEGIN_STMT
  # DEBUG ch => 0
  goto <bb 4>; [100.00%]

  <bb 3> [local count: 644019]:
  # DEBUG BEGIN_STMT
  _2 = (int) ch_23;
  Can_Init_ECU3 (_2);
  # DEBUG BEGIN_STMT
  ch_104 = ch_23 + 1;
  # DEBUG ch => ch_104

  <bb 4> [local count: 751393]:
  # ch_23 = PHI <0(2), ch_104(3)>
  # DEBUG ch => ch_23
  # DEBUG BEGIN_STMT
  if (ch_23 != 6)
    goto <bb 3>; [85.71%]
  else
    goto <bb 5>; [14.29%]

  <bb 5> [local count: 107374]:
  # DEBUG BEGIN_STMT
  board_init ();
  # DEBUG BEGIN_STMT
  tick_500us_71 ={v} gb.tmr_cnt;
  # DEBUG tick_500us => tick_500us_71
  # DEBUG BEGIN_STMT
  tick_1ms_72 ={v} gb.tmr_cnt;
  # DEBUG tick_1ms => tick_1ms_72
  # DEBUG BEGIN_STMT
  tick_2ms_73 ={v} gb.tmr_cnt;
  # DEBUG tick_2ms => tick_2ms_73
  # DEBUG BEGIN_STMT
  tick_5ms_74 ={v} gb.tmr_cnt;
  # DEBUG tick_5ms => tick_5ms_74
  # DEBUG BEGIN_STMT
  tick_10ms_75 ={v} gb.tmr_cnt;
  # DEBUG tick_10ms => tick_10ms_75
  # DEBUG BEGIN_STMT
  tick_20ms_76 ={v} gb.tmr_cnt;
  # DEBUG tick_20ms => tick_20ms_76
  # DEBUG BEGIN_STMT
  tick_50ms_77 ={v} gb.tmr_cnt;
  # DEBUG tick_50ms => tick_50ms_77
  # DEBUG BEGIN_STMT
  tick_100ms_78 ={v} gb.tmr_cnt;
  # DEBUG tick_100ms => tick_100ms_78
  # DEBUG BEGIN_STMT
  tick_200ms_79 ={v} gb.tmr_cnt;
  # DEBUG tick_200ms => tick_200ms_79
  # DEBUG BEGIN_STMT
  tick_1sec_80 ={v} gb.tmr_cnt;
  # DEBUG tick_1sec => tick_1sec_80
  # DEBUG BEGIN_STMT
  tmr_delay (1000);
  # DEBUG BEGIN_STMT
  WATCHDOG_HAL_Init ();
  # DEBUG BEGIN_STMT
  debug_printf ("Board Init Finished\n\r");
  # DEBUG BEGIN_STMT
  ECU3_KATECH_Logic_init ();

  <bb 6> [local count: 1073741824]:
  # tick_100ms_24 = PHI <tick_100ms_78(5), tick_100ms_25(26)>
  # tick_10ms_26 = PHI <tick_10ms_75(5), tick_10ms_27(26)>
  # tick_20ms_28 = PHI <tick_20ms_76(5), tick_20ms_29(26)>
  # tick_50ms_30 = PHI <tick_50ms_77(5), tick_50ms_31(26)>
  # tick_2ms_32 = PHI <tick_2ms_73(5), tick_2ms_33(26)>
  # tick_1sec_34 = PHI <tick_1sec_80(5), tick_1sec_35(26)>
  # tick_1ms_36 = PHI <tick_1ms_72(5), tick_1ms_37(26)>
  # tick_500us_38 = PHI <tick_500us_71(5), tick_500us_39(26)>
  # tick_5ms_40 = PHI <tick_5ms_74(5), tick_5ms_41(26)>
  # tick_200ms_42 = PHI <tick_200ms_79(5), tick_200ms_43(26)>
  # DEBUG tick_200ms => tick_200ms_42
  # DEBUG tick_5ms => tick_5ms_40
  # DEBUG tick_500us => tick_500us_38
  # DEBUG tick_1ms => tick_1ms_36
  # DEBUG tick_1sec => tick_1sec_34
  # DEBUG tick_2ms => tick_2ms_32
  # DEBUG tick_50ms => tick_50ms_30
  # DEBUG tick_20ms => tick_20ms_28
  # DEBUG tick_10ms => tick_10ms_26
  # DEBUG tick_100ms => tick_100ms_24
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 ={v} gb.tmr_cnt;
  _4 = tick_1sec_34 + 1000;
  if (_3 >= _4)
    goto <bb 7>; [33.00%]
  else
    goto <bb 8>; [67.00%]

  <bb 7> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  tick_1sec_85 ={v} gb.tmr_cnt;
  # DEBUG tick_1sec => tick_1sec_85
  # DEBUG BEGIN_STMT
  task_1s ();

  <bb 8> [local count: 1073741824]:
  # tick_1sec_35 = PHI <tick_1sec_34(6), tick_1sec_85(7)>
  # DEBUG tick_1sec => tick_1sec_35
  # DEBUG BEGIN_STMT
  _5 ={v} gb.tmr_cnt;
  _6 = tick_200ms_42 + 200;
  if (_5 >= _6)
    goto <bb 9>; [33.00%]
  else
    goto <bb 10>; [67.00%]

  <bb 9> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  tick_200ms_87 ={v} gb.tmr_cnt;
  # DEBUG tick_200ms => tick_200ms_87
  # DEBUG BEGIN_STMT
  task_200ms ();

  <bb 10> [local count: 1073741824]:
  # tick_200ms_43 = PHI <tick_200ms_42(8), tick_200ms_87(9)>
  # DEBUG tick_200ms => tick_200ms_43
  # DEBUG BEGIN_STMT
  _7 ={v} gb.tmr_cnt;
  _8 = tick_100ms_24 + 100;
  if (_7 >= _8)
    goto <bb 11>; [33.00%]
  else
    goto <bb 12>; [67.00%]

  <bb 11> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  tick_100ms_89 ={v} gb.tmr_cnt;
  # DEBUG tick_100ms => tick_100ms_89
  # DEBUG BEGIN_STMT
  task_100ms ();

  <bb 12> [local count: 1073741824]:
  # tick_100ms_25 = PHI <tick_100ms_24(10), tick_100ms_89(11)>
  # DEBUG tick_100ms => tick_100ms_25
  # DEBUG BEGIN_STMT
  _9 ={v} gb.tmr_cnt;
  _10 = tick_50ms_30 + 50;
  if (_9 >= _10)
    goto <bb 13>; [50.00%]
  else
    goto <bb 14>; [50.00%]

  <bb 13> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  tick_50ms_91 ={v} gb.tmr_cnt;
  # DEBUG tick_50ms => tick_50ms_91
  # DEBUG BEGIN_STMT
  # DEBUG INLINE_ENTRY task_50ms
  # DEBUG BEGIN_STMT

  <bb 14> [local count: 1073741824]:
  # tick_50ms_31 = PHI <tick_50ms_30(12), tick_50ms_91(13)>
  # DEBUG tick_50ms => tick_50ms_31
  # DEBUG BEGIN_STMT
  _11 ={v} gb.tmr_cnt;
  _12 = tick_20ms_28 + 20;
  if (_11 >= _12)
    goto <bb 15>; [33.00%]
  else
    goto <bb 16>; [67.00%]

  <bb 15> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  tick_20ms_93 ={v} gb.tmr_cnt;
  # DEBUG tick_20ms => tick_20ms_93
  # DEBUG BEGIN_STMT
  # DEBUG INLINE_ENTRY task_20ms
  # DEBUG BEGIN_STMT
  CAN_Task_20ms ();

  <bb 16> [local count: 1073741824]:
  # tick_20ms_29 = PHI <tick_20ms_28(14), tick_20ms_93(15)>
  # DEBUG tick_20ms => tick_20ms_29
  # DEBUG BEGIN_STMT
  _13 ={v} gb.tmr_cnt;
  _14 = tick_10ms_26 + 10;
  if (_13 >= _14)
    goto <bb 17>; [33.00%]
  else
    goto <bb 18>; [67.00%]

  <bb 17> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  tick_10ms_94 ={v} gb.tmr_cnt;
  # DEBUG tick_10ms => tick_10ms_94
  # DEBUG BEGIN_STMT
  # DEBUG INLINE_ENTRY task_10ms
  # DEBUG BEGIN_STMT
  CAN_Task_10ms ();

  <bb 18> [local count: 1073741824]:
  # tick_10ms_27 = PHI <tick_10ms_26(16), tick_10ms_94(17)>
  # DEBUG tick_10ms => tick_10ms_27
  # DEBUG BEGIN_STMT
  _15 ={v} gb.tmr_cnt;
  _16 = tick_5ms_40 + 5;
  if (_15 >= _16)
    goto <bb 19>; [33.00%]
  else
    goto <bb 20>; [67.00%]

  <bb 19> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  tick_5ms_95 ={v} gb.tmr_cnt;
  # DEBUG tick_5ms => tick_5ms_95
  # DEBUG BEGIN_STMT
  # DEBUG INLINE_ENTRY task_5ms
  # DEBUG BEGIN_STMT
  CAN_Task_5ms ();

  <bb 20> [local count: 1073741824]:
  # tick_5ms_41 = PHI <tick_5ms_40(18), tick_5ms_95(19)>
  # DEBUG tick_5ms => tick_5ms_41
  # DEBUG BEGIN_STMT
  _17 ={v} gb.tmr_cnt;
  _18 = tick_2ms_32 + 2;
  if (_17 >= _18)
    goto <bb 21>; [33.00%]
  else
    goto <bb 22>; [67.00%]

  <bb 21> [local count: 354334802]:
  # DEBUG BEGIN_STMT
  tick_2ms_96 ={v} gb.tmr_cnt;
  # DEBUG tick_2ms => tick_2ms_96
  # DEBUG BEGIN_STMT
  # DEBUG INLINE_ENTRY task_2ms
  # DEBUG BEGIN_STMT
  ECU3_KATECH_Logic_2ms ();

  <bb 22> [local count: 1073741824]:
  # tick_2ms_33 = PHI <tick_2ms_32(20), tick_2ms_96(21)>
  # DEBUG tick_2ms => tick_2ms_33
  # DEBUG BEGIN_STMT
  _19 ={v} gb.tmr_cnt;
  _20 = tick_1ms_36 + 1;
  if (_19 >= _20)
    goto <bb 23>; [50.00%]
  else
    goto <bb 24>; [50.00%]

  <bb 23> [local count: 536870913]:
  # DEBUG BEGIN_STMT
  tick_1ms_97 ={v} gb.tmr_cnt;
  # DEBUG tick_1ms => tick_1ms_97
  # DEBUG BEGIN_STMT
  # DEBUG INLINE_ENTRY task_1ms
  # DEBUG BEGIN_STMT

  <bb 24> [local count: 1073741824]:
  # tick_1ms_37 = PHI <tick_1ms_36(22), tick_1ms_97(23)>
  # DEBUG tick_1ms => tick_1ms_37
  # DEBUG BEGIN_STMT
  _21 ={v} gb.x500us;
  _22 = tick_500us_38 + 1;
  if (_21 >= _22)
    goto <bb 25>; [67.00%]
  else
    goto <bb 26>; [33.00%]

  <bb 25> [local count: 719407022]:
  # DEBUG BEGIN_STMT
  tick_500us_99 ={v} gb.x500us;
  # DEBUG tick_500us => tick_500us_99
  # DEBUG BEGIN_STMT
  task_500us ();

  <bb 26> [local count: 1073741824]:
  # tick_500us_39 = PHI <tick_500us_38(24), tick_500us_99(25)>
  # DEBUG tick_500us => tick_500us_39
  # DEBUG BEGIN_STMT
  WATCHDOG_HAL_Fed ();
  # DEBUG BEGIN_STMT
  uds_wait ();
  # DEBUG BEGIN_STMT
  goto <bb 6>; [100.00%]

}


