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

/* Variables and functions */
int /*<<< orphan*/ CEC_MSG_RECORD_ON;
int /*<<< orphan*/ CEC_OP_RECORD_SRC_DIGITAL;
int /*<<< orphan*/
cec_set_digital_service_id(int /*<<< orphan*/ *,
                           struct cec_op_digital_service_id const *);
void cec_msg_record_on_digital(
    struct cec_msg *msg, const struct cec_op_digital_service_id *digital) {
  msg->len = 10;
  msg->msg[1] = CEC_MSG_RECORD_ON;
  msg->msg[2] = CEC_OP_RECORD_SRC_DIGITAL;
  cec_set_digital_service_id(msg->msg + 3, digital);
}


x86 assembly (clang, -O0):
<cec_msg_record_on_digital>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    0x2ea7(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    0x2ea3(%rip),%rax
mov    (%rax),%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    -0x10(%rbp),%rsi
call   1030 <cec_set_digital_service_id@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_record_on_digital>:
movl   $0xa,(%rdi)
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    0x8(%rdi),%rdi
mov    %eax,0x4(%rdi)
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rdi)
add    $0xc,%rdi
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_RECORD_ON = global i32 0
@CEC_OP_RECORD_SRC_DIGITAL = global i32 0
define void @cec_msg_record_on_digital(%struct.cec_msg* %0, %struct.cec_op_digital_service_id* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca %struct.cec_op_digital_service_id*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store %struct.cec_op_digital_service_id* %1, %struct.cec_op_digital_service_id** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
store i32 10, i32* %6
%7 = load i32, i32* @CEC_MSG_RECORD_ON
%8 = load %struct.cec_msg*, %struct.cec_msg** %3
%9 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %8, i32 0, i32 1
%10 = load i32*, i32** %9
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %7, i32* %11
%12 = load i32, i32* @CEC_OP_RECORD_SRC_DIGITAL
%13 = load %struct.cec_msg*, %struct.cec_msg** %3
%14 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %13, i32 0, i32 1
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %12, i32* %16
%17 = load %struct.cec_msg*, %struct.cec_msg** %3
%18 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %17, i32 0, i32 1
%19 = load i32*, i32** %18
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load %struct.cec_op_digital_service_id*, %struct.cec_op_digital_service_id** %4
%22 = call i32 @cec_set_digital_service_id(i32* %20, %struct.cec_op_digital_service_id* %21)
ret void
}

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