#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*/ houston_ReadReg(int, unsigned long *, int);
int houston_Rev();
void conget_yc_filter(int *p_luma_filter, int *p_chroma_filter) {
  unsigned long reg, reg07, reg34;
  if (!p_luma_filter || !p_chroma_filter)
    return;
  if (houston_Rev() < 1) {
    *p_luma_filter = 0;
    *p_chroma_filter = 0;
    return;
  }
  houston_ReadReg(0x8d, &reg, 1);
  *p_luma_filter = (reg ? 1 : 0);
  houston_ReadReg(0x47, &reg07, 1);
  houston_ReadReg(0x74, &reg34, 1);
  *p_chroma_filter = !((0x08 & reg07) || (0x20 & reg34));
}


x86 assembly (clang, -O0):
<conget_yc_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <conget_yc_filter+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    114b <conget_yc_filter+0x2b>
jmp    11fe <conget_yc_filter+0xde>
mov    $0x0,%al
call   1030 <houston_Rev@plt>
cmp    $0x1,%eax
jge    1174 <conget_yc_filter+0x54>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    11fe <conget_yc_filter+0xde>
mov    $0x8d,%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1040 <houston_ReadReg@plt>
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%rdx
cmovne %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x47,%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1040 <houston_ReadReg@plt>
mov    $0x74,%edi
lea    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1040 <houston_ReadReg@plt>
mov    -0x20(%rbp),%rcx
and    $0x8,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x29(%rbp)
jne    11ee <conget_yc_filter+0xce>
mov    -0x28(%rbp),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conget_yc_filter>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
test   %rdi,%rdi
je     11b6 <conget_yc_filter+0x96>
mov    %rsi,%r14
test   %rsi,%rsi
je     11b6 <conget_yc_filter+0x96>
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <houston_Rev@plt>
test   %eax,%eax
jle    11ad <conget_yc_filter+0x8d>
lea    0x18(%rsp),%rsi
mov    $0x8d,%edi
mov    $0x1,%edx
call   1040 <houston_ReadReg@plt>
xor    %eax,%eax
cmpq   $0x0,0x18(%rsp)
setne  %al
mov    %eax,(%rbx)
lea    0x10(%rsp),%rsi
mov    $0x47,%edi
mov    $0x1,%edx
call   1040 <houston_ReadReg@plt>
lea    0x8(%rsp),%rsi
mov    $0x74,%edi
mov    $0x1,%edx
call   1040 <houston_ReadReg@plt>
mov    0x10(%rsp),%rax
and    $0x8,%eax
mov    0x8(%rsp),%rcx
and    $0x20,%ecx
xor    %ebp,%ebp
or     %rax,%rcx
sete   %bpl
jmp    11b3 <conget_yc_filter+0x93>
movl   $0x0,(%rbx)
mov    %ebp,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @conget_yc_filter(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32*, i32** %4
%12 = icmp ne i32* %11, null
br i1 %12, label %14, label %13
13: ; preds = %10, %2
br label %41
14: ; preds = %10
%15 = call i32 (...) @houston_Rev()
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32*, i32** %3
store i32 0, i32* %18
%19 = load i32*, i32** %4
store i32 0, i32* %19
br label %41
20: ; preds = %14
%21 = call i32 @houston_ReadReg(i32 141, i64* %5, i32 1)
%22 = load i64, i64* %5
%23 = icmp ne i64 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
%26 = load i32*, i32** %3
store i32 %25, i32* %26
%27 = call i32 @houston_ReadReg(i32 71, i64* %6, i32 1)
%28 = call i32 @houston_ReadReg(i32 116, i64* %7, i32 1)
%29 = load i64, i64* %6
%30 = and i64 8, %29
%31 = icmp ne i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %20
%33 = load i64, i64* %7
%34 = and i64 32, %33
%35 = icmp ne i64 %34, 0
br label %36
36: ; preds = %32, %20
%37 = phi i1 [ true, %20 ], [ %35, %32 ]
%38 = xor i1 %37, true
%39 = zext i1 %38 to i32
%40 = load i32*, i32** %4
store i32 %39, i32* %40
br label %41
41: ; preds = %36, %17, %13
ret void
}

LLVM IR (-O2):
define void @conget_yc_filter(i32* writeonly %0, i32* writeonly %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = bitcast i64* %3 to i8*
%7 = bitcast i64* %4 to i8*
%8 = bitcast i64* %5 to i8*
%9 = icmp ne i32* %0, null
%10 = icmp ne i32* %1, null
%11 = and i1 %9, %10
br i1 %11, label %12, label %33
12: ; preds = %2
%13 = tail call i32 (...) @houston_Rev()
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 0, i32* %0
br label %31
16: ; preds = %12
%17 = call i32 @houston_ReadReg(i32 141, i64* %3, i32 1)
%18 = load i64, i64* %3
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
store i32 %20, i32* %0
%21 = call i32 @houston_ReadReg(i32 71, i64* %4, i32 1)
%22 = call i32 @houston_ReadReg(i32 116, i64* %5, i32 1)
%23 = load i64, i64* %4
%24 = and i64 %23, 8
%25 = icmp eq i64 %24, 0
%26 = load i64, i64* %5
%27 = and i64 %26, 32
%28 = icmp eq i64 %27, 0
%29 = select i1 %25, i1 %28, i1 false
%30 = zext i1 %29 to i32
br label %31
31: ; preds = %15, %16
%32 = phi i32 [ %30, %16 ], [ 0, %15 ]
store i32 %32, i32* %1
br label %33
33: ; preds = %31, %2
ret void
}