#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 _base_convolve_real(float const *, int, float const *, int, float *, int,
                        int, int);
scalar_t__ bounds_check(int, int, int, int, int);
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, 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) {
  if (bounds_check(x_len, h_len, y_len, start, len) < 0)
    return -1;
  memset(y, 0, len * 2 * sizeof(float));
  return _base_convolve_real(x, x_len, h, h_len, y, y_len, start, len);
}


x86 assembly (clang, -O0):
<base_convolve_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    0x10(%rbp),%ecx
mov    0x18(%rbp),%r8d
call   1040 <bounds_check@plt>
cmp    $0x0,%rax
jge    117f <base_convolve_real+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c5 <base_convolve_real+0x95>
mov    -0x30(%rbp),%rdi
mov    0x18(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x34(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1050 <_base_convolve_real@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%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
mov    %r9d,%r12d
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdx,(%rsp)
mov    %esi,%ebx
mov    %rdi,%r13
mov    0x48(%rsp),%r15d
mov    0x40(%rsp),%ecx
mov    %esi,%edi
mov    %ebp,%esi
mov    %r9d,%edx
mov    %r15d,%r8d
call   1040 <bounds_check@plt>
test   %rax,%rax
js     119e <base_convolve_real+0x6e>
shl    $0x3,%r15d
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%edx
call   1030 <memset@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    (%rsp),%rdx
mov    %ebp,%ecx
mov    %r14,%r8
mov    %r12d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <_base_convolve_real@plt>
mov    $0xffffffff,%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 i32
%10 = alloca float*
%11 = alloca i32
%12 = alloca float*
%13 = alloca i32
%14 = alloca float*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store float* %0, float** %10
store i32 %1, i32* %11
store float* %2, float** %12
store i32 %3, i32* %13
store float* %4, float** %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
%18 = load i32, i32* %11
%19 = load i32, i32* %13
%20 = load i32, i32* %15
%21 = load i32, i32* %16
%22 = load i32, i32* %17
%23 = call i64 @bounds_check(i32 %18, i32 %19, i32 %20, i32 %21, i32 %22)
%24 = icmp slt i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %8
store i32 -1, i32* %9
br label %43
26: ; preds = %8
%27 = load float*, float** %14
%28 = load i32, i32* %17
%29 = mul nsw i32 %28, 2
%30 = sext i32 %29 to i64
%31 = mul i64 %30, 4
%32 = trunc i64 %31 to i32
%33 = call i32 @memset(float* %27, i32 0, i32 %32)
%34 = load float*, float** %10
%35 = load i32, i32* %11
%36 = load float*, float** %12
%37 = load i32, i32* %13
%38 = load float*, float** %14
%39 = load i32, i32* %15
%40 = load i32, i32* %16
%41 = load i32, i32* %17
%42 = call i32 @_base_convolve_real(float* %34, i32 %35, float* %36, i32 %37, float* %38, i32 %39, i32 %40, i32 %41)
store i32 %42, i32* %9
br label %43
43: ; preds = %26, %25
%44 = load i32, i32* %9
ret i32 %44
}

LLVM IR (-O2):
define i32 @base_convolve_real(float* %0, i32 %1, float* %2, i32 %3, float* %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i64 @bounds_check(i32 %1, i32 %3, i32 %5, i32 %6, i32 %7)
%10 = icmp slt i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = shl i32 %7, 3
%13 = tail call i32 @memset(float* %4, i32 0, i32 %12)
%14 = tail call i32 @_base_convolve_real(float* %0, i32 %1, float* %2, i32 %3, float* %4, i32 %5, i32 %6, i32 %7)
br label %15
15: ; preds = %8, %11
%16 = phi i32 [ %14, %11 ], [ -1, %8 ]
ret i32 %16
}