#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(void) {
  int n, i;
  printf("enter the number: ");
  scanf("%d", &n);
  int square = 1;
  for (i = 2; i * i <= n; i = i + 2) {
    printf("%d\n", i * i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     118e <main+0x6e>
mov    -0xc(%rbp),%esi
imul   -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <main+0x3b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x4,0x4(%rsp)
jl     1178 <main+0x58>
mov    $0x4,%ebp
lea    0xec1(%rip),%rbx
mov    $0x4,%esi
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%esi
imul   %ebp,%esi
add    $0x2,%ebp
cmp    0x4(%rsp),%esi
jle    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"enter the number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 4
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %12, %7 ], [ 4, %0 ]
%9 = phi i32 [ %11, %7 ], [ 2, %0 ]
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%11 = add nuw nsw i32 %9, 2
%12 = mul nsw i32 %11, %11
%13 = load i32, i32* %1
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %7
15: ; preds = %7, %0
ret i32 0
}