#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 /*<<< orphan*/ header;

/* Variables and functions */
int send_mpeg_pes_packet_ll(unsigned char *, int, int, unsigned long long, int,
                            unsigned char *, int, int,
                            int (*)(unsigned char *, int));
int send_mpeg_lpcm_packet(unsigned char *data, int len, int id,
                          unsigned long long pts, int freq_id,
                          int my_write(unsigned char *data, int len)) {
  unsigned char header[7] = {0xA0, 0x07, 0x00, 0x04, 0x0C, 1 | (freq_id << 4),
                             0x80};
  return send_mpeg_pes_packet_ll(data, len, 0xBD, pts, 2, header,
                                 sizeof(header), 1, my_write);
}


x86 assembly (clang, -O0):
<send_mpeg_lpcm_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
movb   $0xa0,-0x2f(%rbp)
movb   $0x7,-0x2e(%rbp)
movb   $0x0,-0x2d(%rbp)
movb   $0x4,-0x2c(%rbp)
movb   $0xc,-0x2b(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x4,%eax
or     $0x1,%eax
mov    %al,-0x2a(%rbp)
movb   $0x80,-0x29(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    -0x2f(%rbp),%r9
mov    -0x28(%rbp),%rax
mov    $0xbd,%edx
mov    $0x2,%r8d
movl   $0x7,(%rsp)
movl   $0x1,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <send_mpeg_pes_packet_ll@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_mpeg_lpcm_packet>:
push   %rax
mov    %r9,%rax
movl   $0x40007a0,0x1(%rsp)
04
movb   $0xc,0x5(%rsp)
shl    $0x4,%r8b
or     $0x1,%r8b
mov    %r8b,0x6(%rsp)
movb   $0x80,0x7(%rsp)
sub    $0x8,%rsp
lea    0x9(%rsp),%r9
mov    $0xbd,%edx
mov    $0x2,%r8d
push   %rax
push   $0x1
push   $0x7
call   1030 <send_mpeg_pes_packet_ll@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @send_mpeg_lpcm_packet(i8* %0, i32 %1, i32 %2, i64 %3, i32 %4, i32 (i8*, i32)* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32 (i8*, i32)*
%13 = alloca [7 x i8]
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i64 %3, i64* %10
store i32 %4, i32* %11
store i32 (i8*, i32)* %5, i32 (i8*, i32)** %12
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
store i8 -96, i8* %14
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 7, i8* %15
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 0, i8* %16
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 4, i8* %17
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 12, i8* %18
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i32, i32* %11
%21 = shl i32 %20, 4
%22 = or i32 1, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %19
%24 = getelementptr inbounds i8, i8* %19, i64 1
store i8 -128, i8* %24
%25 = load i8*, i8** %7
%26 = load i32, i32* %8
%27 = load i64, i64* %10
%28 = getelementptr inbounds [7 x i8], [7 x i8]* %13, i64 0, i64 0
%29 = load i32 (i8*, i32)*, i32 (i8*, i32)** %12
%30 = call i32 @send_mpeg_pes_packet_ll(i8* %25, i32 %26, i32 189, i64 %27, i32 2, i8* %28, i32 7, i32 1, i32 (i8*, i32)* %29)
ret i32 %30
}

LLVM IR (-O2):
define i32 @send_mpeg_lpcm_packet(i8* %0, i32 %1, i32 %2, i64 %3, i32 %4, i32 (i8*, i32)* %5) {
%7 = alloca [7 x i8]
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
store i8 -96, i8* %8
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 1
store i8 7, i8* %9
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 2
store i8 0, i8* %10
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 3
store i8 4, i8* %11
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 4
store i8 12, i8* %12
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 5
%14 = trunc i32 %4 to i8
%15 = shl i8 %14, 4
%16 = or i8 %15, 1
store i8 %16, i8* %13
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 6
store i8 -128, i8* %17
%18 = call i32 @send_mpeg_pes_packet_ll(i8* %0, i32 %1, i32 189, i64 %3, i32 2, i8* %8, i32 7, i32 1, i32 (i8*, i32)* %5)
ret i32 %18
}