#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*/ SENNA_nn_linear(float *, int, float *, float *, float *,
                                   int);
void SENNA_nn_temporal_convolution(float *output, int output_frame_size,
                                   float *weights, float *biases, float *input,
                                   int input_frame_size, int n_frames,
                                   int k_w) {
  {
    int t;
    for (t = 0; t < n_frames - k_w + 1; t++)
      SENNA_nn_linear(output + t * output_frame_size, output_frame_size,
                      weights, biases, input + t * input_frame_size,
                      input_frame_size * k_w);
  }
}


x86 assembly (clang, -O0):
<SENNA_nn_temporal_convolution>:
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    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    0x10(%rbp),%ecx
sub    0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    119f <SENNA_nn_temporal_convolution+0x8f>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%r8
mov    -0x2c(%rbp),%r9d
imul   0x18(%rbp),%r9d
call   1030 <SENNA_nn_linear@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    113c <SENNA_nn_temporal_convolution+0x2c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SENNA_nn_temporal_convolution>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    0x58(%rsp),%eax
mov    0x50(%rsp),%r14d
mov    %eax,0x8(%rsp)
sub    %eax,%r14d
jl     1198 <SENNA_nn_temporal_convolution+0x88>
mov    %r8,%rbx
mov    %rcx,%r13
mov    %rdx,%r15
mov    %rdi,%rbp
mov    0x8(%rsp),%eax
imul   %r9d,%eax
mov    %eax,0x8(%rsp)
movslq 0xc(%rsp),%r12
movslq %r9d,%rax
add    $0x1,%r14d
shl    $0x2,%rax
mov    %rax,0x10(%rsp)
shl    $0x2,%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
mov    %r15,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    0x8(%rsp),%r9d
call   1030 <SENNA_nn_linear@plt>
add    0x10(%rsp),%rbx
add    %r12,%rbp
add    $0xffffffffffffffff,%r14
jne    1170 <SENNA_nn_temporal_convolution+0x60>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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