#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 */
double pow(float, float);
int /*<<< orphan*/ printf(char *, double);
float sqrt(float);
int main() {
  float num;
  for (num = 2; num > 0; num -= 1 / pow(10.0f, 10.0f))
    if (pow(num, num) == 2.0f)
      printf("%.2f\n", pow(sqrt(2.0f), sqrt(2.0f)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11f8 <main+0xc8>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <pow@plt>
movsd  0xe94(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11bc <main+0x8c>
jp     11bc <main+0x8c>
movss  0xe74(%rip),%xmm0
call   1050 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xe62(%rip),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
call   1040 <pow@plt>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0x91>
movss  0xe3b(%rip),%xmm1
movaps %xmm1,%xmm0
call   1040 <pow@plt>
movsd  0xe37(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114c <main+0x1c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movss  0xed3(%rip),%xmm0
lea    0xeec(%rip),%rbx
jmp    1178 <main+0x58>
cs nopw 0x0(%rax,%rax,1)
movss  0xec0(%rip),%xmm0
movapd %xmm0,%xmm1
call   1040 <pow@plt>
movsd  0xebf(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
ucomiss 0xe96(%rip),%xmm0
jbe    11ae <main+0x8e>
movss  %xmm0,0xc(%rsp)
movapd %xmm0,%xmm1
call   1040 <pow@plt>
ucomisd 0xe81(%rip),%xmm0
jne    1140 <main+0x20>
jp     1140 <main+0x20>
movss  0xe69(%rip),%xmm0
movapd %xmm0,%xmm1
call   1040 <pow@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 2.000000e+00, float* %2
br label %3
3: ; preds = %17, %0
%4 = load float, float* %2
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load float, float* %2
%8 = load float, float* %2
%9 = call double @pow(float %7, float %8)
%10 = fcmp oeq double %9, 2.000000e+00
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = call float @sqrt(float 2.000000e+00)
%13 = call float @sqrt(float 2.000000e+00)
%14 = call double @pow(float %12, float %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %14)
br label %16
16: ; preds = %11, %6
br label %17
17: ; preds = %16
%18 = call double @pow(float 1.000000e+01, float 1.000000e+01)
%19 = fdiv double 1.000000e+00, %18
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = fsub double %21, %19
%23 = fptrunc double %22 to float
store float %23, float* %2
br label %3
24: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %8
%2 = phi float [ 2.000000e+00, %0 ], [ %13, %8 ]
%3 = tail call double @pow(float %2, float %2)
%4 = fcmp oeq double %3, 2.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call double @pow(float 0x3FF6A09E60000000, float 0x3FF6A09E60000000)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %6)
br label %8
8: ; preds = %1, %5
%9 = tail call double @pow(float 1.000000e+01, float 1.000000e+01)
%10 = fdiv double 1.000000e+00, %9
%11 = fpext float %2 to double
%12 = fsub double %11, %10
%13 = fptrunc double %12 to float
%14 = fcmp ogt float %13, 0.000000e+00
br i1 %14, label %1, label %15
15: ; preds = %8
ret i32 0
}