#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 */
scalar_t__ EOF;
scalar_t__ WanNum(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *);
int main() {
  int n, i, flag;
  while (scanf("%d", &n) != EOF) {
    flag = 0;
    for (i = 1; i <= n; i++) {
      if (WanNum(i)) {
        if (!flag) {
          printf("%d", i);
          flag = 1;
        } else
          printf(" %d", i);
      }
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
je     11ee <main+0xbe>
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11db <main+0xab>
mov    -0xc(%rbp),%edi
call   1040 <WanNum@plt>
cmp    $0x0,%rax
je     11c8 <main+0x98>
cmpl   $0x0,-0x10(%rbp)
jne    11b2 <main+0x82>
mov    -0xc(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
jmp    11c3 <main+0x93>
mov    -0xc(%rbp),%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c8 <main+0x98>
jmp    11cd <main+0x9d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x3d>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeaf(%rip),%r15
lea    0x4(%rsp),%rsi
mov    %r15,%rdi
call   1060 <scanf@plt>
mov    0x2e82(%rip),%r12
cmp    (%r12),%rax
jne    117d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x4(%rsp),%r14
lea    0xe77(%rip),%r13
jmp    11ab <main+0x6b>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
cmp    (%r12),%rax
je     116c <main+0x2c>
cmpl   $0x0,0x4(%rsp)
jle    1190 <main+0x50>
mov    $0x1,%ebx
xor    %ebp,%ebp
jmp    11cb <main+0x8b>
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%eax
cmp    0x4(%rsp),%ebx
mov    %eax,%ebx
jge    1190 <main+0x50>
mov    %ebx,%edi
call   1050 <WanNum@plt>
test   %rax,%rax
je     11c0 <main+0x80>
test   %ebp,%ebp
mov    %r13,%rdi
cmove  %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebp
jmp    11c0 <main+0x80>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.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 i32
store i32 0, i32* %1
br label %5
5: ; preds = %32, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %34
9: ; preds = %5
store i32 0, i32* %4
store i32 1, i32* %3
br label %10
10: ; preds = %29, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %32
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call i64 @WanNum(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %22)
store i32 1, i32* %4
br label %27
24: ; preds = %18
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27, %14
br label %29
29: ; preds = %28
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %10
32: ; preds = %10
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %5
34: ; preds = %5
%35 = load i32, i32* %1
ret i32 %35
}

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