#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*/ mac_real_vec_n(float const *, float const *, float *, int);
int _base_convolve_real(const float *x, int x_len, const float *h, int h_len,
                        float *y, int y_len, int start, int len) {
  for (int i = 0; i < len; i++) {
    mac_real_vec_n(&x[2 * (i - (h_len - 1) + start)], h, &y[2 * i], h_len);
  }
  return len;
}


x86 assembly (clang, -O0):
<_base_convolve_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1192 <_base_convolve_real+0x82>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
sub    %ecx,%eax
add    0x10(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <mac_real_vec_n@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    113b <_base_convolve_real+0x2b>
mov    0x18(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_base_convolve_real>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmpl   $0x0,0x48(%rsp)
jle    1163 <_base_convolve_real+0x53>
mov    %r8,%rbx
mov    %ecx,%r13d
mov    %rdx,%r14
mov    %rdi,%r12
mov    0x40(%rsp),%eax
mov    0x48(%rsp),%ebp
sub    %ecx,%eax
lea    (%rax,%rax,1),%r15d
add    $0x2,%r15d
movslq %r15d,%r15
lea    (%r12,%r15,4),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r13d,%ecx
call   1030 <mac_real_vec_n@plt>
add    $0x8,%rbx
add    $0x2,%r15d
add    $0xffffffffffffffff,%rbp
jne    1140 <_base_convolve_real+0x30>
mov    0x48(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @_base_convolve_real(float* %0, i32 %1, float* %2, i32 %3, float* %4, i32 %5, i32 %6, i32 returned %7) {
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = sub i32 1, %3
%12 = add i32 %11, %6
%13 = zext i32 %7 to i64
br label %15
14: ; preds = %15, %8
ret i32 %7
15: ; preds = %10, %15
%16 = phi i64 [ 0, %10 ], [ %25, %15 ]
%17 = trunc i64 %16 to i32
%18 = add i32 %12, %17
%19 = shl nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds float, float* %0, i64 %20
%22 = shl nuw nsw i64 %16, 1
%23 = getelementptr inbounds float, float* %4, i64 %22
%24 = tail call i32 @mac_real_vec_n(float* %21, float* %2, float* %23, i32 %3)
%25 = add nuw nsw i64 %16, 1
%26 = icmp eq i64 %25, %13
br i1 %26, label %14, label %15
}