User blog comment:Kyodaisuu/A program of Kirby-Paris hydra/@comment-1605058-20140817172823/@comment-24061664-20140817174246

As explained in the blog, for E=B to 0 step -1 loop is tricky. It appears to start from B to 0 decreasing 1 by 1, and therefore it is bounded to B+1 times, but it is not. Because in the loop E=E+1 is executed multiple (B*G) times. At each loop, E increases B*G and decreases 1, and therefore it appears to be infinite loop. But it is not, because E=E+1 is not executed when G=0. E increases rapidly, but finally it returns to 0. It can be proven by the fact that the corresponding ordinal is decreasing, and there is no infinite decrease of ordinal. Anyway, it is not a simple primitive recursive.