#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 *, char *);
scalar_t__ scanf(char *, unsigned long *);
scalar_t__ sqrt(double);
int main(void) {
  unsigned long int d, sqr;
  while (scanf("%lu", &d) > 0 && d != 0) {
    sqr = (unsigned long int)sqrt((double)d);
    printf("%s\n", sqr * sqr == d ? "yes" : "no");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jle    116c <main+0x3c>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    117c <main+0x4c>
jmp    11df <main+0xaf>
movaps 0xe7d(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xe7c(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
imul   -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdx
lea    0xe6c(%rip),%rsi
lea    0xe61(%rip),%rax
cmp    %rdx,%rcx
cmove  %rax,%rsi
lea    0xe4f(%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   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xedc(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jle    11e9 <main+0xb9>
mov    0x8(%rsp),%rax
test   %rax,%rax
je     11e9 <main+0xb9>
lea    0xebc(%rip),%r12
lea    0xeb9(%rip),%r13
lea    0xeaa(%rip),%r14
lea    0xe9f(%rip),%r15
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
movq   %rax,%xmm1
punpckldq 0xe63(%rip),%xmm1
subpd  0xe6b(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
imul   %rax,%rax
mov    %r12,%rsi
cmp    0x8(%rsp),%rax
je     11c7 <main+0x97>
mov    %r13,%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jle    11e9 <main+0xb9>
mov    0x8(%rsp),%rax
test   %rax,%rax
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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