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

/* Variables and functions */
int CEC_MSG_TUNER_DEVICE_STATUS;
int /*<<< orphan*/
cec_set_digital_service_id(int *, struct cec_op_digital_service_id const *);
void cec_msg_tuner_device_status_digital(
    struct cec_msg *msg, __u8 rec_flag, __u8 tuner_display_info,
    const struct cec_op_digital_service_id *digital) {
  msg->len = 10;
  msg->msg[1] = CEC_MSG_TUNER_DEVICE_STATUS;
  msg->msg[2] = (rec_flag << 7) | tuner_display_info;
  cec_set_digital_service_id(msg->msg + 3, digital);
}


x86 assembly (clang, -O0):
<cec_msg_tuner_device_status_digital>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x7,%ecx
or     -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
add    $0xc,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cec_set_digital_service_id@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_tuner_device_status_digital>:
movl   $0xa,(%rdi)
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rdi
mov    %eax,0x4(%rdi)
shl    $0x7,%esi
or     %edx,%esi
mov    %esi,0x8(%rdi)
add    $0xc,%rdi
mov    %rcx,%rsi
jmp    1030 <cec_set_digital_service_id@plt>

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
%struct.cec_op_digital_service_id = type { i32 }
@CEC_MSG_TUNER_DEVICE_STATUS = global i32 0
define void @cec_msg_tuner_device_status_digital(%struct.cec_msg* %0, i32 %1, i32 %2, %struct.cec_op_digital_service_id* %3) {
%5 = alloca %struct.cec_msg*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.cec_op_digital_service_id*
store %struct.cec_msg* %0, %struct.cec_msg** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.cec_op_digital_service_id* %3, %struct.cec_op_digital_service_id** %8
%9 = load %struct.cec_msg*, %struct.cec_msg** %5
%10 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %9, i32 0, i32 0
store i32 10, i32* %10
%11 = load i32, i32* @CEC_MSG_TUNER_DEVICE_STATUS
%12 = load %struct.cec_msg*, %struct.cec_msg** %5
%13 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %12, i32 0, i32 1
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %11, i32* %15
%16 = load i32, i32* %6
%17 = shl i32 %16, 7
%18 = load i32, i32* %7
%19 = or i32 %17, %18
%20 = load %struct.cec_msg*, %struct.cec_msg** %5
%21 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %20, i32 0, i32 1
%22 = load i32*, i32** %21
%23 = getelementptr inbounds i32, i32* %22, i64 2
store i32 %19, i32* %23
%24 = load %struct.cec_msg*, %struct.cec_msg** %5
%25 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %24, i32 0, i32 1
%26 = load i32*, i32** %25
%27 = getelementptr inbounds i32, i32* %26, i64 3
%28 = load %struct.cec_op_digital_service_id*, %struct.cec_op_digital_service_id** %8
%29 = call i32 @cec_set_digital_service_id(i32* %27, %struct.cec_op_digital_service_id* %28)
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
%struct.cec_op_digital_service_id = type { i32 }
@CEC_MSG_TUNER_DEVICE_STATUS = global i32 0
define void @cec_msg_tuner_device_status_digital(%struct.cec_msg* nocapture %0, i32 %1, i32 %2, %struct.cec_op_digital_service_id* %3) {
%5 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 10, i32* %5
%6 = load i32, i32* @CEC_MSG_TUNER_DEVICE_STATUS
%7 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %6, i32* %9
%10 = shl i32 %1, 7
%11 = or i32 %10, %2
%12 = getelementptr inbounds i32, i32* %8, i64 2
store i32 %11, i32* %12
%13 = getelementptr inbounds i32, i32* %8, i64 3
%14 = tail call i32 @cec_set_digital_service_id(i32* %13, %struct.cec_op_digital_service_id* %3)
ret void
}