#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 */
struct cec_msg {
  int len;
  int *msg;
};
typedef int __u8;

/* Variables and functions */
int CEC_MSG_REPORT_AUDIO_STATUS;
void cec_msg_report_audio_status(struct cec_msg *msg, __u8 aud_mute_status,
                                 __u8 aud_vol_status) {
  msg->len = 3;
  msg->msg[1] = CEC_MSG_REPORT_AUDIO_STATUS;
  msg->msg[2] = (aud_mute_status << 7) | (aud_vol_status & 0x7f);
}


x86 assembly (clang, -O0):
<cec_msg_report_audio_status>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x7,%ecx
mov    -0x10(%rbp),%eax
and    $0x7f,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_report_audio_status>:
movl   $0x3,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rcx
mov    %eax,0x4(%rcx)
shl    $0x7,%esi
and    $0x7f,%edx
or     %esi,%edx
mov    %edx,0x8(%rcx)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_REPORT_AUDIO_STATUS = global i32 0
define void @cec_msg_report_audio_status(%struct.cec_msg* %0, i32 %1, i32 %2) {
%4 = alloca %struct.cec_msg*
%5 = alloca i32
%6 = alloca i32
store %struct.cec_msg* %0, %struct.cec_msg** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.cec_msg*, %struct.cec_msg** %4
%8 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %7, i32 0, i32 0
store i32 3, i32* %8
%9 = load i32, i32* @CEC_MSG_REPORT_AUDIO_STATUS
%10 = load %struct.cec_msg*, %struct.cec_msg** %4
%11 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %10, i32 0, i32 1
%12 = load i32*, i32** %11
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %9, i32* %13
%14 = load i32, i32* %5
%15 = shl i32 %14, 7
%16 = load i32, i32* %6
%17 = and i32 %16, 127
%18 = or i32 %15, %17
%19 = load %struct.cec_msg*, %struct.cec_msg** %4
%20 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %19, i32 0, i32 1
%21 = load i32*, i32** %20
%22 = getelementptr inbounds i32, i32* %21, i64 2
store i32 %18, i32* %22
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_REPORT_AUDIO_STATUS = global i32 0
define void @cec_msg_report_audio_status(%struct.cec_msg* nocapture %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 3, i32* %4
%5 = load i32, i32* @CEC_MSG_REPORT_AUDIO_STATUS
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %5, i32* %8
%9 = shl i32 %1, 7
%10 = and i32 %2, 127
%11 = or i32 %10, %9
%12 = getelementptr inbounds i32, i32* %7, i64 2
store i32 %11, i32* %12
ret void
}