#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 exp(double);
int /*<<< orphan*/ link_error();
double log(double);
double pow(double, double);
double sqrt(double);
void test2(double x, double y, double z) {
  if (sqrt(pow(x, y)) != pow(x, y * 0.5))
    link_error();
  if (log(pow(x, y)) != y * log(x))
    link_error();
  if (pow(exp(x), y) != exp(x * y))
    link_error();
  if (pow(sqrt(x), y) != pow(x, y * 0.5))
    link_error();
  if (pow(pow(x, y), z) != pow(x, y * z))
    link_error();
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
call   1070 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe73(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    11b4 <test2+0x64>
jp     11b4 <test2+0x64>
jmp    11bb <test2+0x6b>
mov    $0x0,%al
call   1040 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
call   1050 <log@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <log@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    120e <test2+0xbe>
jp     120e <test2+0xbe>
jmp    1215 <test2+0xc5>
mov    $0x0,%al
call   1040 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    125a <test2+0x10a>
jp     125a <test2+0x10a>
jmp    1261 <test2+0x111>
mov    $0x0,%al
call   1040 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1070 <sqrt@plt>
movsd  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xd79(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    12ae <test2+0x15e>
jp     12ae <test2+0x15e>
jmp    12b5 <test2+0x165>
mov    $0x0,%al
call   1040 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1060 <pow@plt>
movsd  -0x18(%rbp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1304 <test2+0x1b4>
jp     1304 <test2+0x1b4>
jmp    130b <test2+0x1bb>
mov    $0x0,%al
call   1040 <link_error@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
sub    $0x28,%rsp
movsd  %xmm2,0x20(%rsp)
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1060 <pow@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     117a <test2+0x2a>
sqrtsd %xmm0,%xmm0
jmp    117f <test2+0x2f>
call   1070 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0xe6e(%rip),%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x18(%rsp)
call   1060 <pow@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    11b1 <test2+0x61>
jnp    11b8 <test2+0x68>
xor    %eax,%eax
call   1040 <link_error@plt>
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <pow@plt>
call   1050 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1050 <log@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    11f1 <test2+0xa1>
jnp    11f8 <test2+0xa8>
xor    %eax,%eax
call   1040 <link_error@plt>
movsd  (%rsp),%xmm0
call   1030 <exp@plt>
movsd  0x10(%rsp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    1231 <test2+0xe1>
jnp    1238 <test2+0xe8>
xor    %eax,%eax
call   1040 <link_error@plt>
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     1251 <test2+0x101>
sqrtsd %xmm0,%xmm0
jmp    1256 <test2+0x106>
call   1070 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
call   1060 <pow@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    1285 <test2+0x135>
jnp    128c <test2+0x13c>
xor    %eax,%eax
call   1040 <link_error@plt>
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <pow@plt>
movsd  0x20(%rsp),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
movsd  (%rsp),%xmm0
call   1060 <pow@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    12d1 <test2+0x181>
jnp    12dc <test2+0x18c>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1040 <link_error@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @test2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call double @pow(double %7, double %8)
%10 = call double @sqrt(double %9)
%11 = load double, double* %4
%12 = load double, double* %5
%13 = fmul double %12, 5.000000e-01
%14 = call double @pow(double %11, double %13)
%15 = fcmp une double %10, %14
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = call i32 (...) @link_error()
br label %18
18: ; preds = %16, %3
%19 = load double, double* %4
%20 = load double, double* %5
%21 = call double @pow(double %19, double %20)
%22 = call double @log(double %21)
%23 = load double, double* %5
%24 = load double, double* %4
%25 = call double @log(double %24)
%26 = fmul double %23, %25
%27 = fcmp une double %22, %26
br i1 %27, label %28, label %30
28: ; preds = %18
%29 = call i32 (...) @link_error()
br label %30
30: ; preds = %28, %18
%31 = load double, double* %4
%32 = call double @exp(double %31)
%33 = load double, double* %5
%34 = call double @pow(double %32, double %33)
%35 = load double, double* %4
%36 = load double, double* %5
%37 = fmul double %35, %36
%38 = call double @exp(double %37)
%39 = fcmp une double %34, %38
br i1 %39, label %40, label %42
40: ; preds = %30
%41 = call i32 (...) @link_error()
br label %42
42: ; preds = %40, %30
%43 = load double, double* %4
%44 = call double @sqrt(double %43)
%45 = load double, double* %5
%46 = call double @pow(double %44, double %45)
%47 = load double, double* %4
%48 = load double, double* %5
%49 = fmul double %48, 5.000000e-01
%50 = call double @pow(double %47, double %49)
%51 = fcmp une double %46, %50
br i1 %51, label %52, label %54
52: ; preds = %42
%53 = call i32 (...) @link_error()
br label %54
54: ; preds = %52, %42
%55 = load double, double* %4
%56 = load double, double* %5
%57 = call double @pow(double %55, double %56)
%58 = load double, double* %6
%59 = call double @pow(double %57, double %58)
%60 = load double, double* %4
%61 = load double, double* %5
%62 = load double, double* %6
%63 = fmul double %61, %62
%64 = call double @pow(double %60, double %63)
%65 = fcmp une double %59, %64
br i1 %65, label %66, label %68
66: ; preds = %54
%67 = call i32 (...) @link_error()
br label %68
68: ; preds = %66, %54
ret void
}

LLVM IR (-O2):
define void @test2(double %0, double %1, double %2) {
%4 = tail call double @pow(double %0, double %1)
%5 = tail call double @sqrt(double %4)
%6 = fmul double %1, 5.000000e-01
%7 = tail call double @pow(double %0, double %6)
%8 = fcmp une double %5, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @link_error()
br label %11
11: ; preds = %9, %3
%12 = tail call double @pow(double %0, double %1)
%13 = tail call double @log(double %12)
%14 = tail call double @log(double %0)
%15 = fmul double %14, %1
%16 = fcmp une double %13, %15
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = tail call i32 (...) @link_error()
br label %19
19: ; preds = %17, %11
%20 = tail call double @exp(double %0)
%21 = tail call double @pow(double %20, double %1)
%22 = fmul double %0, %1
%23 = tail call double @exp(double %22)
%24 = fcmp une double %21, %23
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = tail call i32 (...) @link_error()
br label %27
27: ; preds = %25, %19
%28 = tail call double @sqrt(double %0)
%29 = tail call double @pow(double %28, double %1)
%30 = tail call double @pow(double %0, double %6)
%31 = fcmp une double %29, %30
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = tail call i32 (...) @link_error()
br label %34
34: ; preds = %32, %27
%35 = tail call double @pow(double %0, double %1)
%36 = tail call double @pow(double %35, double %2)
%37 = fmul double %1, %2
%38 = tail call double @pow(double %0, double %37)
%39 = fcmp une double %36, %38
br i1 %39, label %40, label %42
40: ; preds = %34
%41 = tail call i32 (...) @link_error()
br label %42
42: ; preds = %40, %34
ret void
}