#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 */
scalar_t__ silk_inner_product_FLP(float const *, float const *, int);
void silk_autocorrelation_FLP(float *results, const float *inputData,
                              int inputDataSize, int correlationCount) {
  int i;
  if (correlationCount > inputDataSize) {
    correlationCount = inputDataSize;
  }
  for (i = 0; i < correlationCount; i++) {
    results[i] = (float)silk_inner_product_FLP(inputData, inputData + i,
                                               inputDataSize - i);
  }
}


x86 assembly (clang, -O0):
<silk_autocorrelation_FLP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1138 <silk_autocorrelation_FLP+0x28>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1189 <silk_autocorrelation_FLP+0x79>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
sub    -0x1c(%rbp),%edx
call   1030 <silk_inner_product_FLP@plt>
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <silk_autocorrelation_FLP+0x2f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<silk_autocorrelation_FLP>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    %edx,%ecx
cmovg  %edx,%ecx
test   %ecx,%ecx
jle    1168 <silk_autocorrelation_FLP+0x58>
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %ecx,%r12d
shl    $0x2,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
call   1030 <silk_inner_product_FLP@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r15,%rbx,1)
add    $0xffffffff,%ebp
add    $0x4,%rbx
cmp    %rbx,%r12
jne    1140 <silk_autocorrelation_FLP+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @silk_autocorrelation_FLP(float* %0, float* %1, i32 %2, i32 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store float* %0, float** %5
store float* %1, float** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %7
store i32 %14, i32* %8
br label %15
15: ; preds = %13, %4
store i32 0, i32* %9
br label %16
16: ; preds = %35, %15
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %38
20: ; preds = %16
%21 = load float*, float** %6
%22 = load float*, float** %6
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
%26 = load i32, i32* %7
%27 = load i32, i32* %9
%28 = sub nsw i32 %26, %27
%29 = call i64 @silk_inner_product_FLP(float* %21, float* %25, i32 %28)
%30 = sitofp i64 %29 to float
%31 = load float*, float** %5
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %31, i64 %33
store float %30, float* %34
br label %35
35: ; preds = %20
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
br label %16
38: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @silk_autocorrelation_FLP(float* nocapture writeonly %0, float* %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, %2
%6 = select i1 %5, i32 %2, i32 %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = zext i32 %6 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %18, %10 ]
%12 = getelementptr inbounds float, float* %1, i64 %11
%13 = trunc i64 %11 to i32
%14 = sub nsw i32 %2, %13
%15 = tail call i64 @silk_inner_product_FLP(float* %1, float* %12, i32 %14)
%16 = sitofp i64 %15 to float
%17 = getelementptr inbounds float, float* %0, i64 %11
store float %16, float* %17
%18 = add nuw nsw i64 %11, 1
%19 = icmp eq i64 %18, %9
br i1 %19, label %20, label %10
20: ; preds = %10, %4
ret void
}