#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 pow(double, int);
double sqrt(double);
double cart_norm(double a, int *ijk) {
  static int dfac[] = {1, 1, 2, 3, 8, 15, 48, 105, 384, 945, 3840};
  static double inv_dfac[] = {1.0,       1.0,       1 / 2.0,   1 / 3.0,
                              1 / 8.0,   1 / 15.0,  1 / 48.0,  1 / 105.0,
                              1 / 384.0, 1 / 945.0, 1 / 3840.0};
  static const double PI = 3.14159265358979323846;
  int i = ijk[0];
  int j = ijk[1];
  int k = ijk[2];
  double ni = pow(2.0 * a / PI, 0.25) * sqrt(pow(4.0 * a, i) * inv_dfac[i]);
  double nj = pow(2.0 * a / PI, 0.25) * sqrt(pow(4.0 * a, j) * inv_dfac[j]);
  double nk = pow(2.0 * a / PI, 0.25) * sqrt(pow(4.0 * a, k) * inv_dfac[k]);
  return ni * nj * nk;
}


x86 assembly (clang, -O0):
<cart_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x1c(%rbp)
movsd  0xeba(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  0xe85(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <pow@plt>
movslq -0x14(%rbp),%rcx
lea    0x2edd(%rip),%rax
mulsd  (%rax,%rcx,8),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe5a(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe45(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xe25(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%edi
call   1030 <pow@plt>
movslq -0x18(%rbp),%rcx
lea    0x2e7d(%rip),%rax
mulsd  (%rax,%rcx,8),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xdfa(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xde5(%rip),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xdc5(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x1c(%rbp),%edi
call   1030 <pow@plt>
movslq -0x1c(%rbp),%rcx
lea    0x2e1d(%rip),%rax
mulsd  (%rax,%rcx,8),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cart_norm>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
movslq (%rdi),%rbx
movslq 0x4(%rdi),%r15
movslq 0x8(%rdi),%r14
addsd  %xmm0,%xmm0
divsd  0xeb8(%rip),%xmm0
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xea0(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1030 <pow@plt>
lea    0xea4(%rip),%r12
mulsd  (%r12,%rbx,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1192 <cart_norm+0x72>
sqrtsd %xmm0,%xmm0
jmp    1197 <cart_norm+0x77>
call   1040 <sqrt@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %r15d,%edi
call   1030 <pow@plt>
mulsd  (%r12,%r15,8),%xmm0
ucomisd 0xe45(%rip),%xmm0
jb     11d3 <cart_norm+0xb3>
sqrtsd %xmm0,%xmm0
jmp    11d8 <cart_norm+0xb8>
call   1040 <sqrt@plt>
movsd  0x18(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  (%rsp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mov    %r14d,%edi
call   1030 <pow@plt>
mulsd  (%r12,%r14,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     122f <cart_norm+0x10f>
sqrtsd %xmm0,%xmm0
jmp    1234 <cart_norm+0x114>
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@cart_norm.dfac = internal global [11 x i32] [i32 1, i32 1, i32 2, i32 3, i32 8, i32 15, i32 48, i32 105, i32 384, i32 945, i32 3840]
@cart_norm.inv_dfac = internal global [11 x double] [double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 0x3FD5555555555555, double 1.250000e-01, double 0x3FB1111111111111, double 0x3F95555555555555, double 0x3F83813813813814, double 0x3F65555555555555, double 0x3F51566ABC011567, double 0x3F31111111111111]
@cart_norm.PI = internal constant double 0x400921FB54442D18
define double @cart_norm(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %3
store i32* %1, i32** %4
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
store i32 %16, i32* %6
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = load i32, i32* %18
store i32 %19, i32* %7
%20 = load double, double* %3
%21 = fmul double 2.000000e+00, %20
%22 = fdiv double %21, 0x400921FB54442D18
%23 = call double @pow(double %22, i32 0)
%24 = load double, double* %3
%25 = fmul double 4.000000e+00, %24
%26 = load i32, i32* %5
%27 = call double @pow(double %25, i32 %26)
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [11 x double], [11 x double]* @cart_norm.inv_dfac, i64 0, i64 %29
%31 = load double, double* %30
%32 = fmul double %27, %31
%33 = call double @sqrt(double %32)
%34 = fmul double %23, %33
store double %34, double* %8
%35 = load double, double* %3
%36 = fmul double 2.000000e+00, %35
%37 = fdiv double %36, 0x400921FB54442D18
%38 = call double @pow(double %37, i32 0)
%39 = load double, double* %3
%40 = fmul double 4.000000e+00, %39
%41 = load i32, i32* %6
%42 = call double @pow(double %40, i32 %41)
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [11 x double], [11 x double]* @cart_norm.inv_dfac, i64 0, i64 %44
%46 = load double, double* %45
%47 = fmul double %42, %46
%48 = call double @sqrt(double %47)
%49 = fmul double %38, %48
store double %49, double* %9
%50 = load double, double* %3
%51 = fmul double 2.000000e+00, %50
%52 = fdiv double %51, 0x400921FB54442D18
%53 = call double @pow(double %52, i32 0)
%54 = load double, double* %3
%55 = fmul double 4.000000e+00, %54
%56 = load i32, i32* %7
%57 = call double @pow(double %55, i32 %56)
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [11 x double], [11 x double]* @cart_norm.inv_dfac, i64 0, i64 %59
%61 = load double, double* %60
%62 = fmul double %57, %61
%63 = call double @sqrt(double %62)
%64 = fmul double %53, %63
store double %64, double* %10
%65 = load double, double* %8
%66 = load double, double* %9
%67 = fmul double %65, %66
%68 = load double, double* %10
%69 = fmul double %67, %68
ret double %69
}

LLVM IR (-O2):
@cart_norm.inv_dfac = internal unnamed_addr constant [11 x double] [double 1.000000e+00, double 1.000000e+00, double 5.000000e-01, double 0x3FD5555555555555, double 1.250000e-01, double 0x3FB1111111111111, double 0x3F95555555555555, double 0x3F83813813813814, double 0x3F65555555555555, double 0x3F51566ABC011567, double 0x3F31111111111111]
define double @cart_norm(double %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = load i32, i32* %6
%8 = fmul double %0, 2.000000e+00
%9 = fdiv double %8, 0x400921FB54442D18
%10 = tail call double @pow(double %9, i32 0)
%11 = fmul double %0, 4.000000e+00
%12 = tail call double @pow(double %11, i32 %3)
%13 = sext i32 %3 to i64
%14 = getelementptr inbounds [11 x double], [11 x double]* @cart_norm.inv_dfac, i64 0, i64 %13
%15 = load double, double* %14
%16 = fmul double %12, %15
%17 = tail call double @sqrt(double %16)
%18 = fmul double %10, %17
%19 = tail call double @pow(double %9, i32 0)
%20 = tail call double @pow(double %11, i32 %5)
%21 = sext i32 %5 to i64
%22 = getelementptr inbounds [11 x double], [11 x double]* @cart_norm.inv_dfac, i64 0, i64 %21
%23 = load double, double* %22
%24 = fmul double %20, %23
%25 = tail call double @sqrt(double %24)
%26 = fmul double %19, %25
%27 = tail call double @pow(double %9, i32 0)
%28 = tail call double @pow(double %11, i32 %7)
%29 = sext i32 %7 to i64
%30 = getelementptr inbounds [11 x double], [11 x double]* @cart_norm.inv_dfac, i64 0, i64 %29
%31 = load double, double* %30
%32 = fmul double %28, %31
%33 = tail call double @sqrt(double %32)
%34 = fmul double %27, %33
%35 = fmul double %18, %26
%36 = fmul double %35, %34
ret double %36
}