#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 */
scalar_t__ exp(float);
scalar_t__ log(float);
float phi0(float x) {
  float z;
  if (x > 10)
    return (0);
  else if (x < 9.08e-5)
    return (10);
  else if (x > 9)
    return (1.6881e-4);
  else if (x > 8)
    return (4.5887e-4);
  else if (x > 7)
    return (1.2473e-3);
  else if (x > 6)
    return (3.3906e-3);
  else if (x > 5)
    return (9.2168e-3);
  else {
    z = (float)exp(x);
    return ((float)log((z + 1) / (z - 1)));
  }
}


x86 assembly (clang, -O0):
<phi0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xec6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1150 <phi0+0x30>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128a <phi0+0x16a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xecf(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117d <phi0+0x5d>
movss  0xe8d(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128a <phi0+0x16a>
movss  -0x8(%rbp),%xmm0
movss  0xe7a(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11a5 <phi0+0x85>
movss  0xe91(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128a <phi0+0x16a>
movss  -0x8(%rbp),%xmm0
movss  0xe56(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11cd <phi0+0xad>
movss  0xe65(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128a <phi0+0x16a>
movss  -0x8(%rbp),%xmm0
movss  0xe32(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11f5 <phi0+0xd5>
movss  0xe39(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128a <phi0+0x16a>
movss  -0x8(%rbp),%xmm0
movss  0xe0e(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    121d <phi0+0xfd>
movss  0xe0d(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128a <phi0+0x16a>
movss  -0x8(%rbp),%xmm0
movss  0xdea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1245 <phi0+0x125>
movss  0xde1(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    128a <phi0+0x16a>
movss  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xdb7(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xda5(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
call   1040 <log@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi0>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss 0xed5(%rip),%xmm0
ja     11e4 <phi0+0xc4>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xef8(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    1153 <phi0+0x33>
movss  0xeb2(%rip),%xmm1
jmp    11e4 <phi0+0xc4>
ucomiss 0xeae(%rip),%xmm0
jbe    1166 <phi0+0x46>
movss  0xea0(%rip),%xmm1
jmp    11e4 <phi0+0xc4>
ucomiss 0xea3(%rip),%xmm0
jbe    1179 <phi0+0x59>
movss  0xe95(%rip),%xmm1
jmp    11e4 <phi0+0xc4>
ucomiss 0xe98(%rip),%xmm0
jbe    118c <phi0+0x6c>
movss  0xe8a(%rip),%xmm1
jmp    11e4 <phi0+0xc4>
ucomiss 0xe8d(%rip),%xmm0
jbe    119f <phi0+0x7f>
movss  0xe7f(%rip),%xmm1
jmp    11e4 <phi0+0xc4>
ucomiss 0xe82(%rip),%xmm0
jbe    11b2 <phi0+0x92>
movss  0xe74(%rip),%xmm1
jmp    11e4 <phi0+0xc4>
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movss  0xe65(%rip),%xmm0
addss  %xmm1,%xmm0
addss  0xe5d(%rip),%xmm1
divss  %xmm1,%xmm0
call   1040 <log@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @phi0(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp ogt float %5, 1.000000e+01
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %44
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp olt double %10, 9.080000e-05
br i1 %11, label %12, label %13
12: ; preds = %8
store float 1.000000e+01, float* %2
br label %44
13: ; preds = %8
%14 = load float, float* %3
%15 = fcmp ogt float %14, 9.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %13
store float 0x3F262052E0000000, float* %2
br label %44
17: ; preds = %13
%18 = load float, float* %3
%19 = fcmp ogt float %18, 8.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %17
store float 0x3F3E128FA0000000, float* %2
br label %44
21: ; preds = %17
%22 = load float, float* %3
%23 = fcmp ogt float %22, 7.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %21
store float 0x3F546F8E20000000, float* %2
br label %44
25: ; preds = %21
%26 = load float, float* %3
%27 = fcmp ogt float %26, 6.000000e+00
br i1 %27, label %28, label %29
28: ; preds = %25
store float 0x3F6BC69A80000000, float* %2
br label %44
29: ; preds = %25
%30 = load float, float* %3
%31 = fcmp ogt float %30, 5.000000e+00
br i1 %31, label %32, label %33
32: ; preds = %29
store float 0x3F82E04200000000, float* %2
br label %44
33: ; preds = %29
%34 = load float, float* %3
%35 = call i64 @exp(float %34)
%36 = sitofp i64 %35 to float
store float %36, float* %4
%37 = load float, float* %4
%38 = fadd float %37, 1.000000e+00
%39 = load float, float* %4
%40 = fsub float %39, 1.000000e+00
%41 = fdiv float %38, %40
%42 = call i64 @log(float %41)
%43 = sitofp i64 %42 to float
store float %43, float* %2
br label %44
44: ; preds = %33, %32, %28, %24, %20, %16, %12, %7
%45 = load float, float* %2
ret float %45
}

LLVM IR (-O2):
define float @phi0(float %0) {
%2 = fcmp ogt float %0, 1.000000e+01
br i1 %2, label %24, label %3
3: ; preds = %1
%4 = fpext float %0 to double
%5 = fcmp olt double %4, 9.080000e-05
br i1 %5, label %24, label %6
6: ; preds = %3
%7 = fcmp ogt float %0, 9.000000e+00
br i1 %7, label %24, label %8
8: ; preds = %6
%9 = fcmp ogt float %0, 8.000000e+00
br i1 %9, label %24, label %10
10: ; preds = %8
%11 = fcmp ogt float %0, 7.000000e+00
br i1 %11, label %24, label %12
12: ; preds = %10
%13 = fcmp ogt float %0, 6.000000e+00
br i1 %13, label %24, label %14
14: ; preds = %12
%15 = fcmp ogt float %0, 5.000000e+00
br i1 %15, label %24, label %16
16: ; preds = %14
%17 = tail call i64 @exp(float %0)
%18 = sitofp i64 %17 to float
%19 = fadd float %18, 1.000000e+00
%20 = fadd float %18, -1.000000e+00
%21 = fdiv float %19, %20
%22 = tail call i64 @log(float %21)
%23 = sitofp i64 %22 to float
br label %24
24: ; preds = %14, %12, %10, %8, %6, %3, %1, %16
%25 = phi float [ %23, %16 ], [ 0.000000e+00, %1 ], [ 1.000000e+01, %3 ], [ 0x3F262052E0000000, %6 ], [ 0x3F3E128FA0000000, %8 ], [ 0x3F546F8E20000000, %10 ], [ 0x3F6BC69A80000000, %12 ], [ 0x3F82E04200000000, %14 ]
ret float %25
}