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

/* Variables and functions */
int CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION;
int CEC_MSG_CDC_MESSAGE;
void cec_msg_cdc_hec_request_deactivation(struct cec_msg *msg, __u16 phys_addr1,
                                          __u16 phys_addr2, __u16 phys_addr3) {
  msg->len = 11;
  msg->msg[0] |= 0xf;
  msg->msg[1] = CEC_MSG_CDC_MESSAGE;
  msg->msg[4] = CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION;
  msg->msg[5] = phys_addr1 >> 8;
  msg->msg[6] = phys_addr1 & 0xff;
  msg->msg[7] = phys_addr2 >> 8;
  msg->msg[8] = phys_addr2 & 0xff;
  msg->msg[9] = phys_addr3 >> 8;
  msg->msg[10] = phys_addr3 & 0xff;
}


x86 assembly (clang, -O0):
<cec_msg_cdc_hec_request_deactivation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xb,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%ecx
or     $0xf,%ecx
mov    %ecx,(%rax)
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    0x2e93(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x10(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x18(%rax)
mov    -0x10(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x1c(%rax)
mov    -0x10(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x20(%rax)
mov    -0x14(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x24(%rax)
mov    -0x14(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_cdc_hec_request_deactivation>:
movl   $0xb,(%rdi)
mov    0x8(%rdi),%rax
orl    $0xf,(%rax)
mov    0x2ecc(%rip),%rdi
mov    (%rdi),%edi
mov    %edi,0x4(%rax)
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%edi
mov    %edi,0x10(%rax)
movzbl %sil,%edi
sar    $0x8,%esi
mov    %esi,0x14(%rax)
mov    %edi,0x18(%rax)
movzbl %dl,%esi
sar    $0x8,%edx
mov    %edx,0x1c(%rax)
mov    %esi,0x20(%rax)
movzbl %cl,%edx
sar    $0x8,%ecx
mov    %ecx,0x24(%rax)
mov    %edx,0x28(%rax)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_CDC_MESSAGE = global i32 0
@CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION = global i32 0
define void @cec_msg_cdc_hec_request_deactivation(%struct.cec_msg* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.cec_msg*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.cec_msg* %0, %struct.cec_msg** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %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 11, i32* %10
%11 = load %struct.cec_msg*, %struct.cec_msg** %5
%12 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %11, i32 0, i32 1
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = or i32 %15, 15
store i32 %16, i32* %14
%17 = load i32, i32* @CEC_MSG_CDC_MESSAGE
%18 = load %struct.cec_msg*, %struct.cec_msg** %5
%19 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %18, i32 0, i32 1
%20 = load i32*, i32** %19
%21 = getelementptr inbounds i32, i32* %20, i64 1
store i32 %17, i32* %21
%22 = load i32, i32* @CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION
%23 = load %struct.cec_msg*, %struct.cec_msg** %5
%24 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %23, i32 0, i32 1
%25 = load i32*, i32** %24
%26 = getelementptr inbounds i32, i32* %25, i64 4
store i32 %22, i32* %26
%27 = load i32, i32* %6
%28 = ashr i32 %27, 8
%29 = load %struct.cec_msg*, %struct.cec_msg** %5
%30 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %29, i32 0, i32 1
%31 = load i32*, i32** %30
%32 = getelementptr inbounds i32, i32* %31, i64 5
store i32 %28, i32* %32
%33 = load i32, i32* %6
%34 = and i32 %33, 255
%35 = load %struct.cec_msg*, %struct.cec_msg** %5
%36 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %35, i32 0, i32 1
%37 = load i32*, i32** %36
%38 = getelementptr inbounds i32, i32* %37, i64 6
store i32 %34, i32* %38
%39 = load i32, i32* %7
%40 = ashr i32 %39, 8
%41 = load %struct.cec_msg*, %struct.cec_msg** %5
%42 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %41, i32 0, i32 1
%43 = load i32*, i32** %42
%44 = getelementptr inbounds i32, i32* %43, i64 7
store i32 %40, i32* %44
%45 = load i32, i32* %7
%46 = and i32 %45, 255
%47 = load %struct.cec_msg*, %struct.cec_msg** %5
%48 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %47, i32 0, i32 1
%49 = load i32*, i32** %48
%50 = getelementptr inbounds i32, i32* %49, i64 8
store i32 %46, i32* %50
%51 = load i32, i32* %8
%52 = ashr i32 %51, 8
%53 = load %struct.cec_msg*, %struct.cec_msg** %5
%54 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %53, i32 0, i32 1
%55 = load i32*, i32** %54
%56 = getelementptr inbounds i32, i32* %55, i64 9
store i32 %52, i32* %56
%57 = load i32, i32* %8
%58 = and i32 %57, 255
%59 = load %struct.cec_msg*, %struct.cec_msg** %5
%60 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %59, i32 0, i32 1
%61 = load i32*, i32** %60
%62 = getelementptr inbounds i32, i32* %61, i64 10
store i32 %58, i32* %62
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_CDC_MESSAGE = global i32 0
@CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION = global i32 0
define void @cec_msg_cdc_hec_request_deactivation(%struct.cec_msg* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 11, i32* %5
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = or i32 %8, 15
store i32 %9, i32* %7
%10 = load i32, i32* @CEC_MSG_CDC_MESSAGE
%11 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %10, i32* %11
%12 = load i32, i32* @CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION
%13 = getelementptr inbounds i32, i32* %7, i64 4
store i32 %12, i32* %13
%14 = ashr i32 %1, 8
%15 = getelementptr inbounds i32, i32* %7, i64 5
store i32 %14, i32* %15
%16 = and i32 %1, 255
%17 = getelementptr inbounds i32, i32* %7, i64 6
store i32 %16, i32* %17
%18 = ashr i32 %2, 8
%19 = getelementptr inbounds i32, i32* %7, i64 7
store i32 %18, i32* %19
%20 = and i32 %2, 255
%21 = getelementptr inbounds i32, i32* %7, i64 8
store i32 %20, i32* %21
%22 = ashr i32 %3, 8
%23 = getelementptr inbounds i32, i32* %7, i64 9
store i32 %22, i32* %23
%24 = and i32 %3, 255
%25 = getelementptr inbounds i32, i32* %7, i64 10
store i32 %24, i32* %25
ret void
}