Transforming loops into a finite state machine | Hacker News Reader