#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(double **, int const);
double QuatCharPoly(double const **, double const **, int const, double *);
int /*<<< orphan*/ fabs(double);
double sqrt(int /*<<< orphan*/);
double QCP_rmsd(double **coords1, double **coords2, const int len,
                double *coeff) {
  double sumdev2, rmsd;
  CenterCoords(coords1, len);
  CenterCoords(coords2, len);
  sumdev2 = QuatCharPoly((const double **)coords1, (const double **)coords2,
                         len, coeff);
  rmsd = sqrt(fabs(sumdev2 / len));
  return rmsd;
}


x86 assembly (clang, -O0):
<QCP_rmsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%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>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <QuatCharPoly@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <fabs@plt>
mov    %eax,%edi
call   1060 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QCP_rmsd>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <CenterCoords@plt>
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <CenterCoords@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %r14,%rcx
call   1040 <QuatCharPoly@plt>
cvtsi2sd %ebp,%xmm1
divsd  %xmm1,%xmm0
call   1050 <fabs@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <sqrt@plt>

LLVM IR (-O0):
define double @QCP_rmsd(double** %0, double** %1, i32 %2, double* %3) {
%5 = alloca double**
%6 = alloca double**
%7 = alloca i32
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double** %0, double*** %5
store double** %1, double*** %6
store i32 %2, i32* %7
store double* %3, double** %8
%11 = load double**, double*** %5
%12 = load i32, i32* %7
%13 = call i32 @CenterCoords(double** %11, i32 %12)
%14 = load double**, double*** %6
%15 = load i32, i32* %7
%16 = call i32 @CenterCoords(double** %14, i32 %15)
%17 = load double**, double*** %5
%18 = load double**, double*** %6
%19 = load i32, i32* %7
%20 = load double*, double** %8
%21 = call double @QuatCharPoly(double** %17, double** %18, i32 %19, double* %20)
store double %21, double* %9
%22 = load double, double* %9
%23 = load i32, i32* %7
%24 = sitofp i32 %23 to double
%25 = fdiv double %22, %24
%26 = call i32 @fabs(double %25)
%27 = call double @sqrt(i32 %26)
store double %27, double* %10
%28 = load double, double* %10
ret double %28
}

LLVM IR (-O2):
define double @QCP_rmsd(double** %0, double** %1, i32 %2, double* %3) {
%5 = tail call i32 @CenterCoords(double** %0, i32 %2)
%6 = tail call i32 @CenterCoords(double** %1, i32 %2)
%7 = tail call double @QuatCharPoly(double** %0, double** %1, i32 %2, double* %3)
%8 = sitofp i32 %2 to double
%9 = fdiv double %7, %8
%10 = tail call i32 @fabs(double %9)
%11 = tail call double @sqrt(i32 %10)
ret double %11
}