if x = 0 then
y := 0
else if x > 1 and x mod 2 = 0 then
y := 2
else
y := x ∗ x
end if