#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*/ transpose(unsigned char **, int, unsigned char **, int, int);
int /*<<< orphan*/ vpx_lpf_horizontal_16(unsigned char *, int,
                                         unsigned char const *,
                                         unsigned char const *,
                                         unsigned char const *);
void vpx_lpf_vertical_16_sse2(unsigned char *s, int pitch,
                              const unsigned char *blimit,
                              const unsigned char *limit,
                              const unsigned char *thresh) {
  unsigned char t_dst[8 * 16] __attribute__((aligned(8)));
  unsigned char *src[2];
  unsigned char *dst[2];
  src[0] = s - 8;
  src[1] = s;
  dst[0] = t_dst;
  dst[1] = t_dst + 8 * 8;
  transpose(src, pitch, dst, 8, 2);
  vpx_lpf_horizontal_16(t_dst + 8 * 8, 8, blimit, limit, thresh);
  src[0] = t_dst;
  src[1] = t_dst + 8 * 8;
  dst[0] = s - 8;
  dst[1] = s;
  transpose(src, 8, dst, pitch, 2);
}


x86 assembly (clang, -O0):
<vpx_lpf_vertical_16_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xb8(%rbp)
lea    -0xa8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    -0xa8(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0xc8(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0xd0(%rbp),%rdx
mov    $0x8,%ecx
mov    $0x2,%r8d
call   1030 <transpose@plt>
lea    -0xa8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x8,%esi
call   1040 <vpx_lpf_horizontal_16@plt>
lea    -0xa8(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    -0xa8(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0xd0(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
lea    -0xc0(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x8,%esi
mov    $0x2,%r8d
call   1030 <transpose@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpx_lpf_vertical_16_sse2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r8,0x20(%rsp)
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%ebp
mov    %rdi,%rbx
lea    -0x8(%rdi),%r14
mov    %r14,0x10(%rsp)
mov    %rdi,0x18(%rsp)
lea    0x28(%rsp),%rax
mov    %rax,(%rsp)
lea    0x68(%rsp),%r13
mov    %r13,0x8(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rdx
mov    $0x8,%ecx
mov    $0x2,%r8d
call   1030 <transpose@plt>
mov    %r13,%rdi
mov    $0x8,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    0x20(%rsp),%r8
call   1040 <vpx_lpf_horizontal_16@plt>
lea    0x28(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    %r13,0x18(%rsp)
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x8,%esi
mov    %rsp,%rdx
mov    %ebp,%ecx
mov    $0x2,%r8d
call   1030 <transpose@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vpx_lpf_vertical_16_sse2(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [128 x i8]
%12 = alloca [2 x i8*]
%13 = alloca [2 x i8*]
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 -8
%16 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 0
store i8* %15, i8** %16
%17 = load i8*, i8** %6
%18 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 1
store i8* %17, i8** %18
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%20 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 0
store i8* %19, i8** %20
%21 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%22 = getelementptr inbounds i8, i8* %21, i64 64
%23 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 1
store i8* %22, i8** %23
%24 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 0
%25 = load i32, i32* %7
%26 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 0
%27 = call i32 @transpose(i8** %24, i32 %25, i8** %26, i32 8, i32 2)
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%29 = getelementptr inbounds i8, i8* %28, i64 64
%30 = load i8*, i8** %8
%31 = load i8*, i8** %9
%32 = load i8*, i8** %10
%33 = call i32 @vpx_lpf_horizontal_16(i8* %29, i32 8, i8* %30, i8* %31, i8* %32)
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%35 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 0
store i8* %34, i8** %35
%36 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%37 = getelementptr inbounds i8, i8* %36, i64 64
%38 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 1
store i8* %37, i8** %38
%39 = load i8*, i8** %6
%40 = getelementptr inbounds i8, i8* %39, i64 -8
%41 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 0
store i8* %40, i8** %41
%42 = load i8*, i8** %6
%43 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 1
store i8* %42, i8** %43
%44 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 0
%45 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 0
%46 = load i32, i32* %7
%47 = call i32 @transpose(i8** %44, i32 8, i8** %45, i32 %46, i32 2)
ret void
}

LLVM IR (-O2):
define void @vpx_lpf_vertical_16_sse2(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca [128 x i8]
%7 = alloca [2 x i8*]
%8 = alloca [2 x i8*]
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%10 = bitcast [2 x i8*]* %7 to i8*
%11 = bitcast [2 x i8*]* %8 to i8*
%12 = getelementptr inbounds i8, i8* %0, i64 -8
%13 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
store i8* %12, i8** %13
%14 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 1
store i8* %0, i8** %14
%15 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 0
store i8* %9, i8** %15
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 64
%17 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 1
store i8* %16, i8** %17
%18 = call i32 @transpose(i8** %13, i32 %1, i8** %15, i32 8, i32 2)
%19 = call i32 @vpx_lpf_horizontal_16(i8* %16, i32 8, i8* %2, i8* %3, i8* %4)
store i8* %9, i8** %13
store i8* %16, i8** %14
store i8* %12, i8** %15
store i8* %0, i8** %17
%20 = call i32 @transpose(i8** %13, i32 8, i8** %15, i32 %1, i32 2)
ret void
}