#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 */
float expk3f(float);
float fabsfk(float);
float logk3f(float);
__attribute__((visibility("default"))) const float xfastpowf_u3500(float x,
                                                                   float y) {
  float result = expk3f(logk3f(fabsfk(x)) * y);
  int yisint = (y == (int)y) || (fabsfk(y) >= (float)(1LL << 24));
  int yisodd = (1 & (int)y) != 0 && yisint && fabsfk(y) < (float)(1LL << 24);
  result *= (x < 0 && yisodd) ? -1 : 1;
  if (x == 0)
    result = 0;
  if (y == 0)
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1050 <fabsfk@plt>
call   1040 <logk3f@plt>
mulss  -0x8(%rbp),%xmm0
call   1030 <expk3f@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvttss2si -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm1
mov    $0x1,%al
ucomiss %xmm1,%xmm0
mov    %al,-0x15(%rbp)
jne    1187 <xfastpowf_u3500+0x57>
jp     1187 <xfastpowf_u3500+0x57>
jmp    11a2 <xfastpowf_u3500+0x72>
movss  -0x8(%rbp),%xmm0
call   1050 <fabsfk@plt>
movss  0xe67(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cvttss2si -0x8(%rbp),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
je     11f0 <xfastpowf_u3500+0xc0>
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x16(%rbp)
je     11f0 <xfastpowf_u3500+0xc0>
movss  -0x8(%rbp),%xmm0
call   1050 <fabsfk@plt>
movaps %xmm0,%xmm1
movss  0xe19(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
mov    %al,-0x17(%rbp)
jbe    1217 <xfastpowf_u3500+0xe7>
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x17(%rbp)
mov    -0x17(%rbp),%dl
mov    $0x1,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
cvtsi2ss %eax,%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1257 <xfastpowf_u3500+0x127>
jp     1257 <xfastpowf_u3500+0x127>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    127b <xfastpowf_u3500+0x14b>
jp     127b <xfastpowf_u3500+0x14b>
movss  0xd8e(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
sub    $0x30,%rsp
movaps %xmm1,(%rsp)
movaps %xmm0,0x20(%rsp)
call   1050 <fabsfk@plt>
call   1040 <logk3f@plt>
mulss  (%rsp),%xmm0
call   1030 <expk3f@plt>
movaps (%rsp),%xmm3
movaps %xmm0,%xmm5
cvttss2si %xmm3,%ebx
cvttps2dq %xmm3,%xmm0
cvtdq2ps %xmm0,%xmm0
mov    $0x1,%cl
ucomiss %xmm3,%xmm0
jne    116d <xfastpowf_u3500+0x3d>
jnp    118d <xfastpowf_u3500+0x5d>
movaps %xmm3,%xmm0
movaps %xmm5,0x10(%rsp)
call   1050 <fabsfk@plt>
movaps 0x10(%rsp),%xmm5
movaps (%rsp),%xmm3
ucomiss 0xe76(%rip),%xmm0
setae  %cl
xor    %eax,%eax
test   $0x1,%bl
je     11bc <xfastpowf_u3500+0x8c>
test   %cl,%cl
je     11bc <xfastpowf_u3500+0x8c>
movaps %xmm3,%xmm0
movaps %xmm5,0x10(%rsp)
call   1050 <fabsfk@plt>
movaps 0x10(%rsp),%xmm5
movaps (%rsp),%xmm3
movss  0xe4a(%rip),%xmm1
ucomiss %xmm0,%xmm1
seta   %al
test   %al,%al
jne    11c5 <xfastpowf_u3500+0x95>
movaps %xmm5,%xmm0
jmp    11cf <xfastpowf_u3500+0x9f>
movaps 0xe44(%rip),%xmm0
xorps  %xmm5,%xmm0
xorps  %xmm1,%xmm1
movaps 0x20(%rsp),%xmm4
movaps %xmm4,%xmm2
cmpltss %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm5,%xmm2
orps   %xmm0,%xmm2
cmpeqss %xmm1,%xmm4
andnps %xmm2,%xmm4
cmpeqss %xmm1,%xmm3
movaps %xmm3,%xmm1
andnps %xmm4,%xmm1
movss  0xe01(%rip),%xmm0
andps  %xmm3,%xmm0
orps   %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @xfastpowf_u3500(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
store float %0, float* %3
store float %1, float* %4
%8 = load float, float* %3
%9 = call float @fabsfk(float %8)
%10 = call float @logk3f(float %9)
%11 = load float, float* %4
%12 = fmul float %10, %11
%13 = call float @expk3f(float %12)
store float %13, float* %5
%14 = load float, float* %4
%15 = load float, float* %4
%16 = fptosi float %15 to i32
%17 = sitofp i32 %16 to float
%18 = fcmp oeq float %14, %17
br i1 %18, label %23, label %19
19: ; preds = %2
%20 = load float, float* %4
%21 = call float @fabsfk(float %20)
%22 = fcmp oge float %21, 0x4170000000000000
br label %23
23: ; preds = %19, %2
%24 = phi i1 [ true, %2 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %6
%26 = load float, float* %4
%27 = fptosi float %26 to i32
%28 = and i32 1, %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %37
30: ; preds = %23
%31 = load i32, i32* %6
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = load float, float* %4
%35 = call float @fabsfk(float %34)
%36 = fcmp olt float %35, 0x4170000000000000
br label %37
37: ; preds = %33, %30, %23
%38 = phi i1 [ false, %30 ], [ false, %23 ], [ %36, %33 ]
%39 = zext i1 %38 to i32
store i32 %39, i32* %7
%40 = load float, float* %3
%41 = fcmp olt float %40, 0.000000e+00
br i1 %41, label %42, label %45
42: ; preds = %37
%43 = load i32, i32* %7
%44 = icmp ne i32 %43, 0
br label %45
45: ; preds = %42, %37
%46 = phi i1 [ false, %37 ], [ %44, %42 ]
%47 = zext i1 %46 to i64
%48 = select i1 %46, i32 -1, i32 1
%49 = sitofp i32 %48 to float
%50 = load float, float* %5
%51 = fmul float %50, %49
store float %51, float* %5
%52 = load float, float* %3
%53 = fcmp oeq float %52, 0.000000e+00
br i1 %53, label %54, label %55
54: ; preds = %45
store float 0.000000e+00, float* %5
br label %55
55: ; preds = %54, %45
%56 = load float, float* %4
%57 = fcmp oeq float %56, 0.000000e+00
br i1 %57, label %58, label %59
58: ; preds = %55
store float 1.000000e+00, float* %5
br label %59
59: ; preds = %58, %55
%60 = load float, float* %5
ret float %60
}

LLVM IR (-O2):
define float @xfastpowf_u3500(float %0, float %1) {
%3 = tail call float @fabsfk(float %0)
%4 = tail call float @logk3f(float %3)
%5 = fmul float %4, %1
%6 = tail call float @expk3f(float %5)
%7 = fptosi float %1 to i32
%8 = sitofp i32 %7 to float
%9 = fcmp oeq float %8, %1
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call float @fabsfk(float %1)
%12 = fcmp oge float %11, 0x4170000000000000
br label %13
13: ; preds = %10, %2
%14 = phi i1 [ true, %2 ], [ %12, %10 ]
%15 = and i32 %7, 1
%16 = icmp ne i32 %15, 0
%17 = select i1 %16, i1 %14, i1 false
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = tail call float @fabsfk(float %1)
%20 = fcmp olt float %19, 0x4170000000000000
br label %21
21: ; preds = %18, %13
%22 = phi i1 [ false, %13 ], [ %20, %18 ]
%23 = fcmp olt float %0, 0.000000e+00
%24 = select i1 %23, i1 %22, i1 false
%25 = fneg float %6
%26 = select i1 %24, float %25, float %6
%27 = fcmp oeq float %0, 0.000000e+00
%28 = select i1 %27, float 0.000000e+00, float %26
%29 = fcmp oeq float %1, 0.000000e+00
%30 = select i1 %29, float 1.000000e+00, float %28
ret float %30
}