int main() {
  int n, *p, N[4] = {6, 28, 496, 8128};
  while (~scanf("%d", &n)) {
    p = N;
    if (n >= *p)
      printf("%d", *p++);
    while (n >= *p)
      printf(" %d", *p++);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     11e4 <main+0xc4>
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jl     1199 <main+0x79>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119e <main+0x7e>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jl     11d1 <main+0xb1>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119e <main+0x7e>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1145 <main+0x25>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0xffffffff,%eax
je     11f9 <main+0xc9>
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xe9a(%rip),%r15
lea    0xc(%rsp),%r14
lea    0xe8d(%rip),%rbx
jmp    11ac <main+0x7c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0xffffffff,%eax
je     11f9 <main+0xc9>
mov    0xc(%rsp),%eax
mov    %r13,%rbp
cmp    $0x6,%eax
jl     11ce <main+0x9e>
mov    %r15,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%eax
mov    %r12,%rbp
mov    0x0(%rbp),%esi
cmp    %esi,%eax
jl     1190 <main+0x60>
add    $0x4,%rbp
nopl   0x0(%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%rbp),%esi
add    $0x4,%rbp
cmp    %esi,0xc(%rsp)
jge    11e0 <main+0xb0>
jmp    1190 <main+0x60>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.N = [4 x i32] [i32 6, i32 28, i32 496, i32 8128]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [4 x i32]
store i32 0, i32* %1
%5 = bitcast [4 x i32]* %4 to i8*
br label %6
6: ; preds = %32, %0
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = xor i32 %7, -1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %34
10: ; preds = %6
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32* %11, i32** %3
%12 = load i32, i32* %2
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = icmp sge i32 %12, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %3
%19 = load i32, i32* %17
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %16, %10
br label %22
22: ; preds = %27, %21
%23 = load i32, i32* %2
%24 = load i32*, i32** %3
%25 = load i32, i32* %24
%26 = icmp sge i32 %23, %25
br i1 %26, label %27, label %32
27: ; preds = %22
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i32 1
store i32* %29, i32** %3
%30 = load i32, i32* %28
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
br label %22
32: ; preds = %22
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %6
34: ; preds = %6
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
@__const.main.N = [4 x i32] [i32 6, i32 28, i32 496, i32 8128]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %33, label %7
7: ; preds = %0
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
br label %10
10: ; preds = %7, %29
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 6
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 6)
%15 = load i32, i32* %1
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %15, %13 ], [ %11, %10 ]
%18 = phi i32* [ %9, %13 ], [ %8, %10 ]
%19 = load i32, i32* %18
%20 = icmp slt i32 %17, %19
br i1 %20, label %29, label %21
21: ; preds = %16, %21
%22 = phi i32 [ %27, %21 ], [ %19, %16 ]
%23 = phi i32* [ %24, %21 ], [ %18, %16 ]
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%26 = load i32, i32* %1
%27 = load i32, i32* %24
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %21
29: ; preds = %21, %16
%30 = call i32 @putchar(i32 10)
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %10
33: ; preds = %29, %0
ret i32 0
}