#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 omega(int);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  int i, primo, cont;
  for (i = 2; i <= 10000; i++) {
    cont += 1;
    primo = omega(i);
    if (primo == 1)
      printf("%d\t", i);
    if (cont == 10)
      printf("\n");
  }
  printf("\n\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jg     1196 <main+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <omega@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    116b <main+0x4b>
mov    -0x4(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0xa,-0xc(%rbp)
jne    1183 <main+0x63>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1188 <main+0x68>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <main+0xf>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xeb0(%rip),%r14
jmp    116b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x2711,%ebx
je     1194 <main+0x54>
mov    %ebx,%edi
call   1050 <omega@plt>
cmp    $0x1,%eax
jne    1183 <main+0x43>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x2,%eax
jne    1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1160 <main+0x20>
lea    0xe69(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

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

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