#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 */

/* Variables and functions */
int /*<<< orphan*/ zwave_sendClassCommand(unsigned int, int, int,
                                          unsigned char *, int);
void zwavecmd_simple_av_set(unsigned int id, unsigned int itemid,
                            unsigned int key, int seq) {
  unsigned char buf[6];
  buf[0] = seq;
  buf[1] = 0;
  buf[2] = itemid / 256;
  buf[3] = itemid % 256;
  buf[4] = key / 256;
  buf[5] = key % 256;
  zwave_sendClassCommand(id, 0x94, 0x1, buf, 6);
}


x86 assembly (clang, -O0):
<zwavecmd_simple_av_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x16(%rbp)
movb   $0x0,-0x15(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x13(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x12(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x16(%rbp),%rcx
mov    $0x94,%esi
mov    $0x1,%edx
mov    $0x6,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_simple_av_set>:
push   %rax
mov    %esi,%eax
mov    %cl,0x2(%rsp)
movb   $0x0,0x3(%rsp)
mov    %ah,0x4(%rsp)
mov    %al,0x5(%rsp)
mov    %dh,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x2(%rsp),%rcx
mov    $0x94,%esi
mov    $0x1,%edx
mov    $0x6,%r8d
call   1030 <zwave_sendClassCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @zwavecmd_simple_av_set(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [6 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
store i8 %11, i8* %12
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 1
store i8 0, i8* %13
%14 = load i32, i32* %6
%15 = udiv i32 %14, 256
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 2
store i8 %16, i8* %17
%18 = load i32, i32* %6
%19 = urem i32 %18, 256
%20 = trunc i32 %19 to i8
%21 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 3
store i8 %20, i8* %21
%22 = load i32, i32* %7
%23 = udiv i32 %22, 256
%24 = trunc i32 %23 to i8
%25 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 4
store i8 %24, i8* %25
%26 = load i32, i32* %7
%27 = urem i32 %26, 256
%28 = trunc i32 %27 to i8
%29 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 5
store i8 %28, i8* %29
%30 = load i32, i32* %5
%31 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%32 = call i32 @zwave_sendClassCommand(i32 %30, i32 148, i32 1, i8* %31, i32 6)
ret void
}

LLVM IR (-O2):
define void @zwavecmd_simple_av_set(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [6 x i8]
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 0
%7 = trunc i32 %3 to i8
store i8 %7, i8* %6
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 1
store i8 0, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 3
store i8 %12, i8* %13
%14 = lshr i32 %2, 8
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 4
store i8 %15, i8* %16
%17 = trunc i32 %2 to i8
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %5, i64 0, i64 5
store i8 %17, i8* %18
%19 = call i32 @zwave_sendClassCommand(i32 %0, i32 148, i32 1, i8* %6, i32 6)
ret void
}