#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*/ silk_LPC_analysis_filter_FLP(float *, float *, float const *,
                                                int, int const);
float const silk_energy_FLP(float *, int const);
void silk_residual_energy_FLP(float nrgs[4], const float x[], float a[2][16],
                              const float gains[], const int subfr_length,
                              const int nb_subfr, const int LPC_order) {
  int shift;
  float *LPC_res_ptr, LPC_res[(((5 * 4) * 16) + 4 * 16) / 2];
  LPC_res_ptr = LPC_res + LPC_order;
  shift = LPC_order + subfr_length;
  silk_LPC_analysis_filter_FLP(LPC_res, a[0], x + 0 * shift, 2 * shift,
                               LPC_order);
  nrgs[0] = (float)(gains[0] * gains[0] *
                    silk_energy_FLP(LPC_res_ptr + 0 * shift, subfr_length));
  nrgs[1] = (float)(gains[1] * gains[1] *
                    silk_energy_FLP(LPC_res_ptr + 1 * shift, subfr_length));
  if (nb_subfr == 4) {
    silk_LPC_analysis_filter_FLP(LPC_res, a[1], x + 2 * shift, 2 * shift,
                                 LPC_order);
    nrgs[2] = (float)(gains[2] * gains[2] *
                      silk_energy_FLP(LPC_res_ptr + 0 * shift, subfr_length));
    nrgs[3] = (float)(gains[3] * gains[3] *
                      silk_energy_FLP(LPC_res_ptr + 1 * shift, subfr_length));
  }
}


x86 assembly (clang, -O0):
<silk_residual_energy_FLP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x350,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
lea    -0x340(%rbp),%rax
movslq 0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    0x10(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x340(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
imul   $0x0,-0x2c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x2c(%rbp),%ecx
shl    $0x1,%ecx
mov    0x10(%rbp),%r8d
call   1030 <silk_LPC_analysis_filter_FLP@plt>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
mulss  (%rax),%xmm0
movss  %xmm0,-0x348(%rbp)
ff
mov    -0x38(%rbp),%rdi
imul   $0x0,-0x2c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1040 <silk_energy_FLP@plt>
movaps %xmm0,%xmm1
movss  -0x348(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x20(%rbp),%rax
mulss  0x4(%rax),%xmm0
movss  %xmm0,-0x344(%rbp)
ff
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%eax
shl    $0x0,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1040 <silk_energy_FLP@plt>
movaps %xmm0,%xmm1
movss  -0x344(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
cmpl   $0x4,-0x28(%rbp)
jne    12f8 <silk_residual_energy_FLP+0x1d8>
lea    -0x340(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x40,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x2c(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x2c(%rbp),%ecx
shl    $0x1,%ecx
mov    0x10(%rbp),%r8d
call   1030 <silk_LPC_analysis_filter_FLP@plt>
mov    -0x20(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
mulss  0x8(%rax),%xmm0
movss  %xmm0,-0x350(%rbp)
ff
mov    -0x38(%rbp),%rdi
imul   $0x0,-0x2c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1040 <silk_energy_FLP@plt>
movaps %xmm0,%xmm1
movss  -0x350(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x20(%rbp),%rax
mulss  0xc(%rax),%xmm0
movss  %xmm0,-0x34c(%rbp)
ff
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%eax
shl    $0x0,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
call   1040 <silk_energy_FLP@plt>
movaps %xmm0,%xmm1
movss  -0x34c(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
add    $0x350,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silk_residual_energy_FLP>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x338,%rsp
mov    %r9d,0xc(%rsp)
mov    %r8d,%ebx
mov    %rcx,%r14
mov    %rsi,%rax
mov    %rdi,%r12
movslq 0x370(%rsp),%rbp
lea    0x30(%rsp,%rbp,4),%r13
lea    0x0(%rbp,%rbx,1),%r15d
lea    (%r15,%r15,1),%ecx
lea    0x30(%rsp),%rdi
mov    %rdx,0x20(%rsp)
mov    %rdx,%rsi
mov    %rax,0x18(%rsp)
mov    %rax,%rdx
mov    %ecx,0x14(%rsp)
mov    %ebp,%r8d
call   1030 <silk_LPC_analysis_filter_FLP@plt>
movss  (%r14),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
mov    %r13,%rdi
mov    %ebx,%esi
call   1040 <silk_energy_FLP@plt>
mulss  0x10(%rsp),%xmm0
movss  %xmm0,(%r12)
mov    %r14,0x28(%rsp)
movss  0x4(%r14),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
movslq %r15d,%rax
lea    0x0(,%rax,4),%r15
add    %r13,%r15
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <silk_energy_FLP@plt>
mulss  0x10(%rsp),%xmm0
movss  %xmm0,0x4(%r12)
cmpl   $0x4,0xc(%rsp)
jne    125a <silk_residual_energy_FLP+0x13a>
mov    0x20(%rsp),%rsi
add    $0x40,%rsi
mov    0x14(%rsp),%r8d
movslq %r8d,%rax
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,4),%rdx
lea    0x30(%rsp),%rdi
mov    %r8d,%ecx
mov    %ebp,%r8d
call   1030 <silk_LPC_analysis_filter_FLP@plt>
mov    0x28(%rsp),%rbp
movss  0x8(%rbp),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r13,%rdi
mov    %ebx,%esi
call   1040 <silk_energy_FLP@plt>
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%r12)
movss  0xc(%rbp),%xmm0
mulss  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <silk_energy_FLP@plt>
mulss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%r12)
add    $0x338,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @silk_residual_energy_FLP(float* %0, float* %1, [16 x float]* %2, float* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca [16 x float]*
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca float*
%17 = alloca [192 x float]
store float* %0, float** %8
store float* %1, float** %9
store [16 x float]* %2, [16 x float]** %10
store float* %3, float** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%18 = getelementptr inbounds [192 x float], [192 x float]* %17, i64 0, i64 0
%19 = load i32, i32* %14
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %18, i64 %20
store float* %21, float** %16
%22 = load i32, i32* %14
%23 = load i32, i32* %12
%24 = add nsw i32 %22, %23
store i32 %24, i32* %15
%25 = getelementptr inbounds [192 x float], [192 x float]* %17, i64 0, i64 0
%26 = load [16 x float]*, [16 x float]** %10
%27 = getelementptr inbounds [16 x float], [16 x float]* %26, i64 0
%28 = getelementptr inbounds [16 x float], [16 x float]* %27, i64 0, i64 0
%29 = load float*, float** %9
%30 = load i32, i32* %15
%31 = mul nsw i32 0, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds float, float* %29, i64 %32
%34 = load i32, i32* %15
%35 = mul nsw i32 2, %34
%36 = load i32, i32* %14
%37 = call i32 @silk_LPC_analysis_filter_FLP(float* %25, float* %28, float* %33, i32 %35, i32 %36)
%38 = load float*, float** %11
%39 = getelementptr inbounds float, float* %38, i64 0
%40 = load float, float* %39
%41 = load float*, float** %11
%42 = getelementptr inbounds float, float* %41, i64 0
%43 = load float, float* %42
%44 = fmul float %40, %43
%45 = load float*, float** %16
%46 = load i32, i32* %15
%47 = mul nsw i32 0, %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds float, float* %45, i64 %48
%50 = load i32, i32* %12
%51 = call float @silk_energy_FLP(float* %49, i32 %50)
%52 = fmul float %44, %51
%53 = load float*, float** %8
%54 = getelementptr inbounds float, float* %53, i64 0
store float %52, float* %54
%55 = load float*, float** %11
%56 = getelementptr inbounds float, float* %55, i64 1
%57 = load float, float* %56
%58 = load float*, float** %11
%59 = getelementptr inbounds float, float* %58, i64 1
%60 = load float, float* %59
%61 = fmul float %57, %60
%62 = load float*, float** %16
%63 = load i32, i32* %15
%64 = mul nsw i32 1, %63
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds float, float* %62, i64 %65
%67 = load i32, i32* %12
%68 = call float @silk_energy_FLP(float* %66, i32 %67)
%69 = fmul float %61, %68
%70 = load float*, float** %8
%71 = getelementptr inbounds float, float* %70, i64 1
store float %69, float* %71
%72 = load i32, i32* %13
%73 = icmp eq i32 %72, 4
br i1 %73, label %74, label %122
74: ; preds = %7
%75 = getelementptr inbounds [192 x float], [192 x float]* %17, i64 0, i64 0
%76 = load [16 x float]*, [16 x float]** %10
%77 = getelementptr inbounds [16 x float], [16 x float]* %76, i64 1
%78 = getelementptr inbounds [16 x float], [16 x float]* %77, i64 0, i64 0
%79 = load float*, float** %9
%80 = load i32, i32* %15
%81 = mul nsw i32 2, %80
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds float, float* %79, i64 %82
%84 = load i32, i32* %15
%85 = mul nsw i32 2, %84
%86 = load i32, i32* %14
%87 = call i32 @silk_LPC_analysis_filter_FLP(float* %75, float* %78, float* %83, i32 %85, i32 %86)
%88 = load float*, float** %11
%89 = getelementptr inbounds float, float* %88, i64 2
%90 = load float, float* %89
%91 = load float*, float** %11
%92 = getelementptr inbounds float, float* %91, i64 2
%93 = load float, float* %92
%94 = fmul float %90, %93
%95 = load float*, float** %16
%96 = load i32, i32* %15
%97 = mul nsw i32 0, %96
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds float, float* %95, i64 %98
%100 = load i32, i32* %12
%101 = call float @silk_energy_FLP(float* %99, i32 %100)
%102 = fmul float %94, %101
%103 = load float*, float** %8
%104 = getelementptr inbounds float, float* %103, i64 2
store float %102, float* %104
%105 = load float*, float** %11
%106 = getelementptr inbounds float, float* %105, i64 3
%107 = load float, float* %106
%108 = load float*, float** %11
%109 = getelementptr inbounds float, float* %108, i64 3
%110 = load float, float* %109
%111 = fmul float %107, %110
%112 = load float*, float** %16
%113 = load i32, i32* %15
%114 = mul nsw i32 1, %113
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds float, float* %112, i64 %115
%117 = load i32, i32* %12
%118 = call float @silk_energy_FLP(float* %116, i32 %117)
%119 = fmul float %111, %118
%120 = load float*, float** %8
%121 = getelementptr inbounds float, float* %120, i64 3
store float %119, float* %121
br label %122
122: ; preds = %74, %7
ret void
}

LLVM IR (-O2):
define void @silk_residual_energy_FLP(float* nocapture writeonly %0, float* %1, [16 x float]* %2, float* nocapture %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca [192 x float]
%9 = bitcast [192 x float]* %8 to i8*
%10 = getelementptr inbounds [192 x float], [192 x float]* %8, i64 0, i64 0
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds [192 x float], [192 x float]* %8, i64 0, i64 %11
%13 = add nsw i32 %6, %4
%14 = getelementptr inbounds [16 x float], [16 x float]* %2, i64 0, i64 0
%15 = shl nsw i32 %13, 1
%16 = call i32 @silk_LPC_analysis_filter_FLP(float* %10, float* %14, float* %1, i32 %15, i32 %6)
%17 = load float, float* %3
%18 = fmul float %17, %17
%19 = call float @silk_energy_FLP(float* %12, i32 %4)
%20 = fmul float %18, %19
store float %20, float* %0
%21 = getelementptr inbounds float, float* %3, i64 1
%22 = load float, float* %21
%23 = fmul float %22, %22
%24 = sext i32 %13 to i64
%25 = getelementptr inbounds float, float* %12, i64 %24
%26 = call float @silk_energy_FLP(float* %25, i32 %4)
%27 = fmul float %23, %26
%28 = getelementptr inbounds float, float* %0, i64 1
store float %27, float* %28
%29 = icmp eq i32 %5, 4
br i1 %29, label %30, label %47
30: ; preds = %7
%31 = getelementptr inbounds [16 x float], [16 x float]* %2, i64 1, i64 0
%32 = sext i32 %15 to i64
%33 = getelementptr inbounds float, float* %1, i64 %32
%34 = call i32 @silk_LPC_analysis_filter_FLP(float* %10, float* %31, float* %33, i32 %15, i32 %6)
%35 = getelementptr inbounds float, float* %3, i64 2
%36 = load float, float* %35
%37 = fmul float %36, %36
%38 = call float @silk_energy_FLP(float* %12, i32 %4)
%39 = fmul float %37, %38
%40 = getelementptr inbounds float, float* %0, i64 2
store float %39, float* %40
%41 = getelementptr inbounds float, float* %3, i64 3
%42 = load float, float* %41
%43 = fmul float %42, %42
%44 = call float @silk_energy_FLP(float* %25, i32 %4)
%45 = fmul float %43, %44
%46 = getelementptr inbounds float, float* %0, i64 3
store float %45, float* %46
br label %47
47: ; preds = %30, %7
ret void
}