#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 const cos(double const);
double const sin(double const);
double sqrt(double const);
double coulomb_nuclear_form_factor(double mu, double N) {
  if (mu <= 0.)
    return 1.;
  else if (mu > 1.)
    return 0.;
  const double x2 = 10. * mu / N;
  double d;
  if (x2 <= 1E-04) {
    d = 1. / (1. + 0.1 * x2);
  } else {
    const double x = sqrt(x2);
    d = 3 * (sin(x) - x * cos(x)) / (x2 * x);
  }
  return d * d;
}


x86 assembly (clang, -O0):
<coulomb_nuclear_form_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1162 <coulomb_nuclear_form_factor+0x32>
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1274 <coulomb_nuclear_form_factor+0x144>
movsd  -0x10(%rbp),%xmm0
movsd  0xe91(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1186 <coulomb_nuclear_form_factor+0x56>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1274 <coulomb_nuclear_form_factor+0x144>
jmp    118b <coulomb_nuclear_form_factor+0x5b>
movsd  0xe7d(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe5e(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     11e8 <coulomb_nuclear_form_factor+0xb8>
movsd  -0x20(%rbp),%xmm1
movsd  0xe5e(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe32(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe26(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1265 <coulomb_nuclear_form_factor+0x135>
movsd  -0x20(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdca(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coulomb_nuclear_form_factor>:
sub    $0x18,%rsp
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jae    117c <coulomb_nuclear_form_factor+0x4c>
ucomisd 0xeba(%rip),%xmm0
ja     11e8 <coulomb_nuclear_form_factor+0xb8>
mulsd  0xeb4(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1186 <coulomb_nuclear_form_factor+0x56>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
jb     119c <coulomb_nuclear_form_factor+0x6c>
sqrtsd %xmm0,%xmm0
jmp    11a1 <coulomb_nuclear_form_factor+0x71>
movsd  0xe7c(%rip),%xmm2
jmp    11e8 <coulomb_nuclear_form_factor+0xb8>
mulsd  0xe8a(%rip),%xmm0
movsd  0xe6a(%rip),%xmm2
addsd  %xmm2,%xmm0
jmp    11e0 <coulomb_nuclear_form_factor+0xb0>
call   1050 <sqrt@plt>
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x8(%rsp),%xmm2
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
mulsd  0xe4a(%rip),%xmm2
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm2
movapd %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @coulomb_nuclear_form_factor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
%9 = load double, double* %4
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %2
store double 1.000000e+00, double* %3
br label %47
12: ; preds = %2
%13 = load double, double* %4
%14 = fcmp ogt double %13, 1.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
store double 0.000000e+00, double* %3
br label %47
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load double, double* %4
%19 = fmul double 1.000000e+01, %18
%20 = load double, double* %5
%21 = fdiv double %19, %20
store double %21, double* %6
%22 = load double, double* %6
%23 = fcmp ole double %22, 1.000000e-04
br i1 %23, label %24, label %28
24: ; preds = %17
%25 = load double, double* %6
%26 = call double @llvm.fmuladd.f64(double 1.000000e-01, double %25, double 1.000000e+00)
%27 = fdiv double 1.000000e+00, %26
store double %27, double* %7
br label %43
28: ; preds = %17
%29 = load double, double* %6
%30 = call double @sqrt(double %29)
store double %30, double* %8
%31 = load double, double* %8
%32 = call double @sin(double %31)
%33 = load double, double* %8
%34 = load double, double* %8
%35 = call double @cos(double %34)
%36 = fneg double %33
%37 = call double @llvm.fmuladd.f64(double %36, double %35, double %32)
%38 = fmul double 3.000000e+00, %37
%39 = load double, double* %6
%40 = load double, double* %8
%41 = fmul double %39, %40
%42 = fdiv double %38, %41
store double %42, double* %7
br label %43
43: ; preds = %28, %24
%44 = load double, double* %7
%45 = load double, double* %7
%46 = fmul double %44, %45
store double %46, double* %3
br label %47
47: ; preds = %43, %15, %11
%48 = load double, double* %3
ret double %48
}

LLVM IR (-O2):
define double @coulomb_nuclear_form_factor(double %0, double %1) {
%3 = fcmp ugt double %0, 0.000000e+00
br i1 %3, label %4, label %25
4: ; preds = %2
%5 = fcmp ogt double %0, 1.000000e+00
br i1 %5, label %25, label %6
6: ; preds = %4
%7 = fmul double %0, 1.000000e+01
%8 = fdiv double %7, %1
%9 = fcmp ugt double %8, 1.000000e-04
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e-01, double 1.000000e+00)
%12 = fdiv double 1.000000e+00, %11
br label %22
13: ; preds = %6
%14 = tail call double @sqrt(double %8)
%15 = tail call double @sin(double %14)
%16 = tail call double @cos(double %14)
%17 = fneg double %14
%18 = tail call double @llvm.fmuladd.f64(double %17, double %16, double %15)
%19 = fmul double %18, 3.000000e+00
%20 = fmul double %8, %14
%21 = fdiv double %19, %20
br label %22
22: ; preds = %13, %10
%23 = phi double [ %12, %10 ], [ %21, %13 ]
%24 = fmul double %23, %23
br label %25
25: ; preds = %4, %2, %22
%26 = phi double [ %24, %22 ], [ 1.000000e+00, %2 ], [ 0.000000e+00, %4 ]
ret double %26
}