#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 *, unsigned long long *);
int main() {
  unsigned long long int N;
  int i = 2;
  scanf(" %llu", &N);
  while (i <= N) {
    if (N % i == 0)
      break;
    else
      i++;
  }
  i == N ? printf("sim") : printf("nao");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x14(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     117e <main+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    1170 <main+0x50>
jmp    117e <main+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <main+0x26>
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    119d <main+0x7d>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%rcx
mov    $0x2,%esi
cmp    $0x2,%rcx
jb     1190 <main+0x70>
lea    0x1(%rcx),%r8
mov    $0x1,%edi
sub    %rcx,%rdi
mov    $0x2,%esi
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1170 <main+0x50>
mov    %rcx,%rax
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
jne    117b <main+0x5b>
jmp    1190 <main+0x70>
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
je     1190 <main+0x70>
lea    (%rdi,%rsi,1),%rax
add    $0x1,%rax
add    $0x1,%rsi
cmp    $0x2,%rax
jne    1150 <main+0x30>
mov    %r8,%rsi
mov    %esi,%eax
cmp    %rax,%rcx
lea    0xe6a(%rip),%rax
lea    0xe67(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %llu\00"
@.str.1 = [4 x i8] c"sim\00"
@.str.2 = [4 x i8] c"nao\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %2)
br label %5
5: ; preds = %20, %0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i64, i64* %2
%9 = icmp ule i64 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %5
%11 = load i64, i64* %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = urem i64 %11, %13
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
br label %21
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %20
20: ; preds = %17
br label %5
21: ; preds = %16, %5
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = load i64, i64* %2
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %30
28: ; preds = %21
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = phi i32 [ %27, %26 ], [ %29, %28 ]
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c" %llu\00"
@.str.1 = [4 x i8] c"sim\00"
@.str.2 = [4 x i8] c"nao\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = icmp ult i64 %4, 2
br i1 %5, label %15, label %6
6: ; preds = %0
%7 = add i64 %4, 1
br label %8
8: ; preds = %6, %12
%9 = phi i64 [ 2, %6 ], [ %13, %12 ]
%10 = urem i64 %4, %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = add nuw i64 %9, 1
%14 = icmp eq i64 %9, %4
br i1 %14, label %15, label %8
15: ; preds = %12, %8, %0
%16 = phi i64 [ 2, %0 ], [ %9, %8 ], [ %7, %12 ]
%17 = and i64 %16, 4294967295
%18 = icmp eq i64 %4, %17
%19 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%20 = call i32 @printf(i8* dereferenceable(1) %19)
ret i32 0
}