#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*/ _mm256_zeroupper();
int /*<<< orphan*/ convolve_5x5_16x16_avx(float *, float *, float *, long, long,
                                          long);
int /*<<< orphan*/ convolve_5x5_1_avx(float *, float *, float *, long, long,
                                      long);
int /*<<< orphan*/ convolve_5x5_2_avx(float *, float *, float *, long, long,
                                      long);
int /*<<< orphan*/ convolve_5x5_32x32_avx(float *, float *, float *, long, long,
                                          long);
int /*<<< orphan*/ convolve_5x5_4_avx(float *, float *, float *, long, long,
                                      long);
int /*<<< orphan*/ convolve_5x5_64x64_avx(float *, float *, float *, long, long,
                                          long);
int /*<<< orphan*/ convolve_5x5_6_avx(float *, float *, float *, long, long,
                                      long);
int /*<<< orphan*/ convolve_5x5_8x8_avx(float *, float *, float *, long, long,
                                        long);
int /*<<< orphan*/ convolve_5x5_sse(float *, float *, float *, long, long, long,
                                    long);
void convolve_5x5_avx(float *output, float *input, float *kernel, long outRows,
                      long outCols, long outStride, long inCols) {
  long ic = inCols;
  long yy = 0;
  float *t_ = input;
  float *r_ = output;
  float *k_ = kernel;
  if ((outRows == 64) && (outCols == 64)) {
    convolve_5x5_64x64_avx(output, input, kernel, outRows, outStride, inCols);
    return;
  }
  if ((outRows == 32) && (outCols == 32)) {
    convolve_5x5_32x32_avx(output, input, kernel, outRows, outStride, inCols);
    return;
  }
  if ((outRows == 16) && (outCols == 16)) {
    convolve_5x5_16x16_avx(output, input, kernel, outRows, outStride, inCols);
    return;
  }
  if ((outRows == 8) && (outCols == 8)) {
    convolve_5x5_8x8_avx(output, input, kernel, outRows, outStride, inCols);
    return;
  }
  for (; yy < (outRows / 6) * 6; yy += 6) {
    float *pi_ = t_ + yy * ic;
    float *pw_ = k_;
    float *pis_ = pi_;
    convolve_5x5_6_avx(r_, pis_, pw_, outCols, outStride, ic);
    r_ += (outStride * 6);
  }
  if ((yy < (outRows & 0xFFFFFFFE)) && ((yy % 4) != 0)) {
    float *pi_ = t_ + yy * ic;
    float *pw_ = k_;
    float *pis_ = pi_;
    convolve_5x5_2_avx(r_, pis_, pw_, outCols, outStride, ic);
    r_ += (outStride * 2);
    yy += 2;
  }
  for (; yy < (outRows & 0xFFFFFFFC); yy += 4) {
    float *pi_ = t_ + yy * ic;
    float *pw_ = k_;
    float *pis_ = pi_;
    convolve_5x5_4_avx(r_, pis_, pw_, outCols, outStride, ic);
    r_ += (outStride * 4);
  }
  for (; yy < (outRows & 0xFFFFFFFE); yy += 2) {
    float *pi_ = t_ + yy * ic;
    float *pw_ = k_;
    float *pis_ = pi_;
    convolve_5x5_2_avx(r_, pis_, pw_, outCols, outStride, ic);
    r_ += (outStride * 2);
  }
  for (; yy < outRows; yy += 1) {
    float *pi_ = t_ + yy * ic;
    float *pw_ = k_;
    float *pis_ = pi_;
    convolve_5x5_1_avx(r_, pis_, pw_, outCols, outStride, ic);
    r_ += (outStride * 1);
  }
  long procCols = outCols & 0xFFFFFFF8;
  long remCols = outCols - procCols;
  if (remCols > 0) {
    _mm256_zeroupper();
    convolve_5x5_sse(&output[procCols], &input[procCols], kernel, outRows,
                     remCols, outStride, inCols);
  }
}


x86 assembly (clang, -O0):
<convolve_5x5_avx>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x40,-0x20(%rbp)
jne    1227 <convolve_5x5_avx+0x87>
cmpq   $0x40,-0x28(%rbp)
jne    1227 <convolve_5x5_avx+0x87>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
call   10c0 <convolve_5x5_64x64_avx@plt>
jmp    1650 <convolve_5x5_avx+0x4b0>
cmpq   $0x20,-0x20(%rbp)
jne    125f <convolve_5x5_avx+0xbf>
cmpq   $0x20,-0x28(%rbp)
jne    125f <convolve_5x5_avx+0xbf>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
call   1050 <convolve_5x5_32x32_avx@plt>
jmp    1650 <convolve_5x5_avx+0x4b0>
cmpq   $0x10,-0x20(%rbp)
jne    1297 <convolve_5x5_avx+0xf7>
cmpq   $0x10,-0x28(%rbp)
jne    1297 <convolve_5x5_avx+0xf7>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
call   1040 <convolve_5x5_16x16_avx@plt>
jmp    1650 <convolve_5x5_avx+0x4b0>
cmpq   $0x8,-0x20(%rbp)
jne    12cf <convolve_5x5_avx+0x12f>
cmpq   $0x8,-0x28(%rbp)
jne    12cf <convolve_5x5_avx+0x12f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
call   1060 <convolve_5x5_8x8_avx@plt>
jmp    1650 <convolve_5x5_avx+0x4b0>
jmp    12d4 <convolve_5x5_avx+0x134>
mov    -0x40(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x6,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0xe8(%rbp),%rax
imul   $0x6,%rcx,%rcx
cmp    %rcx,%rax
jge    136b <convolve_5x5_avx+0x1cb>
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
imul   -0x38(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x68(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   10a0 <convolve_5x5_6_avx@plt>
imul   $0x6,-0x30(%rbp),%rax
shl    $0x2,%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
add    $0x6,%rax
mov    %rax,-0x40(%rbp)
jmp    12d4 <convolve_5x5_avx+0x134>
mov    -0x40(%rbp),%rax
movabs $0xfffffffe,%rcx
and    -0x20(%rbp),%rcx
cmp    %rcx,%rax
jge    1409 <convolve_5x5_avx+0x269>
mov    -0x40(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1409 <convolve_5x5_avx+0x269>
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
imul   -0x38(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1030 <convolve_5x5_2_avx@plt>
mov    -0x30(%rbp),%rax
shl    $0x1,%rax
shl    $0x2,%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x40(%rbp)
jmp    140e <convolve_5x5_avx+0x26e>
mov    -0x40(%rbp),%rax
movabs $0xfffffffc,%rcx
and    -0x20(%rbp),%rcx
cmp    %rcx,%rax
jge    14a5 <convolve_5x5_avx+0x305>
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
imul   -0x38(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x90(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
mov    -0x98(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   10b0 <convolve_5x5_4_avx@plt>
mov    -0x30(%rbp),%rax
shl    $0x2,%rax
shl    $0x2,%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
jmp    140e <convolve_5x5_avx+0x26e>
jmp    14aa <convolve_5x5_avx+0x30a>
mov    -0x40(%rbp),%rax
movabs $0xfffffffe,%rcx
and    -0x20(%rbp),%rcx
cmp    %rcx,%rax
jge    1541 <convolve_5x5_avx+0x3a1>
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
imul   -0x38(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0xb8(%rbp),%rsi
mov    -0xb0(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1030 <convolve_5x5_2_avx@plt>
mov    -0x30(%rbp),%rax
shl    $0x1,%rax
shl    $0x2,%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x40(%rbp)
jmp    14aa <convolve_5x5_avx+0x30a>
jmp    1546 <convolve_5x5_avx+0x3a6>
mov    -0x40(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    15d0 <convolve_5x5_avx+0x430>
mov    -0x48(%rbp),%rax
mov    -0x40(%rbp),%rcx
imul   -0x38(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0xd0(%rbp),%rsi
mov    -0xc8(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1070 <convolve_5x5_1_avx@plt>
mov    -0x30(%rbp),%rax
shl    $0x0,%rax
shl    $0x2,%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1546 <convolve_5x5_avx+0x3a6>
movabs $0xfffffff8,%rax
and    -0x28(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x28(%rbp),%rax
sub    -0xd8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
cmpq   $0x0,-0xe0(%rbp)
jle    1650 <convolve_5x5_avx+0x4b0>
mov    $0x0,%al
call   1080 <_mm256_zeroupper@plt>
mov    -0x8(%rbp),%rdi
mov    -0xd8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0xd8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0xe0(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1090 <convolve_5x5_sse@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convolve_5x5_avx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,%rbx
mov    %r8,%r10
mov    %rcx,%r14
mov    %rdx,%r8
mov    0x80(%rsp),%r9
cmp    $0x40,%rcx
jne    11ec <convolve_5x5_avx+0x4c>
cmp    $0x40,%r10
jne    11ec <convolve_5x5_avx+0x4c>
mov    $0x40,%ecx
mov    %r8,%rdx
mov    %rbx,%r8
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <convolve_5x5_64x64_avx@plt>
cmp    $0x20,%r14
jne    1216 <convolve_5x5_avx+0x76>
cmp    $0x20,%r10
jne    1216 <convolve_5x5_avx+0x76>
mov    $0x20,%ecx
mov    %r8,%rdx
mov    %rbx,%r8
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <convolve_5x5_32x32_avx@plt>
cmp    $0x10,%r14
jne    1240 <convolve_5x5_avx+0xa0>
cmp    $0x10,%r10
jne    1240 <convolve_5x5_avx+0xa0>
mov    $0x10,%ecx
mov    %r8,%rdx
mov    %rbx,%r8
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <convolve_5x5_16x16_avx@plt>
cmp    $0x8,%r14
jne    126a <convolve_5x5_avx+0xca>
cmp    $0x8,%r10
jne    126a <convolve_5x5_avx+0xca>
mov    $0x8,%ecx
mov    %r8,%rdx
mov    %rbx,%r8
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <convolve_5x5_8x8_avx@plt>
movabs $0x2aaaaaaaaaaaaaab,%rcx
aa aa 2a
mov    %r14,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
add    %rdx,%rax
add    %rax,%rax
lea    (%rax,%rax,2),%rcx
test   %rcx,%rcx
mov    %r8,0x28(%rsp)
mov    %r9,%r13
mov    %r10,0x20(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,0x38(%rsp)
mov    %r14,0x30(%rsp)
mov    %rbx,(%rsp)
jle    1381 <convolve_5x5_avx+0x1e1>
lea    0x0(,%r9,8),%rax
lea    (%rax,%rax,2),%rax
mov    %rax,0x18(%rsp)
lea    0x0(,%rbx,8),%rax
lea    (%rax,%rax,2),%rax
mov    %rax,0x10(%rsp)
mov    $0x2,%r12d
mov    %rdi,%r15
mov    %rsi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%r14
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r8,%rdx
mov    %rcx,%rbx
mov    %r10,%rcx
mov    (%rsp),%r8
mov    %r13,%r9
call   10a0 <convolve_5x5_6_avx@plt>
mov    %rbx,%rcx
mov    0x20(%rsp),%r10
mov    0x28(%rsp),%r8
add    $0x6,%r12
add    $0x4,%r14
add    0x18(%rsp),%rbp
add    0x10(%rsp),%r15
cmp    %rcx,%r14
jl     12f0 <convolve_5x5_avx+0x150>
mov    (%rsp),%rbx
mov    0x30(%rsp),%r14
mov    %r14d,%ecx
and    $0xfffffffe,%ecx
lea    -0x2(%r12),%rax
cmp    %rcx,%rax
mov    %rcx,0x18(%rsp)
jae    1394 <convolve_5x5_avx+0x1f4>
mov    %eax,%ecx
and    $0x2,%ecx
test   %rcx,%rcx
je     1394 <convolve_5x5_avx+0x1f4>
mov    %r13,%r9
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r8,%rdx
mov    %r10,%rcx
mov    %rbx,%r8
call   1030 <convolve_5x5_2_avx@plt>
mov    0x20(%rsp),%r10
mov    0x28(%rsp),%r8
lea    (%r15,%rbx,8),%r15
jmp    1397 <convolve_5x5_avx+0x1f7>
mov    %r14d,%eax
and    $0xfffffffe,%eax
mov    %rax,0x18(%rsp)
xor    %r12d,%r12d
mov    %rdi,%r15
jmp    139c <convolve_5x5_avx+0x1fc>
mov    %rax,%r12
mov    0x8(%rsp),%rsi
mov    %r14d,%edi
and    $0xfffffffc,%edi
cmp    %rdi,%r12
jge    1413 <convolve_5x5_avx+0x273>
mov    %r12,%rax
mov    %r13,%rcx
imul   %r13,%rax
lea    (%rsi,%rax,4),%rbp
shl    $0x4,%rcx
mov    %rcx,0x10(%rsp)
mov    %rbx,%rax
shl    $0x4,%rax
mov    %rax,0x40(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rdi,%r14
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r8,%rdx
mov    %r10,%rcx
mov    %rbx,%r8
mov    %r13,%r9
call   10b0 <convolve_5x5_4_avx@plt>
mov    %r14,%rdi
mov    (%rsp),%rbx
mov    0x20(%rsp),%r10
mov    %r13,%rdx
mov    0x28(%rsp),%r8
add    $0x4,%r12
add    0x10(%rsp),%rbp
add    0x40(%rsp),%r15
cmp    %rdi,%r12
jl     13d0 <convolve_5x5_avx+0x230>
jmp    1416 <convolve_5x5_avx+0x276>
mov    %r13,%rdx
cmp    0x18(%rsp),%r12
jge    148b <convolve_5x5_avx+0x2eb>
mov    %r12,%rax
imul   %rdx,%rax
mov    0x8(%rsp),%rcx
lea    (%rcx,%rax,4),%rbp
lea    0x0(,%rdx,8),%rax
mov    %rax,0x10(%rsp)
lea    0x0(,%rbx,8),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r8,%rdx
mov    %r10,%rcx
mov    %rbx,%r8
mov    %r13,%r9
call   1030 <convolve_5x5_2_avx@plt>
mov    (%rsp),%rbx
mov    0x20(%rsp),%r10
mov    %r13,%rdx
mov    0x28(%rsp),%r8
add    $0x2,%r12
add    0x10(%rsp),%rbp
add    %r14,%r15
cmp    0x18(%rsp),%r12
jl     1450 <convolve_5x5_avx+0x2b0>
cmp    0x30(%rsp),%r12
jge    14ee <convolve_5x5_avx+0x34e>
mov    0x30(%rsp),%rbx
sub    %r12,%rbx
imul   %rdx,%r12
mov    0x8(%rsp),%rax
lea    (%rax,%r12,4),%rbp
lea    0x0(,%rdx,4),%r14
mov    (%rsp),%rax
lea    0x0(,%rax,4),%r12
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r8,%rdx
mov    %r10,%rcx
mov    (%rsp),%r8
mov    %r13,%r9
call   1070 <convolve_5x5_1_avx@plt>
mov    0x20(%rsp),%r10
mov    0x28(%rsp),%r8
add    %r14,%rbp
add    %r12,%r15
add    $0xffffffffffffffff,%rbx
jne    14c0 <convolve_5x5_avx+0x320>
mov    (%rsp),%r14
movabs $0xffffffff00000007,%rbx
ff ff ff
and    %r10,%rbx
jle    1545 <convolve_5x5_avx+0x3a5>
and    $0xfffffff8,%r10d
xor    %eax,%eax
mov    %r8,%r15
mov    %r10,%rbp
call   1080 <_mm256_zeroupper@plt>
mov    0x38(%rsp),%rax
lea    (%rax,%rbp,4),%rdi
mov    0x8(%rsp),%rax
lea    (%rax,%rbp,4),%rsi
mov    %r15,%rdx
mov    0x30(%rsp),%rcx
mov    %rbx,%r8
mov    %r14,%r9
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <convolve_5x5_sse@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @convolve_5x5_avx(float* %0, float* %1, float* %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%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*
%31 = alloca float*
%32 = alloca float*
%33 = alloca float*
%34 = alloca float*
%35 = alloca i64
%36 = alloca i64
store float* %0, float** %8
store float* %1, float** %9
store float* %2, float** %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%37 = load i64, i64* %14
store i64 %37, i64* %15
store i64 0, i64* %16
%38 = load float*, float** %9
store float* %38, float** %17
%39 = load float*, float** %8
store float* %39, float** %18
%40 = load float*, float** %10
store float* %40, float** %19
%41 = load i64, i64* %11
%42 = icmp eq i64 %41, 64
br i1 %42, label %43, label %54
43: ; preds = %7
%44 = load i64, i64* %12
%45 = icmp eq i64 %44, 64
br i1 %45, label %46, label %54
46: ; preds = %43
%47 = load float*, float** %8
%48 = load float*, float** %9
%49 = load float*, float** %10
%50 = load i64, i64* %11
%51 = load i64, i64* %13
%52 = load i64, i64* %14
%53 = call i32 @convolve_5x5_64x64_avx(float* %47, float* %48, float* %49, i64 %50, i64 %51, i64 %52)
br label %260
54: ; preds = %43, %7
%55 = load i64, i64* %11
%56 = icmp eq i64 %55, 32
br i1 %56, label %57, label %68
57: ; preds = %54
%58 = load i64, i64* %12
%59 = icmp eq i64 %58, 32
br i1 %59, label %60, label %68
60: ; preds = %57
%61 = load float*, float** %8
%62 = load float*, float** %9
%63 = load float*, float** %10
%64 = load i64, i64* %11
%65 = load i64, i64* %13
%66 = load i64, i64* %14
%67 = call i32 @convolve_5x5_32x32_avx(float* %61, float* %62, float* %63, i64 %64, i64 %65, i64 %66)
br label %260
68: ; preds = %57, %54
%69 = load i64, i64* %11
%70 = icmp eq i64 %69, 16
br i1 %70, label %71, label %82
71: ; preds = %68
%72 = load i64, i64* %12
%73 = icmp eq i64 %72, 16
br i1 %73, label %74, label %82
74: ; preds = %71
%75 = load float*, float** %8
%76 = load float*, float** %9
%77 = load float*, float** %10
%78 = load i64, i64* %11
%79 = load i64, i64* %13
%80 = load i64, i64* %14
%81 = call i32 @convolve_5x5_16x16_avx(float* %75, float* %76, float* %77, i64 %78, i64 %79, i64 %80)
br label %260
82: ; preds = %71, %68
%83 = load i64, i64* %11
%84 = icmp eq i64 %83, 8
br i1 %84, label %85, label %96
85: ; preds = %82
%86 = load i64, i64* %12
%87 = icmp eq i64 %86, 8
br i1 %87, label %88, label %96
88: ; preds = %85
%89 = load float*, float** %8
%90 = load float*, float** %9
%91 = load float*, float** %10
%92 = load i64, i64* %11
%93 = load i64, i64* %13
%94 = load i64, i64* %14
%95 = call i32 @convolve_5x5_8x8_avx(float* %89, float* %90, float* %91, i64 %92, i64 %93, i64 %94)
br label %260
96: ; preds = %85, %82
br label %97
97: ; preds = %122, %96
%98 = load i64, i64* %16
%99 = load i64, i64* %11
%100 = sdiv i64 %99, 6
%101 = mul nsw i64 %100, 6
%102 = icmp slt i64 %98, %101
br i1 %102, label %103, label %125
103: ; preds = %97
%104 = load float*, float** %17
%105 = load i64, i64* %16
%106 = load i64, i64* %15
%107 = mul nsw i64 %105, %106
%108 = getelementptr inbounds float, float* %104, i64 %107
store float* %108, float** %20
%109 = load float*, float** %19
store float* %109, float** %21
%110 = load float*, float** %20
store float* %110, float** %22
%111 = load float*, float** %18
%112 = load float*, float** %22
%113 = load float*, float** %21
%114 = load i64, i64* %12
%115 = load i64, i64* %13
%116 = load i64, i64* %15
%117 = call i32 @convolve_5x5_6_avx(float* %111, float* %112, float* %113, i64 %114, i64 %115, i64 %116)
%118 = load i64, i64* %13
%119 = mul nsw i64 %118, 6
%120 = load float*, float** %18
%121 = getelementptr inbounds float, float* %120, i64 %119
store float* %121, float** %18
br label %122
122: ; preds = %103
%123 = load i64, i64* %16
%124 = add nsw i64 %123, 6
store i64 %124, i64* %16
br label %97
125: ; preds = %97
%126 = load i64, i64* %16
%127 = load i64, i64* %11
%128 = and i64 %127, 4294967294
%129 = icmp slt i64 %126, %128
br i1 %129, label %130, label %155
130: ; preds = %125
%131 = load i64, i64* %16
%132 = srem i64 %131, 4
%133 = icmp ne i64 %132, 0
br i1 %133, label %134, label %155
134: ; preds = %130
%135 = load float*, float** %17
%136 = load i64, i64* %16
%137 = load i64, i64* %15
%138 = mul nsw i64 %136, %137
%139 = getelementptr inbounds float, float* %135, i64 %138
store float* %139, float** %23
%140 = load float*, float** %19
store float* %140, float** %24
%141 = load float*, float** %23
store float* %141, float** %25
%142 = load float*, float** %18
%143 = load float*, float** %25
%144 = load float*, float** %24
%145 = load i64, i64* %12
%146 = load i64, i64* %13
%147 = load i64, i64* %15
%148 = call i32 @convolve_5x5_2_avx(float* %142, float* %143, float* %144, i64 %145, i64 %146, i64 %147)
%149 = load i64, i64* %13
%150 = mul nsw i64 %149, 2
%151 = load float*, float** %18
%152 = getelementptr inbounds float, float* %151, i64 %150
store float* %152, float** %18
%153 = load i64, i64* %16
%154 = add nsw i64 %153, 2
store i64 %154, i64* %16
br label %155
155: ; preds = %134, %130, %125
br label %156
156: ; preds = %180, %155
%157 = load i64, i64* %16
%158 = load i64, i64* %11
%159 = and i64 %158, 4294967292
%160 = icmp slt i64 %157, %159
br i1 %160, label %161, label %183
161: ; preds = %156
%162 = load float*, float** %17
%163 = load i64, i64* %16
%164 = load i64, i64* %15
%165 = mul nsw i64 %163, %164
%166 = getelementptr inbounds float, float* %162, i64 %165
store float* %166, float** %26
%167 = load float*, float** %19
store float* %167, float** %27
%168 = load float*, float** %26
store float* %168, float** %28
%169 = load float*, float** %18
%170 = load float*, float** %28
%171 = load float*, float** %27
%172 = load i64, i64* %12
%173 = load i64, i64* %13
%174 = load i64, i64* %15
%175 = call i32 @convolve_5x5_4_avx(float* %169, float* %170, float* %171, i64 %172, i64 %173, i64 %174)
%176 = load i64, i64* %13
%177 = mul nsw i64 %176, 4
%178 = load float*, float** %18
%179 = getelementptr inbounds float, float* %178, i64 %177
store float* %179, float** %18
br label %180
180: ; preds = %161
%181 = load i64, i64* %16
%182 = add nsw i64 %181, 4
store i64 %182, i64* %16
br label %156
183: ; preds = %156
br label %184
184: ; preds = %208, %183
%185 = load i64, i64* %16
%186 = load i64, i64* %11
%187 = and i64 %186, 4294967294
%188 = icmp slt i64 %185, %187
br i1 %188, label %189, label %211
189: ; preds = %184
%190 = load float*, float** %17
%191 = load i64, i64* %16
%192 = load i64, i64* %15
%193 = mul nsw i64 %191, %192
%194 = getelementptr inbounds float, float* %190, i64 %193
store float* %194, float** %29
%195 = load float*, float** %19
store float* %195, float** %30
%196 = load float*, float** %29
store float* %196, float** %31
%197 = load float*, float** %18
%198 = load float*, float** %31
%199 = load float*, float** %30
%200 = load i64, i64* %12
%201 = load i64, i64* %13
%202 = load i64, i64* %15
%203 = call i32 @convolve_5x5_2_avx(float* %197, float* %198, float* %199, i64 %200, i64 %201, i64 %202)
%204 = load i64, i64* %13
%205 = mul nsw i64 %204, 2
%206 = load float*, float** %18
%207 = getelementptr inbounds float, float* %206, i64 %205
store float* %207, float** %18
br label %208
208: ; preds = %189
%209 = load i64, i64* %16
%210 = add nsw i64 %209, 2
store i64 %210, i64* %16
br label %184
211: ; preds = %184
br label %212
212: ; preds = %235, %211
%213 = load i64, i64* %16
%214 = load i64, i64* %11
%215 = icmp slt i64 %213, %214
br i1 %215, label %216, label %238
216: ; preds = %212
%217 = load float*, float** %17
%218 = load i64, i64* %16
%219 = load i64, i64* %15
%220 = mul nsw i64 %218, %219
%221 = getelementptr inbounds float, float* %217, i64 %220
store float* %221, float** %32
%222 = load float*, float** %19
store float* %222, float** %33
%223 = load float*, float** %32
store float* %223, float** %34
%224 = load float*, float** %18
%225 = load float*, float** %34
%226 = load float*, float** %33
%227 = load i64, i64* %12
%228 = load i64, i64* %13
%229 = load i64, i64* %15
%230 = call i32 @convolve_5x5_1_avx(float* %224, float* %225, float* %226, i64 %227, i64 %228, i64 %229)
%231 = load i64, i64* %13
%232 = mul nsw i64 %231, 1
%233 = load float*, float** %18
%234 = getelementptr inbounds float, float* %233, i64 %232
store float* %234, float** %18
br label %235
235: ; preds = %216
%236 = load i64, i64* %16
%237 = add nsw i64 %236, 1
store i64 %237, i64* %16
br label %212
238: ; preds = %212
%239 = load i64, i64* %12
%240 = and i64 %239, 4294967288
store i64 %240, i64* %35
%241 = load i64, i64* %12
%242 = load i64, i64* %35
%243 = sub nsw i64 %241, %242
store i64 %243, i64* %36
%244 = load i64, i64* %36
%245 = icmp sgt i64 %244, 0
br i1 %245, label %246, label %260
246: ; preds = %238
%247 = call i32 (...) @_mm256_zeroupper()
%248 = load float*, float** %8
%249 = load i64, i64* %35
%250 = getelementptr inbounds float, float* %248, i64 %249
%251 = load float*, float** %9
%252 = load i64, i64* %35
%253 = getelementptr inbounds float, float* %251, i64 %252
%254 = load float*, float** %10
%255 = load i64, i64* %11
%256 = load i64, i64* %36
%257 = load i64, i64* %13
%258 = load i64, i64* %14
%259 = call i32 @convolve_5x5_sse(float* %250, float* %253, float* %254, i64 %255, i64 %256, i64 %257, i64 %258)
br label %260
260: ; preds = %46, %60, %74, %88, %246, %238
ret void
}

LLVM IR (-O2):
define void @convolve_5x5_avx(float* %0, float* %1, float* %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = icmp eq i64 %3, 64
%9 = icmp eq i64 %4, 64
%10 = and i1 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 @convolve_5x5_64x64_avx(float* %0, float* %1, float* %2, i64 64, i64 %5, i64 %6)
br label %115
13: ; preds = %7
%14 = icmp eq i64 %3, 32
%15 = icmp eq i64 %4, 32
%16 = and i1 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 @convolve_5x5_32x32_avx(float* %0, float* %1, float* %2, i64 32, i64 %5, i64 %6)
br label %115
19: ; preds = %13
%20 = icmp eq i64 %3, 16
%21 = icmp eq i64 %4, 16
%22 = and i1 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 @convolve_5x5_16x16_avx(float* %0, float* %1, float* %2, i64 16, i64 %5, i64 %6)
br label %115
25: ; preds = %19
%26 = icmp eq i64 %3, 8
%27 = icmp eq i64 %4, 8
%28 = and i1 %26, %27
br i1 %28, label %37, label %29
29: ; preds = %25
%30 = srem i64 %3, 6
%31 = sub i64 %3, %30
%32 = icmp sgt i64 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = and i64 %3, 4294967294
br label %61
35: ; preds = %29
%36 = mul nsw i64 %5, 6
br label %39
37: ; preds = %25
%38 = tail call i32 @convolve_5x5_8x8_avx(float* %0, float* %1, float* %2, i64 8, i64 %5, i64 %6)
br label %115
39: ; preds = %35, %39
%40 = phi i64 [ 0, %35 ], [ %46, %39 ]
%41 = phi float* [ %0, %35 ], [ %45, %39 ]
%42 = mul nsw i64 %40, %6
%43 = getelementptr inbounds float, float* %1, i64 %42
%44 = tail call i32 @convolve_5x5_6_avx(float* %41, float* %43, float* %2, i64 %4, i64 %5, i64 %6)
%45 = getelementptr inbounds float, float* %41, i64 %36
%46 = add nuw nsw i64 %40, 6
%47 = icmp slt i64 %46, %31
br i1 %47, label %39, label %48
48: ; preds = %39
%49 = and i64 %3, 4294967294
%50 = icmp uge i64 %46, %49
%51 = and i64 %46, 2
%52 = icmp eq i64 %51, 0
%53 = or i1 %50, %52
br i1 %53, label %61, label %54
54: ; preds = %48
%55 = mul nsw i64 %46, %6
%56 = getelementptr inbounds float, float* %1, i64 %55
%57 = tail call i32 @convolve_5x5_2_avx(float* %45, float* %56, float* %2, i64 %4, i64 %5, i64 %6)
%58 = shl nsw i64 %5, 1
%59 = getelementptr inbounds float, float* %45, i64 %58
%60 = add nuw nsw i64 %40, 8
br label %61
61: ; preds = %33, %54, %48
%62 = phi i64 [ %49, %54 ], [ %49, %48 ], [ %34, %33 ]
%63 = phi float* [ %59, %54 ], [ %45, %48 ], [ %0, %33 ]
%64 = phi i64 [ %60, %54 ], [ %46, %48 ], [ 0, %33 ]
%65 = and i64 %3, 4294967292
%66 = icmp slt i64 %64, %65
br i1 %66, label %67, label %69
67: ; preds = %61
%68 = shl nsw i64 %5, 2
br label %75
69: ; preds = %75, %61
%70 = phi float* [ %63, %61 ], [ %81, %75 ]
%71 = phi i64 [ %64, %61 ], [ %82, %75 ]
%72 = icmp slt i64 %71, %62
br i1 %72, label %73, label %84
73: ; preds = %69
%74 = shl nsw i64 %5, 1
br label %88
75: ; preds = %67, %75
%76 = phi i64 [ %64, %67 ], [ %82, %75 ]
%77 = phi float* [ %63, %67 ], [ %81, %75 ]
%78 = mul nsw i64 %76, %6
%79 = getelementptr inbounds float, float* %1, i64 %78
%80 = tail call i32 @convolve_5x5_4_avx(float* %77, float* %79, float* %2, i64 %4, i64 %5, i64 %6)
%81 = getelementptr inbounds float, float* %77, i64 %68
%82 = add nsw i64 %76, 4
%83 = icmp slt i64 %82, %65
br i1 %83, label %75, label %69
84: ; preds = %88, %69
%85 = phi float* [ %70, %69 ], [ %94, %88 ]
%86 = phi i64 [ %71, %69 ], [ %95, %88 ]
%87 = icmp slt i64 %86, %3
br i1 %87, label %97, label %106
88: ; preds = %73, %88
%89 = phi i64 [ %71, %73 ], [ %95, %88 ]
%90 = phi float* [ %70, %73 ], [ %94, %88 ]
%91 = mul nsw i64 %89, %6
%92 = getelementptr inbounds float, float* %1, i64 %91
%93 = tail call i32 @convolve_5x5_2_avx(float* %90, float* %92, float* %2, i64 %4, i64 %5, i64 %6)
%94 = getelementptr inbounds float, float* %90, i64 %74
%95 = add nsw i64 %89, 2
%96 = icmp slt i64 %95, %62
br i1 %96, label %88, label %84
97: ; preds = %84, %97
%98 = phi i64 [ %104, %97 ], [ %86, %84 ]
%99 = phi float* [ %103, %97 ], [ %85, %84 ]
%100 = mul nsw i64 %98, %6
%101 = getelementptr inbounds float, float* %1, i64 %100
%102 = tail call i32 @convolve_5x5_1_avx(float* %99, float* %101, float* %2, i64 %4, i64 %5, i64 %6)
%103 = getelementptr inbounds float, float* %99, i64 %5
%104 = add i64 %98, 1
%105 = icmp eq i64 %104, %3
br i1 %105, label %106, label %97
106: ; preds = %97, %84
%107 = and i64 %4, 4294967288
%108 = and i64 %4, -4294967289
%109 = icmp sgt i64 %108, 0
br i1 %109, label %110, label %115
110: ; preds = %106
%111 = tail call i32 (...) @_mm256_zeroupper()
%112 = getelementptr inbounds float, float* %0, i64 %107
%113 = getelementptr inbounds float, float* %1, i64 %107
%114 = tail call i32 @convolve_5x5_sse(float* %112, float* %113, float* %2, i64 %3, i64 %108, i64 %5, i64 %6)
br label %115
115: ; preds = %106, %110, %37, %23, %17, %11
ret void
}