#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 *msg;
};
typedef int __u16;

/* Variables and functions */
void cec_ops_routing_change(const struct cec_msg *msg, __u16 *orig_phys_addr,
                            __u16 *new_phys_addr) {
  *orig_phys_addr = (msg->msg[2] << 8) | msg->msg[3];
  *new_phys_addr = (msg->msg[4] << 8) | msg->msg[5];
}


x86 assembly (clang, -O0):
<cec_ops_routing_change>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
or     0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
or     0x14(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_ops_routing_change>:
mov    (%rdi),%rax
mov    0x8(%rax),%ecx
shl    $0x8,%ecx
or     0xc(%rax),%ecx
mov    %ecx,(%rsi)
mov    0x10(%rax),%ecx
shl    $0x8,%ecx
or     0x14(%rax),%ecx
mov    %ecx,(%rdx)
ret

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

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_routing_change(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = getelementptr inbounds i32, i32* %5, i64 3
%10 = load i32, i32* %9
%11 = or i32 %8, %10
store i32 %11, i32* %1
%12 = getelementptr inbounds i32, i32* %5, i64 4
%13 = load i32, i32* %12
%14 = shl i32 %13, 8
%15 = getelementptr inbounds i32, i32* %5, i64 5
%16 = load i32, i32* %15
%17 = or i32 %14, %16
store i32 %17, i32* %2
ret void
}