#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 log(int);
double pow(double, int);
double dcs_wood_saxon(double Z, double A) {
  if (Z == 1) {
    return 0.;
  } else {
    double r0 = pow(A, 1. / 3.);
    r0 = 1.12 * r0 - 0.86 / r0;
    const double a = 0.54;
    const double zeta3 = 1.202056903159594;
    const double V =
        a * (r0 * r0 * log(2.) +
             a * r0 * 3.14159265358979323846 * 3.14159265358979323846 / 6. +
             a * a * 1.5 * zeta3);
    return 1. - 4. * 3.14159265358979323846 * 0.17 * V / A;
  }
}


x86 assembly (clang, -O0):
<dcs_wood_saxon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    115c <dcs_wood_saxon+0x3c>
jp     115c <dcs_wood_saxon+0x3c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    125f <dcs_wood_saxon+0x13f>
movsd  -0x18(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe9a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe5d(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  0xe22(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe2d(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  0xe21(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  0xe0d(%rip),%xmm3
divsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdf1(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xddd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xdc4(%rip),%xmm1
mulsd  -0x38(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xdaa(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcs_wood_saxon>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd 0xecc(%rip),%xmm2
jne    113d <dcs_wood_saxon+0x1d>
jp     113d <dcs_wood_saxon+0x1d>
add    $0x18,%rsp
ret
movapd %xmm1,%xmm0
xor    %edi,%edi
movsd  %xmm1,0x10(%rsp)
call   1040 <pow@plt>
movsd  0xeb2(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xeae(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  0xe8d(%rip),%xmm1
movsd  (%rsp),%xmm3
mulsd  %xmm1,%xmm3
movsd  0xe84(%rip),%xmm2
mulsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm3
divsd  0xe7c(%rip),%xmm3
mulsd  0x8(%rsp),%xmm0
addsd  %xmm3,%xmm0
addsd  0xe72(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xe6e(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
addsd  0xe28(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @dcs_wood_saxon(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
%10 = load double, double* %4
%11 = fcmp oeq double %10, 1.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %2
store double 0.000000e+00, double* %3
br label %38
13: ; preds = %2
%14 = load double, double* %5
%15 = call double @pow(double %14, i32 0)
store double %15, double* %6
%16 = load double, double* %6
%17 = load double, double* %6
%18 = fdiv double 8.600000e-01, %17
%19 = fneg double %18
%20 = call double @llvm.fmuladd.f64(double 1.120000e+00, double %16, double %19)
store double %20, double* %6
store double 5.400000e-01, double* %7
store double 0x3FF33BA004F00620, double* %8
%21 = load double, double* %6
%22 = load double, double* %6
%23 = fmul double %21, %22
%24 = call double @log(i32 2)
%25 = load double, double* %6
%26 = fmul double 5.400000e-01, %25
%27 = fmul double %26, 0x400921FB54442D18
%28 = fmul double %27, 0x400921FB54442D18
%29 = fdiv double %28, 6.000000e+00
%30 = call double @llvm.fmuladd.f64(double %23, double %24, double %29)
%31 = fadd double %30, 0x3FE0D32FED61BE17
%32 = fmul double 5.400000e-01, %31
store double %32, double* %9
%33 = load double, double* %9
%34 = fmul double 0x4001171B8B38998C, %33
%35 = load double, double* %5
%36 = fdiv double %34, %35
%37 = fsub double 1.000000e+00, %36
store double %37, double* %3
br label %38
38: ; preds = %13, %12
%39 = load double, double* %3
ret double %39
}

LLVM IR (-O2):
define double @dcs_wood_saxon(double %0, double %1) {
%3 = fcmp oeq double %0, 1.000000e+00
br i1 %3, label %20, label %4
4: ; preds = %2
%5 = tail call double @pow(double %1, i32 0)
%6 = fdiv double -8.600000e-01, %5
%7 = tail call double @llvm.fmuladd.f64(double %5, double 1.120000e+00, double %6)
%8 = fmul double %7, %7
%9 = tail call double @log(i32 2)
%10 = fmul double %7, 5.400000e-01
%11 = fmul double %10, 0x400921FB54442D18
%12 = fmul double %11, 0x400921FB54442D18
%13 = fdiv double %12, 6.000000e+00
%14 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %13)
%15 = fadd double %14, 0x3FE0D32FED61BE17
%16 = fmul double %15, 5.400000e-01
%17 = fmul double %16, 0x4001171B8B38998C
%18 = fdiv double %17, %1
%19 = fsub double 1.000000e+00, %18
br label %20
20: ; preds = %2, %4
%21 = phi double [ %19, %4 ], [ 0.000000e+00, %2 ]
ret double %21
}