#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;
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ decode_time_stamp(int /*<<< orphan*/ *, int const *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
unsigned int get16be(int const *);
void dump_pes_packet_header(FILE *fp, const uint8_t *pes_packet,
                            const uint8_t *end) {
  unsigned int packet_start_code_prefix;
  unsigned int stream_id;
  unsigned int PES_packet_length;
  unsigned int PES_scrambling_control;
  unsigned int PES_priority;
  unsigned int data_alignment_indicator;
  unsigned int copyright;
  unsigned int original_or_copy;
  unsigned int PTS_DTS_flags;
  unsigned int ESCR_flag;
  unsigned int ES_rate_flag;
  unsigned int DSM_trick_mode_flag;
  unsigned int additional_copy_info_flag;
  unsigned int PES_CRC_flag;
  unsigned int PES_extension_flag;
  unsigned int PES_header_data_length;
  int64_t ts;
  fputs("PES packet", fp);
  if (pes_packet + 9 >= end)
    goto truncated;
  packet_start_code_prefix =
      ((pes_packet[0] << 16) | (pes_packet[1] << 8) | (pes_packet[2] << 0));
  stream_id = pes_packet[3];
  PES_packet_length = get16be(pes_packet + 4);
  PES_scrambling_control = (pes_packet[6] & 0x30) >> 4;
  PES_priority = pes_packet[6] & 0x08;
  data_alignment_indicator = pes_packet[6] & 0x04;
  copyright = pes_packet[6] & 0x02;
  original_or_copy = pes_packet[6] & 0x01;
  PTS_DTS_flags = (pes_packet[7] & 0xC0) >> 6;
  ESCR_flag = pes_packet[7] & 0x20;
  ES_rate_flag = pes_packet[7] & 0x10;
  DSM_trick_mode_flag = pes_packet[7] & 0x08;
  additional_copy_info_flag = pes_packet[7] & 0x04;
  PES_CRC_flag = pes_packet[7] & 0x02;
  PES_extension_flag = pes_packet[7] & 0x01;
  PES_header_data_length = pes_packet[8];
  fprintf(fp,
          " %06X%02X %5u "
          "%u%u%u%c%c%c%c%u%c%c%c%c%c%c %u",
          packet_start_code_prefix, stream_id, PES_packet_length,
          !!(pes_packet[6] & 0x80), !!(pes_packet[6] & 0x40),
          PES_scrambling_control, PES_priority ? 'P' : '-',
          data_alignment_indicator ? 'A' : '-', copyright ? 'C' : '-',
          original_or_copy ? 'O' : 'C', PTS_DTS_flags, ESCR_flag ? 'E' : '-',
          ES_rate_flag ? 'E' : '-', DSM_trick_mode_flag ? 'D' : '-',
          additional_copy_info_flag ? 'A' : '-', PES_CRC_flag ? 'C' : '-',
          PES_extension_flag ? 'X' : '-', PES_header_data_length);
  switch (PTS_DTS_flags) {
  case 0:
  case 1:
    fputc('\n', fp);
    break;
  case 2:
    if (pes_packet + 14 >= end)
      goto truncated;
    if (decode_time_stamp(&ts, &pes_packet[9], 0x21))
      fprintf(fp,
              " PTS=%"
              "lld"
              "\n",
              ts);
    else
      fputs(" bad PTS\n", fp);
    break;
  case 3:
    if (pes_packet + 19 >= end)
      goto truncated;
    if (decode_time_stamp(&ts, &pes_packet[9], 0x31))
      fprintf(fp,
              " PTS=%"
              "lld",
              ts);
    else
      fputs(" bad PTS", fp);
    if (decode_time_stamp(&ts, &pes_packet[14], 0x11))
      fprintf(fp,
              " DTS=%"
              "lld"
              "\n",
              ts);
    else
      fputs(" bad DTS\n", fp);
    break;
  }
  return;
truncated:
  fputs(" truncated\n", fp);
}


x86 assembly (clang, -O0):
<dump_pes_packet_header>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x38(%rbp),%rax
add    $0x24,%rax
cmp    -0x40(%rbp),%rax
jb     1197 <dump_pes_packet_header+0x47>
jmp    1575 <dump_pes_packet_header+0x425>
mov    -0x38(%rbp),%rcx
mov    (%rcx),%eax
mov    0x4(%rcx),%edx
shl    $0x10,%eax
shl    $0x8,%edx
or     %edx,%eax
mov    0x8(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x48(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x10,%rdi
call   1040 <get16be@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x30,%eax
shr    $0x4,%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x8,%eax
mov    %eax,-0x54(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x4,%eax
mov    %eax,-0x58(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x2,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
movzbl 0x1c(%rax),%eax
shr    $0x6,%eax
mov    %eax,-0x64(%rbp)
mov    -0x38(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x20,%eax
mov    %eax,-0x68(%rbp)
mov    -0x38(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x10,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x38(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x8,%eax
mov    %eax,-0x70(%rbp)
mov    -0x38(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x4,%eax
mov    %eax,-0x74(%rbp)
mov    -0x38(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x2,%eax
mov    %eax,-0x78(%rbp)
mov    -0x38(%rbp),%rax
mov    0x1c(%rax),%eax
and    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    -0x38(%rbp),%rax
mov    0x20(%rax),%eax
mov    %eax,-0x80(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    -0x48(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x4c(%rbp),%r8d
mov    -0x38(%rbp),%rax
mov    0x18(%rax),%esi
mov    %sil,%al
movzbl %al,%r9d
shr    $0x7,%r9d
and    $0x40,%esi
shr    $0x6,%esi
mov    -0x50(%rbp),%r10d
mov    -0x54(%rbp),%eax
test   %eax,%eax
mov    $0x50,%eax
mov    $0x2d,%r13d
mov    %r13d,-0xac(%rbp)
mov    %r13d,%r11d
cmovne %eax,%r11d
mov    -0x58(%rbp),%eax
test   %eax,%eax
mov    $0x41,%eax
mov    %eax,-0xb4(%rbp)
mov    %r13d,%ebx
cmovne %eax,%ebx
mov    -0x5c(%rbp),%eax
test   %eax,%eax
mov    $0x43,%r15d
mov    %r15d,-0xb0(%rbp)
mov    %r13d,%r14d
cmovne %r15d,%r14d
mov    -0x60(%rbp),%eax
test   %eax,%eax
mov    $0x4f,%eax
cmovne %eax,%r15d
mov    -0x64(%rbp),%r12d
mov    -0x68(%rbp),%eax
test   %eax,%eax
mov    $0x45,%ecx
cmovne %ecx,%r13d
mov    -0x6c(%rbp),%eax
test   %eax,%eax
mov    -0xac(%rbp),%eax
cmovne %ecx,%eax
mov    -0xac(%rbp),%ecx
mov    %eax,-0x90(%rbp)
mov    -0x70(%rbp),%eax
test   %eax,%eax
mov    $0x44,%eax
cmovne %eax,%ecx
mov    -0xb4(%rbp),%eax
mov    %ecx,-0x94(%rbp)
mov    -0x74(%rbp),%ecx
test   %ecx,%ecx
mov    -0xac(%rbp),%ecx
cmovne %eax,%ecx
mov    -0xb0(%rbp),%eax
mov    %ecx,-0x98(%rbp)
mov    -0x78(%rbp),%ecx
test   %ecx,%ecx
mov    -0xac(%rbp),%ecx
cmovne %eax,%ecx
mov    -0xac(%rbp),%eax
mov    %ecx,-0x9c(%rbp)
mov    -0x7c(%rbp),%ecx
test   %ecx,%ecx
mov    $0x58,%ecx
cmovne %ecx,%eax
mov    %eax,-0xa0(%rbp)
mov    -0x80(%rbp),%ecx
mov    %rsp,%rax
mov    %rax,-0xa8(%rbp)
mov    %ecx,0x68(%rax)
mov    -0xa0(%rbp),%ecx
mov    %ecx,0x60(%rax)
mov    -0x9c(%rbp),%ecx
mov    %ecx,0x58(%rax)
mov    -0x98(%rbp),%ecx
mov    %ecx,0x50(%rax)
mov    -0x94(%rbp),%ecx
mov    %ecx,0x48(%rax)
mov    -0x90(%rbp),%ecx
mov    %ecx,0x40(%rax)
mov    -0x8c(%rbp),%ecx
mov    %r13d,0x38(%rax)
mov    %r12d,0x30(%rax)
mov    %r15d,0x28(%rax)
mov    %r14d,0x20(%rax)
mov    %ebx,0x18(%rax)
mov    %r11d,0x10(%rax)
mov    %r10d,0x8(%rax)
mov    %esi,(%rax)
lea    0xc19(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    -0x64(%rbp),%eax
mov    %eax,-0x88(%rbp)
sub    $0x2,%eax
jb     1438 <dump_pes_packet_header+0x2e8>
jmp    1410 <dump_pes_packet_header+0x2c0>
mov    -0x88(%rbp),%eax
sub    $0x2,%eax
je     144b <dump_pes_packet_header+0x2fb>
jmp    1424 <dump_pes_packet_header+0x2d4>
mov    -0x88(%rbp),%eax
sub    $0x3,%eax
je     14b6 <dump_pes_packet_header+0x366>
jmp    1570 <dump_pes_packet_header+0x420>
mov    -0x30(%rbp),%rsi
mov    $0xa,%edi
call   1060 <fputc@plt>
jmp    1570 <dump_pes_packet_header+0x420>
mov    -0x38(%rbp),%rax
add    $0x38,%rax
cmp    -0x40(%rbp),%rax
jb     1462 <dump_pes_packet_header+0x312>
jmp    1575 <dump_pes_packet_header+0x425>
mov    -0x38(%rbp),%rsi
add    $0x24,%rsi
lea    -0x84(%rbp),%rdi
mov    $0x21,%edx
call   1030 <decode_time_stamp@plt>
cmp    $0x0,%eax
je     14a1 <dump_pes_packet_header+0x351>
mov    -0x30(%rbp),%rdi
mov    -0x84(%rbp),%edx
lea    0xba4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    14b1 <dump_pes_packet_header+0x361>
mov    -0x30(%rbp),%rsi
lea    0xb98(%rip),%rdi
call   1050 <fputs@plt>
jmp    1570 <dump_pes_packet_header+0x420>
mov    -0x38(%rbp),%rax
add    $0x4c,%rax
cmp    -0x40(%rbp),%rax
jb     14cd <dump_pes_packet_header+0x37d>
jmp    1575 <dump_pes_packet_header+0x425>
mov    -0x38(%rbp),%rsi
add    $0x24,%rsi
lea    -0x84(%rbp),%rdi
mov    $0x31,%edx
call   1030 <decode_time_stamp@plt>
cmp    $0x0,%eax
je     150c <dump_pes_packet_header+0x3bc>
mov    -0x30(%rbp),%rdi
mov    -0x84(%rbp),%edx
lea    0xb4e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    151c <dump_pes_packet_header+0x3cc>
mov    -0x30(%rbp),%rsi
lea    0xb41(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x38(%rbp),%rsi
add    $0x38,%rsi
lea    -0x84(%rbp),%rdi
mov    $0x11,%edx
call   1030 <decode_time_stamp@plt>
cmp    $0x0,%eax
je     155b <dump_pes_packet_header+0x40b>
mov    -0x30(%rbp),%rdi
mov    -0x84(%rbp),%edx
lea    0xb12(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    156b <dump_pes_packet_header+0x41b>
mov    -0x30(%rbp),%rsi
lea    0xb06(%rip),%rdi
call   1050 <fputs@plt>
jmp    1570 <dump_pes_packet_header+0x420>
jmp    1585 <dump_pes_packet_header+0x435>
mov    -0x30(%rbp),%rsi
lea    0xaf6(%rip),%rdi
call   1050 <fputs@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_pes_packet_header>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xeb2(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
lea    0x24(%rbx),%rax
cmp    %rbp,%rax
jae    13c5 <dump_pes_packet_header+0x275>
mov    %rbp,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    (%rbx),%eax
mov    0x4(%rbx),%ebp
shl    $0x10,%eax
shl    $0x8,%ebp
or     %eax,%ebp
or     0x8(%rbx),%ebp
mov    0xc(%rbx),%eax
mov    %eax,0xc(%rsp)
lea    0x10(%rbx),%rdi
call   1040 <get16be@plt>
mov    0x18(%rbx),%rdx
movq   %rdx,%xmm0
pshufd $0x5,%xmm0,%xmm1
pshufd $0x55,%xmm0,%xmm0
mov    %edx,%ecx
shr    $0x4,%ecx
and    $0x3,%ecx
mov    %rcx,0x60(%rsp)
mov    %rdx,%rcx
shr    $0x26,%rcx
pand   0xe1a(%rip),%xmm0
and    $0x3,%ecx
mov    %rcx,0x50(%rsp)
pand   0xe1a(%rip),%xmm1
mov    %edx,%r9d
shr    $0x7,%r9d
and    $0x1,%r9d
mov    %edx,%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
mov    %rcx,0x58(%rsp)
test   $0x8,%dl
mov    $0x2d,%ecx
mov    $0x50,%esi
cmove  %ecx,%esi
mov    %rsi,0x48(%rsp)
test   $0x4,%dl
mov    $0x41,%edx
cmove  %ecx,%edx
mov    %rdx,0x40(%rsp)
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm1
pcmpeqd %xmm2,%xmm0
packssdw %xmm1,%xmm0
packsswb %xmm0,%xmm0
pmovmskb %xmm0,%edx
test   $0x80,%dl
mov    $0x43,%r10d
mov    $0x43,%esi
cmovne %ecx,%esi
mov    %rsi,0x38(%rsp)
test   $0x40,%dl
mov    $0x4f,%esi
cmovne %r10d,%esi
mov    %rsi,0x30(%rsp)
test   $0x20,%dl
mov    $0x45,%r12d
cmovne %ecx,%r12d
mov    %r14,%rsi
mov    $0x45,%r14d
test   $0x10,%dl
cmovne %ecx,%r14d
test   $0x8,%dl
mov    $0x44,%r11d
cmovne %ecx,%r11d
test   $0x4,%dl
mov    $0x41,%r15d
cmovne %ecx,%r15d
test   $0x2,%dl
cmovne %ecx,%r10d
test   $0x1,%dl
mov    $0x58,%r13d
cmovne %ecx,%r13d
mov    %rsi,%rdi
mov    %rbx,0x20(%rsp)
mov    0x20(%rbx),%ebx
lea    0xd5c(%rip),%rsi
mov    %rdi,0x28(%rsp)
mov    %ebp,%edx
mov    0xc(%rsp),%ecx
mov    %eax,%r8d
xor    %eax,%eax
push   %rbx
push   %r13
push   %r10
push   %r15
push   %r11
push   %r14
push   %r12
mov    0x88(%rsp),%rbx
push   %rbx
push   0x70(%rsp)
push   0x80(%rsp)
push   0x90(%rsp)
push   0xa0(%rsp)
push   0xc0(%rsp)
push   0xc0(%rsp)
call   1060 <fprintf@plt>
add    $0x70,%rsp
cmp    $0x2,%ebx
jae    1347 <dump_pes_packet_header+0x1f7>
mov    $0xa,%edi
mov    0x28(%rsp),%rsi
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fputc@plt>
mov    0x28(%rsp),%r14
jne    1386 <dump_pes_packet_header+0x236>
mov    0x20(%rsp),%rax
add    $0x38,%rax
cmp    0x10(%rsp),%rax
mov    0x18(%rsp),%rsi
jae    13c5 <dump_pes_packet_header+0x275>
lea    0x8(%rsp),%rdi
mov    $0x21,%edx
call   1030 <decode_time_stamp@plt>
test   %eax,%eax
je     13ec <dump_pes_packet_header+0x29c>
mov    0x8(%rsp),%edx
lea    0xcd8(%rip),%rsi
jmp    1433 <dump_pes_packet_header+0x2e3>
mov    0x20(%rsp),%rbp
lea    0x4c(%rbp),%rax
cmp    0x10(%rsp),%rax
mov    0x18(%rsp),%rsi
jae    13c5 <dump_pes_packet_header+0x275>
lea    0x8(%rsp),%rdi
mov    $0x31,%edx
call   1030 <decode_time_stamp@plt>
test   %eax,%eax
je     13f5 <dump_pes_packet_header+0x2a5>
mov    0x8(%rsp),%edx
lea    0xcb5(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    140e <dump_pes_packet_header+0x2be>
lea    0xcca(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r14,%rcx
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <fwrite@plt>
lea    0xc71(%rip),%rdi
jmp    1446 <dump_pes_packet_header+0x2f6>
lea    0xc7c(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
add    $0x38,%rbp
lea    0x8(%rsp),%rdi
mov    %rbp,%rsi
mov    $0x11,%edx
call   1030 <decode_time_stamp@plt>
test   %eax,%eax
je     143f <dump_pes_packet_header+0x2ef>
mov    0x8(%rsp),%edx
lea    0xc4e(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1458 <dump_pes_packet_header+0x308>
lea    0xc46(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"PES packet\00"
@.str.1 = [46 x i8] c" %06X%02X %5u %u%u%u%c%c%c%c%u%c%c%c%c%c%c %u\00"
@.str.2 = [11 x i8] c" PTS=%lld\0A\00"
@.str.3 = [10 x i8] c" bad PTS\0A\00"
@.str.4 = [10 x i8] c" PTS=%lld\00"
@.str.5 = [9 x i8] c" bad PTS\00"
@.str.6 = [11 x i8] c" DTS=%lld\0A\00"
@.str.7 = [10 x i8] c" bad DTS\0A\00"
@.str.8 = [12 x i8] c" truncated\0A\00"
define void @dump_pes_packet_header(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%24 = load i32*, i32** %4
%25 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %24)
%26 = load i32*, i32** %5
%27 = getelementptr inbounds i32, i32* %26, i64 9
%28 = load i32*, i32** %6
%29 = icmp uge i32* %27, %28
br i1 %29, label %30, label %31
30: ; preds = %3
br label %224
31: ; preds = %3
%32 = load i32*, i32** %5
%33 = getelementptr inbounds i32, i32* %32, i64 0
%34 = load i32, i32* %33
%35 = shl i32 %34, 16
%36 = load i32*, i32** %5
%37 = getelementptr inbounds i32, i32* %36, i64 1
%38 = load i32, i32* %37
%39 = shl i32 %38, 8
%40 = or i32 %35, %39
%41 = load i32*, i32** %5
%42 = getelementptr inbounds i32, i32* %41, i64 2
%43 = load i32, i32* %42
%44 = shl i32 %43, 0
%45 = or i32 %40, %44
store i32 %45, i32* %7
%46 = load i32*, i32** %5
%47 = getelementptr inbounds i32, i32* %46, i64 3
%48 = load i32, i32* %47
store i32 %48, i32* %8
%49 = load i32*, i32** %5
%50 = getelementptr inbounds i32, i32* %49, i64 4
%51 = call i32 @get16be(i32* %50)
store i32 %51, i32* %9
%52 = load i32*, i32** %5
%53 = getelementptr inbounds i32, i32* %52, i64 6
%54 = load i32, i32* %53
%55 = and i32 %54, 48
%56 = ashr i32 %55, 4
store i32 %56, i32* %10
%57 = load i32*, i32** %5
%58 = getelementptr inbounds i32, i32* %57, i64 6
%59 = load i32, i32* %58
%60 = and i32 %59, 8
store i32 %60, i32* %11
%61 = load i32*, i32** %5
%62 = getelementptr inbounds i32, i32* %61, i64 6
%63 = load i32, i32* %62
%64 = and i32 %63, 4
store i32 %64, i32* %12
%65 = load i32*, i32** %5
%66 = getelementptr inbounds i32, i32* %65, i64 6
%67 = load i32, i32* %66
%68 = and i32 %67, 2
store i32 %68, i32* %13
%69 = load i32*, i32** %5
%70 = getelementptr inbounds i32, i32* %69, i64 6
%71 = load i32, i32* %70
%72 = and i32 %71, 1
store i32 %72, i32* %14
%73 = load i32*, i32** %5
%74 = getelementptr inbounds i32, i32* %73, i64 7
%75 = load i32, i32* %74
%76 = and i32 %75, 192
%77 = ashr i32 %76, 6
store i32 %77, i32* %15
%78 = load i32*, i32** %5
%79 = getelementptr inbounds i32, i32* %78, i64 7
%80 = load i32, i32* %79
%81 = and i32 %80, 32
store i32 %81, i32* %16
%82 = load i32*, i32** %5
%83 = getelementptr inbounds i32, i32* %82, i64 7
%84 = load i32, i32* %83
%85 = and i32 %84, 16
store i32 %85, i32* %17
%86 = load i32*, i32** %5
%87 = getelementptr inbounds i32, i32* %86, i64 7
%88 = load i32, i32* %87
%89 = and i32 %88, 8
store i32 %89, i32* %18
%90 = load i32*, i32** %5
%91 = getelementptr inbounds i32, i32* %90, i64 7
%92 = load i32, i32* %91
%93 = and i32 %92, 4
store i32 %93, i32* %19
%94 = load i32*, i32** %5
%95 = getelementptr inbounds i32, i32* %94, i64 7
%96 = load i32, i32* %95
%97 = and i32 %96, 2
store i32 %97, i32* %20
%98 = load i32*, i32** %5
%99 = getelementptr inbounds i32, i32* %98, i64 7
%100 = load i32, i32* %99
%101 = and i32 %100, 1
store i32 %101, i32* %21
%102 = load i32*, i32** %5
%103 = getelementptr inbounds i32, i32* %102, i64 8
%104 = load i32, i32* %103
store i32 %104, i32* %22
%105 = load i32*, i32** %4
%106 = load i32, i32* %7
%107 = load i32, i32* %8
%108 = load i32, i32* %9
%109 = load i32*, i32** %5
%110 = getelementptr inbounds i32, i32* %109, i64 6
%111 = load i32, i32* %110
%112 = and i32 %111, 128
%113 = icmp ne i32 %112, 0
%114 = xor i1 %113, true
%115 = xor i1 %114, true
%116 = zext i1 %115 to i32
%117 = load i32*, i32** %5
%118 = getelementptr inbounds i32, i32* %117, i64 6
%119 = load i32, i32* %118
%120 = and i32 %119, 64
%121 = icmp ne i32 %120, 0
%122 = xor i1 %121, true
%123 = xor i1 %122, true
%124 = zext i1 %123 to i32
%125 = load i32, i32* %10
%126 = load i32, i32* %11
%127 = icmp ne i32 %126, 0
%128 = zext i1 %127 to i64
%129 = select i1 %127, i32 80, i32 45
%130 = load i32, i32* %12
%131 = icmp ne i32 %130, 0
%132 = zext i1 %131 to i64
%133 = select i1 %131, i32 65, i32 45
%134 = load i32, i32* %13
%135 = icmp ne i32 %134, 0
%136 = zext i1 %135 to i64
%137 = select i1 %135, i32 67, i32 45
%138 = load i32, i32* %14
%139 = icmp ne i32 %138, 0
%140 = zext i1 %139 to i64
%141 = select i1 %139, i32 79, i32 67
%142 = load i32, i32* %15
%143 = load i32, i32* %16
%144 = icmp ne i32 %143, 0
%145 = zext i1 %144 to i64
%146 = select i1 %144, i32 69, i32 45
%147 = load i32, i32* %17
%148 = icmp ne i32 %147, 0
%149 = zext i1 %148 to i64
%150 = select i1 %148, i32 69, i32 45
%151 = load i32, i32* %18
%152 = icmp ne i32 %151, 0
%153 = zext i1 %152 to i64
%154 = select i1 %152, i32 68, i32 45
%155 = load i32, i32* %19
%156 = icmp ne i32 %155, 0
%157 = zext i1 %156 to i64
%158 = select i1 %156, i32 65, i32 45
%159 = load i32, i32* %20
%160 = icmp ne i32 %159, 0
%161 = zext i1 %160 to i64
%162 = select i1 %160, i32 67, i32 45
%163 = load i32, i32* %21
%164 = icmp ne i32 %163, 0
%165 = zext i1 %164 to i64
%166 = select i1 %164, i32 88, i32 45
%167 = load i32, i32* %22
%168 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %106, i32 %107, i32 %108, i32 %116, i32 %124, i32 %125, i32 %129, i32 %133, i32 %137, i32 %141, i32 %142, i32 %146, i32 %150, i32 %154, i32 %158, i32 %162, i32 %166, i32 %167)
%169 = load i32, i32* %15
switch i32 %169, label %223 [
i32 0, label %170
i32 1, label %170
i32 2, label %173
i32 3, label %192
]
170: ; preds = %31, %31
%171 = load i32*, i32** %4
%172 = call i32 @fputc(i8 signext 10, i32* %171)
br label %223
173: ; preds = %31
%174 = load i32*, i32** %5
%175 = getelementptr inbounds i32, i32* %174, i64 14
%176 = load i32*, i32** %6
%177 = icmp uge i32* %175, %176
br i1 %177, label %178, label %179
178: ; preds = %173
br label %224
179: ; preds = %173
%180 = load i32*, i32** %5
%181 = getelementptr inbounds i32, i32* %180, i64 9
%182 = call i32 @decode_time_stamp(i32* %23, i32* %181, i32 33)
%183 = icmp ne i32 %182, 0
br i1 %183, label %184, label %188
184: ; preds = %179
%185 = load i32*, i32** %4
%186 = load i32, i32* %23
%187 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %185, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %186)
br label %191
188: ; preds = %179
%189 = load i32*, i32** %4
%190 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32* %189)
br label %191
191: ; preds = %188, %184
br label %223
192: ; preds = %31
%193 = load i32*, i32** %5
%194 = getelementptr inbounds i32, i32* %193, i64 19
%195 = load i32*, i32** %6
%196 = icmp uge i32* %194, %195
br i1 %196, label %197, label %198
197: ; preds = %192
br label %224
198: ; preds = %192
%199 = load i32*, i32** %5
%200 = getelementptr inbounds i32, i32* %199, i64 9
%201 = call i32 @decode_time_stamp(i32* %23, i32* %200, i32 49)
%202 = icmp ne i32 %201, 0
br i1 %202, label %203, label %207
203: ; preds = %198
%204 = load i32*, i32** %4
%205 = load i32, i32* %23
%206 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %204, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %205)
br label %210
207: ; preds = %198
%208 = load i32*, i32** %4
%209 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i32* %208)
br label %210
210: ; preds = %207, %203
%211 = load i32*, i32** %5
%212 = getelementptr inbounds i32, i32* %211, i64 14
%213 = call i32 @decode_time_stamp(i32* %23, i32* %212, i32 17)
%214 = icmp ne i32 %213, 0
br i1 %214, label %215, label %219
215: ; preds = %210
%216 = load i32*, i32** %4
%217 = load i32, i32* %23
%218 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %216, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %217)
br label %222
219: ; preds = %210
%220 = load i32*, i32** %4
%221 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32* %220)
br label %222
222: ; preds = %219, %215
br label %223
223: ; preds = %31, %222, %191, %170
br label %227
224: ; preds = %197, %178, %30
%225 = load i32*, i32** %4
%226 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32* %225)
br label %227
227: ; preds = %224, %223
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"PES packet\00"
@.str.1 = [46 x i8] c" %06X%02X %5u %u%u%u%c%c%c%c%u%c%c%c%c%c%c %u\00"
@.str.2 = [11 x i8] c" PTS=%lld\0A\00"
@.str.3 = [10 x i8] c" bad PTS\0A\00"
@.str.4 = [10 x i8] c" PTS=%lld\00"
@.str.5 = [9 x i8] c" bad PTS\00"
@.str.6 = [11 x i8] c" DTS=%lld\0A\00"
@.str.7 = [10 x i8] c" bad DTS\0A\00"
@.str.8 = [12 x i8] c" truncated\0A\00"
define void @dump_pes_packet_header(i32* nocapture %0, i32* %1, i32* readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
%7 = getelementptr inbounds i32, i32* %1, i64 9
%8 = icmp ult i32* %7, %2
br i1 %8, label %9, label %98
9: ; preds = %3
%10 = load i32, i32* %1
%11 = shl i32 %10, 16
%12 = getelementptr inbounds i32, i32* %1, i64 1
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = or i32 %14, %11
%16 = getelementptr inbounds i32, i32* %1, i64 2
%17 = load i32, i32* %16
%18 = or i32 %15, %17
%19 = getelementptr inbounds i32, i32* %1, i64 3
%20 = load i32, i32* %19
%21 = getelementptr inbounds i32, i32* %1, i64 4
%22 = tail call i32 @get16be(i32* %21)
%23 = getelementptr inbounds i32, i32* %1, i64 6
%24 = bitcast i32* %23 to <2 x i32>*
%25 = load <2 x i32>, <2 x i32>* %24
%26 = shufflevector <2 x i32> %25, <2 x i32> poison, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0>
%27 = extractelement <2 x i32> %25, i64 0
%28 = lshr i32 %27, 4
%29 = and i32 %28, 3
%30 = and i32 %27, 8
%31 = and i32 %27, 4
%32 = extractelement <2 x i32> %25, i64 1
%33 = lshr i32 %32, 6
%34 = and i32 %33, 3
%35 = and <8 x i32> %26, <i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 1, i32 2>
%36 = getelementptr inbounds i32, i32* %1, i64 8
%37 = load i32, i32* %36
%38 = lshr i32 %27, 7
%39 = and i32 %38, 1
%40 = lshr i32 %27, 6
%41 = and i32 %40, 1
%42 = icmp eq i32 %30, 0
%43 = select i1 %42, i32 45, i32 80
%44 = icmp eq i32 %31, 0
%45 = select i1 %44, i32 45, i32 65
%46 = icmp eq <8 x i32> %35, zeroinitializer
%47 = extractelement <8 x i1> %46, i64 7
%48 = select i1 %47, i32 45, i32 67
%49 = extractelement <8 x i1> %46, i64 6
%50 = select i1 %49, i32 67, i32 79
%51 = extractelement <8 x i1> %46, i64 5
%52 = select i1 %51, i32 45, i32 69
%53 = extractelement <8 x i1> %46, i64 4
%54 = select i1 %53, i32 45, i32 69
%55 = extractelement <8 x i1> %46, i64 3
%56 = select i1 %55, i32 45, i32 68
%57 = extractelement <8 x i1> %46, i64 2
%58 = select i1 %57, i32 45, i32 65
%59 = extractelement <8 x i1> %46, i64 1
%60 = select i1 %59, i32 45, i32 67
%61 = extractelement <8 x i1> %46, i64 0
%62 = select i1 %61, i32 45, i32 88
%63 = tail call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %20, i32 %22, i32 %39, i32 %41, i32 %29, i32 %43, i32 %45, i32 %48, i32 %50, i32 %34, i32 %52, i32 %54, i32 %56, i32 %58, i32 %60, i32 %62, i32 %37)
switch i32 %34, label %97 [
i32 0, label %64
i32 1, label %64
i32 2, label %66
i32 3, label %77
]
64: ; preds = %9, %9
%65 = tail call i32 @fputc(i8 signext 10, i32* %0)
br label %100
66: ; preds = %9
%67 = getelementptr inbounds i32, i32* %1, i64 14
%68 = icmp ult i32* %67, %2
br i1 %68, label %69, label %98
69: ; preds = %66
%70 = call i32 @decode_time_stamp(i32* %4, i32* %7, i32 33)
%71 = icmp eq i32 %70, 0
br i1 %71, label %75, label %72
72: ; preds = %69
%73 = load i32, i32* %4
%74 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %73)
br label %100
75: ; preds = %69
%76 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64 9, i64 1, i32* %0)
br label %100
77: ; preds = %9
%78 = getelementptr inbounds i32, i32* %1, i64 19
%79 = icmp ult i32* %78, %2
br i1 %79, label %80, label %98
80: ; preds = %77
%81 = call i32 @decode_time_stamp(i32* %4, i32* %7, i32 49)
%82 = icmp eq i32 %81, 0
br i1 %82, label %86, label %83
83: ; preds = %80
%84 = load i32, i32* %4
%85 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %84)
br label %88
86: ; preds = %80
%87 = call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i64 8, i64 1, i32* %0)
br label %88
88: ; preds = %86, %83
%89 = getelementptr inbounds i32, i32* %1, i64 14
%90 = call i32 @decode_time_stamp(i32* %4, i32* %89, i32 17)
%91 = icmp eq i32 %90, 0
br i1 %91, label %95, label %92
92: ; preds = %88
%93 = load i32, i32* %4
%94 = call i32 (i32*, i8*, i32, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %93)
br label %100
95: ; preds = %88
%96 = call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i64 9, i64 1, i32* %0)
br label %100
97: ; preds = %9
unreachable
98: ; preds = %77, %66, %3
%99 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i64 11, i64 1, i32* %0)
br label %100
100: ; preds = %64, %75, %72, %95, %92, %98
ret void
}