#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 main(void) {
  int number;
  int divisor;
  printf("1\n2\n");
  for (number = 3; number <= 100; number += 2) {
    for (divisor = 3; divisor < number; divisor += 2)
      if (number % divisor == 0)
        break;
    if (divisor >= number)
      printf("%d\n", number);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     11a9 <main+0x99>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1179 <main+0x69>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1166 <main+0x56>
jmp    1179 <main+0x69>
jmp    116b <main+0x5b>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <main+0x35>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1196 <main+0x86>
mov    -0x8(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <main+0x8b>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%ebx
lea    0xec4(%rip),%r14
jmp    1156 <main+0x36>
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2(%rbx),%eax
cmp    $0x63,%ebx
mov    %eax,%ebx
jae    1173 <main+0x53>
cmp    $0x4,%ebx
jb     1140 <main+0x20>
mov    $0x3,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
je     114c <main+0x2c>
add    $0x2,%ecx
cmp    %ebx,%ecx
jb     1160 <main+0x40>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [4 x i8] c"1\0A2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %14
%3 = phi i32 [ 3, %0 ], [ %15, %14 ]
%4 = icmp ugt i32 %3, 3
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp ult i32 %11, %3
br i1 %6, label %7, label %12
7: ; preds = %2, %5
%8 = phi i32 [ %11, %5 ], [ 3, %2 ]
%9 = urem i32 %3, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 2
br i1 %10, label %14, label %5
12: ; preds = %5, %2
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
br label %14
14: ; preds = %7, %12
%15 = add nuw nsw i32 %3, 2
%16 = icmp ult i32 %3, 99
br i1 %16, label %2, label %17
17: ; preds = %14
ret i32 0
}