static mut I: i32 = 1;

fn iterator() -> i32 {
    unsafe {
        I = I << 1;
        I
    }
}

fn print_binary(num: i32) {
    for shift in (0..32).rev() {
        print!("{}", (num >> shift) & 1);
    }
    println!();
}

fn main() {
    let mut run = 1;
    while run != 0 {
        let next = iterator();
        println!("Int: {}", next);
        print!("Bin: ");
        print_binary(next);
        run = next;
    }
}
