Arm interview question

basic digital design, FSM, bit manipulation in C