#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 scalar_t__ uint8_t;
typedef int int64_t;

/* Variables and functions */
int64_t PesGetPts(const uint8_t *p) {
  return ((((int64_t)p[9]) & 0x0E) << 29) | (((int64_t)p[10]) << 22) |
         ((((int64_t)p[11]) & 0xFE) << 14) | (((int64_t)p[12]) << 7) |
         ((((int64_t)p[13]) & 0xFE) >> 1);
}


x86 assembly (clang, -O0):
<PesGetPts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x48(%rax),%rax
and    $0xe,%eax
shl    $0x1d,%eax
mov    -0x8(%rbp),%rcx
mov    0x50(%rcx),%rcx
shl    $0x16,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x58(%rcx),%rcx
and    $0xfe,%ecx
shl    $0xe,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x60(%rcx),%rcx
shl    $0x7,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x68(%rcx),%rcx
and    $0xfe,%ecx
sar    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PesGetPts>:
mov    0x48(%rdi),%eax
mov    0x50(%rdi),%ecx
and    $0xfffffffe,%eax
shl    $0x1d,%eax
shl    $0x16,%ecx
or     %eax,%ecx
mov    0x58(%rdi),%eax
shl    $0xe,%eax
and    $0x3f8000,%eax
or     %ecx,%eax
mov    0x60(%rdi),%ecx
shl    $0x7,%ecx
or     %eax,%ecx
mov    0x68(%rdi),%eax
shr    %eax
and    $0x7f,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @PesGetPts(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 9
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 14
%8 = shl i32 %7, 29
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 10
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 22
%14 = or i32 %8, %13
%15 = load i64*, i64** %2
%16 = getelementptr inbounds i64, i64* %15, i64 11
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = and i32 %18, 254
%20 = shl i32 %19, 14
%21 = or i32 %14, %20
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 12
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = shl i32 %25, 7
%27 = or i32 %21, %26
%28 = load i64*, i64** %2
%29 = getelementptr inbounds i64, i64* %28, i64 13
%30 = load i64, i64* %29
%31 = trunc i64 %30 to i32
%32 = and i32 %31, 254
%33 = ashr i32 %32, 1
%34 = or i32 %27, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @PesGetPts(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 9
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 29
%6 = and i32 %5, -1073741824
%7 = getelementptr inbounds i64, i64* %0, i64 10
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 22
%11 = or i32 %6, %10
%12 = getelementptr inbounds i64, i64* %0, i64 11
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 14
%16 = and i32 %15, 4161536
%17 = or i32 %11, %16
%18 = getelementptr inbounds i64, i64* %0, i64 12
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 7
%22 = or i32 %17, %21
%23 = getelementptr inbounds i64, i64* %0, i64 13
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = lshr i32 %25, 1
%27 = and i32 %26, 127
%28 = or i32 %22, %27
ret i32 %28
}