#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 potential(double);
int pow(double, int);
double sqrt(int);
double function(double r, double b, double E) {
  return 1.0 /
         (pow(r, 2) * sqrt(1 - (pow(b, 2) / pow(r, 2)) - (potential(r) / E)));
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x2c(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <potential@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <sqrt@plt>
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <potential@plt>
divsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1050 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0xe37(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @function(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 = call i32 @pow(double %7, i32 2)
%9 = sitofp i32 %8 to double
%10 = load double, double* %5
%11 = call i32 @pow(double %10, i32 2)
%12 = load double, double* %4
%13 = call i32 @pow(double %12, i32 2)
%14 = sdiv i32 %11, %13
%15 = sub nsw i32 1, %14
%16 = sitofp i32 %15 to double
%17 = load double, double* %4
%18 = call double @potential(double %17)
%19 = load double, double* %6
%20 = fdiv double %18, %19
%21 = fsub double %16, %20
%22 = fptosi double %21 to i32
%23 = call double @sqrt(i32 %22)
%24 = fmul double %9, %23
%25 = fdiv double 1.000000e+00, %24
ret double %25
}

LLVM IR (-O2):
define double @function(double %0, double %1, double %2) {
%4 = tail call i32 @pow(double %0, i32 2)
%5 = sitofp i32 %4 to double
%6 = tail call i32 @pow(double %1, i32 2)
%7 = tail call i32 @pow(double %0, i32 2)
%8 = sdiv i32 %6, %7
%9 = sub nsw i32 1, %8
%10 = sitofp i32 %9 to double
%11 = tail call double @potential(double %0)
%12 = fdiv double %11, %2
%13 = fsub double %10, %12
%14 = fptosi double %13 to i32
%15 = tail call double @sqrt(i32 %14)
%16 = fmul double %15, %5
%17 = fdiv double 1.000000e+00, %16
ret double %17
}