#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_wakeup_set(unsigned int id, int v, int n) {
  unsigned char buf[255];
  buf[0] = (v >> 16) & 0xff;
  buf[1] = (v >> 8) & 0xff;
  buf[2] = v & 0xff;
  buf[3] = n;
  zwave_sendClassCommand(id, 0x84, 0x04, buf, 4);
}


x86 assembly (clang, -O0):
<zwavecmd_wakeup_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x110(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x10f(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x10e(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x10d(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rcx
mov    $0x84,%esi
mov    $0x4,%r8d
mov    %r8d,%edx
call   1030 <zwave_sendClassCommand@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_wakeup_set>:
sub    $0x108,%rsp
mov    %esi,%eax
mov    %esi,%ecx
shr    $0x10,%ecx
mov    %cl,(%rsp)
mov    %ah,0x1(%rsp)
mov    %al,0x2(%rsp)
mov    %dl,0x3(%rsp)
mov    %rsp,%rcx
mov    $0x84,%esi
mov    $0x4,%edx
mov    $0x4,%r8d
call   1030 <zwave_sendClassCommand@plt>
add    $0x108,%rsp
ret

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

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