#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);
double fabs(double);
double log(double);
double pow(double a, double b) {
  double c;
  double epsilon;
  epsilon = 1.0e-10;
  if ((fabs(a) < epsilon) && (a >= 0.0)) {
    c = exp(b * log(a + epsilon));
  } else if ((fabs(a) < epsilon) && (a < 0.0)) {
    c = exp(b * log(a - epsilon));
  } else {
    c = exp(b * log(a));
  }
  return c;
}


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xeb5(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a4 <pow+0x84>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11a4 <pow+0x84>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1234 <pow+0x114>
movsd  -0x8(%rbp),%xmm1
movaps 0xe50(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1205 <pow+0xe5>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1205 <pow+0xe5>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    122f <pow+0x10f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1234 <pow+0x114>
movsd  -0x18(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
push   %rax
movapd 0xed7(%rip),%xmm2
andpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movsd  %xmm1,(%rsp)
jb     1158 <pow+0x38>
movsd  0xecc(%rip),%xmm4
ucomisd %xmm2,%xmm4
jbe    1158 <pow+0x38>
addsd  0xebe(%rip),%xmm0
movapd %xmm0,%xmm1
jmp    118e <pow+0x6e>
movsd  0xeb8(%rip),%xmm1
cmpltsd 0xea7(%rip),%xmm2
addsd  %xmm0,%xmm1
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1040 <log@plt>
mulsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @pow(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.000000e-10, double* %6
%7 = load double, double* %3
%8 = call double @llvm.fabs.f64(double %7)
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %22
11: ; preds = %2
%12 = load double, double* %3
%13 = fcmp oge double %12, 0.000000e+00
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load double, double* %4
%16 = load double, double* %3
%17 = load double, double* %6
%18 = fadd double %16, %17
%19 = call double @log(double %18)
%20 = fmul double %15, %19
%21 = call double @exp(double %20)
store double %21, double* %5
br label %45
22: ; preds = %11, %2
%23 = load double, double* %3
%24 = call double @llvm.fabs.f64(double %23)
%25 = load double, double* %6
%26 = fcmp olt double %24, %25
br i1 %26, label %27, label %38
27: ; preds = %22
%28 = load double, double* %3
%29 = fcmp olt double %28, 0.000000e+00
br i1 %29, label %30, label %38
30: ; preds = %27
%31 = load double, double* %4
%32 = load double, double* %3
%33 = load double, double* %6
%34 = fsub double %32, %33
%35 = call double @log(double %34)
%36 = fmul double %31, %35
%37 = call double @exp(double %36)
store double %37, double* %5
br label %44
38: ; preds = %27, %22
%39 = load double, double* %4
%40 = load double, double* %3
%41 = call double @log(double %40)
%42 = fmul double %39, %41
%43 = call double @exp(double %42)
store double %43, double* %5
br label %44
44: ; preds = %38, %30
br label %45
45: ; preds = %44, %14
%46 = load double, double* %5
ret double %46
}

LLVM IR (-O2):
define double @pow(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fcmp olt double %3, 1.000000e-10
%5 = fcmp oge double %0, 0.000000e+00
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = fadd double %0, 1.000000e-10
br label %14
9: ; preds = %2
%10 = fcmp olt double %0, 0.000000e+00
%11 = and i1 %10, %4
%12 = fadd double %0, -1.000000e-10
%13 = select i1 %11, double %12, double %0
br label %14
14: ; preds = %9, %7
%15 = phi double [ %8, %7 ], [ %13, %9 ]
%16 = tail call double @log(double %15)
%17 = fmul double %16, %1
%18 = tail call double @exp(double %17)
ret double %18
}