#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*/ CenterCoords(float **, int const);
int /*<<< orphan*/ FastCalcRMSDAndRotation(float *, float *, float *, float,
                                           int const, int);
float InnerProduct(float *, float **, float **, int const, float const *);
float CalcRMSDRotationalMatrix(float **coords1, float **coords2, const int len,
                               float *rot, const float *weight) {
  float A[9], rmsd;
  CenterCoords(coords1, len);
  CenterCoords(coords2, len);
  float 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    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <CenterCoords@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <CenterCoords@plt>
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1040 <InnerProduct@plt>
movss  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rsi
movss  -0x58(%rbp),%xmm0
mov    -0x14(%rbp),%ecx
lea    -0x54(%rbp),%rdx
mov    $0xffffffff,%r8d
call   1050 <FastCalcRMSDAndRotation@plt>
movss  -0x54(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcRMSDRotationalMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,%r15
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r12
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <CenterCoords@plt>
mov    %r12,%rdi
mov    %ebp,%esi
call   1030 <CenterCoords@plt>
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %ebp,%ecx
mov    %r15,%r8
call   1040 <InnerProduct@plt>
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
mov    %r13,%rsi
mov    %ebp,%ecx
mov    $0xffffffff,%r8d
call   1050 <FastCalcRMSDAndRotation@plt>
movss  0xc(%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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