AMD Interview Question

How do you program this in C?