#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) {
  char criba[100];
  int i, j;
  criba[0] = 0;
  for (i = 1; i < 100; i++) {
    criba[i] = i;
  }
  for (i = 2; i < 100; i++) {
    if (criba[i]) {
      for (j = 2; i * j < 100; j++) {
        criba[i * j] = 0;
      }
    }
  }
  for (i = 0; i < 100; i++) {
    if (criba[i]) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x70(%rbp)
movl   $0x1,-0x74(%rbp)
cmpl   $0x64,-0x74(%rbp)
jge    1152 <main+0x42>
mov    -0x74(%rbp),%eax
mov    %al,%cl
movslq -0x74(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    112d <main+0x1d>
movl   $0x2,-0x74(%rbp)
cmpl   $0x64,-0x74(%rbp)
jge    11bd <main+0xad>
movslq -0x74(%rbp),%rax
cmpb   $0x0,-0x70(%rbp,%rax,1)
je     11aa <main+0x9a>
movl   $0x2,-0x78(%rbp)
mov    -0x74(%rbp),%eax
imul   -0x78(%rbp),%eax
cmp    $0x64,%eax
jge    11a5 <main+0x95>
mov    -0x74(%rbp),%eax
imul   -0x78(%rbp),%eax
cltq
movb   $0x0,-0x70(%rbp,%rax,1)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1179 <main+0x69>
jmp    11aa <main+0x9a>
jmp    11af <main+0x9f>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1159 <main+0x49>
movl   $0x0,-0x74(%rbp)
cmpl   $0x64,-0x74(%rbp)
jge    11ff <main+0xef>
movslq -0x74(%rbp),%rax
cmpb   $0x0,-0x70(%rbp,%rax,1)
je     11ec <main+0xdc>
mov    -0x74(%rbp),%esi
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <main+0xe1>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11c4 <main+0xb4>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
movb   $0x0,(%rsp)
movaps 0xede(%rip),%xmm0
movups %xmm0,0x1(%rsp)
movaps 0xee2(%rip),%xmm0
movups %xmm0,0x11(%rsp)
movaps 0xee6(%rip),%xmm0
movups %xmm0,0x21(%rsp)
movaps 0xeea(%rip),%xmm0
movups %xmm0,0x31(%rsp)
movaps 0xeee(%rip),%xmm0
movups %xmm0,0x41(%rsp)
movaps 0xef2(%rip),%xmm0
movups %xmm0,0x51(%rsp)
movw   $0x6261,0x61(%rsp)
movb   $0x63,0x63(%rsp)
mov    $0x4,%eax
mov    $0x2,%ecx
jmp    118e <main+0x7e>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
add    $0x2,%rax
cmp    $0x64,%rcx
je     11af <main+0x9f>
cmpb   $0x0,(%rsp,%rcx,1)
je     1180 <main+0x70>
cmp    $0x31,%rcx
ja     1180 <main+0x70>
mov    %rax,%rdx
nopl   (%rax)
movb   $0x0,(%rsp,%rdx,1)
add    %rcx,%rdx
cmp    $0x64,%rdx
jb     11a0 <main+0x90>
jmp    1180 <main+0x70>
xor    %ebx,%ebx
lea    0xea8(%rip),%r14
jmp    11ca <main+0xba>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x64,%rbx
je     11dc <main+0xcc>
cmpb   $0x0,(%rsp,%rbx,1)
je     11c0 <main+0xb0>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    11c0 <main+0xb0>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 0, i8* %5
store i32 1, i32* %3
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %13
store i8 %11, i8* %14
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
store i32 2, i32* %3
br label %19
19: ; preds = %45, %18
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 100
br i1 %21, label %22, label %48
22: ; preds = %19
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %44
28: ; preds = %22
store i32 2, i32* %4
br label %29
29: ; preds = %40, %28
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = mul nsw i32 %30, %31
%33 = icmp slt i32 %32, 100
br i1 %33, label %34, label %43
34: ; preds = %29
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = mul nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %38
store i8 0, i8* %39
br label %40
40: ; preds = %34
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %29
43: ; preds = %29
br label %44
44: ; preds = %43, %22
br label %45
45: ; preds = %44
%46 = load i32, i32* %3
%47 = add nsw i32 %46, 1
store i32 %47, i32* %3
br label %19
48: ; preds = %19
store i32 0, i32* %3
br label %49
49: ; preds = %62, %48
%50 = load i32, i32* %3
%51 = icmp slt i32 %50, 100
br i1 %51, label %52, label %65
52: ; preds = %49
%53 = load i32, i32* %3
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = icmp ne i8 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %52
%59 = load i32, i32* %3
%60 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %58, %52
br label %62
62: ; preds = %61
%63 = load i32, i32* %3
%64 = add nsw i32 %63, 1
store i32 %64, i32* %3
br label %49
65: ; preds = %49
ret i32 0
}

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