#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n, i = 0;
  scanf("%d", &n);
  do
    if (n & 1)
      printf("%d ", 1 << i);
  while (i++, n /= 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     116b <main+0x4b>
mov    -0xc(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    1146 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
mov    0x4(%rsp),%eax
lea    0xec1(%rip),%r14
jmp    116a <main+0x4a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ecx,0x4(%rsp)
add    $0x1,%eax
cmp    $0x2,%eax
mov    %ecx,%eax
jbe    1185 <main+0x65>
test   $0x1,%al
je     1150 <main+0x30>
mov    $0x1,%esi
mov    %ebx,%ecx
shl    %cl,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%eax
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32, i32* %3
%11 = shl i32 1, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %5
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 2
store i32 %18, i32* %2
%19 = icmp ne i32 %18, 0
br i1 %19, label %5, label %20
20: ; preds = %14
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
br label %5
5: ; preds = %14, %0
%6 = phi i32 [ %4, %0 ], [ %17, %14 ]
%7 = phi i32 [ 0, %0 ], [ %16, %14 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = shl nuw i32 1, %7
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
br label %14
14: ; preds = %5, %10
%15 = phi i32 [ %6, %5 ], [ %13, %10 ]
%16 = add nuw nsw i32 %7, 1
%17 = sdiv i32 %15, 2
store i32 %17, i32* %1
%18 = add i32 %15, 1
%19 = icmp ult i32 %18, 3
br i1 %19, label %20, label %5
20: ; preds = %14
ret i32 0
}