···2323 cmd, x, y = program[pc]
24242525 if cmd == 'cpy':
2626- # Subroutines that look like this perform multiplication:
2626+ # The following instructions simply perform multiplication:
2727 # cpy b c
2828 # inc a
2929 # dec c
3030 # jnz c -2
3131 # dec d
3232 # jnz d -5
3333- # Perform a lookahead and optimize it by doing the following:
3333+ # Perform a peephole optimization by doing the following:
3434 # - Set a to b*d
3535 # - Set c and d to 0.
3636- # - Move forward 5 instructions.
3636+ # - Advance the PC by 5 instructions.
3737 next_cmds, next_regs = zip(*program[pc+1:pc+5])[0:2]
38383939 if x.isalpha() and next_cmds == ('inc', 'dec', 'jnz', 'dec'):