Code problem with LED

val = digitalRead(pirState); //read input and store it
..........
  if (pirState == HIGH) 

{

So you are using pirState to define a pin number in the first statement, this means it has to be a number.
In the if statement you are expecting pirState to be a logic value.
It can't be both.