#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 n, divisor, achou;
  scanf("%d", &n);
  divisor = 2;
  achou = 0;
  while (divisor < n && !achou) {
    if (n % divisor == 0) {
      achou = 1;
    } else {
      divisor++;
    }
  }
  if (achou) {
    printf("N\n");
  } else {
    printf("S\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jge    116a <main+0x4a>
cmpl   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    117a <main+0x5a>
jmp    11a4 <main+0x84>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1196 <main+0x76>
movl   $0x1,-0x10(%rbp)
jmp    119f <main+0x7f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
cmpl   $0x0,-0x10(%rbp)
je     11bf <main+0x9f>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    11cb <main+0xab>
lea    0xe40(%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
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
cmp    $0x3,%ecx
jl     1157 <main+0x37>
mov    $0x2,%esi
mov    %ecx,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%esi
cmp    %ecx,%esi
jge    1153 <main+0x33>
test   %edx,%edx
jne    1140 <main+0x20>
test   %edx,%edx
je     1160 <main+0x40>
lea    0xea5(%rip),%rdi
jmp    1167 <main+0x47>
lea    0xe9e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [2 x i8] c"S\00"
@str.3 = [2 x i8] c"N\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 2
br i1 %5, label %6, label %17
6: ; preds = %0, %6
%7 = phi i32 [ %12, %6 ], [ 2, %0 ]
%8 = srem i32 %4, %7
%9 = icmp eq i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %7, %11
%13 = icmp slt i32 %12, %4
%14 = xor i1 %9, true
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %6, label %16
16: ; preds = %6
br i1 %9, label %18, label %17
17: ; preds = %0, %16
br label %18
18: ; preds = %16, %17
%19 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), %17 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), %16 ]
%20 = call i32 @puts(i8* dereferenceable(1) %19)
ret i32 0
}