#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 */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int vpx_get_filter_taps(const int16_t *const filter) {
  assert(filter[3] != 128);
  if (!filter[0] && !filter[1] && !filter[2])
    return 2;
  else
    return 8;
}


x86 assembly (clang, -O0):
<vpx_get_filter_taps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x80,0xc(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1169 <vpx_get_filter_taps+0x59>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jne    1169 <vpx_get_filter_taps+0x59>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
jne    1169 <vpx_get_filter_taps+0x59>
movl   $0x2,-0x4(%rbp)
jmp    1170 <vpx_get_filter_taps+0x60>
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vpx_get_filter_taps>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmpl   $0x80,0xc(%rbx)
setne  %dil
call   1030 <assert@plt>
cmpl   $0x0,(%rbx)
jne    1137 <vpx_get_filter_taps+0x27>
cmpl   $0x0,0x4(%rbx)
jne    1137 <vpx_get_filter_taps+0x27>
cmpl   $0x0,0x8(%rbx)
je     113e <vpx_get_filter_taps+0x2e>
mov    $0x8,%eax
pop    %rbx
ret
mov    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vpx_get_filter_taps(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 3
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 128
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %25, label %14
14: ; preds = %1
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %14
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %19
store i32 2, i32* %2
br label %26
25: ; preds = %19, %14, %1
store i32 8, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @vpx_get_filter_taps(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 128
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* %0
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = getelementptr inbounds i32, i32* %0, i64 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = getelementptr inbounds i32, i32* %0, i64 2
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13, %9, %1
br label %18
18: ; preds = %13, %17
%19 = phi i32 [ 8, %17 ], [ 2, %13 ]
ret i32 %19
}