Siul2_Dio_Ip_WriteChannel (uint8 u8Siul2Instance, Siul2_Dio_Ip_PinsChannelType pin, Siul2_Dio_Ip_PinsLevelType value)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (int) u8Siul2Instance;
  _2 = Siul2BaseAdresses[_1];
  _3 = pin ^ 3;
  _4 = (long unsigned int) _3;
  _5 = _2 + _4;
  _6 = _5 + 4864;
  _7 = (uint8 *) _6;
  *_7 = value;
  return;

}


Siul2_Dio_Ip_ReadChannel (uint8 u8Siul2Instance, Siul2_Dio_Ip_PinsChannelType pin)
{
  Siul2_Dio_Ip_PinsLevelType returnValue;
  Siul2_Dio_Ip_PinsLevelType D.4833;

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

}


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;

  <bb 2> :
  # DEBUG BEGIN_STMT
  _1 = (int) u8Siul2Instance;
  _2 = Siul2BaseAdresses[_1];
  base = (struct SIUL2_Type *) _2;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _3 = Siul2_Dio_Ip_REV_BIT_16 (mask);
  maskRev = (uint32) _3;
  # DEBUG BEGIN_STMT
  _4 = Siul2_Dio_Ip_REV_BIT_16 (pins);
  pinsRev = (uint32) _4;
  # DEBUG BEGIN_STMT
  _5 = maskRev << 16;
  _6 = (int) u8PortId;
  _7 = pinsRev | _5;
  base->MPGPDO[_6] = _7;
  return;

}


Siul2_Dio_Ip_ReadPin (const struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pin)
{
  Siul2_Dio_Ip_PinsLevelType returnValue;
  Siul2_Dio_Ip_PinsLevelType D.4831;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  returnValue = 0;
  # DEBUG BEGIN_STMT
  _1 = base->PGPDI;
  _2 = Siul2_Dio_Ip_REV_BIT_16 (_1);
  _3 = (int) _2;
  _4 = (int) pin;
  _5 = 1 << _4;
  _6 = _3 & _5;
  _7 = (int) pin;
  _8 = _6 >> _7;
  returnValue = (Siul2_Dio_Ip_PinsLevelType) _8;
  # DEBUG BEGIN_STMT
  D.4831 = returnValue;
  return D.4831;

}


Siul2_Dio_Ip_ReadPins (const struct Siul2_Dio_Ip_GpioType * const base)
{
  Siul2_Dio_Ip_PinsChannelType returnValue;
  Siul2_Dio_Ip_PinsChannelType D.4829;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  returnValue = 0;
  # DEBUG BEGIN_STMT
  _1 = base->PGPDI;
  returnValue = Siul2_Dio_Ip_REV_BIT_16 (_1);
  # DEBUG BEGIN_STMT
  D.4829 = returnValue;
  return D.4829;

}


Siul2_Dio_Ip_TogglePins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  short unsigned int D.4828;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.4828 = Siul2_Dio_Ip_REV_BIT_16 (pins);
  _1 = base->PGPDO;
  _2 = D.4828 ^ _1;
  base->PGPDO = _2;
  return;

}


Siul2_Dio_Ip_ClearPins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  short unsigned int D.4827;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = Siul2_Dio_Ip_REV_BIT_16 (pins);
  D.4827 = ~_1;
  _2 = base->PGPDO;
  _3 = D.4827 & _2;
  base->PGPDO = _3;
  return;

}


Siul2_Dio_Ip_SetPins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  short unsigned int D.4826;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  D.4826 = Siul2_Dio_Ip_REV_BIT_16 (pins);
  _1 = base->PGPDO;
  _2 = D.4826 | _1;
  base->PGPDO = _2;
  return;

}


Siul2_Dio_Ip_GetPinsOutput (const struct Siul2_Dio_Ip_GpioType * const base)
{
  Siul2_Dio_Ip_PinsChannelType returnValue;
  Siul2_Dio_Ip_PinsChannelType D.4824;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  returnValue = 0;
  # DEBUG BEGIN_STMT
  _1 = base->PGPDO;
  returnValue = Siul2_Dio_Ip_REV_BIT_16 (_1);
  # DEBUG BEGIN_STMT
  D.4824 = returnValue;
  return D.4824;

}


Siul2_Dio_Ip_WritePins (struct Siul2_Dio_Ip_GpioType * const base, Siul2_Dio_Ip_PinsChannelType pins)
{
  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = Siul2_Dio_Ip_REV_BIT_16 (pins);
  base->PGPDO = _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;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  pinsValues = base->PGPDO;
  # DEBUG BEGIN_STMT
  _1 = (unsigned int) pin;
  _2 = 15 - _1;
  _3 = 1 << _2;
  _4 = (short unsigned int) _3;
  _5 = ~_4;
  pinsValues = pinsValues & _5;
  # DEBUG BEGIN_STMT
  _6 = (unsigned int) value;
  _7 = _6 & 1;
  _8 = (unsigned int) pin;
  _9 = 15 - _8;
  _10 = _7 << _9;
  _11 = (short unsigned int) _10;
  pinsValues = pinsValues | _11;
  # DEBUG BEGIN_STMT
  base->PGPDO = pinsValues;
  return;

}


Siul2_Dio_Ip_REV_BIT_16 (uint16 value)
{
  uint16 ret;
  uint8 i;
  uint16 D.4822;

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

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

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (i <= 7)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.4822 = ret;
  return D.4822;

}


