Yes, I know how to implement detection logically, I have no issues with algorithm, but I can't implement it in hardware, also, I can't understand, why statement
IF PORTC.4=1

or

IF PORTC.4=0

makes corresponding pin high or low?