#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*/ a_to_aca(float *, float *, float *, int);
double itakura(int, float *, float *, float *, float *);
int /*<<< orphan*/ lpc(int, float, int, float const *, float *, float *,
                       float *, float *, float *, float);
int /*<<< orphan*/ retrieve_windstat(float *, int, float *, float *);
int /*<<< orphan*/ save_windstat(float *, int, float, float);
float wind_energy(float const *, int);
float get_similarity(int order, int size, const float *pdata,
                     const float *cdata, float *rmsa, float *rms_ratio,
                     float pre, float stab, int init) {
  float rho3[100 + 1], err3, rms3, rmsd3, b0, t, a2[100 + 1], rho1[100 + 1],
      a1[100 + 1], b[100 + 1], err1, rms1, rmsd1;
  lpc(order, stab, size - 1, cdata, a2, rho3, (float *)NULL, &err3, &rmsd3,
      pre);
  rms3 = wind_energy(cdata, size);
  if (!init) {
    if (!retrieve_windstat(rho1, order, &err1, &rms1)) {
      lpc(order, stab, size - 1, pdata, a1, rho1, (float *)NULL, &err1, &rmsd1,
          pre);
      rms1 = wind_energy(pdata, size);
    }
    a_to_aca(a2 + 1, b, &b0, order);
    t = itakura(order, b, &b0, rho1 + 1, &err1) - .8;
    if (rms1 > 0.0)
      *rms_ratio = (0.001 + rms3) / rms1;
    else if (rms3 > 0.0)
      *rms_ratio = 2.0;
    else
      *rms_ratio = 1.0;
  } else {
    *rms_ratio = 1.0;
    t = 10.0;
  }
  *rmsa = rms3;
  save_windstat(rho3, order, err3, rms3);
  return ((float)(0.2 / t));
}


x86 assembly (clang, -O0):
<get_similarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x880,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movss  %xmm0,-0x2c(%rbp)
movss  %xmm1,-0x30(%rbp)
mov    -0x4(%rbp),%edi
movss  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%rdx
lea    -0x380(%rbp),%rcx
lea    -0x1d0(%rbp),%r8
movss  -0x2c(%rbp),%xmm1
xor    %eax,%eax
mov    %eax,%r9d
lea    -0x1d4(%rbp),%r10
lea    -0x1dc(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1060 <lpc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <wind_energy@plt>
movss  %xmm0,-0x1d8(%rbp)
ff
cmpl   $0x0,0x10(%rbp)
jne    136d <get_similarity+0x20d>
lea    -0x520(%rbp),%rdi
mov    -0x4(%rbp),%esi
lea    -0x864(%rbp),%rdx
lea    -0x868(%rbp),%rcx
call   1030 <retrieve_windstat@plt>
cmp    $0x0,%eax
jne    1272 <get_similarity+0x112>
mov    -0x4(%rbp),%edi
movss  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%rdx
lea    -0x6c0(%rbp),%rcx
lea    -0x520(%rbp),%r8
movss  -0x2c(%rbp),%xmm1
xor    %eax,%eax
mov    %eax,%r9d
lea    -0x864(%rbp),%r10
lea    -0x86c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1060 <lpc@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <wind_energy@plt>
movss  %xmm0,-0x868(%rbp)
ff
lea    -0x380(%rbp),%rdi
add    $0x4,%rdi
lea    -0x860(%rbp),%rsi
mov    -0x4(%rbp),%ecx
lea    -0x1e0(%rbp),%rdx
call   1050 <a_to_aca@plt>
mov    -0x4(%rbp),%edi
lea    -0x860(%rbp),%rsi
lea    -0x520(%rbp),%rcx
add    $0x4,%rcx
lea    -0x1e0(%rbp),%rdx
lea    -0x864(%rbp),%r8
call   1080 <itakura@plt>
movsd  0xd3d(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1e4(%rbp)
ff
movss  -0x868(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1325 <get_similarity+0x1c5>
movss  -0x1d8(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movsd  0xd08(%rip),%xmm0
addsd  %xmm1,%xmm0
movss  -0x868(%rbp),%xmm1
ff
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
jmp    1368 <get_similarity+0x208>
movss  -0x1d8(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1353 <get_similarity+0x1f3>
mov    -0x28(%rbp),%rax
movss  0xcd2(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    1363 <get_similarity+0x203>
mov    -0x28(%rbp),%rax
movss  0xcb9(%rip),%xmm0
movss  %xmm0,(%rax)
jmp    1368 <get_similarity+0x208>
jmp    138d <get_similarity+0x22d>
mov    -0x28(%rbp),%rax
movss  0xc9f(%rip),%xmm0
movss  %xmm0,(%rax)
movss  0xc9b(%rip),%xmm0
movss  %xmm0,-0x1e4(%rbp)
ff
movss  -0x1d8(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
lea    -0x1d0(%rbp),%rdi
mov    -0x4(%rbp),%esi
movss  -0x1d4(%rbp),%xmm0
ff
movss  -0x1d8(%rbp),%xmm1
ff
call   1070 <save_windstat@plt>
movss  -0x1e4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm1
movsd  0xc40(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x880,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_similarity>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x848,%rsp
movaps %xmm0,%xmm2
mov    %r9,0x10(%rsp)
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r12
mov    %esi,%ebx
mov    %edi,%r13d
lea    -0x1(%rbx),%ebp
lea    0x2c(%rsp),%rax
lea    0x20(%rsp),%r10
lea    0x1d0(%rsp),%rcx
lea    0x370(%rsp),%r8
movss  %xmm1,0x18(%rsp)
movapd %xmm1,%xmm0
mov    %ebp,%esi
mov    %r14,%rdx
xor    %r9d,%r9d
movss  %xmm2,0x4(%rsp)
movaps %xmm2,%xmm1
push   %rax
push   %r10
call   1060 <lpc@plt>
add    $0x10,%rsp
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <wind_energy@plt>
movapd %xmm0,%xmm2
cmpl   $0x0,0x880(%rsp)
je     11fe <get_similarity+0x9e>
movss  0xe15(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xe0b(%rip),%xmm0
jmp    1305 <get_similarity+0x1a5>
movss  %xmm2,0x8(%rsp)
lea    0x30(%rsp),%rdi
lea    0x1c(%rsp),%r14
lea    0xc(%rsp),%rcx
mov    %r13d,%esi
mov    %r14,%rdx
call   1030 <retrieve_windstat@plt>
test   %eax,%eax
jne    1267 <get_similarity+0x107>
lea    0x24(%rsp),%rax
lea    0x6b0(%rsp),%rcx
lea    0x30(%rsp),%r8
mov    %r13d,%edi
movss  0x18(%rsp),%xmm0
mov    %ebp,%esi
mov    %r12,%rdx
xor    %r9d,%r9d
movss  0x4(%rsp),%xmm1
push   %rax
push   %r14
call   1060 <lpc@plt>
add    $0x10,%rsp
mov    %r12,%rdi
mov    %ebx,%esi
call   1040 <wind_energy@plt>
movss  %xmm0,0xc(%rsp)
lea    0x1d4(%rsp),%rdi
lea    0x510(%rsp),%rbx
lea    0x28(%rsp),%rbp
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r13d,%ecx
call   1050 <a_to_aca@plt>
lea    0x34(%rsp),%rcx
lea    0x1c(%rsp),%r8
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1080 <itakura@plt>
addsd  0xd5e(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsd2ss %xmm0,%xmm2
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
movss  %xmm2,0x4(%rsp)
jbe    12eb <get_similarity+0x18b>
movss  0x8(%rsp),%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
addsd  0xd3e(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
jmp    1305 <get_similarity+0x1a5>
xor    %eax,%eax
movss  0x8(%rsp),%xmm2
ucomiss %xmm1,%xmm2
seta   %al
lea    0xd10(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
mov    0x10(%rsp),%rax
movss  %xmm0,(%rax)
movss  %xmm2,(%r15)
movss  0x20(%rsp),%xmm0
lea    0x370(%rsp),%rdi
mov    %r13d,%esi
movaps %xmm2,%xmm1
call   1070 <save_windstat@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xce2(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x848,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define float @get_similarity(i32 %0, i32 %1, float* %2, float* %3, float* %4, float* %5, float %6, float %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
%15 = alloca float*
%16 = alloca float
%17 = alloca float
%18 = alloca i32
%19 = alloca [101 x float]
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca [101 x float]
%26 = alloca [101 x float]
%27 = alloca [101 x float]
%28 = alloca [101 x float]
%29 = alloca float
%30 = alloca float
%31 = alloca float
store i32 %0, i32* %10
store i32 %1, i32* %11
store float* %2, float** %12
store float* %3, float** %13
store float* %4, float** %14
store float* %5, float** %15
store float %6, float* %16
store float %7, float* %17
store i32 %8, i32* %18
%32 = load i32, i32* %10
%33 = load float, float* %17
%34 = load i32, i32* %11
%35 = sub nsw i32 %34, 1
%36 = load float*, float** %13
%37 = getelementptr inbounds [101 x float], [101 x float]* %25, i64 0, i64 0
%38 = getelementptr inbounds [101 x float], [101 x float]* %19, i64 0, i64 0
%39 = load float, float* %16
%40 = call i32 @lpc(i32 %32, float %33, i32 %35, float* %36, float* %37, float* %38, float* null, float* %20, float* %22, float %39)
%41 = load float*, float** %13
%42 = load i32, i32* %11
%43 = call float @wind_energy(float* %41, i32 %42)
store float %43, float* %21
%44 = load i32, i32* %18
%45 = icmp ne i32 %44, 0
br i1 %45, label %99, label %46
46: ; preds = %9
%47 = getelementptr inbounds [101 x float], [101 x float]* %26, i64 0, i64 0
%48 = load i32, i32* %10
%49 = call i32 @retrieve_windstat(float* %47, i32 %48, float* %29, float* %30)
%50 = icmp ne i32 %49, 0
br i1 %50, label %64, label %51
51: ; preds = %46
%52 = load i32, i32* %10
%53 = load float, float* %17
%54 = load i32, i32* %11
%55 = sub nsw i32 %54, 1
%56 = load float*, float** %12
%57 = getelementptr inbounds [101 x float], [101 x float]* %27, i64 0, i64 0
%58 = getelementptr inbounds [101 x float], [101 x float]* %26, i64 0, i64 0
%59 = load float, float* %16
%60 = call i32 @lpc(i32 %52, float %53, i32 %55, float* %56, float* %57, float* %58, float* null, float* %29, float* %31, float %59)
%61 = load float*, float** %12
%62 = load i32, i32* %11
%63 = call float @wind_energy(float* %61, i32 %62)
store float %63, float* %30
br label %64
64: ; preds = %51, %46
%65 = getelementptr inbounds [101 x float], [101 x float]* %25, i64 0, i64 0
%66 = getelementptr inbounds float, float* %65, i64 1
%67 = getelementptr inbounds [101 x float], [101 x float]* %28, i64 0, i64 0
%68 = load i32, i32* %10
%69 = call i32 @a_to_aca(float* %66, float* %67, float* %23, i32 %68)
%70 = load i32, i32* %10
%71 = getelementptr inbounds [101 x float], [101 x float]* %28, i64 0, i64 0
%72 = getelementptr inbounds [101 x float], [101 x float]* %26, i64 0, i64 0
%73 = getelementptr inbounds float, float* %72, i64 1
%74 = call double @itakura(i32 %70, float* %71, float* %23, float* %73, float* %29)
%75 = fsub double %74, 8.000000e-01
%76 = fptrunc double %75 to float
store float %76, float* %24
%77 = load float, float* %30
%78 = fpext float %77 to double
%79 = fcmp ogt double %78, 0.000000e+00
br i1 %79, label %80, label %89
80: ; preds = %64
%81 = load float, float* %21
%82 = fpext float %81 to double
%83 = fadd double 1.000000e-03, %82
%84 = load float, float* %30
%85 = fpext float %84 to double
%86 = fdiv double %83, %85
%87 = fptrunc double %86 to float
%88 = load float*, float** %15
store float %87, float* %88
br label %98
89: ; preds = %64
%90 = load float, float* %21
%91 = fpext float %90 to double
%92 = fcmp ogt double %91, 0.000000e+00
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = load float*, float** %15
store float 2.000000e+00, float* %94
br label %97
95: ; preds = %89
%96 = load float*, float** %15
store float 1.000000e+00, float* %96
br label %97
97: ; preds = %95, %93
br label %98
98: ; preds = %97, %80
br label %101
99: ; preds = %9
%100 = load float*, float** %15
store float 1.000000e+00, float* %100
store float 1.000000e+01, float* %24
br label %101
101: ; preds = %99, %98
%102 = load float, float* %21
%103 = load float*, float** %14
store float %102, float* %103
%104 = getelementptr inbounds [101 x float], [101 x float]* %19, i64 0, i64 0
%105 = load i32, i32* %10
%106 = load float, float* %20
%107 = load float, float* %21
%108 = call i32 @save_windstat(float* %104, i32 %105, float %106, float %107)
%109 = load float, float* %24
%110 = fpext float %109 to double
%111 = fdiv double 2.000000e-01, %110
%112 = fptrunc double %111 to float
ret float %112
}

LLVM IR (-O2):
define float @get_similarity(i32 %0, i32 %1, float* %2, float* %3, float* nocapture writeonly %4, float* nocapture writeonly %5, float %6, float %7, i32 %8) {
%10 = alloca [101 x float]
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca [101 x float]
%15 = alloca [101 x float]
%16 = alloca [101 x float]
%17 = alloca [101 x float]
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = bitcast [101 x float]* %10 to i8*
%22 = bitcast float* %11 to i8*
%23 = bitcast float* %12 to i8*
%24 = bitcast float* %13 to i8*
%25 = bitcast [101 x float]* %14 to i8*
%26 = bitcast [101 x float]* %15 to i8*
%27 = bitcast [101 x float]* %16 to i8*
%28 = bitcast [101 x float]* %17 to i8*
%29 = bitcast float* %18 to i8*
%30 = bitcast float* %19 to i8*
%31 = bitcast float* %20 to i8*
%32 = add nsw i32 %1, -1
%33 = getelementptr inbounds [101 x float], [101 x float]* %14, i64 0, i64 0
%34 = getelementptr inbounds [101 x float], [101 x float]* %10, i64 0, i64 0
%35 = call i32 @lpc(i32 %0, float %7, i32 %32, float* %3, float* %33, float* %34, float* null, float* %11, float* %12, float %6)
%36 = call float @wind_energy(float* %3, i32 %1)
%37 = icmp eq i32 %8, 0
br i1 %37, label %38, label %65
38: ; preds = %9
%39 = getelementptr inbounds [101 x float], [101 x float]* %15, i64 0, i64 0
%40 = call i32 @retrieve_windstat(float* %39, i32 %0, float* %18, float* %19)
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = getelementptr inbounds [101 x float], [101 x float]* %16, i64 0, i64 0
%44 = call i32 @lpc(i32 %0, float %7, i32 %32, float* %2, float* %43, float* %39, float* null, float* %18, float* %20, float %6)
%45 = call float @wind_energy(float* %2, i32 %1)
store float %45, float* %19
br label %46
46: ; preds = %42, %38
%47 = getelementptr inbounds [101 x float], [101 x float]* %14, i64 0, i64 1
%48 = getelementptr inbounds [101 x float], [101 x float]* %17, i64 0, i64 0
%49 = call i32 @a_to_aca(float* %47, float* %48, float* %13, i32 %0)
%50 = getelementptr inbounds [101 x float], [101 x float]* %15, i64 0, i64 1
%51 = call double @itakura(i32 %0, float* %48, float* %13, float* %50, float* %18)
%52 = fadd double %51, -8.000000e-01
%53 = fptrunc double %52 to float
%54 = load float, float* %19
%55 = fcmp ogt float %54, 0.000000e+00
br i1 %55, label %56, label %62
56: ; preds = %46
%57 = fpext float %54 to double
%58 = fpext float %36 to double
%59 = fadd double %58, 1.000000e-03
%60 = fdiv double %59, %57
%61 = fptrunc double %60 to float
br label %65
62: ; preds = %46
%63 = fcmp ogt float %36, 0.000000e+00
%64 = select i1 %63, float 2.000000e+00, float 1.000000e+00
br label %65
65: ; preds = %9, %62, %56
%66 = phi float [ %61, %56 ], [ %64, %62 ], [ 1.000000e+00, %9 ]
%67 = phi float [ %53, %56 ], [ %53, %62 ], [ 1.000000e+01, %9 ]
store float %66, float* %5
store float %36, float* %4
%68 = load float, float* %11
%69 = call i32 @save_windstat(float* %34, i32 %0, float %68, float %36)
%70 = fpext float %67 to double
%71 = fdiv double 2.000000e-01, %70
%72 = fptrunc double %71 to float
ret float %72
}