#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);
int main(void) {
  int i, j;
  for (i = 1; i <= 100; i++) {
    for (j = 2; j < i; j++)
      if (i % j == 0)
        break;
    if (j == 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   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1199 <main+0x89>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116b <main+0x5b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1158 <main+0x48>
jmp    116b <main+0x5b>
jmp    115d <main+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1186 <main+0x76>
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    118b <main+0x7b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
xor    %r15d,%r15d
lea    0xedc(%rip),%r14
jmp    1146 <main+0x36>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
add    $0xffffffff,%r15d
cmp    $0x65,%ebx
je     1186 <main+0x76>
mov    $0x2,%ecx
cmp    $0x3,%ebx
jb     1180 <main+0x70>
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
je     1180 <main+0x70>
lea    (%r15,%rcx,1),%eax
add    $0x1,%eax
add    $0x1,%ecx
cmp    $0x1,%eax
jne    1160 <main+0x50>
jmp    1130 <main+0x20>
nopl   0x0(%rax,%rax,1)
cmp    %ebx,%ecx
je     1130 <main+0x20>
jmp    113a <main+0x2a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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