#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 */
scalar_t__ checked(int);
double clock();
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int i;
  freopen("input.txt", "r", stdin);
  double start, end;
  start = clock();
  for (i = 0; i < 256; i++) {
    if (checked(i * i)) {
      printf("%d\n", i);
    }
  }
  end = clock();
  printf("%.3lf MS\n", (end - start) / 1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
lea    0xea2(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1050 <freopen@plt>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    11cc <main+0x8c>
mov    -0x14(%rbp),%edi
imul   -0x14(%rbp),%edi
call   1060 <checked@plt>
cmp    $0x0,%rax
je     11b9 <main+0x79>
cvtsi2sdl -0x14(%rbp),%xmm0
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
jmp    11be <main+0x7e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1185 <main+0x45>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xe16(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe23(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeba(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1050 <freopen@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <clock@plt>
movsd  %xmm0,0x10(%rsp)
xorpd  %xmm0,%xmm0
lea    0xea0(%rip),%rbx
jmp    1199 <main+0x59>
xchg   %ax,%ax
movsd  0x8(%rsp),%xmm0
addsd  0xe72(%rip),%xmm0
add    $0x1,%ebp
cmp    $0x100,%ebp
je     11be <main+0x7e>
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
imul   %ebp,%edi
call   1060 <checked@plt>
test   %rax,%rax
je     1180 <main+0x40>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <printf@plt>
jmp    1180 <main+0x40>
xor    %eax,%eax
call   1030 <clock@plt>
subsd  0x10(%rsp),%xmm0
divsd  0xe35(%rip),%xmm0
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [10 x i8] c"%.3lf MS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @stdin
%10 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call double (...) @clock()
store double %11, double* %7
store i32 0, i32* %6
br label %12
12: ; preds = %26, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 256
br i1 %14, label %15, label %29
15: ; preds = %12
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = mul nsw i32 %16, %17
%19 = call i64 @checked(i32 %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i32, i32* %6
%23 = sitofp i32 %22 to double
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %23)
br label %25
25: ; preds = %21, %15
br label %26
26: ; preds = %25
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %12
29: ; preds = %12
%30 = call double (...) @clock()
store double %30, double* %8
%31 = load double, double* %8
%32 = load double, double* %7
%33 = fsub double %31, %32
%34 = fdiv double %33, 1.000000e+03
%35 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [10 x i8] c"%.3lf MS\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call double (...) @clock()
br label %6
6: ; preds = %2, %14
%7 = phi i32 [ 0, %2 ], [ %15, %14 ]
%8 = mul nuw nsw i32 %7, %7
%9 = tail call i64 @checked(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = sitofp i32 %7 to double
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %12)
br label %14
14: ; preds = %6, %11
%15 = add nuw nsw i32 %7, 1
%16 = icmp eq i32 %15, 256
br i1 %16, label %17, label %6
17: ; preds = %14
%18 = tail call double (...) @clock()
%19 = fsub double %18, %5
%20 = fdiv double %19, 1.000000e+03
%21 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), double %20)
ret i32 0
}