#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*/ FastCalcRMSDAndRotation(double *, double *, double *, double,
                                           int const, int);
double InnerProduct(double *, double **, double **, int const, double const *);
double CalcRMSDRotationalMatrix(double **coords1, double **coords2,
                                const int len, double *rot,
                                const double *weight) {
  double A[9], rmsd;
  double E0 = InnerProduct(A, coords1, coords2, len, weight);
  FastCalcRMSDAndRotation(rot, A, &rmsd, E0, len, -1);
  return rmsd;
}


x86 assembly (clang, -O0):
<CalcRMSDRotationalMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1030 <InnerProduct@plt>
movsd  %xmm0,-0x80(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x70(%rbp),%rsi
movsd  -0x80(%rbp),%xmm0
mov    -0x14(%rbp),%ecx
lea    -0x78(%rbp),%rdx
mov    $0xffffffff,%r8d
call   1040 <FastCalcRMSDAndRotation@plt>
movsd  -0x78(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcRMSDRotationalMatrix>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %ebp,%ecx
call   1030 <InnerProduct@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%ecx
mov    $0xffffffff,%r8d
call   1040 <FastCalcRMSDAndRotation@plt>
movsd  0x8(%rsp),%xmm0
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @CalcRMSDRotationalMatrix(double** %0, double** %1, i32 %2, double* %3, double* %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca [9 x double]
%12 = alloca double
%13 = alloca double
store double** %0, double*** %6
store double** %1, double*** %7
store i32 %2, i32* %8
store double* %3, double** %9
store double* %4, double** %10
%14 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%15 = load double**, double*** %6
%16 = load double**, double*** %7
%17 = load i32, i32* %8
%18 = load double*, double** %10
%19 = call double @InnerProduct(double* %14, double** %15, double** %16, i32 %17, double* %18)
store double %19, double* %13
%20 = load double*, double** %9
%21 = getelementptr inbounds [9 x double], [9 x double]* %11, i64 0, i64 0
%22 = load double, double* %13
%23 = load i32, i32* %8
%24 = call i32 @FastCalcRMSDAndRotation(double* %20, double* %21, double* %12, double %22, i32 %23, i32 -1)
%25 = load double, double* %12
ret double %25
}

LLVM IR (-O2):
define double @CalcRMSDRotationalMatrix(double** %0, double** %1, i32 %2, double* %3, double* %4) {
%6 = alloca [9 x double]
%7 = alloca double
%8 = bitcast [9 x double]* %6 to i8*
%9 = bitcast double* %7 to i8*
%10 = getelementptr inbounds [9 x double], [9 x double]* %6, i64 0, i64 0
%11 = call double @InnerProduct(double* %10, double** %0, double** %1, i32 %2, double* %4)
%12 = call i32 @FastCalcRMSDAndRotation(double* %3, double* %10, double* %7, double %11, i32 %2, i32 -1)
%13 = load double, double* %7
ret double %13
}