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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11d5 <main+0xb5>
lea    0xeb9(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3e8,-0xc(%rbp)
jl     116a <main+0x4a>
cmpl   $0x270f,-0xc(%rbp)
jle    1176 <main+0x56>
movl   $0x1,-0x8(%rbp)
jmp    11d0 <main+0xb0>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   $0x64,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11bf <main+0x9f>
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
jmp    11cb <main+0xab>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
jmp    1136 <main+0x16>
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    -0x2710(%rax),%ecx
cmp    $0xffffdcd8,%ecx
jb     11b4 <main+0x94>
lea    0xebe(%rip),%r15
lea    0xeaa(%rip),%r12
lea    0xea0(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzwl %ax,%ecx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ecx
shr    $0x11,%ecx
imul   $0xffffff9c,%ecx,%edx
add    %eax,%ecx
add    %edx,%ecx
imul   %ecx,%ecx
cmp    %eax,%ecx
mov    %r12,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x2710(%rax),%ecx
cmp    $0xffffdcd7,%ecx
ja     1170 <main+0x50>
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 = [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
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %7
7: ; preds = %40, %0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %41
10: ; preds = %7
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 1000
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 9999
br i1 %16, label %17, label %18
17: ; preds = %14, %10
store i32 1, i32* %2
br label %40
18: ; preds = %14
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 100
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = mul nsw i32 %22, 100
%24 = sub nsw i32 %21, %23
store i32 %24, i32* %5
%25 = load i32, i32* %4
%26 = load i32, i32* %5
%27 = add nsw i32 %25, %26
%28 = load i32, i32* %4
%29 = load i32, i32* %5
%30 = add nsw i32 %28, %29
%31 = mul nsw i32 %27, %30
store i32 %31, i32* %6
%32 = load i32, i32* %6
%33 = load i32, i32* %3
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %37
35: ; preds = %18
%36 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %39
37: ; preds = %18
%38 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
br label %40
40: ; preds = %39, %17
br label %7
41: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add i32 %4, -10000
%6 = icmp ult i32 %5, -9000
br i1 %6, label %23, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %20, %7 ], [ %4, %0 ]
%9 = trunc i32 %8 to i16
%10 = udiv i16 %9, 100
%11 = zext i16 %10 to i32
%12 = mul nsw i32 %11, -100
%13 = add nuw nsw i32 %8, %11
%14 = add nsw i32 %13, %12
%15 = mul nsw i32 %14, %14
%16 = icmp eq i32 %15, %8
%17 = select i1 %16, 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)
%18 = call i32 @puts(i8* dereferenceable(1) %17)
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%20 = load i32, i32* %1
%21 = add i32 %20, -10000
%22 = icmp ult i32 %21, -9000
br i1 %22, label %23, label %7
23: ; preds = %7, %0
ret i32 0
}