#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;
  void **msg;
};
typedef void *__u8;

/* Variables and functions */
void *CEC_MSG_FEATURE_ABORT;
void cec_msg_feature_abort(struct cec_msg *msg, __u8 abort_msg, __u8 reason) {
  msg->len = 4;
  msg->msg[1] = CEC_MSG_FEATURE_ABORT;
  msg->msg[2] = abort_msg;
  msg->msg[3] = reason;
}


x86 assembly (clang, -O0):
<cec_msg_feature_abort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
mov    0x2ec7(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x10(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_msg_feature_abort>:
movl   $0x4,(%rdi)
mov    0x2edb(%rip),%rax
mov    (%rax),%rax
mov    0x8(%rdi),%rcx
mov    %rax,0x8(%rcx)
mov    0x8(%rdi),%rax
mov    %rsi,0x10(%rax)
mov    0x8(%rdi),%rax
mov    %rdx,0x18(%rax)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32, i8** }
@CEC_MSG_FEATURE_ABORT = global i8* null
define void @cec_msg_feature_abort(%struct.cec_msg* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cec_msg*
%5 = alloca i8*
%6 = alloca i8*
store %struct.cec_msg* %0, %struct.cec_msg** %4
store i8* %1, i8** %5
store i8* %2, i8** %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 4, i32* %8
%9 = load i8*, i8** @CEC_MSG_FEATURE_ABORT
%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 i8**, i8*** %11
%13 = getelementptr inbounds i8*, i8** %12, i64 1
store i8* %9, i8** %13
%14 = load i8*, i8** %5
%15 = load %struct.cec_msg*, %struct.cec_msg** %4
%16 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %15, i32 0, i32 1
%17 = load i8**, i8*** %16
%18 = getelementptr inbounds i8*, i8** %17, i64 2
store i8* %14, i8** %18
%19 = load i8*, i8** %6
%20 = load %struct.cec_msg*, %struct.cec_msg** %4
%21 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %20, i32 0, i32 1
%22 = load i8**, i8*** %21
%23 = getelementptr inbounds i8*, i8** %22, i64 3
store i8* %19, i8** %23
ret void
}

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