#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*/ multiply_array_array(double *, double *, double *, int, int);
int /*<<< orphan*/ subtract_array_number(double *, double *, double, int, int);
void calculate_msd_one(double *out, double *x, double *xo, int nlns) {
  double xdlt[nlns];
  double xodlt[nlns];
  subtract_array_number(xdlt, x, x[0], 1, nlns);
  subtract_array_number(xodlt, xo, xo[0], 1, nlns);
  multiply_array_array(out, xdlt, xodlt, 1, nlns);
}


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

x86 assembly (clang, -O2):
<calculate_msd_one>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdx,%r15
mov    %rdi,%r14
mov    %ecx,%eax
mov    %rsp,%r13
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
movsd  (%rsi),%xmm0
mov    %r13,%rdi
mov    $0x1,%edx
call   1030 <subtract_array_number@plt>
movsd  (%r15),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
mov    %r12d,%ecx
call   1030 <subtract_array_number@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
mov    $0x1,%ecx
mov    %r12d,%r8d
call   1040 <multiply_array_array@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_one(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%12 = load i32, i32* %8
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %9
%15 = alloca double, i64 %13
store i64 %13, i64* %10
%16 = load i32, i32* %8
%17 = zext i32 %16 to i64
%18 = alloca double, i64 %17
store i64 %17, i64* %11
%19 = load double*, double** %6
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = load i32, i32* %8
%24 = call i32 @subtract_array_number(double* %15, double* %19, double %22, i32 1, i32 %23)
%25 = load double*, double** %7
%26 = load double*, double** %7
%27 = getelementptr inbounds double, double* %26, i64 0
%28 = load double, double* %27
%29 = load i32, i32* %8
%30 = call i32 @subtract_array_number(double* %18, double* %25, double %28, i32 1, i32 %29)
%31 = load double*, double** %5
%32 = load i32, i32* %8
%33 = call i32 @multiply_array_array(double* %31, double* %15, double* %18, i32 1, i32 %32)
%34 = load i8*, i8** %9
ret void
}

LLVM IR (-O2):
define void @calculate_msd_one(double* %0, double* %1, double* %2, i32 %3) {
%5 = zext i32 %3 to i64
%6 = alloca double, i64 %5
%7 = alloca double, i64 %5
%8 = load double, double* %1
%9 = call i32 @subtract_array_number(double* %6, double* %1, double %8, i32 1, i32 %3)
%10 = load double, double* %2
%11 = call i32 @subtract_array_number(double* %7, double* %2, double %10, i32 1, i32 %3)
%12 = call i32 @multiply_array_array(double* %0, double* %6, double* %7, i32 1, i32 %3)
ret void
}