#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*/ printf(char *, unsigned char, ...);
void zwavecmd_wakeup_dump(void *data, void *payload, int len) {
  unsigned char *pp = (unsigned char *)payload;
  int v;
  if (pp[0] != 0x06) {
    printf("Unknown command(%x)\n", pp[0]);
    return;
  }
  v = (pp[1] << 16) + (pp[2] << 8) + pp[3];
  printf("Send wakeup notification to node %d at interval of %d\n", pp[4], v);
}


x86 assembly (clang, -O0):
<zwavecmd_wakeup_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x6,%eax
je     1155 <zwavecmd_wakeup_dump+0x45>
mov    -0x20(%rbp),%rax
lea    0xeba(%rip),%rdi
movzbl (%rax),%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <zwavecmd_wakeup_dump+0x85>
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%eax
mov    -0x20(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x20(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%al
mov    -0x24(%rbp),%edx
lea    0xe8a(%rip),%rdi
movzbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zwavecmd_wakeup_dump>:
mov    (%rsi),%al
cmp    $0x6,%al
jne    113e <zwavecmd_wakeup_dump+0x2e>
movzbl 0x1(%rsi),%eax
shl    $0x10,%eax
movzbl 0x2(%rsi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x3(%rsi),%edx
or     %ecx,%edx
movzbl 0x4(%rsi),%esi
lea    0xede(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
movzbl %al,%esi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Unknown command(%x)\0A\00"
@.str.1 = [55 x i8] c"Send wakeup notification to node %d at interval of %d\0A\00"
define void @zwavecmd_wakeup_dump(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp ne i32 %13, 6
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 zeroext %18)
br label %42
20: ; preds = %3
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 16
%26 = load i8*, i8** %7
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = shl i32 %29, 8
%31 = add nsw i32 %25, %30
%32 = load i8*, i8** %7
%33 = getelementptr inbounds i8, i8* %32, i64 3
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = add nsw i32 %31, %35
store i32 %36, i32* %8
%37 = load i8*, i8** %7
%38 = getelementptr inbounds i8, i8* %37, i64 4
%39 = load i8, i8* %38
%40 = load i32, i32* %8
%41 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %39, i32 %40)
br label %42
42: ; preds = %20, %15
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Unknown command(%x)\0A\00"
@.str.1 = [55 x i8] c"Send wakeup notification to node %d at interval of %d\0A\00"
define void @zwavecmd_wakeup_dump(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 6
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8 zeroext %4)
br label %25
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = getelementptr inbounds i8, i8* %1, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl nuw nsw i32 %15, 8
%17 = or i32 %16, %12
%18 = getelementptr inbounds i8, i8* %1, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
%22 = getelementptr inbounds i8, i8* %1, i64 4
%23 = load i8, i8* %22
%24 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %23, i32 %21)
br label %25
25: ; preds = %8, %6
ret void
}