#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 exp(double);
double sqrt(double);
double electron_inject_density(double x, double y, double z, double nx,
                               double ny, double nz, double t) {
  double center_x = 1.5;
  double center_y = 0.0;
  double center_z = 0.0;
  double d =
      sqrt((x - center_x) * (x - center_x) + (y - center_y) * (y - center_y) +
           (z - center_z) * (z - center_z));
  double d_sigma = 0.2;
  double t_center = 3e-9;
  double t_sigma = 1e-9;
  return 1.0e3 * exp(-d * d / d_sigma / d_sigma) *
         exp(-(t - t_center) * (t - t_center) / t_sigma / t_sigma);
}


x86 assembly (clang, -O0):
<electron_inject_density>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  0xeca(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x40(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm3
subsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  0xe4b(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe36(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe21(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xdd9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x38(%rbp),%xmm1
subsd  -0x68(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x70(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<electron_inject_density>:
sub    $0x28,%rsp
movaps %xmm6,0x10(%rsp)
addsd  0xecf(%rip),%xmm0
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1158 <electron_inject_density+0x38>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1161 <electron_inject_density+0x41>
movapd %xmm2,%xmm0
call   1040 <sqrt@plt>
movapd %xmm0,%xmm1
xorpd  0xec3(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
divsd  %xmm0,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xe7e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
addsd  0xe72(%rip),%xmm0
movapd 0xe82(%rip),%xmm1
xorpd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
divsd  %xmm0,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @electron_inject_density(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
store double 1.500000e+00, double* %15
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %17
%22 = load double, double* %8
%23 = load double, double* %15
%24 = fsub double %22, %23
%25 = load double, double* %8
%26 = load double, double* %15
%27 = fsub double %25, %26
%28 = load double, double* %9
%29 = load double, double* %16
%30 = fsub double %28, %29
%31 = load double, double* %9
%32 = load double, double* %16
%33 = fsub double %31, %32
%34 = fmul double %30, %33
%35 = call double @llvm.fmuladd.f64(double %24, double %27, double %34)
%36 = load double, double* %10
%37 = load double, double* %17
%38 = fsub double %36, %37
%39 = load double, double* %10
%40 = load double, double* %17
%41 = fsub double %39, %40
%42 = call double @llvm.fmuladd.f64(double %38, double %41, double %35)
%43 = call double @sqrt(double %42)
store double %43, double* %18
store double 2.000000e-01, double* %19
store double 3.000000e-09, double* %20
store double 1.000000e-09, double* %21
%44 = load double, double* %18
%45 = fneg double %44
%46 = load double, double* %18
%47 = fmul double %45, %46
%48 = load double, double* %19
%49 = fdiv double %47, %48
%50 = load double, double* %19
%51 = fdiv double %49, %50
%52 = call double @exp(double %51)
%53 = fmul double 1.000000e+03, %52
%54 = load double, double* %14
%55 = load double, double* %20
%56 = fsub double %54, %55
%57 = fneg double %56
%58 = load double, double* %14
%59 = load double, double* %20
%60 = fsub double %58, %59
%61 = fmul double %57, %60
%62 = load double, double* %21
%63 = fdiv double %61, %62
%64 = load double, double* %21
%65 = fdiv double %63, %64
%66 = call double @exp(double %65)
%67 = fmul double %53, %66
ret double %67
}

LLVM IR (-O2):
define double @electron_inject_density(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fadd double %0, -1.500000e+00
%9 = fmul double %1, %1
%10 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %9)
%11 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %10)
%12 = tail call double @sqrt(double %11)
%13 = fneg double %12
%14 = fmul double %12, %13
%15 = fdiv double %14, 2.000000e-01
%16 = fdiv double %15, 2.000000e-01
%17 = tail call double @exp(double %16)
%18 = fmul double %17, 1.000000e+03
%19 = fadd double %6, -3.000000e-09
%20 = fneg double %19
%21 = fmul double %19, %20
%22 = fdiv double %21, 1.000000e-09
%23 = fdiv double %22, 1.000000e-09
%24 = tail call double @exp(double %23)
%25 = fmul double %18, %24
ret double %25
}