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

/* Variables and functions */
int64_t ff_parse_pes_pts(uint8_t *buf) {
  return (int64_t)(*buf & 0x0e) << 29 |
         (((((const uint8_t *)(buf + 1))[0] << 8) |
           ((const uint8_t *)(buf + 1))[1]) >>
          1) << 15 |
         ((((const uint8_t *)(buf + 3))[0] << 8) |
          ((const uint8_t *)(buf + 3))[1]) >>
             1;
}


x86 assembly (clang, -O0):
<ff_parse_pes_pts>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xe,%eax
shl    $0x1d,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rdx
or     0x8(%rdx),%ecx
sar    $0x1,%ecx
shl    $0xf,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rdx
or     0x10(%rdx),%ecx
sar    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_parse_pes_pts>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
and    $0xfffffffe,%eax
shl    $0x1d,%eax
mov    0x8(%rdi),%edx
shl    $0x16,%ecx
or     %eax,%ecx
and    $0xfffffffe,%edx
shl    $0xe,%edx
or     %ecx,%edx
mov    0xc(%rdi),%eax
shl    $0x8,%eax
or     0x10(%rdi),%eax
sar    %eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ff_parse_pes_pts(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 29
%4 = and i32 %3, -1073741824
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %6, 22
%10 = shl i32 %8, 14
%11 = and i32 %10, -32768
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = getelementptr inbounds i32, i32* %0, i64 4
%16 = load i32, i32* %15
%17 = or i32 %14, %16
%18 = ashr i32 %17, 1
%19 = or i32 %4, %9
%20 = or i32 %19, %11
%21 = or i32 %20, %18
ret i32 %21
}