#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 *);
scalar_t__ scanf(char *, unsigned int *);
scalar_t__ sqrt(unsigned int);
int main() {
  unsigned int num;
  int root;
  while (scanf("%d", &num) != 0 && num != 0) {
    root = (int)sqrt(num);
    if (root * root == num) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
je     116b <main+0x3b>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    117b <main+0x4b>
jmp    11b8 <main+0x88>
mov    -0x8(%rbp),%edi
call   1050 <sqrt@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11a7 <main+0x77>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
jmp    11b3 <main+0x83>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <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    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     11a1 <main+0x71>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     11a1 <main+0x71>
lea    0xea9(%rip),%r15
lea    0xe9f(%rip),%r12
lea    0xe95(%rip),%r14
lea    0x4(%rsp),%rbx
call   1050 <sqrt@plt>
imul   %eax,%eax
mov    %r15,%rdi
cmp    0x4(%rsp),%eax
je     1184 <main+0x54>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     11a1 <main+0x71>
mov    0x4(%rsp),%edi
test   %edi,%edi
jne    1170 <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 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %25, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %26
12: ; preds = %10
%13 = load i32, i32* %2
%14 = call i64 @sqrt(i32 %13)
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* %3
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %2
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %12
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %12
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
br label %4
26: ; preds = %10
ret i32 0
}

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