#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*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  int n;
  int i;
  int times;
  int flag2, flag3, flag5, flag7;
  if (argc != 2) {
    printf("Usage: %s INPUT_FILE\n\n", argv[0]);
    exit(-1);
  }
  if (access(argv[1], F_OK)) {
    printf("Error: INPUT_FILE %s does not exist\n\n", argv[1]);
    exit(-1);
  }
  freopen(argv[1], "r", stdin);
  for (n = 1; n < 10000; ++n) {
    printf("%d  ", n);
    times = 0;
    for (i = 1; i <= n; ++i)
      if (!(n % i))
        times++;
    if (times % 2)
      printf("yes\n");
    else
      printf("no\n");
  }
  fclose(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     118f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e32(%rip),%rax
mov    (%rax),%esi
call   1060 <access@plt>
cmp    $0x0,%rax
je     11cf <main+0x7f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e0a(%rip),%rax
mov    (%rax),%edx
lea    0xe56(%rip),%rsi
call   1050 <freopen@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    129f <main+0x14f>
mov    -0x14(%rbp),%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1257 <main+0x107>
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
jne    1244 <main+0xf4>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1249 <main+0xf9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    121f <main+0xcf>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     127e <main+0x12e>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128c <main+0x13c>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1291 <main+0x141>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f3 <main+0xa3>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1297 <main+0x137>
mov    0x8(%rbx),%rdi
mov    0x2e4e(%rip),%rax
mov    (%rax),%esi
call   1070 <access@plt>
mov    0x8(%rbx),%rcx
test   %rax,%rax
jne    12a3 <main+0x143>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edx
lea    0xe97(%rip),%rsi
mov    %rcx,%rdi
call   1060 <freopen@plt>
mov    $0x1,%ebx
mov    $0x2,%r12d
lea    0xe87(%rip),%r13
xor    %r15d,%r15d
jmp    11fa <main+0x9a>
cs nopw 0x0(%rax,%rax,1)
nop
test   $0x1,%cl
mov    %r13,%rdi
lea    0xe67(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
add    $0x1,%r12d
cmp    $0x2711,%r12d
je     1278 <main+0x118>
mov    %r15d,%r14d
lea    0x1(%r14),%r15d
lea    0xe37(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebp
mov    $0x0,%ecx
test   %r14d,%r14d
je     125d <main+0xfd>
mov    %ebx,%esi
and    $0xfffffffe,%esi
neg    %esi
xor    %ecx,%ecx
mov    $0x1,%edi
xchg   %ax,%ax
mov    %ebx,%eax
xor    %edx,%edx
div    %edi
cmp    $0x1,%edx
adc    $0x0,%ecx
lea    0x1(%rdi),%ebp
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
cmp    $0x1,%edx
adc    $0x0,%ecx
mov    %edi,%ebp
add    $0x2,%ebp
lea    (%rsi,%rdi,1),%eax
add    $0x2,%eax
mov    %ebp,%edi
cmp    $0x1,%eax
jne    1230 <main+0xd0>
test   $0x1,%r15b
je     11d0 <main+0x70>
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
cmp    $0x1,%edx
adc    $0x0,%ecx
jmp    11d0 <main+0x70>
mov    0x2d69(%rip),%rax
mov    (%rax),%edi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xd5f(%rip),%rdi
jmp    12ad <main+0x14d>
lea    0xd6d(%rip),%rdi
mov    %rcx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [5 x i8] c"%d \00"
@.str.4 = [5 x i8] c"yes\0A\00"
@.str.5 = [4 x i8] c"no\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i32, i32* @F_OK
%26 = call i64 @access(i8* %24, i32 %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %21
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %31)
%33 = call i32 @exit(i32 -1)
unreachable
34: ; preds = %21
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = load i32, i32* @stdin
%39 = call i32 @freopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %38)
store i32 1, i32* %6
br label %40
40: ; preds = %71, %34
%41 = load i32, i32* %6
%42 = icmp slt i32 %41, 10000
br i1 %42, label %43, label %74
43: ; preds = %40
%44 = load i32, i32* %6
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %44)
store i32 0, i32* %8
store i32 1, i32* %7
br label %46
46: ; preds = %59, %43
%47 = load i32, i32* %7
%48 = load i32, i32* %6
%49 = icmp sle i32 %47, %48
br i1 %49, label %50, label %62
50: ; preds = %46
%51 = load i32, i32* %6
%52 = load i32, i32* %7
%53 = srem i32 %51, %52
%54 = icmp ne i32 %53, 0
br i1 %54, label %58, label %55
55: ; preds = %50
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %58
58: ; preds = %55, %50
br label %59
59: ; preds = %58
%60 = load i32, i32* %7
%61 = add nsw i32 %60, 1
store i32 %61, i32* %7
br label %46
62: ; preds = %46
%63 = load i32, i32* %8
%64 = srem i32 %63, 2
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %70
68: ; preds = %62
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %70
70: ; preds = %68, %66
br label %71
71: ; preds = %70
%72 = load i32, i32* %6
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
br label %40
74: ; preds = %40
%75 = load i32, i32* @stdin
%76 = call i32 @fclose(i32 %75)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [5 x i8] c"%d \00"
@str = [3 x i8] c"no\00"
@str.6 = [4 x i8] c"yes\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = load i32, i32* @F_OK
%12 = tail call i64 @access(i8* %10, i32 %11)
%13 = icmp eq i64 %12, 0
%14 = load i8*, i8** %9
br i1 %13, label %18, label %15
15: ; preds = %8
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%17 = tail call i32 @exit(i32 -1)
unreachable
18: ; preds = %8
%19 = load i32, i32* @stdin
%20 = tail call i32 @freopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %57
%22 = phi i32 [ 0, %18 ], [ %66, %57 ]
%23 = phi i32 [ 2, %18 ], [ %64, %57 ]
%24 = phi i32 [ 1, %18 ], [ %63, %57 ]
%25 = add i32 %22, 1
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%27 = and i32 %25, 1
%28 = icmp eq i32 %22, 0
br i1 %28, label %47, label %29
29: ; preds = %21
%30 = and i32 %25, -2
br label %31
31: ; preds = %31, %29
%32 = phi i32 [ 1, %29 ], [ %44, %31 ]
%33 = phi i32 [ 0, %29 ], [ %43, %31 ]
%34 = phi i32 [ 0, %29 ], [ %45, %31 ]
%35 = urem i32 %24, %32
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i32
%38 = add nuw nsw i32 %33, %37
%39 = add nuw nsw i32 %32, 1
%40 = urem i32 %24, %39
%41 = icmp eq i32 %40, 0
%42 = zext i1 %41 to i32
%43 = add nuw nsw i32 %38, %42
%44 = add nuw nsw i32 %32, 2
%45 = add i32 %34, 2
%46 = icmp eq i32 %45, %30
br i1 %46, label %47, label %31
47: ; preds = %31, %21
%48 = phi i32 [ undef, %21 ], [ %43, %31 ]
%49 = phi i32 [ 1, %21 ], [ %44, %31 ]
%50 = phi i32 [ 0, %21 ], [ %43, %31 ]
%51 = icmp eq i32 %27, 0
br i1 %51, label %57, label %52
52: ; preds = %47
%53 = urem i32 %24, %49
%54 = icmp eq i32 %53, 0
%55 = zext i1 %54 to i32
%56 = add nuw nsw i32 %50, %55
br label %57
57: ; preds = %47, %52
%58 = phi i32 [ %48, %47 ], [ %56, %52 ]
%59 = and i32 %58, 1
%60 = icmp eq i32 %59, 0
%61 = select i1 %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0)
%62 = tail call i32 @puts(i8* dereferenceable(1) %61)
%63 = add nuw nsw i32 %24, 1
%64 = add nuw nsw i32 %23, 1
%65 = icmp eq i32 %64, 10001
%66 = add i32 %22, 1
br i1 %65, label %67, label %21
67: ; preds = %57
%68 = load i32, i32* @stdin
%69 = tail call i32 @fclose(i32 %68)
ret i32 0
}