#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() {
  int i, n, divisore;
  for (i = 50; i < 100; i++) {
    divisore = 0;
    for (n = 3; n < i; n++) {
      if ((2 * i + 1) % n == 0) {
        divisore = 1;
        break;
      }
    }
    if (divisore == 0)
      printf("Il numero %d è primo.\n", i * 2 + 1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    11b1 <main+0xa1>
movl   $0x0,-0x10(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117f <main+0x6f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    116c <main+0x5c>
movl   $0x1,-0x10(%rbp)
jmp    117f <main+0x6f>
jmp    1171 <main+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x2e>
cmpl   $0x0,-0x10(%rbp)
jne    119e <main+0x8e>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    11a3 <main+0x93>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x32,%r15d
mov    $0xffffffd1,%ebx
lea    0xed9(%rip),%r14
jmp    113d <main+0x2d>
nopl   0x0(%rax)
add    $0x1,%r15d
add    $0xffffffff,%ebx
cmp    $0x64,%r15d
je     116f <main+0x5f>
lea    (%r15,%r15,1),%esi
add    $0x1,%esi
mov    $0x3,%ecx
nopl   0x0(%rax)
mov    %esi,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
je     1130 <main+0x20>
add    $0x1,%ecx
lea    (%rbx,%rcx,1),%eax
cmp    $0x3,%eax
jne    1150 <main+0x40>
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Il numero %d \C3\A8 primo.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 50, i32* %2
br label %5
5: ; preds = %34, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %37
8: ; preds = %5
store i32 0, i32* %4
store i32 3, i32* %3
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i32, i32* %2
%15 = mul nsw i32 2, %14
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %3
%18 = srem i32 %16, %17
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 1, i32* %4
br label %25
21: ; preds = %13
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %9
25: ; preds = %20, %9
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load i32, i32* %2
%30 = mul nsw i32 %29, 2
%31 = add nsw i32 %30, 1
%32 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %28, %25
br label %34
34: ; preds = %33
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %5
37: ; preds = %5
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [24 x i8] c"Il numero %d \C3\A8 primo.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %14, %0
%2 = phi i32 [ 50, %0 ], [ %15, %14 ]
%3 = shl nuw nsw i32 %2, 1
%4 = or i32 %3, 1
br label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %2
br i1 %6, label %12, label %7
7: ; preds = %1, %5
%8 = phi i32 [ 3, %1 ], [ %11, %5 ]
%9 = urem i32 %4, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %14, label %5
12: ; preds = %5
%13 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %14
14: ; preds = %7, %12
%15 = add nuw nsw i32 %2, 1
%16 = icmp eq i32 %15, 100
br i1 %16, label %17, label %1
17: ; preds = %14
ret i32 0
}