#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 (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
call   1050 <sqrt@plt>
movsd  0xeb1(%rip),%xmm1
call   1040 <pow@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
movsd  0xe79(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xe74(%rip),%xmm1
call   1040 <pow@plt>
ucomisd -0x8(%rbp),%xmm0
jne    11af <test+0x7f>
jp     11af <test+0x7f>
jmp    11b6 <test+0x86>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movsd  %xmm1,(%rsp)
jb     114d <test+0x1d>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1156 <test+0x26>
movapd %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  0xea2(%rip),%xmm1
call   1040 <pow@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1174 <test+0x44>
jnp    117b <test+0x4b>
xor    %eax,%eax
call   1030 <link_error@plt>
movsd  0xe7d(%rip),%xmm1
movsd  (%rsp),%xmm0
call   1040 <pow@plt>
movsd  0xe73(%rip),%xmm1
call   1040 <pow@plt>
ucomisd (%rsp),%xmm0
jne    11a3 <test+0x73>
jnp    11ab <test+0x7b>
xor    %eax,%eax
pop    %rcx
jmp    1030 <link_error@plt>
pop    %rax
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 @sqrt(double %3)
%5 = call double @pow(double %4, double 4.000000e+00)
%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 @pow(double %13, double 4.000000e+00)
%15 = call double @pow(double %14, double 2.500000e-01)
%16 = load double, double* %2
%17 = fcmp une double %15, %16
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 (...) @link_error()
br label %20
20: ; preds = %18, %12
ret void
}

LLVM IR (-O2):
define void @test(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = tail call double @pow(double %2, double 4.000000e+00)
%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 @pow(double %0, double 4.000000e+00)
%10 = tail call double @pow(double %9, double 2.500000e-01)
%11 = fcmp une double %10, %0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 (...) @link_error()
br label %14
14: ; preds = %12, %8
ret void
}