#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 dist2(double, double, double, double, double, double);
double exp(double);
double overlap_1D(int, int, double, double, double);
double pow(double, double);
double product_center_1D(double, double, double, double);
double overlap(double alpha1, int l1, int m1, int n1, double xa, double ya,
               double za, double alpha2, int l2, int m2, int n2, double xb,
               double yb, double zb) {
  double rab2, gamma, xp, yp, zp, pre, wx, wy, wz;
  rab2 = dist2(xa, ya, za, xb, yb, zb);
  gamma = alpha1 + alpha2;
  xp = product_center_1D(alpha1, xa, alpha2, xb);
  yp = product_center_1D(alpha1, ya, alpha2, yb);
  zp = product_center_1D(alpha1, za, alpha2, zb);
  pre = pow(3.14159265358979323846 / gamma, 1.5) *
        exp(-alpha1 * alpha2 * rab2 / gamma);
  wx = overlap_1D(l1, l2, xp - xa, xp - xb, gamma);
  wy = overlap_1D(m1, m2, yp - ya, yp - yb, gamma);
  wz = overlap_1D(n1, n2, zp - za, zp - zb, gamma);
  return pre * wx * wy * wz;
}


x86 assembly (clang, -O0):
<overlap>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    %r8d,-0x40(%rbp)
mov    %r9d,-0x44(%rbp)
movsd  %xmm5,-0x50(%rbp)
movsd  %xmm6,-0x58(%rbp)
movsd  %xmm7,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm4
movsd  -0x60(%rbp),%xmm5
call   1040 <dist2@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
call   1030 <product_center_1D@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
call   1030 <product_center_1D@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
call   1030 <product_center_1D@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xdd5(%rip),%xmm0
divsd  -0x70(%rbp),%xmm0
movsd  0xdc0(%rip),%xmm1
call   1060 <pow@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0xc(%rbp),%edi
mov    -0x3c(%rbp),%esi
movsd  -0x78(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
subsd  -0x50(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1070 <overlap_1D@plt>
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x10(%rbp),%edi
mov    -0x40(%rbp),%esi
movsd  -0x80(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
subsd  -0x58(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1070 <overlap_1D@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x14(%rbp),%edi
mov    -0x44(%rbp),%esi
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x30(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
subsd  -0x60(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1070 <overlap_1D@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
mulsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0xa8(%rbp),%xmm0
ff
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<overlap>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movsd  %xmm7,0x48(%rsp)
movsd  %xmm6,0x40(%rsp)
movsd  %xmm5,0x30(%rsp)
mov    %r9d,%r14d
mov    %r8d,%r12d
mov    %ecx,%ebx
movsd  %xmm4,(%rsp)
movsd  %xmm3,0x50(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x38(%rsp)
mov    %edx,%r15d
mov    %esi,%r13d
mov    %edi,%ebp
movaps %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
movaps %xmm5,%xmm3
movaps %xmm6,%xmm4
movaps %xmm7,%xmm5
call   1040 <dist2@plt>
movsd  %xmm0,0x60(%rsp)
movapd 0x10(%rsp),%xmm0
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  0x38(%rsp),%xmm1
movsd  0x30(%rsp),%xmm3
call   1030 <product_center_1D@plt>
movsd  %xmm0,0x58(%rsp)
movaps 0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
movsd  0x40(%rsp),%xmm3
call   1030 <product_center_1D@plt>
movsd  %xmm0,0x68(%rsp)
movaps 0x10(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
movsd  (%rsp),%xmm2
movsd  0x48(%rsp),%xmm3
call   1030 <product_center_1D@plt>
movsd  %xmm0,0x70(%rsp)
movsd  0xdcd(%rip),%xmm0
divsd  0x20(%rsp),%xmm0
movsd  0xdc7(%rip),%xmm1
call   1060 <pow@plt>
movapd 0x10(%rsp),%xmm1
xorpd  0xdbc(%rip),%xmm1
movsd  %xmm0,0x10(%rsp)
mulsd  (%rsp),%xmm1
mulsd  0x60(%rsp),%xmm1
divsd  0x20(%rsp),%xmm1
movapd %xmm1,%xmm0
call   1050 <exp@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x58(%rsp),%xmm1
movapd %xmm1,%xmm0
subsd  0x38(%rsp),%xmm0
subsd  0x30(%rsp),%xmm1
mov    %ebp,%edi
mov    %ebx,%esi
movaps 0x20(%rsp),%xmm2
call   1070 <overlap_1D@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x68(%rsp),%xmm1
movapd %xmm1,%xmm0
subsd  0x8(%rsp),%xmm0
subsd  0x40(%rsp),%xmm1
mov    %r13d,%edi
mov    %r12d,%esi
movaps 0x20(%rsp),%xmm2
call   1070 <overlap_1D@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x70(%rsp),%xmm1
movapd %xmm1,%xmm0
subsd  0x50(%rsp),%xmm0
subsd  0x48(%rsp),%xmm1
mov    %r15d,%edi
mov    %r14d,%esi
movaps 0x20(%rsp),%xmm2
call   1070 <overlap_1D@plt>
movsd  0x10(%rsp),%xmm1
mulsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %9, i32 %10, double %11, double %12, double %13) {
%15 = alloca double
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
store double %0, double* %15
store i32 %1, i32* %16
store i32 %2, i32* %17
store i32 %3, i32* %18
store double %4, double* %19
store double %5, double* %20
store double %6, double* %21
store double %7, double* %22
store i32 %8, i32* %23
store i32 %9, i32* %24
store i32 %10, i32* %25
store double %11, double* %26
store double %12, double* %27
store double %13, double* %28
%38 = load double, double* %19
%39 = load double, double* %20
%40 = load double, double* %21
%41 = load double, double* %26
%42 = load double, double* %27
%43 = load double, double* %28
%44 = call double @dist2(double %38, double %39, double %40, double %41, double %42, double %43)
store double %44, double* %29
%45 = load double, double* %15
%46 = load double, double* %22
%47 = fadd double %45, %46
store double %47, double* %30
%48 = load double, double* %15
%49 = load double, double* %19
%50 = load double, double* %22
%51 = load double, double* %26
%52 = call double @product_center_1D(double %48, double %49, double %50, double %51)
store double %52, double* %31
%53 = load double, double* %15
%54 = load double, double* %20
%55 = load double, double* %22
%56 = load double, double* %27
%57 = call double @product_center_1D(double %53, double %54, double %55, double %56)
store double %57, double* %32
%58 = load double, double* %15
%59 = load double, double* %21
%60 = load double, double* %22
%61 = load double, double* %28
%62 = call double @product_center_1D(double %58, double %59, double %60, double %61)
store double %62, double* %33
%63 = load double, double* %30
%64 = fdiv double 0x400921FB54442D18, %63
%65 = call double @pow(double %64, double 1.500000e+00)
%66 = load double, double* %15
%67 = fneg double %66
%68 = load double, double* %22
%69 = fmul double %67, %68
%70 = load double, double* %29
%71 = fmul double %69, %70
%72 = load double, double* %30
%73 = fdiv double %71, %72
%74 = call double @exp(double %73)
%75 = fmul double %65, %74
store double %75, double* %34
%76 = load i32, i32* %16
%77 = load i32, i32* %23
%78 = load double, double* %31
%79 = load double, double* %19
%80 = fsub double %78, %79
%81 = load double, double* %31
%82 = load double, double* %26
%83 = fsub double %81, %82
%84 = load double, double* %30
%85 = call double @overlap_1D(i32 %76, i32 %77, double %80, double %83, double %84)
store double %85, double* %35
%86 = load i32, i32* %17
%87 = load i32, i32* %24
%88 = load double, double* %32
%89 = load double, double* %20
%90 = fsub double %88, %89
%91 = load double, double* %32
%92 = load double, double* %27
%93 = fsub double %91, %92
%94 = load double, double* %30
%95 = call double @overlap_1D(i32 %86, i32 %87, double %90, double %93, double %94)
store double %95, double* %36
%96 = load i32, i32* %18
%97 = load i32, i32* %25
%98 = load double, double* %33
%99 = load double, double* %21
%100 = fsub double %98, %99
%101 = load double, double* %33
%102 = load double, double* %28
%103 = fsub double %101, %102
%104 = load double, double* %30
%105 = call double @overlap_1D(i32 %96, i32 %97, double %100, double %103, double %104)
store double %105, double* %37
%106 = load double, double* %34
%107 = load double, double* %35
%108 = fmul double %106, %107
%109 = load double, double* %36
%110 = fmul double %108, %109
%111 = load double, double* %37
%112 = fmul double %110, %111
ret double %112
}

LLVM IR (-O2):
define double @overlap(double %0, i32 %1, i32 %2, i32 %3, double %4, double %5, double %6, double %7, i32 %8, i32 %9, i32 %10, double %11, double %12, double %13) {
%15 = tail call double @dist2(double %4, double %5, double %6, double %11, double %12, double %13)
%16 = fadd double %0, %7
%17 = tail call double @product_center_1D(double %0, double %4, double %7, double %11)
%18 = tail call double @product_center_1D(double %0, double %5, double %7, double %12)
%19 = tail call double @product_center_1D(double %0, double %6, double %7, double %13)
%20 = fdiv double 0x400921FB54442D18, %16
%21 = tail call double @pow(double %20, double 1.500000e+00)
%22 = fneg double %0
%23 = fmul double %22, %7
%24 = fmul double %23, %15
%25 = fdiv double %24, %16
%26 = tail call double @exp(double %25)
%27 = fmul double %21, %26
%28 = fsub double %17, %4
%29 = fsub double %17, %11
%30 = tail call double @overlap_1D(i32 %1, i32 %8, double %28, double %29, double %16)
%31 = fsub double %18, %5
%32 = fsub double %18, %12
%33 = tail call double @overlap_1D(i32 %2, i32 %9, double %31, double %32, double %16)
%34 = fsub double %19, %6
%35 = fsub double %19, %13
%36 = tail call double @overlap_1D(i32 %3, i32 %10, double %34, double %35, double %16)
%37 = fmul double %27, %30
%38 = fmul double %37, %33
%39 = fmul double %38, %36
ret double %39
}