#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 sqrt(int);
int main() {
  int i, j, n, a[101];
  for (i = 1; i <= 100; i++)
    a[i] = i;
  a[1] = 0;
  for (i = 2; i < sqrt(100); i++)
    for (j = i + 1; j <= 100; j++) {
      if (a[i] != 0 && a[j] != 0)
        if (a[j] % a[i] == 0)
          a[j] = 0;
    }
  printf("\n");
  for (i = 2, n = 0; i <= 100; i++) {
    if (a[i] != 0) {
      printf("%5d", a[i]);
      n++;
    }
    if (n == 10) {
      printf("\n");
      n = 0;
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     115f <main+0x3f>
mov    -0x8(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x1b0(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
movl   $0x0,-0x1ac(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1b4(%rbp)
mov    $0x64,%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    -0x1b4(%rbp),%eax
cmp    %ecx,%eax
jge    1224 <main+0x104>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     1211 <main+0xf1>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0x1b0(%rbp,%rax,4)
je     11fe <main+0xde>
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x1b0(%rbp,%rax,4)
je     11fe <main+0xde>
movslq -0xc(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cltd
idivl  -0x1b0(%rbp,%rcx,4)
cmp    $0x0,%edx
jne    11f9 <main+0xd9>
movslq -0xc(%rbp),%rax
movl   $0x0,-0x1b0(%rbp,%rax,4)
jmp    11fe <main+0xde>
jmp    1203 <main+0xe3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119c <main+0x7c>
jmp    1216 <main+0xf6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1170 <main+0x50>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     12b0 <main+0x190>
movslq -0x8(%rbp),%rax
cmpl   $0x0,-0x1b0(%rbp,%rax,4)
je     127e <main+0x15e>
movslq -0x8(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jne    129d <main+0x17d>
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
jmp    12a2 <main+0x182>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1240 <main+0x120>
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1a0,%rsp
movaps 0xebe(%rip),%xmm0
movups %xmm0,0x4(%rsp)
movaps 0xec2(%rip),%xmm0
movups %xmm0,0x14(%rsp)
movaps 0xec6(%rip),%xmm0
movups %xmm0,0x24(%rsp)
movaps 0xeca(%rip),%xmm0
movups %xmm0,0x34(%rsp)
movaps 0xece(%rip),%xmm0
movups %xmm0,0x44(%rsp)
movaps 0xed2(%rip),%xmm0
movups %xmm0,0x54(%rsp)
movaps 0xed6(%rip),%xmm0
movups %xmm0,0x64(%rsp)
movaps 0xeda(%rip),%xmm0
movups %xmm0,0x74(%rsp)
movaps 0xede(%rip),%xmm0
movups %xmm0,0x84(%rsp)
movaps 0xedf(%rip),%xmm0
movups %xmm0,0x94(%rsp)
movaps 0xee0(%rip),%xmm0
movups %xmm0,0xa4(%rsp)
movaps 0xee1(%rip),%xmm0
movups %xmm0,0xb4(%rsp)
movaps 0xee2(%rip),%xmm0
movups %xmm0,0xc4(%rsp)
movaps 0xee3(%rip),%xmm0
movups %xmm0,0xd4(%rsp)
movaps 0xee4(%rip),%xmm0
movups %xmm0,0xe4(%rsp)
movaps 0xee5(%rip),%xmm0
movups %xmm0,0xf4(%rsp)
movaps 0xee6(%rip),%xmm0
movups %xmm0,0x104(%rsp)
movaps 0xee7(%rip),%xmm0
movups %xmm0,0x114(%rsp)
movaps 0xee8(%rip),%xmm0
movups %xmm0,0x124(%rsp)
movaps 0xee9(%rip),%xmm0
movups %xmm0,0x134(%rsp)
movaps 0xeea(%rip),%xmm0
movups %xmm0,0x144(%rsp)
movaps 0xeeb(%rip),%xmm0
movups %xmm0,0x154(%rsp)
movaps 0xeec(%rip),%xmm0
movups %xmm0,0x164(%rsp)
movaps 0xeed(%rip),%xmm0
movups %xmm0,0x174(%rsp)
movaps 0xeee(%rip),%xmm0
movups %xmm0,0x184(%rsp)
movl   $0x0,0x4(%rsp)
mov    $0x64,%edi
call   1050 <sqrt@plt>
cmp    $0x3,%eax
jl     1318 <main+0x1e8>
mov    $0x3,%ebx
mov    $0x2,%r14d
jmp    12d5 <main+0x1a5>
xchg   %ax,%ax
mov    $0x64,%edi
call   1050 <sqrt@plt>
cltq
add    $0x1,%rbx
cmp    %rax,%r14
jge    1318 <main+0x1e8>
mov    %r14,%rcx
add    $0x1,%r14
cmp    $0x63,%rcx
ja     12c0 <main+0x190>
mov    %rbx,%rsi
jmp    12fa <main+0x1ca>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rsi
cmp    $0x65,%rsi
je     12c0 <main+0x190>
mov    (%rsp,%rcx,4),%edi
test   %edi,%edi
je     12f0 <main+0x1c0>
mov    (%rsp,%rsi,4),%eax
test   %eax,%eax
je     12f0 <main+0x1c0>
cltd
idiv   %edi
test   %edx,%edx
jne    12f0 <main+0x1c0>
movl   $0x0,(%rsp,%rsi,4)
jmp    12f0 <main+0x1c0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%ebx
lea    0xe62(%rip),%r14
xor    %ebp,%ebp
jmp    134a <main+0x21a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    $0x65,%rbx
je     1371 <main+0x241>
mov    (%rsp,%rbx,4),%esi
test   %esi,%esi
je     1340 <main+0x210>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1340 <main+0x210>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
jmp    1340 <main+0x210>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c"%5d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [101 x i32]
store i32 0, i32* %1
store i32 1, i32* %2
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 100
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %12
store i32 %10, i32* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %6
17: ; preds = %6
%18 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 1
store i32 0, i32* %18
store i32 2, i32* %2
br label %19
19: ; preds = %62, %17
%20 = load i32, i32* %2
%21 = call i32 @sqrt(i32 100)
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %65
23: ; preds = %19
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %26
26: ; preds = %58, %23
%27 = load i32, i32* %3
%28 = icmp sle i32 %27, 100
br i1 %28, label %29, label %61
29: ; preds = %26
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %57
35: ; preds = %29
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %57
41: ; preds = %35
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = srem i32 %45, %49
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %41
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %54
store i32 0, i32* %55
br label %56
56: ; preds = %52, %41
br label %57
57: ; preds = %56, %35, %29
br label %58
58: ; preds = %57
%59 = load i32, i32* %3
%60 = add nsw i32 %59, 1
store i32 %60, i32* %3
br label %26
61: ; preds = %26
br label %62
62: ; preds = %61
%63 = load i32, i32* %2
%64 = add nsw i32 %63, 1
store i32 %64, i32* %2
br label %19
65: ; preds = %19
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %2
store i32 0, i32* %4
br label %67
67: ; preds = %90, %65
%68 = load i32, i32* %2
%69 = icmp sle i32 %68, 100
br i1 %69, label %70, label %93
70: ; preds = %67
%71 = load i32, i32* %2
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %84
76: ; preds = %70
%77 = load i32, i32* %2
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [101 x i32], [101 x i32]* %5, i64 0, i64 %78
%80 = load i32, i32* %79
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %80)
%82 = load i32, i32* %4
%83 = add nsw i32 %82, 1
store i32 %83, i32* %4
br label %84
84: ; preds = %76, %70
%85 = load i32, i32* %4
%86 = icmp eq i32 %85, 10
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %89
89: ; preds = %87, %84
br label %90
90: ; preds = %89
%91 = load i32, i32* %2
%92 = add nsw i32 %91, 1
store i32 %92, i32* %2
br label %67
93: ; preds = %67
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%5d\00"
define i32 @main() {
%1 = alloca [101 x i32]
%2 = bitcast [101 x i32]* %1 to i8*
%3 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 1
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 1, i32 2, i32 3, i32 4>, <4 x i32>* %4
%5 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 5
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 5, i32 6, i32 7, i32 8>, <4 x i32>* %6
%7 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 9
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 9, i32 10, i32 11, i32 12>, <4 x i32>* %8
%9 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 13
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 13, i32 14, i32 15, i32 16>, <4 x i32>* %10
%11 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 17
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 17, i32 18, i32 19, i32 20>, <4 x i32>* %12
%13 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 21
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 21, i32 22, i32 23, i32 24>, <4 x i32>* %14
%15 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 25
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 25, i32 26, i32 27, i32 28>, <4 x i32>* %16
%17 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 29
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 29, i32 30, i32 31, i32 32>, <4 x i32>* %18
%19 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 33
%20 = bitcast i32* %19 to <4 x i32>*
store <4 x i32> <i32 33, i32 34, i32 35, i32 36>, <4 x i32>* %20
%21 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 37
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> <i32 37, i32 38, i32 39, i32 40>, <4 x i32>* %22
%23 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 41
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> <i32 41, i32 42, i32 43, i32 44>, <4 x i32>* %24
%25 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 45
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 45, i32 46, i32 47, i32 48>, <4 x i32>* %26
%27 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 49
%28 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> <i32 49, i32 50, i32 51, i32 52>, <4 x i32>* %28
%29 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 53
%30 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> <i32 53, i32 54, i32 55, i32 56>, <4 x i32>* %30
%31 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 57
%32 = bitcast i32* %31 to <4 x i32>*
store <4 x i32> <i32 57, i32 58, i32 59, i32 60>, <4 x i32>* %32
%33 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 61
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> <i32 61, i32 62, i32 63, i32 64>, <4 x i32>* %34
%35 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 65
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> <i32 65, i32 66, i32 67, i32 68>, <4 x i32>* %36
%37 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 69
%38 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> <i32 69, i32 70, i32 71, i32 72>, <4 x i32>* %38
%39 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 73
%40 = bitcast i32* %39 to <4 x i32>*
store <4 x i32> <i32 73, i32 74, i32 75, i32 76>, <4 x i32>* %40
%41 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 77
%42 = bitcast i32* %41 to <4 x i32>*
store <4 x i32> <i32 77, i32 78, i32 79, i32 80>, <4 x i32>* %42
%43 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 81
%44 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> <i32 81, i32 82, i32 83, i32 84>, <4 x i32>* %44
%45 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 85
%46 = bitcast i32* %45 to <4 x i32>*
store <4 x i32> <i32 85, i32 86, i32 87, i32 88>, <4 x i32>* %46
%47 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 89
%48 = bitcast i32* %47 to <4 x i32>*
store <4 x i32> <i32 89, i32 90, i32 91, i32 92>, <4 x i32>* %48
%49 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 93
%50 = bitcast i32* %49 to <4 x i32>*
store <4 x i32> <i32 93, i32 94, i32 95, i32 96>, <4 x i32>* %50
%51 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 97
%52 = bitcast i32* %51 to <4 x i32>*
store <4 x i32> <i32 97, i32 98, i32 99, i32 100>, <4 x i32>* %52
%53 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 1
store i32 0, i32* %53
%54 = tail call i32 @sqrt(i32 100)
%55 = icmp sgt i32 %54, 2
br i1 %55, label %61, label %83
56: ; preds = %80, %61
%57 = tail call i32 @sqrt(i32 100)
%58 = sext i32 %57 to i64
%59 = icmp slt i64 %64, %58
%60 = add nuw nsw i64 %63, 1
br i1 %59, label %61, label %83
61: ; preds = %0, %56
%62 = phi i64 [ %64, %56 ], [ 2, %0 ]
%63 = phi i64 [ %60, %56 ], [ 3, %0 ]
%64 = add nuw nsw i64 %62, 1
%65 = icmp ult i64 %62, 100
br i1 %65, label %66, label %56
66: ; preds = %61
%67 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 %62
br label %68
68: ; preds = %66, %80
%69 = phi i64 [ %63, %66 ], [ %81, %80 ]
%70 = load i32, i32* %67
%71 = icmp eq i32 %70, 0
br i1 %71, label %80, label %72
72: ; preds = %68
%73 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 %69
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 0
br i1 %75, label %80, label %76
76: ; preds = %72
%77 = srem i32 %74, %70
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %76
store i32 0, i32* %73
br label %80
80: ; preds = %68, %72, %79, %76
%81 = add nuw nsw i64 %69, 1
%82 = icmp eq i64 %81, 101
br i1 %82, label %56, label %68
83: ; preds = %56, %0
%84 = tail call i32 @putchar(i32 10)
br label %85
85: ; preds = %83, %97
%86 = phi i64 [ 2, %83 ], [ %99, %97 ]
%87 = phi i32 [ 0, %83 ], [ %98, %97 ]
%88 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 %86
%89 = load i32, i32* %88
%90 = icmp eq i32 %89, 0
br i1 %90, label %97, label %91
91: ; preds = %85
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %89)
%93 = add nsw i32 %87, 1
%94 = icmp eq i32 %93, 10
br i1 %94, label %95, label %97
95: ; preds = %91
%96 = tail call i32 @putchar(i32 10)
br label %97
97: ; preds = %85, %91, %95
%98 = phi i32 [ 0, %95 ], [ %93, %91 ], [ %87, %85 ]
%99 = add nuw nsw i64 %86, 1
%100 = icmp eq i64 %99, 101
br i1 %100, label %101, label %85
101: ; preds = %97
%102 = tail call i32 @putchar(i32 10)
ret i32 0
}