#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 scanf(char *, int *);
main() {
  int x;
  while (scanf("%d", &x) == 1) {
    if (x % 6 == 0)
      printf("Y\n");
    else
      printf("N\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    117e <main+0x5e>
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116d <main+0x4d>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x59>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1193 <main+0x73>
lea    0xec0(%rip),%r15
lea    0xeb7(%rip),%r12
lea    0xead(%rip),%r14
lea    0x4(%rsp),%rbx
jmp    1175 <main+0x55>
nopw   0x0(%rax,%rax,1)
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1193 <main+0x73>
imul   $0xaaaaaaab,0x4(%rsp),%eax
aa
add    $0x2aaaaaaa,%eax
ror    %eax
mov    %r15,%rdi
cmp    $0x2aaaaaab,%eax
jb     1160 <main+0x40>
mov    %r12,%rdi
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"Y\0A\00"
@.str.2 = [3 x i8] c"N\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
br label %3
15: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [2 x i8] c"N\00"
@str.3 = [2 x i8] c"Y\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 = icmp eq i32 %3, 1
br i1 %4, label %5, label %13
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = srem i32 %6, 6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = icmp eq i32 %11, 1
br i1 %12, label %5, label %13
13: ; preds = %5, %0
ret i32 0
}