#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 /*<<< orphan*/ gint2_nai_S_cD(double *, double, double *, double, double *,
                                  double *);
void gint2_nai_S_pD(double *a, double a_a, double *b, double b_a, double *c,
                    double *out) {
  double tmp0, tmp1;
  gint2_nai_S_cD(a, a_a, b, b_a, c, out);
  tmp0 = out[2];
  out[2] = out[4];
  tmp1 = out[5] - 0.5 * out[0] - 0.5 * out[3];
  out[3] = 0.866025403784439 * out[0] - 0.866025403784439 * out[3];
  out[0] = tmp1;
  out[4] = out[1];
  out[1] = tmp0;
}


x86 assembly (clang, -O0):
<gint2_nai_S_pD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
movsd  -0x20(%rbp),%xmm1
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1030 <gint2_nai_S_cD@plt>
mov    -0x30(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x30(%rbp),%rax
movsd  0x20(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x30(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xe7e(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x30(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xe65(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  0xe3c(%rip),%xmm1
mulsd  0x18(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe18(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x18(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gint2_nai_S_pD>:
push   %rbx
mov    %rcx,%rbx
call   1030 <gint2_nai_S_cD@plt>
movsd  0x10(%rbx),%xmm0
movsd  0x20(%rbx),%xmm1
movsd  %xmm1,0x10(%rbx)
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm2
movsd  0xec7(%rip),%xmm3
movapd %xmm1,%xmm4
mulsd  %xmm3,%xmm4
addsd  0x28(%rbx),%xmm4
movsd  0x18(%rbx),%xmm5
mulsd  %xmm5,%xmm3
mulsd  0xeb1(%rip),%xmm5
addsd  %xmm4,%xmm3
mulsd  0xead(%rip),%xmm1
addsd  %xmm5,%xmm1
movsd  %xmm1,0x18(%rbx)
movsd  %xmm3,(%rbx)
movsd  %xmm2,0x20(%rbx)
movsd  %xmm0,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @gint2_nai_S_pD(double* %0, double %1, double* %2, double %3, double* %4, double* %5) {
%7 = alloca double*
%8 = alloca double
%9 = alloca double*
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
store double* %0, double** %7
store double %1, double* %8
store double* %2, double** %9
store double %3, double* %10
store double* %4, double** %11
store double* %5, double** %12
%15 = load double*, double** %7
%16 = load double, double* %8
%17 = load double*, double** %9
%18 = load double, double* %10
%19 = load double*, double** %11
%20 = load double*, double** %12
%21 = call i32 @gint2_nai_S_cD(double* %15, double %16, double* %17, double %18, double* %19, double* %20)
%22 = load double*, double** %12
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
store double %24, double* %13
%25 = load double*, double** %12
%26 = getelementptr inbounds double, double* %25, i64 4
%27 = load double, double* %26
%28 = load double*, double** %12
%29 = getelementptr inbounds double, double* %28, i64 2
store double %27, double* %29
%30 = load double*, double** %12
%31 = getelementptr inbounds double, double* %30, i64 5
%32 = load double, double* %31
%33 = load double*, double** %12
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %35, double %32)
%37 = load double*, double** %12
%38 = getelementptr inbounds double, double* %37, i64 3
%39 = load double, double* %38
%40 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %39, double %36)
store double %40, double* %14
%41 = load double*, double** %12
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = load double*, double** %12
%45 = getelementptr inbounds double, double* %44, i64 3
%46 = load double, double* %45
%47 = fmul double 0x3FEBB67AE8584CAE, %46
%48 = fneg double %47
%49 = call double @llvm.fmuladd.f64(double 0x3FEBB67AE8584CAE, double %43, double %48)
%50 = load double*, double** %12
%51 = getelementptr inbounds double, double* %50, i64 3
store double %49, double* %51
%52 = load double, double* %14
%53 = load double*, double** %12
%54 = getelementptr inbounds double, double* %53, i64 0
store double %52, double* %54
%55 = load double*, double** %12
%56 = getelementptr inbounds double, double* %55, i64 1
%57 = load double, double* %56
%58 = load double*, double** %12
%59 = getelementptr inbounds double, double* %58, i64 4
store double %57, double* %59
%60 = load double, double* %13
%61 = load double*, double** %12
%62 = getelementptr inbounds double, double* %61, i64 1
store double %60, double* %62
ret void
}

LLVM IR (-O2):
define void @gint2_nai_S_pD(double* %0, double %1, double* %2, double %3, double* %4, double* %5) {
%7 = tail call i32 @gint2_nai_S_cD(double* %0, double %1, double* %2, double %3, double* %4, double* %5)
%8 = getelementptr inbounds double, double* %5, i64 2
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %5, i64 4
%11 = load double, double* %10
store double %11, double* %8
%12 = getelementptr inbounds double, double* %5, i64 5
%13 = load double, double* %12
%14 = load double, double* %5
%15 = tail call double @llvm.fmuladd.f64(double %14, double -5.000000e-01, double %13)
%16 = getelementptr inbounds double, double* %5, i64 3
%17 = load double, double* %16
%18 = tail call double @llvm.fmuladd.f64(double %17, double -5.000000e-01, double %15)
%19 = fmul double %17, 0xBFEBB67AE8584CAE
%20 = tail call double @llvm.fmuladd.f64(double %14, double 0x3FEBB67AE8584CAE, double %19)
store double %20, double* %16
store double %18, double* %5
%21 = getelementptr inbounds double, double* %5, i64 1
%22 = load double, double* %21
store double %22, double* %10
store double %9, double* %21
ret void
}