#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c = 1;
  scanf("%d", &a);
  for (b = 1; b * b <= a; b++) {
    if (b * b == a) {
      printf("1");
      c = 0;
      break;
    }
  }
  if (c == 1) {
    printf("0");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1198 <main+0x78>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1185 <main+0x65>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
jmp    1198 <main+0x78>
jmp    118a <main+0x6a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
cmpl   $0x1,-0x10(%rbp)
jne    11ae <main+0x8e>
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    $0x30,%edi
test   %eax,%eax
jle    1167 <main+0x47>
mov    $0x1,%edx
mov    $0x2,%ecx
nopl   0x0(%rax)
cmp    %eax,%edx
je     1162 <main+0x42>
mov    %ecx,%edx
imul   %ecx,%edx
add    $0x1,%ecx
cmp    %eax,%edx
jle    1150 <main+0x30>
jmp    1167 <main+0x47>
mov    $0x31,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %14, label %9
6: ; preds = %9
%7 = mul nsw i32 %13, %13
%8 = icmp sgt i32 %7, %4
br i1 %8, label %14, label %9
9: ; preds = %0, %6
%10 = phi i32 [ %7, %6 ], [ 1, %0 ]
%11 = phi i32 [ %13, %6 ], [ 1, %0 ]
%12 = icmp eq i32 %10, %4
%13 = add nuw nsw i32 %11, 1
br i1 %12, label %14, label %6
14: ; preds = %6, %9, %0
%15 = phi i32 [ 48, %0 ], [ 49, %9 ], [ 48, %6 ]
%16 = call i32 @putchar(i32 %15)
ret i32 0
}