#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char sieve[100];
  char *sp;
  int num;
  for (sp = sieve; sp < &sieve[100]; sp++)
    *sp = true;
  for (num = 3; num += 2;) {
    sp = &sieve[0] + (num - 3) / 2;
    if (sp >= &sieve[100])
      break;
    while (sp += num, sp < &sieve[100])
      *sp = false;
  }
  printf("2, ");
  for (num = 3, sp = &sieve[0]; sp < &sieve[100]; num += 2, sp++) {
    if (*sp)
      printf("%d, ", num);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
lea    -0x70(%rbp),%rcx
add    $0x64,%rcx
cmp    %rcx,%rax
jae    1157 <main+0x47>
mov    -0x78(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    112a <main+0x1a>
movl   $0x3,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x7c(%rbp)
cmp    $0x0,%eax
je     11f2 <main+0xe2>
lea    -0x70(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x7c(%rbp),%eax
sub    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x88(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
lea    -0x70(%rbp),%rcx
add    $0x64,%rcx
cmp    %rcx,%rax
jb     11b6 <main+0xa6>
jmp    11f2 <main+0xe2>
jmp    11bb <main+0xab>
mov    -0x7c(%rbp),%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
lea    -0x70(%rbp),%rcx
add    $0x64,%rcx
cmp    %rcx,%rax
jae    11ed <main+0xdd>
mov    -0x78(%rbp),%rax
movb   $0x0,(%rax)
jmp    11bb <main+0xab>
jmp    115e <main+0x4e>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x3,-0x7c(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
lea    -0x70(%rbp),%rcx
add    $0x64,%rcx
cmp    %rcx,%rax
jae    1261 <main+0x151>
mov    -0x78(%rbp),%rax
cmpb   $0x0,(%rax)
je     1242 <main+0x132>
mov    -0x7c(%rbp),%esi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1247 <main+0x137>
mov    -0x7c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
jmp    120f <main+0xff>
mov    0x2d78(%rip),%rax
mov    (%rax),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0x64(%rsp),%rbx
lea    0x1(%rsp),%rdx
cmp    %rdx,%rbx
cmova  %rbx,%rdx
mov    %rsp,%r15
sub    %r15,%rdx
mov    %r15,%rdi
mov    $0x1,%esi
call   1040 <memset@plt>
mov    $0x1,%ecx
mov    $0x5,%eax
jmp    1167 <main+0x47>
nopw   0x0(%rax,%rax,1)
add    $0x4,%rax
shr    %rcx
add    %rsp,%rcx
nopw   0x0(%rax,%rax,1)
add    %rax,%rcx
cmp    %rbx,%rcx
jae    1180 <main+0x60>
movb   $0x0,(%rcx)
jmp    1170 <main+0x50>
nopl   (%rax)
cmp    $0xc8,%rax
ja     11ad <main+0x8d>
lea    0x2(%rax),%rcx
mov    %rax,%rdx
shr    %rdx
add    %rsp,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
add    %rcx,%rdx
cmp    %rbx,%rdx
jae    1160 <main+0x40>
movb   $0x0,(%rdx)
jmp    11a0 <main+0x80>
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%ebp
lea    0xe3d(%rip),%r14
jmp    11dc <main+0xbc>
nopl   0x0(%rax)
add    $0x2,%ebp
add    $0x1,%r15
cmp    %rbx,%r15
jae    11f0 <main+0xd0>
cmpb   $0x0,(%r15)
je     11d0 <main+0xb0>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"2, \00"
@.str.1 = [5 x i8] c"%d, \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = ptrtoint [100 x i8]* %1 to i64
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = add i64 %3, 100
%6 = or i64 %3, 1
%7 = call i64 @llvm.umax.i64(i64 %5, i64 %6)
%8 = sub i64 %7, %3
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 100
br label %25
10: ; preds = %31, %25
%11 = add nuw nsw i64 %26, 2
%12 = icmp ult i64 %26, 201
br i1 %12, label %13, label %35
13: ; preds = %10
%14 = lshr i64 %26, 1
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %14
%16 = getelementptr inbounds i8, i8* %15, i64 %11
%17 = icmp ult i8* %16, %9
br i1 %17, label %18, label %22
18: ; preds = %13, %18
%19 = phi i8* [ %20, %18 ], [ %16, %13 ]
store i8 0, i8* %19
%20 = getelementptr inbounds i8, i8* %19, i64 %11
%21 = icmp ult i8* %20, %9
br i1 %21, label %18, label %22
22: ; preds = %18, %13
%23 = add nuw nsw i64 %26, 4
%24 = lshr i64 %11, 1
br label %25
25: ; preds = %22, %0
%26 = phi i64 [ 5, %0 ], [ %23, %22 ]
%27 = phi i64 [ 1, %0 ], [ %24, %22 ]
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %27
%29 = getelementptr inbounds i8, i8* %28, i64 %26
%30 = icmp ult i8* %29, %9
br i1 %30, label %31, label %10
31: ; preds = %25, %31
%32 = phi i8* [ %33, %31 ], [ %29, %25 ]
store i8 0, i8* %32
%33 = getelementptr inbounds i8, i8* %32, i64 %26
%34 = icmp ult i8* %33, %9
br i1 %34, label %31, label %10
35: ; preds = %10
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %37
37: ; preds = %35, %44
%38 = phi i32 [ 3, %35 ], [ %45, %44 ]
%39 = phi i8* [ %4, %35 ], [ %46, %44 ]
%40 = load i8, i8* %39
%41 = icmp eq i8 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %37
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %44
44: ; preds = %37, %42
%45 = add nuw nsw i32 %38, 2
%46 = getelementptr inbounds i8, i8* %39, i64 1
%47 = icmp ult i8* %46, %9
br i1 %47, label %37, label %48
48: ; preds = %44
%49 = load i32, i32* @EXIT_SUCCESS
ret i32 %49
}