int parse_dpms_capabilities(unsigned char flags) {
  printf("[EDID] %s: "
         "# DPMS capabilities: Active off:%s  Suspend:%s  Standby:%s\n\n",
         __FUNCTION__, (flags & (1 << 5)) ? "yes" : "no",
         (flags & (1 << 6)) ? "yes" : "no", (flags & (1 << 7)) ? "yes" : "no");
  return 0;
}


x86 assembly (clang, -O0):
<parse_dpms_capabilities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x20,%ecx
lea    0xf38(%rip),%rdx
lea    0xf2d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
movzbl -0x1(%rbp),%esi
and    $0x40,%esi
lea    0xf1c(%rip),%rcx
lea    0xf11(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%rcx
movzbl -0x1(%rbp),%esi
and    $0x80,%esi
lea    0xefd(%rip),%r8
lea    0xef2(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r8
lea    0xe84(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_dpms_capabilities>:
push   %rax
test   $0x20,%dil
lea    0xf48(%rip),%rax
lea    0xf3d(%rip),%r8
mov    %r8,%rdx
cmove  %rax,%rdx
test   $0x40,%dil
mov    %r8,%rcx
cmove  %rax,%rcx
test   $0x80,%dil
cmove  %rax,%r8
lea    0xebc(%rip),%rdi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [72 x i8] c"[EDID] %s: # DPMS capabilities: Active off:%s Suspend:%s Standby:%s\0A\0A\00"
@__FUNCTION__.parse_dpms_capabilities = [24 x i8] c"parse_dpms_capabilities\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define i32 @parse_dpms_capabilities(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 64
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = and i32 %16, 128
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.parse_dpms_capabilities, i64 0, i64 0), i8* %8, i8* %14, i8* %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"[EDID] %s: # DPMS capabilities: Active off:%s Suspend:%s Standby:%s\0A\0A\00"
@__FUNCTION__.parse_dpms_capabilities = [24 x i8] c"parse_dpms_capabilities\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define i32 @parse_dpms_capabilities(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%6 = and i32 %2, 64
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%9 = and i32 %2, 128
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.parse_dpms_capabilities, i64 0, i64 0), i8* %5, i8* %8, i8* %11)
ret i32 0
}