AMD interview question

How do you program this in C?