AMD interview question

Debug a program, of about 50 lines. Pretty easy one.