Siul2_Dio_Ip_WriteChannel (uint8 u8Siul2Instance, Siul2_Dio_Ip_PinsChannelType pin, Siul2_Dio_Ip_PinsLevelType value)
{
  int _1;
  long unsigned int _2;
  short unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  uint8 * _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (int) u8Siul2Instance_8(D);
  _2 = Siul2BaseAdresses[_1];
  _3 = pin_10(D) ^ 3;
  _4 = (long unsigned int) _3;
  _5 = _2 + _4;
  _6 = _5 + 4864;
  _7 = (uint8 *) _6;
  *_7 = value_11(D);
  return;

}


Siul2_Dio_Ip_ReadChannel (uint8 u8Siul2Instance, Siul2_Dio_Ip_PinsChannelType pin)
{
  Siul2_Dio_Ip_PinsLevelType returnValue;
  int _1;
  long unsigned int _2;
  short unsigned int _3;
  long unsigned int _4;
  long unsigned int _5;
  long unsigned int _6;
  uint8 * _7;
  unsigned char _8;
  Siul2_Dio_Ip_PinsLevelType _14;

  <bb 2> :
  # DEBUG BEGIN_STMT
  returnValue_9 = 0;
  # DEBUG returnValue => returnValue_9
  # DEBUG BEGIN_STMT
  _1 = (int) u8Siul2Instance_10(D);
  _2 = Siul2BaseAdresses[_1];
  _3 = pin_12(D) ^ 3;
  _4 = (long unsigned int) _3;
  _5 = _2 + _4;
  _6 = _5 + 5376;
  _7 = (uint8 *) _6;
  _8 = *_7;
  returnValue_13 = _8 & 1;
  # DEBUG returnValue => returnValue_13
  # DEBUG BEGIN_STMT
  _14 = returnValue_13;
  return _14;

}


Siul2_Dio_Ip_MaskedWritePins (uint8 u8Siul2Instance, uint8 u8PortId, Siul2_Dio_Ip_PinsChannelType pins, Siul2_Dio_Ip_PinsChannelType mask)
{
  uint32 pinsRev;
  uint32 maskRev;
  struct SIUL2_Type * base;
  int _1;
  long unsigned int _2;
  short unsigned int _3;
  short unsigned int _4;
  long unsigned int _5;
  int _6;
  long unsigned int _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (int) u8Siul2Instance_8(D);
  _2 = Siul2BaseAdresses[_1];
  base_10 = (struct SIUL2_Type *) _2;
  # DEBUG base => base_10
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = Siul2_Dio_Ip_REV_BIT_16 (mask_11(D));
  maskRev_13 = (uint32) _3;
  # DEBUG maskRev => maskRev_13
  # DEBUG BEGIN_STMT
  _4 = Siul2_Dio_Ip_REV_BIT_16 (pins_14(D));
  pinsRev_16 = (uint32) _4;
  # DEBUG pinsRev => pinsRev_16
  # DEBUG BEGIN_STMT
  _5 = maskRev_13 << 16;
  _6 = (int) u8PortId_17(D);
  _7 = pinsRev_16 | _5;
  base_10->MPGPDO[_6] ={v} _7;
  return;

}


Siul2_Dio_Ip_ReadPin (const struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pin)
{
  Siul2_Dio_Ip_PinsLevelType returnValue;
  short unsigned int _1;
  short unsigned int _2;
  int _3;
  int _4;
  int _5;
  int _6;
  int _7;
  int _8;
  Siul2_Dio_Ip_PinsLevelType _15;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  returnValue_9 = 0;
  # DEBUG returnValue => returnValue_9
  # DEBUG BEGIN_STMT
  _1 ={v} base_11(D)->PGPDI;
  _2 = Siul2_Dio_Ip_REV_BIT_16 (_1);
  _3 = (int) _2;
  _4 = (int) pin_13(D);
  _5 = 1 << _4;
  _6 = _3 & _5;
  _7 = (int) pin_13(D);
  _8 = _6 >> _7;
  returnValue_14 = (Siul2_Dio_Ip_PinsLevelType) _8;
  # DEBUG returnValue => returnValue_14
  # DEBUG BEGIN_STMT
  _15 = returnValue_14;
  return _15;

}


Siul2_Dio_Ip_ReadPins (const struct Siul2_Dio_Ip_GpioType * const base)
{
  Siul2_Dio_Ip_PinsChannelType returnValue;
  short unsigned int _1;
  Siul2_Dio_Ip_PinsChannelType _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  returnValue_2 = 0;
  # DEBUG returnValue => returnValue_2
  # DEBUG BEGIN_STMT
  _1 ={v} base_4(D)->PGPDI;
  returnValue_6 = Siul2_Dio_Ip_REV_BIT_16 (_1);
  # DEBUG returnValue => returnValue_6
  # DEBUG BEGIN_STMT
  _7 = returnValue_6;
  return _7;

}


Siul2_Dio_Ip_TogglePins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  short unsigned int _1;
  short unsigned int _2;
  short unsigned int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = Siul2_Dio_Ip_REV_BIT_16 (pins_4(D));
  _1 ={v} base_7(D)->PGPDO;
  _2 = _6 ^ _1;
  base_7(D)->PGPDO ={v} _2;
  return;

}


Siul2_Dio_Ip_ClearPins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  short unsigned int _1;
  short unsigned int _2;
  short unsigned int _3;
  short unsigned int _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = Siul2_Dio_Ip_REV_BIT_16 (pins_5(D));
  _7 = ~_1;
  _2 ={v} base_8(D)->PGPDO;
  _3 = _7 & _2;
  base_8(D)->PGPDO ={v} _3;
  return;

}


Siul2_Dio_Ip_SetPins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  short unsigned int _1;
  short unsigned int _2;
  short unsigned int _6;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _6 = Siul2_Dio_Ip_REV_BIT_16 (pins_4(D));
  _1 ={v} base_7(D)->PGPDO;
  _2 = _6 | _1;
  base_7(D)->PGPDO ={v} _2;
  return;

}


Siul2_Dio_Ip_GetPinsOutput (const struct Siul2_Dio_Ip_GpioType * const base)
{
  Siul2_Dio_Ip_PinsChannelType returnValue;
  short unsigned int _1;
  Siul2_Dio_Ip_PinsChannelType _7;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  returnValue_2 = 0;
  # DEBUG returnValue => returnValue_2
  # DEBUG BEGIN_STMT
  _1 ={v} base_4(D)->PGPDO;
  returnValue_6 = Siul2_Dio_Ip_REV_BIT_16 (_1);
  # DEBUG returnValue => returnValue_6
  # DEBUG BEGIN_STMT
  _7 = returnValue_6;
  return _7;

}


Siul2_Dio_Ip_WritePins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  short unsigned int _1;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = Siul2_Dio_Ip_REV_BIT_16 (pins_3(D));
  base_5(D)->PGPDO ={v} _1;
  return;

}


Siul2_Dio_Ip_WritePin (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pin, Siul2_Dio_Ip_PinsLevelType value)
{
  Siul2_Dio_Ip_PinsChannelType pinsValues;
  unsigned int _1;
  unsigned int _2;
  int _3;
  short unsigned int _4;
  short unsigned int _5;
  unsigned int _6;
  unsigned int _7;
  unsigned int _8;
  unsigned int _9;
  unsigned int _10;
  short unsigned int _11;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pinsValues_14 ={v} base_13(D)->PGPDO;
  # DEBUG pinsValues => pinsValues_14
  # DEBUG BEGIN_STMT
  _1 = (unsigned int) pin_15(D);
  _2 = 15 - _1;
  _3 = 1 << _2;
  _4 = (short unsigned int) _3;
  _5 = ~_4;
  pinsValues_16 = pinsValues_14 & _5;
  # DEBUG pinsValues => pinsValues_16
  # DEBUG BEGIN_STMT
  _6 = (unsigned int) value_17(D);
  _7 = _6 & 1;
  _8 = (unsigned int) pin_15(D);
  _9 = 15 - _8;
  _10 = _7 << _9;
  _11 = (short unsigned int) _10;
  pinsValues_18 = pinsValues_16 | _11;
  # DEBUG pinsValues => pinsValues_18
  # DEBUG BEGIN_STMT
  base_13(D)->PGPDO ={v} pinsValues_18;
  return;

}


Siul2_Dio_Ip_REV_BIT_16 (uint16 value)
{
  uint16 ret;
  uint8 i;
  int _1;
  int _2;
  int _3;
  unsigned int _4;
  unsigned int _5;
  unsigned int _6;
  unsigned int _7;
  unsigned int _8;
  short unsigned int _9;
  int _10;
  int _11;
  int _12;
  unsigned int _13;
  unsigned int _14;
  unsigned int _15;
  unsigned int _16;
  unsigned int _17;
  short unsigned int _18;
  short unsigned int _19;
  unsigned char i.0_20;
  uint16 _25;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ret_23 = 0;
  # DEBUG ret => ret_23
  # DEBUG BEGIN_STMT
  i_24 = 0;
  # DEBUG i => i_24
  goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = (int) value_27(D);
  _2 = (int) i_21;
  _3 = _1 >> _2;
  _4 = (unsigned int) _3;
  _5 = _4 & 1;
  _6 = (unsigned int) i_21;
  _7 = 15 - _6;
  _8 = _5 << _7;
  _9 = (short unsigned int) _8;
  _10 = (int) value_27(D);
  _11 = (int) i_21;
  _12 = _10 << _11;
  _13 = (unsigned int) _12;
  _14 = _13 & 32768;
  _15 = (unsigned int) i_21;
  _16 = 15 - _15;
  _17 = _14 >> _16;
  _18 = (short unsigned int) _17;
  _19 = _9 | _18;
  ret_28 = ret_22 | _19;
  # DEBUG ret => ret_28
  # DEBUG BEGIN_STMT
  i.0_20 = i_21;
  i_29 = i.0_20 + 1;
  # DEBUG i => i_29

  <bb 4> :
  # i_21 = PHI <i_24(2), i_29(3)>
  # ret_22 = PHI <ret_23(2), ret_28(3)>
  # DEBUG ret => ret_22
  # DEBUG i => i_21
  # DEBUG BEGIN_STMT
  if (i_21 <= 7)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  _25 = ret_22;
  return _25;

}


