#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 */
int M_PI;
double pow(int, int);
void getDFT_xSlater(double rhoa, double rhob, double *Exc, double *dEdrhoa,
                    double *dEdrhob) {
  double alpha = 2. / 3;
  double Cx = 3. / 4 * pow(3. / M_PI, 1. / 3);
  double rho = rhoa + rhob;
  if (rho > 1.0E-10) {
    double z = (rhoa - rhob) / rho;
    double f = (pow(1. + z, 4. / 3) + pow(1. - z, 4. / 3) - 2.) / 2 /
               (pow(2., 1. / 3) - 1.);
    double dfdz = 4. / 3 * (pow(1. + z, 1. / 3) - pow(1. - z, 1. / 3)) / 2 /
                  (pow(2., 1. / 3) - 1.);
    double e0 = -3. / 2 * alpha * Cx * pow(rho, 1. / 3);
    double e1 = pow(2., 1. / 3) * e0;
    double e = e0 + (e1 - e0) * f;
    double delta = e1 - e0;
    *dEdrhoa += e + 1. / 3 * e + delta * dfdz * 2. * rhob / rho;
    *dEdrhob += e + 1. / 3 * e - delta * dfdz * 2. * rhoa / rho;
    *Exc += e * rho;
  }
}


x86 assembly (clang, -O0):
<getDFT_xSlater>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movsd  0xedf(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2ea3(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xebf(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe70(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1403 <getDFT_xSlater+0x2f3>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe82(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    $0x1,%esi
call   1030 <pow@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xe5f(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    $0x1,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  0xe1d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe11(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xdfe(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xde9(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xdc9(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
cvttsd2si %xmm0,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movsd  -0x90(%rbp),%xmm1
ff
subsd  %xmm0,%xmm1
movsd  0xdad(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd81(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xd6e(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xd51(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
cvttsd2si -0x40(%rbp),%edi
xor    %esi,%esi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <pow@plt>
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  0xcc5(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  0xca3(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  0xc7b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x78(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  0xc59(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  -0x40(%rbp),%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm2
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDFT_xSlater>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r14
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x28(%rsp)
mov    0x2eb0(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movapd %xmm0,%xmm3
movsd  0x28(%rsp),%xmm2
movapd %xmm2,%xmm0
movsd  0x20(%rsp),%xmm4
addsd  %xmm4,%xmm2
ucomisd 0xe92(%rip),%xmm2
jbe    1323 <getDFT_xSlater+0x213>
subsd  %xmm4,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  0xe7e(%rip),%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
mov    $0x1,%esi
movsd  %xmm2,0x18(%rsp)
movsd  %xmm3,0x10(%rsp)
call   1030 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0xe55(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <pow@plt>
addsd  (%rsp),%xmm0
addsd  0xe3a(%rip),%xmm0
mulsd  0xe3a(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <pow@plt>
addsd  0xe28(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xdf8(%rip),%xmm1
mulsd  0xde0(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <pow@plt>
addsd  0xdcf(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xdc3(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
cvttsd2si 0x18(%rsp),%edi
xor    %esi,%esi
call   1030 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
subsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  0xd7c(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
movapd %xmm2,%xmm4
mulsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movsd  0x18(%rsp),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
addsd  (%r12),%xmm2
movsd  %xmm2,(%r12)
mulsd  0x28(%rsp),%xmm0
divsd  %xmm3,%xmm0
subsd  %xmm0,%xmm1
addsd  (%r15),%xmm1
movsd  %xmm1,(%r15)
mulsd  %xmm3,%xmm4
addsd  (%r14),%xmm4
movsd  %xmm4,(%r14)
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define void @getDFT_xSlater(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%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
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
store double 0x3FE5555555555555, double* %11
%21 = load i32, i32* @M_PI
%22 = sitofp i32 %21 to double
%23 = fdiv double 3.000000e+00, %22
%24 = fptosi double %23 to i32
%25 = call double @pow(i32 %24, i32 0)
%26 = fmul double 7.500000e-01, %25
store double %26, double* %12
%27 = load double, double* %6
%28 = load double, double* %7
%29 = fadd double %27, %28
store double %29, double* %13
%30 = load double, double* %13
%31 = fcmp ogt double %30, 1.000000e-10
br i1 %31, label %32, label %121
32: ; preds = %5
%33 = load double, double* %6
%34 = load double, double* %7
%35 = fsub double %33, %34
%36 = load double, double* %13
%37 = fdiv double %35, %36
store double %37, double* %14
%38 = load double, double* %14
%39 = fadd double 1.000000e+00, %38
%40 = fptosi double %39 to i32
%41 = call double @pow(i32 %40, i32 1)
%42 = load double, double* %14
%43 = fsub double 1.000000e+00, %42
%44 = fptosi double %43 to i32
%45 = call double @pow(i32 %44, i32 1)
%46 = fadd double %41, %45
%47 = fsub double %46, 2.000000e+00
%48 = fdiv double %47, 2.000000e+00
%49 = call double @pow(i32 2, i32 0)
%50 = fsub double %49, 1.000000e+00
%51 = fdiv double %48, %50
store double %51, double* %15
%52 = load double, double* %14
%53 = fadd double 1.000000e+00, %52
%54 = fptosi double %53 to i32
%55 = call double @pow(i32 %54, i32 0)
%56 = load double, double* %14
%57 = fsub double 1.000000e+00, %56
%58 = fptosi double %57 to i32
%59 = call double @pow(i32 %58, i32 0)
%60 = fsub double %55, %59
%61 = fmul double 0x3FF5555555555555, %60
%62 = fdiv double %61, 2.000000e+00
%63 = call double @pow(i32 2, i32 0)
%64 = fsub double %63, 1.000000e+00
%65 = fdiv double %62, %64
store double %65, double* %16
%66 = load double, double* %11
%67 = fmul double -1.500000e+00, %66
%68 = load double, double* %12
%69 = fmul double %67, %68
%70 = load double, double* %13
%71 = fptosi double %70 to i32
%72 = call double @pow(i32 %71, i32 0)
%73 = fmul double %69, %72
store double %73, double* %17
%74 = call double @pow(i32 2, i32 0)
%75 = load double, double* %17
%76 = fmul double %74, %75
store double %76, double* %18
%77 = load double, double* %17
%78 = load double, double* %18
%79 = load double, double* %17
%80 = fsub double %78, %79
%81 = load double, double* %15
%82 = call double @llvm.fmuladd.f64(double %80, double %81, double %77)
store double %82, double* %19
%83 = load double, double* %18
%84 = load double, double* %17
%85 = fsub double %83, %84
store double %85, double* %20
%86 = load double, double* %19
%87 = load double, double* %19
%88 = call double @llvm.fmuladd.f64(double 0x3FD5555555555555, double %87, double %86)
%89 = load double, double* %20
%90 = load double, double* %16
%91 = fmul double %89, %90
%92 = fmul double %91, 2.000000e+00
%93 = load double, double* %7
%94 = fmul double %92, %93
%95 = load double, double* %13
%96 = fdiv double %94, %95
%97 = fadd double %88, %96
%98 = load double*, double** %9
%99 = load double, double* %98
%100 = fadd double %99, %97
store double %100, double* %98
%101 = load double, double* %19
%102 = load double, double* %19
%103 = call double @llvm.fmuladd.f64(double 0x3FD5555555555555, double %102, double %101)
%104 = load double, double* %20
%105 = load double, double* %16
%106 = fmul double %104, %105
%107 = fmul double %106, 2.000000e+00
%108 = load double, double* %6
%109 = fmul double %107, %108
%110 = load double, double* %13
%111 = fdiv double %109, %110
%112 = fsub double %103, %111
%113 = load double*, double** %10
%114 = load double, double* %113
%115 = fadd double %114, %112
store double %115, double* %113
%116 = load double, double* %19
%117 = load double, double* %13
%118 = load double*, double** %8
%119 = load double, double* %118
%120 = call double @llvm.fmuladd.f64(double %116, double %117, double %119)
store double %120, double* %118
br label %121
121: ; preds = %32, %5
ret void
}

LLVM IR (-O2):
@M_PI = global i32 0
define void @getDFT_xSlater(double %0, double %1, double* nocapture %2, double* nocapture %3, double* nocapture %4) {
%6 = load i32, i32* @M_PI
%7 = sitofp i32 %6 to double
%8 = fdiv double 3.000000e+00, %7
%9 = fptosi double %8 to i32
%10 = tail call double @pow(i32 %9, i32 0)
%11 = fadd double %0, %1
%12 = fcmp ogt double %11, 1.000000e-10
br i1 %12, label %13, label %59
13: ; preds = %5
%14 = fsub double %0, %1
%15 = fdiv double %14, %11
%16 = fadd double %15, 1.000000e+00
%17 = fptosi double %16 to i32
%18 = tail call double @pow(i32 %17, i32 1)
%19 = fsub double 1.000000e+00, %15
%20 = fptosi double %19 to i32
%21 = tail call double @pow(i32 %20, i32 1)
%22 = fadd double %18, %21
%23 = fadd double %22, -2.000000e+00
%24 = fmul double %23, 5.000000e-01
%25 = tail call double @pow(i32 2, i32 0)
%26 = fadd double %25, -1.000000e+00
%27 = fdiv double %24, %26
%28 = tail call double @pow(i32 %17, i32 0)
%29 = tail call double @pow(i32 %20, i32 0)
%30 = fsub double %28, %29
%31 = fmul double %30, 0x3FF5555555555555
%32 = fmul double %31, 5.000000e-01
%33 = tail call double @pow(i32 2, i32 0)
%34 = fadd double %33, -1.000000e+00
%35 = fdiv double %32, %34
%36 = fmul double %10, -7.500000e-01
%37 = fptosi double %11 to i32
%38 = tail call double @pow(i32 %37, i32 0)
%39 = fmul double %36, %38
%40 = tail call double @pow(i32 2, i32 0)
%41 = fmul double %40, %39
%42 = fsub double %41, %39
%43 = tail call double @llvm.fmuladd.f64(double %42, double %27, double %39)
%44 = tail call double @llvm.fmuladd.f64(double %43, double 0x3FD5555555555555, double %43)
%45 = fmul double %35, %42
%46 = fmul double %45, 2.000000e+00
%47 = fmul double %46, %1
%48 = fdiv double %47, %11
%49 = fadd double %44, %48
%50 = load double, double* %3
%51 = fadd double %50, %49
store double %51, double* %3
%52 = fmul double %46, %0
%53 = fdiv double %52, %11
%54 = fsub double %44, %53
%55 = load double, double* %4
%56 = fadd double %55, %54
store double %56, double* %4
%57 = load double, double* %2
%58 = tail call double @llvm.fmuladd.f64(double %43, double %11, double %57)
store double %58, double* %2
br label %59
59: ; preds = %13, %5
ret void
}