#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;
int /*<<< orphan*/ clr(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int /*<<< orphan*/ set(int);
scalar_t__ test(int);
int main() {
  int i;
  for (i = 0; i < 10000000; i++)
    clr(i);
  while (scanf("%d", &i) != EOF)
    set(i);
  for (i = 0; i < 10000000; i++)
    if (test(i))
      printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    1189 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <clr@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x16>
jmp    118e <main+0x3e>
lea    0xe6b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e43(%rip),%rcx
cmp    (%rcx),%rax
je     11bb <main+0x6b>
mov    -0x8(%rbp),%edi
call   1060 <set@plt>
jmp    118e <main+0x3e>
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    1203 <main+0xb3>
mov    -0x8(%rbp),%edi
call   1070 <test@plt>
cmp    $0x0,%rax
je     11f0 <main+0xa0>
mov    -0x8(%rbp),%esi
lea    0xe18(%rip),%rdi
call   1040 <printf@plt>
jmp    11f5 <main+0xa5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c2 <main+0x72>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <clr@plt>
add    $0x1,%ebx
cmp    $0x989680,%ebx
jne    1160 <main+0x10>
movl   $0x989680,0xc(%rsp)
lea    0xe7f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e56(%rip),%r15
cmp    (%r15),%rax
je     11c9 <main+0x79>
lea    0xe62(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc(%rsp),%edi
call   1060 <set@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    (%r15),%rax
jne    11b0 <main+0x60>
movl   $0x0,0xc(%rsp)
xor    %edi,%edi
lea    0xe29(%rip),%rbx
jmp    11f2 <main+0xa2>
nopl   0x0(%rax)
mov    0xc(%rsp),%eax
lea    0x1(%rax),%edi
mov    %edi,0xc(%rsp)
cmp    $0x98967f,%eax
jge    120a <main+0xba>
call   1070 <test@plt>
test   %rax,%rax
je     11e0 <main+0x90>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
jmp    11e0 <main+0x90>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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