#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 uint8_t;

/* Variables and functions */
bool pes_validate_dts(const uint8_t *p_pes) {
  return (p_pes[9] & 0x10) && ((p_pes[14] & 0xf1) == 0x11) &&
         (p_pes[16] & 0x1) && (p_pes[18] & 0x1);
}


x86 assembly (clang, -O0):
<pes_validate_dts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
and    $0x10,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1166 <pes_validate_dts+0x66>
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%ecx
and    $0xf1,%ecx
xor    %eax,%eax
cmp    $0x11,%ecx
mov    %al,-0x9(%rbp)
jne    1166 <pes_validate_dts+0x66>
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%ecx
and    $0x1,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1166 <pes_validate_dts+0x66>
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_validate_dts>:
xor    %eax,%eax
testb  $0x10,0x24(%rdi)
je     1121 <pes_validate_dts+0x21>
mov    $0xf1,%ecx
and    0x38(%rdi),%ecx
cmp    $0x11,%ecx
jne    1121 <pes_validate_dts+0x21>
testb  $0x1,0x40(%rdi)
je     1121 <pes_validate_dts+0x21>
mov    0x48(%rdi),%eax
and    $0x1,%eax
ret

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

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