#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void decode(char *buffer, int len) {
  fprintf(stdout, " 1: %s\n", ((buffer[7] & 0x01) > 0) ? "ON" : "OFF");
  fprintf(stdout, " 2: %s\n", ((buffer[7] & 0x02) > 0) ? "ON" : "OFF");
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movsbl 0x7(%rax),%ecx
and    $0x1,%ecx
lea    0xed1(%rip),%rdx
lea    0xec7(%rip),%rax
cmp    $0x0,%ecx
cmovg  %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movsbl 0x7(%rax),%ecx
and    $0x2,%ecx
lea    0xe9c(%rip),%rdx
lea    0xe92(%rip),%rax
cmp    $0x0,%ecx
cmovg  %rax,%rdx
lea    0xe8b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2ebe(%rip),%r15
mov    (%r15),%edi
testb  $0x1,0x7(%r14)
lea    0xeda(%rip),%r12
lea    0xed0(%rip),%rbx
mov    %rbx,%rdx
cmove  %r12,%rdx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
testb  $0x2,0x7(%r14)
mov    (%r15),%edi
cmove  %r12,%rbx
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c" 1: %s\0A\00"
@.str.1 = [3 x i8] c"ON\00"
@.str.2 = [4 x i8] c"OFF\00"
@.str.3 = [8 x i8] c" 2: %s\0A\00"
define void @decode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 7
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, 1
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @stdout
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 7
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = and i32 %19, 2
%21 = icmp sgt i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%24 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %23)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c" 1: %s\0A\00"
@.str.1 = [3 x i8] c"ON\00"
@.str.2 = [4 x i8] c"OFF\00"
@.str.3 = [8 x i8] c" 2: %s\0A\00"
define void @decode(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = getelementptr inbounds i8, i8* %0, i64 7
%5 = load i8, i8* %4
%6 = and i8 %5, 1
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stdout
%11 = load i8, i8* %4
%12 = and i8 %11, 2
%13 = icmp eq i8 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%15 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %14)
ret void
}