#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 */
struct reb_simulation {
  int dummy;
};

/* Variables and functions */
int fabs(double);
double pow(int, double);
double coefficient_of_restitution_bridges(const struct reb_simulation *const r,
                                          double v) {
  double eps = 0.32 * pow(fabs(v) * 100., -0.234);
  if (eps > 1)
    eps = 1;
  if (eps < 0)
    eps = 0;
  return eps;
}


x86 assembly (clang, -O0):
<coefficient_of_restitution_bridges>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xeb9(%rip),%xmm0
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe83(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1194 <coefficient_of_restitution_bridges+0x74>
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11aa <coefficient_of_restitution_bridges+0x8a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coefficient_of_restitution_bridges>:
push   %rax
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xecb(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xec7(%rip),%xmm0
call   1040 <pow@plt>
mulsd  0xec2(%rip),%xmm0
movsd  0xec2(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
maxsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.reb_simulation = type { i32 }
define double @coefficient_of_restitution_bridges(%struct.reb_simulation* %0, double %1) {
%3 = alloca %struct.reb_simulation*
%4 = alloca double
%5 = alloca double
store %struct.reb_simulation* %0, %struct.reb_simulation** %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call i32 @fabs(double %6)
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 1.000000e+02
%10 = fptosi double %9 to i32
%11 = call double @pow(i32 %10, double -2.340000e-01)
%12 = fmul double 3.200000e-01, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = fcmp ogt double %13, 1.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %2
store double 1.000000e+00, double* %5
br label %16
16: ; preds = %15, %2
%17 = load double, double* %5
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %16
store double 0.000000e+00, double* %5
br label %20
20: ; preds = %19, %16
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
%struct.reb_simulation = type { i32 }
define double @coefficient_of_restitution_bridges(%struct.reb_simulation* nocapture readnone %0, double %1) {
%3 = tail call i32 @fabs(double %1)
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 1.000000e+02
%6 = fptosi double %5 to i32
%7 = tail call double @pow(i32 %6, double -2.340000e-01)
%8 = fmul double %7, 3.200000e-01
%9 = fcmp ogt double %8, 1.000000e+00
%10 = select i1 %9, double 1.000000e+00, double %8
%11 = fcmp olt double %10, 0.000000e+00
%12 = select i1 %11, double 0.000000e+00, double %10
ret double %12
}