#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i, numero;
  do {
    printf("Informe um numero primo maior que 1:");
    scanf("%d", &numero);
  } while (numero <= 1);
  for (i = 2; i < numero; i++)
    if (numero % i == 0)
      break;
  if (numero == i)
    printf("Numero primo %d", numero);
  else
    printf("Numero não primo %d", numero);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jle    112f <main+0xf>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1192 <main+0x72>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    117f <main+0x5f>
jmp    1192 <main+0x72>
jmp    1184 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x3e>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11b4 <main+0x94>
mov    -0xc(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c5 <main+0xa5>
mov    -0xc(%rbp),%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xefb(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2,%esi
jl     1140 <main+0x20>
jne    1169 <main+0x49>
lea    0xebe(%rip),%rdi
jmp    1196 <main+0x76>
mov    $0x2,%ecx
xchg   %ax,%ax
mov    %esi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1182 <main+0x62>
add    $0x1,%ecx
cmp    %ecx,%esi
jne    1170 <main+0x50>
mov    %esi,%ecx
cmp    %ecx,%esi
lea    0xe9a(%rip),%rax
lea    0xea3(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [37 x i8] c"Informe um numero primo maior que 1:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Numero primo %d\00"
@.str.3 = [21 x i8] c"Numero n\C3\A3o primo %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 2
br i1 %7, label %3, label %8
8: ; preds = %3
%9 = icmp eq i32 %6, 2
br i1 %9, label %21, label %10
10: ; preds = %8, %14
%11 = phi i32 [ %15, %14 ], [ 2, %8 ]
%12 = srem i32 %6, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = add nuw nsw i32 %11, 1
%16 = icmp eq i32 %15, %6
br i1 %16, label %17, label %10
17: ; preds = %14, %10
%18 = phi i32 [ %6, %14 ], [ %11, %10 ]
%19 = icmp eq i32 %6, %18
%20 = select i1 %19, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0)
br label %21
21: ; preds = %17, %8
%22 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), %8 ], [ %20, %17 ]
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %22, i32 %6)
ret i32 0
}