#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*/ cvprod(float *, float *, float *, long);
void rspectprod(float *data1, float *data2, float *outdata, long N) {
  if (N > 1) {
    outdata[0] = data1[0] * data2[0];
    outdata[1] = data1[1] * data2[1];
    cvprod(data1 + 2, data2 + 2, outdata + 2, N / 2 - 1);
  } else {
    outdata[0] = data1[0] * data2[0];
  }
}


x86 assembly (clang, -O0):
<rspectprod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jle    11a5 <rspectprod+0x95>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    -0x28(%rbp),%rdx
mov    %rax,%rcx
sub    $0x1,%rcx
call   1030 <cvprod@plt>
jmp    11bd <rspectprod+0xad>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rspectprod>:
movss  (%rdi),%xmm0
mulss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
cmp    $0x2,%rcx
jl     1149 <rspectprod+0x39>
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
add    $0x8,%rdi
add    $0x8,%rsi
add    $0x8,%rdx
shr    %rcx
add    $0xffffffffffffffff,%rcx
jmp    1030 <cvprod@plt>
ret

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

LLVM IR (-O2):
define void @rspectprod(float* %0, float* %1, float* %2, i64 %3) {
%5 = icmp sgt i64 %3, 1
%6 = load float, float* %0
%7 = load float, float* %1
%8 = fmul float %6, %7
store float %8, float* %2
br i1 %5, label %9, label %22
9: ; preds = %4
%10 = getelementptr inbounds float, float* %0, i64 1
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %1, i64 1
%13 = load float, float* %12
%14 = fmul float %11, %13
%15 = getelementptr inbounds float, float* %2, i64 1
store float %14, float* %15
%16 = getelementptr inbounds float, float* %0, i64 2
%17 = getelementptr inbounds float, float* %1, i64 2
%18 = getelementptr inbounds float, float* %2, i64 2
%19 = lshr i64 %3, 1
%20 = add nsw i64 %19, -1
%21 = tail call i32 @cvprod(float* %16, float* %17, float* %18, i64 %20)
br label %22
22: ; preds = %4, %9
ret void
}