#include <math.h>
#include <c7x.h>
#include <string.h>

void MadeUpFunc(const int8_t* restrict input, uint8_t* restrict output)
{
  short32 vReLU = (short32)(0);

  for (uint32_t channel = 1; channel < 512; channel++)
  {
    uchar64 vOut;
    short32 vFixedScalar = (short32)(0);
    short32 vOffset = (short32)(roundf(0.0));
    for (uint32_t ctr = 0; ctr < 4; ctr++)
    {
      char64 vIn = (char64)(0);
      short32 vInHalfLo = __convert_short32(vIn.lo());
      short32 vInHalfHi = __convert_short32(vIn.hi());
      short32 vResultLo = __shift_right(vInHalfLo*vFixedScalar,(int16)(0)) + vOffset;
      short32 vResultHi = __shift_right(vInHalfHi*vFixedScalar,(int16)(0)) + vOffset;
      vResultLo = __min(vResultLo,(short32)255);
      vResultHi = __min(vResultHi,(short32)255);
      __vstore_packl_2src(&vOut, __convert_ushort32(__max(vResultLo,vReLU)),__convert_ushort32(__max(vResultHi,vReLU)));
      vpred vpStore0 = __SA0_VPRED(uchar64);
      *__SA0ADV(uchar64, output) = __vload_pred(vpStore0, &vOut);
    }
  }
}

