#include <stdio.h>
void count_up(unsigned int * num, unsigned int * cursor);


 int main(void)
{
    unsigned int i = 0x0;
    unsigned int cursor = 0x1;
    while(1)
    {
        cursor = 0x1;
        count_up(&i, &cursor);
    }

    return 0;
}

void count_up(unsigned int * num, unsigned int * cursor)
{
    if((*num & *cursor) == *cursor)
    {
        *num ^= *cursor;
        *cursor <<= 1;
        count_up(num, cursor);
    }
    else
    {
        *num ^= *cursor;
    	printf("%d\n", *num);
    }
}