#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 */
void nnp_conv1x1_only_2x4__scalar(size_t input_channels, size_t image_size,
                                  const float *input, const float *kernel,
                                  float *output) {
  const float *pinput0 = input;
  const float *pinput1 = input + image_size;
  const float kernel00 = kernel[0];
  const float kernel01 = kernel[1];
  kernel += input_channels;
  const float kernel10 = kernel[0];
  const float kernel11 = kernel[1];
  kernel += input_channels;
  const float kernel20 = kernel[0];
  const float kernel21 = kernel[1];
  kernel += input_channels;
  const float kernel30 = kernel[0];
  const float kernel31 = kernel[1];
  float *poutput0 = output;
  float *poutput1 = poutput0 + image_size;
  float *poutput2 = poutput1 + image_size;
  float *poutput3 = poutput2 + image_size;
  do {
    float output0 = *poutput0;
    float output1 = *poutput1;
    float output2 = *poutput2;
    float output3 = *poutput3;
    const float input0 = *pinput0++;
    output0 += kernel00 * input0;
    output1 += kernel10 * input0;
    output2 += kernel20 * input0;
    output3 += kernel30 * input0;
    const float input1 = *pinput1++;
    output0 += kernel01 * input1;
    *poutput0++ = output0;
    output1 += kernel11 * input1;
    *poutput1++ = output1;
    output2 += kernel21 * input1;
    *poutput2++ = output2;
    output3 += kernel31 * input1;
    *poutput3++ = output3;
  } while (--image_size != 0);
}


x86 assembly (clang, -O0):
<nnp_conv1x1_only_2x4__scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x44(%rbp)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x54(%rbp)
mov    -0x20(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x60(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x7c(%rbp)
mov    -0x68(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x80(%rbp)
mov    -0x70(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
mov    -0x78(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x30(%rbp)
movss  (%rax),%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x3c(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x7c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x44(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x80(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x4c(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x84(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x54(%rbp),%xmm0
movss  -0x8c(%rbp),%xmm2
ff
movss  -0x88(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x38(%rbp)
movss  (%rax),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
movss  -0x40(%rbp),%xmm0
movss  -0x90(%rbp),%xmm2
ff
movss  -0x7c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x7c(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x60(%rbp)
movss  %xmm0,(%rax)
movss  -0x48(%rbp),%xmm0
movss  -0x90(%rbp),%xmm2
ff
movss  -0x80(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x80(%rbp),%xmm0
mov    -0x68(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x68(%rbp)
movss  %xmm0,(%rax)
movss  -0x50(%rbp),%xmm0
movss  -0x90(%rbp),%xmm2
ff
movss  -0x84(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x84(%rbp),%xmm0
ff
mov    -0x70(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x70(%rbp)
movss  %xmm0,(%rax)
movss  -0x58(%rbp),%xmm0
movss  -0x90(%rbp),%xmm2
ff
movss  -0x88(%rbp),%xmm1
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x88(%rbp),%xmm0
ff
mov    -0x78(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x78(%rbp)
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1214 <nnp_conv1x1_only_2x4__scalar+0x114>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nnp_conv1x1_only_2x4__scalar>:
lea    (%rdx,%rsi,4),%r9
movss  (%rcx),%xmm8
movss  0x4(%rcx),%xmm9
lea    (%rcx,%rdi,4),%rax
movss  (%rcx,%rdi,4),%xmm10
movss  0x4(%rcx,%rdi,4),%xmm11
lea    (%rax,%rdi,4),%rcx
movss  (%rax,%rdi,4),%xmm12
movss  0x4(%rax,%rdi,4),%xmm13
movss  (%rcx,%rdi,4),%xmm6
movss  0x4(%rcx,%rdi,4),%xmm7
lea    (%r8,%rsi,4),%r10
lea    (%r10,%rsi,4),%rdi
lea    (%rdi,%rsi,4),%rax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movss  (%rdx,%rcx,4),%xmm0
movaps %xmm8,%xmm1
mulss  %xmm0,%xmm1
addss  (%r8,%rcx,4),%xmm1
movaps %xmm10,%xmm2
mulss  %xmm0,%xmm2
addss  (%r10,%rcx,4),%xmm2
movaps %xmm12,%xmm4
mulss  %xmm0,%xmm4
addss  (%rdi,%rcx,4),%xmm4
mulss  %xmm6,%xmm0
addss  (%rax,%rcx,4),%xmm0
movss  (%r9,%rcx,4),%xmm3
movaps %xmm9,%xmm5
mulss  %xmm3,%xmm5
addss  %xmm1,%xmm5
movss  %xmm5,(%r8,%rcx,4)
movaps %xmm11,%xmm1
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  %xmm1,(%r10,%rcx,4)
movaps %xmm13,%xmm1
mulss  %xmm3,%xmm1
addss  %xmm4,%xmm1
movss  %xmm1,(%rdi,%rcx,4)
mulss  %xmm7,%xmm3
addss  %xmm0,%xmm3
movss  %xmm3,(%rax,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1150 <nnp_conv1x1_only_2x4__scalar+0x50>
ret

LLVM IR (-O0):
define void @nnp_conv1x1_only_2x4__scalar(i64 %0, i64 %1, float* %2, float* %3, float* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float*
%22 = alloca float*
%23 = alloca float*
%24 = alloca float*
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca float
%30 = alloca float
store i64 %0, i64* %6
store i64 %1, i64* %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%31 = load float*, float** %8
store float* %31, float** %11
%32 = load float*, float** %8
%33 = load i64, i64* %7
%34 = getelementptr inbounds float, float* %32, i64 %33
store float* %34, float** %12
%35 = load float*, float** %9
%36 = getelementptr inbounds float, float* %35, i64 0
%37 = load float, float* %36
store float %37, float* %13
%38 = load float*, float** %9
%39 = getelementptr inbounds float, float* %38, i64 1
%40 = load float, float* %39
store float %40, float* %14
%41 = load i64, i64* %6
%42 = load float*, float** %9
%43 = getelementptr inbounds float, float* %42, i64 %41
store float* %43, float** %9
%44 = load float*, float** %9
%45 = getelementptr inbounds float, float* %44, i64 0
%46 = load float, float* %45
store float %46, float* %15
%47 = load float*, float** %9
%48 = getelementptr inbounds float, float* %47, i64 1
%49 = load float, float* %48
store float %49, float* %16
%50 = load i64, i64* %6
%51 = load float*, float** %9
%52 = getelementptr inbounds float, float* %51, i64 %50
store float* %52, float** %9
%53 = load float*, float** %9
%54 = getelementptr inbounds float, float* %53, i64 0
%55 = load float, float* %54
store float %55, float* %17
%56 = load float*, float** %9
%57 = getelementptr inbounds float, float* %56, i64 1
%58 = load float, float* %57
store float %58, float* %18
%59 = load i64, i64* %6
%60 = load float*, float** %9
%61 = getelementptr inbounds float, float* %60, i64 %59
store float* %61, float** %9
%62 = load float*, float** %9
%63 = getelementptr inbounds float, float* %62, i64 0
%64 = load float, float* %63
store float %64, float* %19
%65 = load float*, float** %9
%66 = getelementptr inbounds float, float* %65, i64 1
%67 = load float, float* %66
store float %67, float* %20
%68 = load float*, float** %10
store float* %68, float** %21
%69 = load float*, float** %21
%70 = load i64, i64* %7
%71 = getelementptr inbounds float, float* %69, i64 %70
store float* %71, float** %22
%72 = load float*, float** %22
%73 = load i64, i64* %7
%74 = getelementptr inbounds float, float* %72, i64 %73
store float* %74, float** %23
%75 = load float*, float** %23
%76 = load i64, i64* %7
%77 = getelementptr inbounds float, float* %75, i64 %76
store float* %77, float** %24
br label %78
78: ; preds = %137, %5
%79 = load float*, float** %21
%80 = load float, float* %79
store float %80, float* %25
%81 = load float*, float** %22
%82 = load float, float* %81
store float %82, float* %26
%83 = load float*, float** %23
%84 = load float, float* %83
store float %84, float* %27
%85 = load float*, float** %24
%86 = load float, float* %85
store float %86, float* %28
%87 = load float*, float** %11
%88 = getelementptr inbounds float, float* %87, i32 1
store float* %88, float** %11
%89 = load float, float* %87
store float %89, float* %29
%90 = load float, float* %13
%91 = load float, float* %29
%92 = load float, float* %25
%93 = call float @llvm.fmuladd.f32(float %90, float %91, float %92)
store float %93, float* %25
%94 = load float, float* %15
%95 = load float, float* %29
%96 = load float, float* %26
%97 = call float @llvm.fmuladd.f32(float %94, float %95, float %96)
store float %97, float* %26
%98 = load float, float* %17
%99 = load float, float* %29
%100 = load float, float* %27
%101 = call float @llvm.fmuladd.f32(float %98, float %99, float %100)
store float %101, float* %27
%102 = load float, float* %19
%103 = load float, float* %29
%104 = load float, float* %28
%105 = call float @llvm.fmuladd.f32(float %102, float %103, float %104)
store float %105, float* %28
%106 = load float*, float** %12
%107 = getelementptr inbounds float, float* %106, i32 1
store float* %107, float** %12
%108 = load float, float* %106
store float %108, float* %30
%109 = load float, float* %14
%110 = load float, float* %30
%111 = load float, float* %25
%112 = call float @llvm.fmuladd.f32(float %109, float %110, float %111)
store float %112, float* %25
%113 = load float, float* %25
%114 = load float*, float** %21
%115 = getelementptr inbounds float, float* %114, i32 1
store float* %115, float** %21
store float %113, float* %114
%116 = load float, float* %16
%117 = load float, float* %30
%118 = load float, float* %26
%119 = call float @llvm.fmuladd.f32(float %116, float %117, float %118)
store float %119, float* %26
%120 = load float, float* %26
%121 = load float*, float** %22
%122 = getelementptr inbounds float, float* %121, i32 1
store float* %122, float** %22
store float %120, float* %121
%123 = load float, float* %18
%124 = load float, float* %30
%125 = load float, float* %27
%126 = call float @llvm.fmuladd.f32(float %123, float %124, float %125)
store float %126, float* %27
%127 = load float, float* %27
%128 = load float*, float** %23
%129 = getelementptr inbounds float, float* %128, i32 1
store float* %129, float** %23
store float %127, float* %128
%130 = load float, float* %20
%131 = load float, float* %30
%132 = load float, float* %28
%133 = call float @llvm.fmuladd.f32(float %130, float %131, float %132)
store float %133, float* %28
%134 = load float, float* %28
%135 = load float*, float** %24
%136 = getelementptr inbounds float, float* %135, i32 1
store float* %136, float** %24
store float %134, float* %135
br label %137
137: ; preds = %78
%138 = load i64, i64* %7
%139 = add i64 %138, -1
store i64 %139, i64* %7
%140 = icmp ne i64 %139, 0
br i1 %140, label %78, label %141
141: ; preds = %137
ret void
}

LLVM IR (-O2):
define void @nnp_conv1x1_only_2x4__scalar(i64 %0, i64 %1, float* nocapture %2, float* nocapture %3, float* nocapture %4) {
%6 = getelementptr inbounds float, float* %2, i64 %1
%7 = load float, float* %3
%8 = getelementptr inbounds float, float* %3, i64 1
%9 = load float, float* %8
%10 = getelementptr inbounds float, float* %3, i64 %0
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %10, i64 1
%13 = load float, float* %12
%14 = getelementptr inbounds float, float* %10, i64 %0
%15 = load float, float* %14
%16 = getelementptr inbounds float, float* %14, i64 1
%17 = load float, float* %16
%18 = getelementptr inbounds float, float* %14, i64 %0
%19 = load float, float* %18
%20 = getelementptr inbounds float, float* %18, i64 1
%21 = load float, float* %20
%22 = getelementptr inbounds float, float* %4, i64 %1
%23 = getelementptr inbounds float, float* %22, i64 %1
%24 = getelementptr inbounds float, float* %23, i64 %1
br label %25
25: ; preds = %25, %5
%26 = phi float* [ %24, %5 ], [ %52, %25 ]
%27 = phi float* [ %23, %5 ], [ %50, %25 ]
%28 = phi float* [ %22, %5 ], [ %48, %25 ]
%29 = phi float* [ %4, %5 ], [ %46, %25 ]
%30 = phi float* [ %6, %5 ], [ %43, %25 ]
%31 = phi float* [ %2, %5 ], [ %37, %25 ]
%32 = phi i64 [ %1, %5 ], [ %53, %25 ]
%33 = load float, float* %29
%34 = load float, float* %28
%35 = load float, float* %27
%36 = load float, float* %26
%37 = getelementptr inbounds float, float* %31, i64 1
%38 = load float, float* %31
%39 = tail call float @llvm.fmuladd.f32(float %7, float %38, float %33)
%40 = tail call float @llvm.fmuladd.f32(float %11, float %38, float %34)
%41 = tail call float @llvm.fmuladd.f32(float %15, float %38, float %35)
%42 = tail call float @llvm.fmuladd.f32(float %19, float %38, float %36)
%43 = getelementptr inbounds float, float* %30, i64 1
%44 = load float, float* %30
%45 = tail call float @llvm.fmuladd.f32(float %9, float %44, float %39)
%46 = getelementptr inbounds float, float* %29, i64 1
store float %45, float* %29
%47 = tail call float @llvm.fmuladd.f32(float %13, float %44, float %40)
%48 = getelementptr inbounds float, float* %28, i64 1
store float %47, float* %28
%49 = tail call float @llvm.fmuladd.f32(float %17, float %44, float %41)
%50 = getelementptr inbounds float, float* %27, i64 1
store float %49, float* %27
%51 = tail call float @llvm.fmuladd.f32(float %21, float %44, float %42)
%52 = getelementptr inbounds float, float* %26, i64 1
store float %51, float* %26
%53 = add i64 %32, -1
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %25
55: ; preds = %25
ret void
}