#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*/ vp8_simple_filter(char, unsigned char *, unsigned char *,
                                     unsigned char *, unsigned char *);
char vp8_simple_filter_mask(unsigned char const, unsigned char, unsigned char,
                            unsigned char, unsigned char);
void vp8_loop_filter_simple_vertical_edge_simd(unsigned char *s, int p,
                                               const unsigned char *blimit) {
  signed char mask = 0;
  int i = 0;
  do {
    mask = vp8_simple_filter_mask(blimit[0], s[-2], s[-1], s[0], s[1]);
    vp8_simple_filter(mask, s - 2, s - 1, s, s + 1);
    s += p;
  } while (++i < 16);
}


x86 assembly (clang, -O0):
<vp8_loop_filter_simple_vertical_edge_simd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x0,-0x19(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%dil
mov    -0x8(%rbp),%rax
mov    -0x2(%rax),%sil
mov    -0x8(%rbp),%rax
mov    -0x1(%rax),%dl
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
movzbl %dil,%edi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl 0x1(%rax),%r8d
call   1030 <vp8_simple_filter_mask@plt>
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    -0x8(%rbp),%rsi
add    $0xfffffffffffffffe,%rsi
mov    -0x8(%rbp),%rdx
add    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
add    $0x1,%r8
movsbl %al,%edi
call   1040 <vp8_simple_filter@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x10,%eax
jl     113e <vp8_loop_filter_simple_vertical_edge_simd+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_loop_filter_simple_vertical_edge_simd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,(%rsp)
mov    %rdi,%rbx
movslq %esi,%rbp
mov    $0x10,%r14d
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%rax
movzbl (%rax),%edi
lea    -0x2(%rbx),%r15
movzbl -0x2(%rbx),%esi
lea    -0x1(%rbx),%r12
movzbl -0x1(%rbx),%edx
movzbl (%rbx),%ecx
lea    0x1(%rbx),%r13
movzbl 0x1(%rbx),%r8d
call   1030 <vp8_simple_filter_mask@plt>
movsbl %al,%edi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
call   1040 <vp8_simple_filter@plt>
add    %rbp,%rbx
add    $0xffffffff,%r14d
jne    1140 <vp8_loop_filter_simple_vertical_edge_simd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @vp8_loop_filter_simple_vertical_edge_simd(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i8 0, i8* %7
store i32 0, i32* %8
br label %9
9: ; preds = %39, %3
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 -2
%15 = load i8, i8* %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 -1
%18 = load i8, i8* %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = call signext i8 @vp8_simple_filter_mask(i8 zeroext %12, i8 zeroext %15, i8 zeroext %18, i8 zeroext %21, i8 zeroext %24)
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 -2
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 -1
%31 = load i8*, i8** %4
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = call i32 @vp8_simple_filter(i8 signext %26, i8* %28, i8* %30, i8* %31, i8* %33)
%35 = load i32, i32* %5
%36 = load i8*, i8** %4
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds i8, i8* %36, i64 %37
store i8* %38, i8** %4
br label %39
39: ; preds = %9
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
store i32 %41, i32* %8
%42 = icmp slt i32 %41, 16
br i1 %42, label %9, label %43
43: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @vp8_loop_filter_simple_vertical_edge_simd(i8* %0, i32 %1, i8* nocapture %2) {
%4 = sext i32 %1 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i8* [ %0, %3 ], [ %18, %5 ]
%7 = phi i32 [ 0, %3 ], [ %19, %5 ]
%8 = load i8, i8* %2
%9 = getelementptr inbounds i8, i8* %6, i64 -2
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %6, i64 -1
%12 = load i8, i8* %11
%13 = load i8, i8* %6
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = tail call signext i8 @vp8_simple_filter_mask(i8 zeroext %8, i8 zeroext %10, i8 zeroext %12, i8 zeroext %13, i8 zeroext %15)
%17 = tail call i32 @vp8_simple_filter(i8 signext %16, i8* %9, i8* %11, i8* %6, i8* %14)
%18 = getelementptr inbounds i8, i8* %6, i64 %4
%19 = add nuw nsw i32 %7, 1
%20 = icmp eq i32 %19, 16
br i1 %20, label %21, label %5
21: ; preds = %5
ret void
}