#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 n;
  scanf("%d\n", &n);
  while (n >= 1000 && n <= 9999) {
    if (((n / 100) + (n % 100)) * ((n / 100) + (n % 100)) == n)
      printf("propriedade do 3025!\n");
    else
      printf("numero comum\n");
    scanf("%d\n", &n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x3e8,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     115e <main+0x3e>
cmpl   $0x270f,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    116e <main+0x4e>
jmp    11ea <main+0xca>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
mov    $0x64,%esi
cltd
idiv   %esi
mov    -0x10(%rbp),%eax
add    %edx,%ecx
imul   %ecx,%eax
cmp    -0x8(%rbp),%eax
jne    11c9 <main+0xa9>
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
jmp    11d5 <main+0xb5>
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe24(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
jmp    113f <main+0x1f>
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    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x3e8(%rax),%ecx
cmp    $0x2327,%ecx
ja     11bc <main+0x9c>
lea    0xebf(%rip),%r15
lea    0xeab(%rip),%r12
lea    0xea0(%rip),%r14
lea    0x4(%rsp),%rbx
jmp    1192 <main+0x72>
nopw   0x0(%rax,%rax,1)
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x3e8(%rax),%ecx
cmp    $0x2328,%ecx
jae    11bc <main+0x9c>
movzwl %ax,%ecx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ecx
shr    $0x11,%ecx
imul   $0x64,%ecx,%edx
mov    %eax,%esi
sub    %edx,%esi
add    %ecx,%esi
movzwl %si,%ecx
imul   %ecx,%ecx
mov    %r15,%rdi
cmp    %eax,%ecx
je     1170 <main+0x50>
mov    %r12,%rdi
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [13 x i8] c"numero comum\00"
@str.3 = [21 x i8] c"propriedade do 3025!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add i32 %4, -1000
%6 = icmp ult i32 %5, 9000
br i1 %6, label %7, label %22
7: ; preds = %0, %7
%8 = phi i32 [ %19, %7 ], [ %4, %0 ]
%9 = trunc i32 %8 to i16
%10 = udiv i16 %9, 100
%11 = urem i16 %9, 100
%12 = add nuw nsw i16 %10, %11
%13 = zext i16 %12 to i32
%14 = mul nuw nsw i32 %13, %13
%15 = icmp eq i32 %14, %8
%16 = select i1 %15, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0)
%17 = call i32 @puts(i8* dereferenceable(1) %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%19 = load i32, i32* %1
%20 = add i32 %19, -1000
%21 = icmp ult i32 %20, 9000
br i1 %21, label %7, label %22
22: ; preds = %7, %0
ret i32 0
}