#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*/ link_error();
double pow(double, double);
double sqrt(double);
void test(double x) {
  if (sqrt(pow(x, 4.0)) != x * x)
    link_error();
  if (pow(sqrt(x), 4.0) != x * x)
    link_error();
  if (pow(pow(x, 4.0), 0.25) != x)
    link_error();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
call   1040 <pow@plt>
call   1050 <sqrt@plt>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1173 <test+0x43>
jp     1173 <test+0x43>
jmp    117a <test+0x4a>
mov    $0x0,%al
call   1030 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  0xe74(%rip),%xmm1
call   1040 <pow@plt>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <test+0x80>
jp     11b0 <test+0x80>
jmp    11b7 <test+0x87>
mov    $0x0,%al
call   1030 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
movsd  0xe3c(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xe37(%rip),%xmm1
call   1040 <pow@plt>
ucomisd -0x8(%rbp),%xmm0
jne    11ec <test+0xbc>
jp     11ec <test+0xbc>
jmp    11f3 <test+0xc3>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x18,%rsp
movsd  0xec4(%rip),%xmm1
movsd  %xmm0,0x8(%rsp)
call   1040 <pow@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1157 <test+0x27>
sqrtsd %xmm0,%xmm0
jmp    115c <test+0x2c>
call   1050 <sqrt@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
ucomisd %xmm2,%xmm0
jne    1178 <test+0x48>
jnp    1185 <test+0x55>
xor    %eax,%eax
call   1030 <link_error@plt>
movsd  0x8(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1198 <test+0x68>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11a1 <test+0x71>
movapd %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  0xe57(%rip),%xmm1
call   1040 <pow@plt>
ucomisd 0x10(%rsp),%xmm0
jne    11b8 <test+0x88>
jnp    11bf <test+0x8f>
xor    %eax,%eax
call   1030 <link_error@plt>
movsd  0xe39(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <pow@plt>
movsd  0xe2e(%rip),%xmm1
call   1040 <pow@plt>
ucomisd 0x8(%rsp),%xmm0
jne    11e9 <test+0xb9>
jnp    11f4 <test+0xc4>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1030 <link_error@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 4.000000e+00)
%5 = call double @sqrt(double %4)
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = fcmp une double %5, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 (...) @link_error()
br label %12
12: ; preds = %10, %1
%13 = load double, double* %2
%14 = call double @sqrt(double %13)
%15 = call double @pow(double %14, double 4.000000e+00)
%16 = load double, double* %2
%17 = load double, double* %2
%18 = fmul double %16, %17
%19 = fcmp une double %15, %18
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = call i32 (...) @link_error()
br label %22
22: ; preds = %20, %12
%23 = load double, double* %2
%24 = call double @pow(double %23, double 4.000000e+00)
%25 = call double @pow(double %24, double 2.500000e-01)
%26 = load double, double* %2
%27 = fcmp une double %25, %26
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 (...) @link_error()
br label %30
30: ; preds = %28, %22
ret void
}

LLVM IR (-O2):
define void @test(double %0) {
%2 = tail call double @pow(double %0, double 4.000000e+00)
%3 = tail call double @sqrt(double %2)
%4 = fmul double %0, %0
%5 = fcmp une double %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @link_error()
br label %8
8: ; preds = %6, %1
%9 = tail call double @sqrt(double %0)
%10 = tail call double @pow(double %9, double 4.000000e+00)
%11 = fcmp une double %10, %4
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 (...) @link_error()
br label %14
14: ; preds = %12, %8
%15 = tail call double @pow(double %0, double 4.000000e+00)
%16 = tail call double @pow(double %15, double 2.500000e-01)
%17 = fcmp une double %16, %0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 (...) @link_error()
br label %20
20: ; preds = %18, %14
ret void
}