#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float sqt(float f) {
  float t = 1;
  while ((t * t) != f && t != f) {
    t++;
  }
  if (t > 9999999 || t < -9999999 || t == f) {
    printf("ERROR 5");
    printf("\n\n");
    exit(0);
  } else {
    return t;
  }
}


x86 assembly (clang, -O0):
<sqt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomiss -0x4(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jne    115e <sqt+0x3e>
jp     115e <sqt+0x3e>
jmp    1172 <sqt+0x52>
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1182 <sqt+0x62>
jmp    1199 <sqt+0x79>
movss  0xe76(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113a <sqt+0x1a>
movss  -0x8(%rbp),%xmm0
movss  0xe5e(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     11d6 <sqt+0xb6>
movss  0xe51(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
ja     11d6 <sqt+0xb6>
movss  -0x8(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jne    11f5 <sqt+0xd5>
jp     11f5 <sqt+0xd5>
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqt>:
push   %rax
movaps %xmm0,%xmm1
movss  0xec4(%rip),%xmm0
ucomiss %xmm0,%xmm1
jne    1143 <sqt+0x13>
jnp    1169 <sqt+0x39>
movss  0xeb5(%rip),%xmm2
movaps %xmm2,%xmm0
xchg   %ax,%ax
addss  %xmm2,%xmm0
ucomiss %xmm1,%xmm0
jne    115b <sqt+0x2b>
jnp    1169 <sqt+0x39>
movaps %xmm0,%xmm3
mulss  %xmm0,%xmm3
ucomiss %xmm1,%xmm3
jne    1150 <sqt+0x20>
jp     1150 <sqt+0x20>
ucomiss %xmm1,%xmm0
jne    1170 <sqt+0x40>
jnp    1188 <sqt+0x58>
ucomiss 0xe8d(%rip),%xmm0
ja     1188 <sqt+0x58>
movss  0xe87(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1188 <sqt+0x58>
pop    %rax
ret
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR 5\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define float @sqt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 1.000000e+00, float* %3
br label %4
4: ; preds = %16, %1
%5 = load float, float* %3
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = load float, float* %2
%9 = fcmp une float %7, %8
br i1 %9, label %10, label %14
10: ; preds = %4
%11 = load float, float* %3
%12 = load float, float* %2
%13 = fcmp une float %11, %12
br label %14
14: ; preds = %10, %4
%15 = phi i1 [ false, %4 ], [ %13, %10 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load float, float* %3
%18 = fadd float %17, 1.000000e+00
store float %18, float* %3
br label %4
19: ; preds = %14
%20 = load float, float* %3
%21 = fcmp ogt float %20, 0x416312CFE0000000
br i1 %21, label %29, label %22
22: ; preds = %19
%23 = load float, float* %3
%24 = fcmp olt float %23, 0xC16312CFE0000000
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = load float, float* %3
%27 = load float, float* %2
%28 = fcmp oeq float %26, %27
br i1 %28, label %29, label %33
29: ; preds = %25, %22, %19
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%32 = call i32 @exit(i32 0)
unreachable
33: ; preds = %25
%34 = load float, float* %3
ret float %34
}

LLVM IR (-O2):
@.str = [8 x i8] c"ERROR 5\00"
@str = [2 x i8] c"\0A\00"
define float @sqt(float %0) {
%2 = fcmp une float %0, 1.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi float [ %5, %3 ], [ 1.000000e+00, %1 ]
%5 = fadd float %4, 1.000000e+00
%6 = fmul float %5, %5
%7 = fcmp une float %6, %0
%8 = fcmp une float %5, %0
%9 = and i1 %8, %7
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi float [ 1.000000e+00, %1 ], [ %5, %3 ]
%12 = fcmp ogt float %11, 0x416312CFE0000000
%13 = fcmp olt float %11, 0xC16312CFE0000000
%14 = or i1 %12, %13
%15 = fcmp oeq float %11, %0
%16 = or i1 %15, %14
br i1 %16, label %17, label %21
17: ; preds = %10
%18 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%20 = tail call i32 @exit(i32 0)
unreachable
21: ; preds = %10
ret float %11
}