#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*/ add_arrays_inplace(double *, double *, int, int);
int /*<<< orphan*/ calculate_msd_one(double *, double *, double *, int);
void calculate_msd_xyz_cross(double *out, double *xi, double *yi, double *zi,
                             double *xj, double *yj, double *zj, int nlns) {
  double tmp[nlns];
  calculate_msd_one(out, xi, xj, nlns);
  calculate_msd_one(tmp, yi, yj, nlns);
  add_arrays_inplace(out, tmp, 1, nlns);
  calculate_msd_one(tmp, zi, zj, nlns);
  add_arrays_inplace(out, tmp, 1, nlns);
}


x86 assembly (clang, -O0):
<calculate_msd_xyz_cross>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    0x18(%rbp),%ecx
call   1040 <calculate_msd_one@plt>
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    0x18(%rbp),%ecx
call   1040 <calculate_msd_one@plt>
mov    -0x48(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%ecx
mov    $0x1,%edx
call   1030 <add_arrays_inplace@plt>
mov    -0x48(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    0x18(%rbp),%ecx
call   1040 <calculate_msd_one@plt>
mov    -0x48(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%ecx
mov    $0x1,%edx
call   1030 <add_arrays_inplace@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_msd_xyz_cross>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r12
mov    %rcx,-0x30(%rbp)
mov    %rdx,%r15
mov    %rdi,%r13
mov    0x18(%rbp),%r14d
mov    %rsp,%rbx
lea    0xf(,%r14,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %r8,%rdx
mov    %r14d,%ecx
call   1040 <calculate_msd_one@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14d,%ecx
call   1040 <calculate_msd_one@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    %r14d,%ecx
call   1030 <add_arrays_inplace@plt>
mov    %rbx,%rdi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    %r14d,%ecx
call   1040 <calculate_msd_one@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    %r14d,%ecx
call   1030 <add_arrays_inplace@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @calculate_msd_xyz_cross(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i64
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store i32 %7, i32* %16
%19 = load i32, i32* %16
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %17
%22 = alloca double, i64 %20
store i64 %20, i64* %18
%23 = load double*, double** %9
%24 = load double*, double** %10
%25 = load double*, double** %13
%26 = load i32, i32* %16
%27 = call i32 @calculate_msd_one(double* %23, double* %24, double* %25, i32 %26)
%28 = load double*, double** %11
%29 = load double*, double** %14
%30 = load i32, i32* %16
%31 = call i32 @calculate_msd_one(double* %22, double* %28, double* %29, i32 %30)
%32 = load double*, double** %9
%33 = load i32, i32* %16
%34 = call i32 @add_arrays_inplace(double* %32, double* %22, i32 1, i32 %33)
%35 = load double*, double** %12
%36 = load double*, double** %15
%37 = load i32, i32* %16
%38 = call i32 @calculate_msd_one(double* %22, double* %35, double* %36, i32 %37)
%39 = load double*, double** %9
%40 = load i32, i32* %16
%41 = call i32 @add_arrays_inplace(double* %39, double* %22, i32 1, i32 %40)
%42 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @calculate_msd_xyz_cross(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, i32 %7) {
%9 = zext i32 %7 to i64
%10 = alloca double, i64 %9
%11 = tail call i32 @calculate_msd_one(double* %0, double* %1, double* %4, i32 %7)
%12 = call i32 @calculate_msd_one(double* %10, double* %2, double* %5, i32 %7)
%13 = call i32 @add_arrays_inplace(double* %0, double* %10, i32 1, i32 %7)
%14 = call i32 @calculate_msd_one(double* %10, double* %3, double* %6, i32 %7)
%15 = call i32 @add_arrays_inplace(double* %0, double* %10, i32 1, i32 %7)
ret void
}