#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);
void FindPrimerNumber(void) {
  int signal[1000];
  int tendency[1000 / 100] = {0};
  int number = 0;
  int num = 0;
  for (number = 0; number < 1000; number++) {
    signal[number] = 1;
  }
  for (number = 1; number <= 1000; number++) {
    if (signal[number] != 0) {
      for (num = number + 2; num <= 1000; num++) {
        if (num % (number + 1) == 0) {
          signal[num - 1] = 0;
        }
      }
    }
  }
  for (number = 1; number < 1000; number++) {
    if (signal[number] != 0) {
      printf("%d\t", number + 1);
    }
  }
}


x86 assembly (clang, -O0):
<FindPrimerNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfe0,%rsp
lea    -0xfd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0xfd4(%rbp)
movl   $0x0,-0xfd8(%rbp)
movl   $0x0,-0xfd4(%rbp)
cmpl   $0x3e8,-0xfd4(%rbp)
jge    1192 <FindPrimerNumber+0x72>
movslq -0xfd4(%rbp),%rax
movl   $0x1,-0xfa0(%rbp,%rax,4)
mov    -0xfd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfd4(%rbp)
jmp    115c <FindPrimerNumber+0x3c>
movl   $0x1,-0xfd4(%rbp)
cmpl   $0x3e8,-0xfd4(%rbp)
jg     1248 <FindPrimerNumber+0x128>
movslq -0xfd4(%rbp),%rax
cmpl   $0x0,-0xfa0(%rbp,%rax,4)
je     122f <FindPrimerNumber+0x10f>
mov    -0xfd4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xfd8(%rbp)
cmpl   $0x3e8,-0xfd8(%rbp)
jg     122a <FindPrimerNumber+0x10a>
mov    -0xfd8(%rbp),%eax
mov    -0xfd4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1211 <FindPrimerNumber+0xf1>
mov    -0xfd8(%rbp),%eax
sub    $0x1,%eax
cltq
movl   $0x0,-0xfa0(%rbp,%rax,4)
jmp    1216 <FindPrimerNumber+0xf6>
mov    -0xfd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfd8(%rbp)
jmp    11d0 <FindPrimerNumber+0xb0>
jmp    122f <FindPrimerNumber+0x10f>
jmp    1234 <FindPrimerNumber+0x114>
mov    -0xfd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfd4(%rbp)
jmp    119c <FindPrimerNumber+0x7c>
movl   $0x1,-0xfd4(%rbp)
cmpl   $0x3e8,-0xfd4(%rbp)
jge    12a5 <FindPrimerNumber+0x185>
movslq -0xfd4(%rbp),%rax
cmpl   $0x0,-0xfa0(%rbp,%rax,4)
je     128c <FindPrimerNumber+0x16c>
mov    -0xfd4(%rbp),%esi
add    $0x1,%esi
lea    0xd79(%rip),%rdi
call   1030 <printf@plt>
jmp    1291 <FindPrimerNumber+0x171>
mov    -0xfd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfd4(%rbp)
jmp    1252 <FindPrimerNumber+0x132>
add    $0xfe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindPrimerNumber>:
push   %r14
push   %rbx
sub    $0xfa8,%rsp
xor    %eax,%eax
movaps 0xedd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps %xmm0,(%rsp,%rax,4)
movaps %xmm0,0x10(%rsp,%rax,4)
movaps %xmm0,0x20(%rsp,%rax,4)
movaps %xmm0,0x30(%rsp,%rax,4)
movaps %xmm0,0x40(%rsp,%rax,4)
movaps %xmm0,0x50(%rsp,%rax,4)
movaps %xmm0,0x60(%rsp,%rax,4)
movaps %xmm0,0x70(%rsp,%rax,4)
movaps %xmm0,0x80(%rsp,%rax,4)
movaps %xmm0,0x90(%rsp,%rax,4)
add    $0x28,%rax
cmp    $0x3e8,%rax
jne    1130 <FindPrimerNumber+0x20>
mov    $0x1,%ecx
mov    $0x2,%ebx
jmp    1191 <FindPrimerNumber+0x81>
nop
add    $0x1,%rcx
add    $0x1,%rbx
cmp    $0x3e9,%rcx
je     11d1 <FindPrimerNumber+0xc1>
cmpl   $0x0,(%rsp,%rcx,4)
je     1180 <FindPrimerNumber+0x70>
cmp    $0x3e6,%rcx
ja     1180 <FindPrimerNumber+0x70>
lea    0x1(%rcx),%edi
mov    %rbx,%rsi
jmp    11bd <FindPrimerNumber+0xad>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rsi
cmp    $0x3e8,%rsi
je     1180 <FindPrimerNumber+0x70>
lea    0x1(%rsi),%eax
xor    %edx,%edx
div    %edi
test   %edx,%edx
jne    11b0 <FindPrimerNumber+0xa0>
movl   $0x0,(%rsp,%rsi,4)
jmp    11b0 <FindPrimerNumber+0xa0>
mov    $0x1,%esi
lea    0xe33(%rip),%r14
jmp    11ec <FindPrimerNumber+0xdc>
nop
mov    %rbx,%rsi
cmp    $0x3e8,%rbx
je     1203 <FindPrimerNumber+0xf3>
lea    0x1(%rsi),%rbx
cmpl   $0x0,(%rsp,%rsi,4)
je     11e0 <FindPrimerNumber+0xd0>
add    $0x1,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    11e0 <FindPrimerNumber+0xd0>
add    $0xfa8,%rsp
pop    %rbx
pop    %r14
ret

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

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