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

/* Variables and functions */
void pes_set_dts(uint8_t *p_pes, uint64_t i_dts) {
  p_pes[7] |= 0x40;
  if (p_pes[8] < 10)
    p_pes[8] = 10;
  p_pes[9] |= 0x10;
  p_pes[14] = 0x11 | ((i_dts >> 29) & 0xe);
  p_pes[15] = (i_dts >> 22) & 0xff;
  p_pes[16] = 0x1 | ((i_dts >> 14) & 0xfe);
  p_pes[17] = (i_dts >> 7) & 0xff;
  p_pes[18] = 0x1 | ((i_dts << 1) & 0xfe);
}


x86 assembly (clang, -O0):
<pes_set_dts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
or     $0x40,%ecx
mov    %ecx,0x1c(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0xa,0x20(%rax)
jge    1131 <pes_set_dts+0x31>
mov    -0x8(%rbp),%rax
movl   $0xa,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
or     $0x10,%ecx
mov    %ecx,0x24(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x1d,%ecx
and    $0xe,%ecx
or     $0x11,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x38(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x16,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x3c(%rax)
mov    -0xc(%rbp),%ecx
sar    $0xe,%ecx
and    $0xfe,%ecx
or     $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x40(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x7,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x44(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
and    $0xfe,%ecx
or     $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x48(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_set_dts>:
orb    $0x40,0x1c(%rdi)
cmpl   $0x9,0x20(%rdi)
jg     1111 <pes_set_dts+0x11>
movl   $0xa,0x20(%rdi)
orb    $0x10,0x24(%rdi)
mov    %esi,%eax
sar    $0x1d,%eax
and    $0xe,%eax
or     $0x11,%eax
mov    %eax,0x38(%rdi)
mov    %esi,%eax
shr    $0x16,%eax
movzbl %al,%eax
mov    %eax,0x3c(%rdi)
mov    %esi,%eax
shr    $0xe,%eax
or     $0x1,%eax
movzbl %al,%eax
mov    %eax,0x40(%rdi)
mov    %esi,%eax
shr    $0x7,%eax
movzbl %al,%eax
mov    %eax,0x44(%rdi)
lea    (%rsi,%rsi,1),%eax
add    $0x1,%eax
movzbl %al,%eax
mov    %eax,0x48(%rdi)
ret

LLVM IR (-O0):
define void @pes_set_dts(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 7
%7 = load i32, i32* %6
%8 = or i32 %7, 64
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = load i32, i32* %10
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 8
store i32 10, i32* %15
br label %16
16: ; preds = %13, %2
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 9
%19 = load i32, i32* %18
%20 = or i32 %19, 16
store i32 %20, i32* %18
%21 = load i32, i32* %4
%22 = ashr i32 %21, 29
%23 = and i32 %22, 14
%24 = or i32 17, %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 14
store i32 %24, i32* %26
%27 = load i32, i32* %4
%28 = ashr i32 %27, 22
%29 = and i32 %28, 255
%30 = load i32*, i32** %3
%31 = getelementptr inbounds i32, i32* %30, i64 15
store i32 %29, i32* %31
%32 = load i32, i32* %4
%33 = ashr i32 %32, 14
%34 = and i32 %33, 254
%35 = or i32 1, %34
%36 = load i32*, i32** %3
%37 = getelementptr inbounds i32, i32* %36, i64 16
store i32 %35, i32* %37
%38 = load i32, i32* %4
%39 = ashr i32 %38, 7
%40 = and i32 %39, 255
%41 = load i32*, i32** %3
%42 = getelementptr inbounds i32, i32* %41, i64 17
store i32 %40, i32* %42
%43 = load i32, i32* %4
%44 = shl i32 %43, 1
%45 = and i32 %44, 254
%46 = or i32 1, %45
%47 = load i32*, i32** %3
%48 = getelementptr inbounds i32, i32* %47, i64 18
store i32 %46, i32* %48
ret void
}

LLVM IR (-O2):
define void @pes_set_dts(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 7
%4 = load i32, i32* %3
%5 = or i32 %4, 64
store i32 %5, i32* %3
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 10, i32* %6
br label %10
10: ; preds = %9, %2
%11 = getelementptr inbounds i32, i32* %0, i64 9
%12 = load i32, i32* %11
%13 = or i32 %12, 16
store i32 %13, i32* %11
%14 = ashr i32 %1, 29
%15 = and i32 %14, 14
%16 = or i32 %15, 17
%17 = getelementptr inbounds i32, i32* %0, i64 14
store i32 %16, i32* %17
%18 = lshr i32 %1, 22
%19 = and i32 %18, 255
%20 = getelementptr inbounds i32, i32* %0, i64 15
store i32 %19, i32* %20
%21 = lshr i32 %1, 14
%22 = and i32 %21, 254
%23 = or i32 %22, 1
%24 = getelementptr inbounds i32, i32* %0, i64 16
store i32 %23, i32* %24
%25 = lshr i32 %1, 7
%26 = and i32 %25, 255
%27 = getelementptr inbounds i32, i32* %0, i64 17
store i32 %26, i32* %27
%28 = shl i32 %1, 1
%29 = and i32 %28, 254
%30 = or i32 %29, 1
%31 = getelementptr inbounds i32, i32* %0, i64 18
store i32 %30, i32* %31
ret void
}