#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 *, long long *);
long long sqrt(long long);
int main() {
  long long n;
  while (scanf("%lld", &n) == 1) {
    if (n == 0)
      break;
    long long root = sqrt(n);
    if (root * root == n)
      printf("yes\n");
    else
      printf("no\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11aa <main+0x7a>
cmpq   $0x0,-0x10(%rbp)
jne    1168 <main+0x38>
jmp    11aa <main+0x7a>
mov    -0x10(%rbp),%rdi
call   1050 <sqrt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1199 <main+0x69>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    11a5 <main+0x75>
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11a3 <main+0x73>
mov    (%rsp),%rdi
test   %rdi,%rdi
je     11a3 <main+0x73>
lea    0xeac(%rip),%r15
lea    0xea2(%rip),%r12
lea    0xe96(%rip),%r14
mov    %rsp,%rbx
nopl   (%rax)
call   1050 <sqrt@plt>
imul   %rax,%rax
mov    %r15,%rdi
cmp    (%rsp),%rax
je     1185 <main+0x55>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11a3 <main+0x73>
mov    (%rsp),%rdi
test   %rdi,%rdi
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
br label %4
4: ; preds = %23, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %24
11: ; preds = %7
%12 = load i64, i64* %2
%13 = call i64 @sqrt(i64 %12)
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = load i64, i64* %3
%16 = mul nsw i64 %14, %15
%17 = load i64, i64* %2
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %23
21: ; preds = %11
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %4
24: ; preds = %10, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp ne i32 %3, 1
%5 = load i64, i64* %1
%6 = icmp eq i64 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %21, label %8
8: ; preds = %0, %8
%9 = phi i64 [ %18, %8 ], [ %5, %0 ]
%10 = call i64 @sqrt(i64 %9)
%11 = mul nsw i64 %10, %10
%12 = load i64, i64* %1
%13 = icmp eq i64 %11, %12
%14 = select i1 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%15 = call i32 @puts(i8* dereferenceable(1) %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%17 = icmp ne i32 %16, 1
%18 = load i64, i64* %1
%19 = icmp eq i64 %18, 0
%20 = select i1 %17, i1 true, i1 %19
br i1 %20, label %21, label %8
21: ; preds = %8, %0
ret i32 0
}