#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int main(void) {
  int n = 0;
  while (scanf("%d", &n) != EOF) {
    int pow = n * n;
    int flag = 1;
    while (n) {
      int nn = n % 10;
      int powpow = pow % 10;
      if (nn != powpow) {
        flag = 0;
        break;
      }
      n /= 10;
      pow /= 10;
    }
    if (flag) {
      printf("Yes!\n");
    } else {
      printf("No!\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
je     11f2 <main+0xd2>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     11a5 <main+0x85>
movl   $0x0,-0x10(%rbp)
jmp    11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1167 <main+0x47>
cmpl   $0x0,-0x10(%rbp)
je     11e1 <main+0xc1>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    11ed <main+0xcd>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e9d(%rip),%r12
cmp    (%r12),%rax
jne    1162 <main+0x42>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9e(%rip),%rbp
lea    0xe90(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xe87(%rip),%r13
jmp    1199 <main+0x79>
xchg   %ax,%ax
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     1151 <main+0x31>
mov    0x4(%rsp),%eax
mov    %rbp,%rdi
test   %eax,%eax
je     1183 <main+0x63>
mov    %eax,%ecx
imul   %ecx,%ecx
nopl   0x0(%rax)
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rdx
add    %edi,%edx
lea    (%rdx,%rdx,1),%edi
lea    (%rdi,%rdi,4),%edi
sub    %edi,%esi
movslq %ecx,%rdi
imul   $0x66666667,%rdi,%rcx
mov    %rcx,%rbx
shr    $0x3f,%rbx
sar    $0x22,%rcx
add    %ebx,%ecx
lea    (%rcx,%rcx,1),%ebx
lea    (%rbx,%rbx,4),%ebx
sub    %ebx,%edi
cmp    %edi,%esi
jne    1180 <main+0x60>
mov    %edx,0x4(%rsp)
add    $0x9,%eax
cmp    $0x13,%eax
mov    %edx,%eax
jae    11b0 <main+0x90>
mov    %rbp,%rdi
jmp    1183 <main+0x63>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@str = [4 x i8] c"No!\00"
@str.3 = [5 x i8] c"Yes!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %28, label %6
6: ; preds = %0, %22
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %22, label %9
9: ; preds = %6
%10 = mul nsw i32 %7, %7
br label %14
11: ; preds = %14
store i32 %18, i32* %1
%12 = add i32 %16, 9
%13 = icmp ult i32 %12, 19
br i1 %13, label %22, label %14
14: ; preds = %9, %11
%15 = phi i32 [ %20, %11 ], [ %10, %9 ]
%16 = phi i32 [ %18, %11 ], [ %7, %9 ]
%17 = srem i32 %16, 10
%18 = sdiv i32 %16, 10
%19 = srem i32 %15, 10
%20 = sdiv i32 %15, 10
%21 = icmp eq i32 %17, %19
br i1 %21, label %11, label %22
22: ; preds = %14, %11, %6
%23 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0), %14 ]
%24 = call i32 @puts(i8* dereferenceable(1) %23)
%25 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%26 = load i64, i64* @EOF
%27 = icmp eq i64 %25, %26
br i1 %27, label %28, label %6
28: ; preds = %22, %0
ret i32 0
}