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

/* Variables and functions */
int CEC_MSG_CDC_HEC_DISCOVER;
int CEC_MSG_CDC_MESSAGE;
void cec_msg_cdc_hec_discover(struct cec_msg *msg) {
  msg->len = 5;
  msg->msg[0] |= 0xf;
  msg->msg[1] = CEC_MSG_CDC_MESSAGE;
  msg->msg[4] = CEC_MSG_CDC_HEC_DISCOVER;
}


x86 assembly (clang, -O0):
<cec_msg_cdc_hec_discover>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%ecx
or     $0xf,%ecx
mov    %ecx,(%rax)
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x4(%rax)
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_cdc_hec_discover>:
movl   $0x5,(%rdi)
mov    0x8(%rdi),%rax
orl    $0xf,(%rax)
mov    0x2ec4(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x4(%rax)
mov    0x2ed8(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x10(%rax)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_CDC_MESSAGE = global i32 0
@CEC_MSG_CDC_HEC_DISCOVER = global i32 0
define void @cec_msg_cdc_hec_discover(%struct.cec_msg* %0) {
%2 = alloca %struct.cec_msg*
store %struct.cec_msg* %0, %struct.cec_msg** %2
%3 = load %struct.cec_msg*, %struct.cec_msg** %2
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %3, i32 0, i32 0
store i32 5, i32* %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %2
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = or i32 %9, 15
store i32 %10, i32* %8
%11 = load i32, i32* @CEC_MSG_CDC_MESSAGE
%12 = load %struct.cec_msg*, %struct.cec_msg** %2
%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* @CEC_MSG_CDC_HEC_DISCOVER
%17 = load %struct.cec_msg*, %struct.cec_msg** %2
%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 4
store i32 %16, i32* %20
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32, i32* }
@CEC_MSG_CDC_MESSAGE = global i32 0
@CEC_MSG_CDC_HEC_DISCOVER = global i32 0
define void @cec_msg_cdc_hec_discover(%struct.cec_msg* nocapture %0) {
%2 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
store i32 5, i32* %2
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 1
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = or i32 %5, 15
store i32 %6, i32* %4
%7 = load i32, i32* @CEC_MSG_CDC_MESSAGE
%8 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %7, i32* %8
%9 = load i32, i32* @CEC_MSG_CDC_HEC_DISCOVER
%10 = getelementptr inbounds i32, i32* %4, i64 4
store i32 %9, i32* %10
ret void
}