#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*/ DRM_INFO(char *, char const *, unsigned int, char *, char *,
                            char *, char *, char *, char *, char *, char *,
                            char *);
void r128_print_dirty(const char *msg, unsigned int flags) {
  DRM_INFO("%s: (0x%x) %s%s%s%s%s%s%s%s%s\n", msg, flags,
           (flags & 0x040) ? "core, " : "", (flags & 0x001) ? "context, " : "",
           (flags & 0x002) ? "setup, " : "", (flags & 0x004) ? "tex0, " : "",
           (flags & 0x008) ? "tex1, " : "", (flags & 0x080) ? "masks, " : "",
           (flags & 0x100) ? "window, " : "",
           (flags & 0x200) ? "cliprects, " : "",
           (flags & 0x400) ? "quiescence, " : "");
}


x86 assembly (clang, -O0):
<r128_print_dirty>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %rdi,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x2c(%rbp),%edi
and    $0x40,%edi
lea    0xee4(%rip),%rcx
lea    0xede(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rcx
mov    -0x2c(%rbp),%edi
and    $0x1,%edi
lea    0xec9(%rip),%r8
lea    0xeca(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r8
mov    -0x2c(%rbp),%edi
and    $0x2,%edi
lea    0xeae(%rip),%r9
lea    0xeb9(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r9
mov    -0x2c(%rbp),%edi
and    $0x4,%edi
lea    0xe93(%rip),%r15
lea    0xea6(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r15
mov    -0x2c(%rbp),%edi
and    $0x8,%edi
lea    0xe78(%rip),%r14
lea    0xe92(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r14
mov    -0x2c(%rbp),%edi
and    $0x80,%edi
lea    0xe5a(%rip),%rbx
lea    0xe7b(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rbx
mov    -0x2c(%rbp),%edi
and    $0x100,%edi
lea    0xe3c(%rip),%r11
lea    0xe65(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r11
mov    -0x2c(%rbp),%edi
and    $0x200,%edi
lea    0xe1e(%rip),%r10
lea    0xe50(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r10
mov    -0x2c(%rbp),%r12d
and    $0x400,%r12d
lea    0xdfe(%rip),%rax
lea    0xe3c(%rip),%rdi
cmp    $0x0,%r12d
cmovne %rdi,%rax
lea    0xdca(%rip),%rdi
mov    %r15,(%rsp)
mov    %r14,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   1030 <DRM_INFO@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<r128_print_dirty>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %esi,%edx
mov    %rdi,%r11
test   $0x40,%dl
lea    0xf17(%rip),%rdi
lea    0xf11(%rip),%rcx
cmove  %rdi,%rcx
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xebd(%rip),%xmm1
pand   %xmm0,%xmm1
pand   0xec1(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%esi
lea    0xed8(%rip),%r8
test   $0x80,%sil
cmovne %rdi,%r8
lea    0xed3(%rip),%r9
test   $0x40,%sil
cmovne %rdi,%r9
lea    0xecc(%rip),%r10
test   $0x20,%sil
cmovne %rdi,%r10
lea    0xec4(%rip),%r14
test   $0x10,%sil
cmovne %rdi,%r14
lea    0xebc(%rip),%r15
test   $0x8,%sil
cmovne %rdi,%r15
lea    0xeb5(%rip),%r12
test   $0x4,%sil
cmovne %rdi,%r12
lea    0xeaf(%rip),%rbx
test   $0x2,%sil
cmovne %rdi,%rbx
lea    0xeac(%rip),%rax
test   $0x1,%sil
cmovne %rdi,%rax
lea    0xe3a(%rip),%rdi
mov    %r11,%rsi
push   %rax
push   %rbx
push   %r12
push   %r15
push   %r14
push   %r10
call   1030 <DRM_INFO@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"%s: (0x%x) %s%s%s%s%s%s%s%s%s\0A\00"
@.str.1 = [7 x i8] c"core, \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"context, \00"
@.str.4 = [8 x i8] c"setup, \00"
@.str.5 = [7 x i8] c"tex0, \00"
@.str.6 = [7 x i8] c"tex1, \00"
@.str.7 = [8 x i8] c"masks, \00"
@.str.8 = [9 x i8] c"window, \00"
@.str.9 = [12 x i8] c"cliprects, \00"
@.str.10 = [13 x i8] c"quiescence, \00"
define void @r128_print_dirty(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 64
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%17 = load i32, i32* %4
%18 = and i32 %17, 2
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%22 = load i32, i32* %4
%23 = and i32 %22, 4
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%27 = load i32, i32* %4
%28 = and i32 %27, 8
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%32 = load i32, i32* %4
%33 = and i32 %32, 128
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%37 = load i32, i32* %4
%38 = and i32 %37, 256
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%42 = load i32, i32* %4
%43 = and i32 %42, 512
%44 = icmp ne i32 %43, 0
%45 = zext i1 %44 to i64
%46 = select i1 %44, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%47 = load i32, i32* %4
%48 = and i32 %47, 1024
%49 = icmp ne i32 %48, 0
%50 = zext i1 %49 to i64
%51 = select i1 %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%52 = call i32 @DRM_INFO(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i8* %11, i8* %16, i8* %21, i8* %26, i8* %31, i8* %36, i8* %41, i8* %46, i8* %51)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s: (0x%x) %s%s%s%s%s%s%s%s%s\0A\00"
@.str.1 = [7 x i8] c"core, \00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"context, \00"
@.str.4 = [8 x i8] c"setup, \00"
@.str.5 = [7 x i8] c"tex0, \00"
@.str.6 = [7 x i8] c"tex1, \00"
@.str.7 = [8 x i8] c"masks, \00"
@.str.8 = [9 x i8] c"window, \00"
@.str.9 = [12 x i8] c"cliprects, \00"
@.str.10 = [13 x i8] c"quiescence, \00"
define void @r128_print_dirty(i8* %0, i32 %1) {
%3 = and i32 %1, 64
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%6 = insertelement <8 x i32> poison, i32 %1, i64 0
%7 = shufflevector <8 x i32> %6, <8 x i32> poison, <8 x i32> zeroinitializer
%8 = and <8 x i32> %7, <i32 1024, i32 512, i32 256, i32 128, i32 8, i32 4, i32 2, i32 1>
%9 = icmp eq <8 x i32> %8, zeroinitializer
%10 = extractelement <8 x i1> %9, i64 7
%11 = select i1 %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0)
%12 = extractelement <8 x i1> %9, i64 6
%13 = select i1 %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0)
%14 = extractelement <8 x i1> %9, i64 5
%15 = select i1 %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%16 = extractelement <8 x i1> %9, i64 4
%17 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0)
%18 = extractelement <8 x i1> %9, i64 3
%19 = select i1 %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0)
%20 = extractelement <8 x i1> %9, i64 2
%21 = select i1 %20, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0)
%22 = extractelement <8 x i1> %9, i64 1
%23 = select i1 %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0)
%24 = extractelement <8 x i1> %9, i64 0
%25 = select i1 %24, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0)
%26 = tail call i32 @DRM_INFO(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %5, i8* %11, i8* %13, i8* %15, i8* %17, i8* %19, i8* %21, i8* %23, i8* %25)
ret void
}