#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);
int main() {
  int i = 10;
  int j;
  for (; i < 100; ++i)
    for (j = 0; j < 100; ++j) {
      int numero = i * 100 + j;
      int sum = i + j;
      int sqNumero = sum * sum;
      if (sqNumero == numero)
        printf("encontrado %d\n", numero);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    119f <main+0x8f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    118c <main+0x7c>
imul   $0x64,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1179 <main+0x69>
mov    -0x10(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    117e <main+0x6e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    1191 <main+0x81>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <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
mov    $0xa,%r12d
mov    $0x3e8,%r15d
lea    0xed5(%rip),%r14
jmp    113e <main+0x2e>
nopl   (%rax)
add    $0x1,%r12d
add    $0x64,%r15d
cmp    $0x64,%r12d
je     1171 <main+0x61>
xor    %ebx,%ebx
jmp    1158 <main+0x48>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1130 <main+0x20>
lea    (%r15,%rbx,1),%esi
lea    (%r12,%rbx,1),%eax
imul   %eax,%eax
cmp    %eax,%esi
jne    1150 <main+0x40>
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"encontrado %d\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 10, i32* %2
br label %7
7: ; preds = %36, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %39
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %32, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 100
br i1 %13, label %14, label %35
14: ; preds = %11
%15 = load i32, i32* %2
%16 = mul nsw i32 %15, 100
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
store i32 %18, i32* %4
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %19, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = load i32, i32* %5
%24 = mul nsw i32 %22, %23
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = load i32, i32* %4
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %14
%29 = load i32, i32* %4
%30 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %14
br label %32
32: ; preds = %31
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %11
35: ; preds = %11
br label %36
36: ; preds = %35
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %7
39: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"encontrado %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %15
%2 = phi i32 [ 10, %0 ], [ %16, %15 ]
%3 = mul nuw nsw i32 %2, 100
br label %4
4: ; preds = %1, %12
%5 = phi i32 [ 0, %1 ], [ %13, %12 ]
%6 = add nuw nsw i32 %5, %3
%7 = add nuw nsw i32 %5, %2
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %6
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %12
12: ; preds = %10, %4
%13 = add nuw nsw i32 %5, 1
%14 = icmp eq i32 %13, 100
br i1 %14, label %15, label %4
15: ; preds = %12
%16 = add nuw nsw i32 %2, 1
%17 = icmp eq i32 %16, 100
br i1 %17, label %18, label %1
18: ; preds = %15
ret i32 0
}