Write a C function to reverse the bits of a 32-bit unsigned integer without using a lookup table.
Implement the equivalent Python function reverse_bits(n) for grading. Return the unsigned 32-bit integer whose bit at position i equals the input bit at position 31 - i. The input is guaranteed to be within the 32-bit unsigned range.
def reverse_bits(n):