#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 */
typedef int mode_t;

/* Variables and functions */
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strmode(int, char *);
void printindicator(mode_t md) {
  char buf[10];
  (void)strmode(md, buf);
  printf(buf[0] == 'l'                                          ? "@"
         : buf[0] == 'd'                                        ? "/"
         : buf[0] == 's'                                        ? "="
         : buf[0] == 'p'                                        ? "|"
         : buf[0] == 'w'                                        ? "%%"
         : ((S_IXUSR & md) || (S_IXGRP & md) || (S_IXOTH & md)) ? "*"
                                                                : "?");
}


x86 assembly (clang, -O0):
<printindicator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xe(%rbp),%rsi
call   1040 <strmode@plt>
movsbl -0xe(%rbp),%eax
cmp    $0x6c,%eax
jne    1154 <printindicator+0x34>
lea    0xeb5(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    124d <printindicator+0x12d>
movsbl -0xe(%rbp),%eax
cmp    $0x64,%eax
jne    1171 <printindicator+0x51>
lea    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1245 <printindicator+0x125>
movsbl -0xe(%rbp),%eax
cmp    $0x73,%eax
jne    118e <printindicator+0x6e>
lea    0xe7f(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    123d <printindicator+0x11d>
movsbl -0xe(%rbp),%eax
cmp    $0x70,%eax
jne    11ab <printindicator+0x8b>
lea    0xe64(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1235 <printindicator+0x115>
movsbl -0xe(%rbp),%eax
cmp    $0x77,%eax
jne    11c8 <printindicator+0xa8>
lea    0xe49(%rip),%rax
mov    %rax,-0x38(%rbp)
jmp    122d <printindicator+0x10d>
mov    0x2e11(%rip),%rax
mov    (%rax),%ecx
and    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x39(%rbp)
jne    1211 <printindicator+0xf1>
mov    0x2def(%rip),%rax
mov    (%rax),%ecx
and    -0x4(%rbp),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x39(%rbp)
jne    1211 <printindicator+0xf1>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%dl
lea    0xdf2(%rip),%rax
lea    0xde9(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printindicator>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x6(%rsp),%rsi
call   1040 <strmode@plt>
mov    0x6(%rsp),%al
add    $0x9c,%al
cmp    $0x13,%al
ja     115e <printindicator+0x3e>
lea    0xf0e(%rip),%rdi
movzbl %al,%eax
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xef6(%rip),%rdi
jmp    11b1 <printindicator+0x91>
mov    0x2e7b(%rip),%rax
lea    0xeef(%rip),%rdi
test   %ebx,(%rax)
jne    11b1 <printindicator+0x91>
mov    0x2e61(%rip),%rax
test   %ebx,(%rax)
jne    11b1 <printindicator+0x91>
mov    0x2e66(%rip),%rax
test   %ebx,(%rax)
lea    0xed2(%rip),%rax
lea    0xec9(%rip),%rdi
cmove  %rax,%rdi
jmp    11b1 <printindicator+0x91>
lea    0xeb7(%rip),%rdi
jmp    11b1 <printindicator+0x91>
lea    0xeac(%rip),%rdi
jmp    11b1 <printindicator+0x91>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"@\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"=\00"
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [3 x i8] c"%%\00"
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IXOTH = global i32 0
@.str.5 = [2 x i8] c"*\00"
@.str.6 = [2 x i8] c"?\00"
define void @printindicator(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @strmode(i32 %4, i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 108
br i1 %10, label %11, label %12
11: ; preds = %1
br label %63
12: ; preds = %1
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 100
br i1 %16, label %17, label %18
17: ; preds = %12
br label %61
18: ; preds = %12
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 115
br i1 %22, label %23, label %24
23: ; preds = %18
br label %59
24: ; preds = %18
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 112
br i1 %28, label %29, label %30
29: ; preds = %24
br label %57
30: ; preds = %24
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 119
br i1 %34, label %35, label %36
35: ; preds = %30
br label %55
36: ; preds = %30
%37 = load i32, i32* @S_IXUSR
%38 = load i32, i32* %2
%39 = and i32 %37, %38
%40 = icmp ne i32 %39, 0
br i1 %40, label %51, label %41
41: ; preds = %36
%42 = load i32, i32* @S_IXGRP
%43 = load i32, i32* %2
%44 = and i32 %42, %43
%45 = icmp ne i32 %44, 0
br i1 %45, label %51, label %46
46: ; preds = %41
%47 = load i32, i32* @S_IXOTH
%48 = load i32, i32* %2
%49 = and i32 %47, %48
%50 = icmp ne i32 %49, 0
br label %51
51: ; preds = %46, %41, %36
%52 = phi i1 [ true, %41 ], [ true, %36 ], [ %50, %46 ]
%53 = zext i1 %52 to i64
%54 = select i1 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0)
br label %55
55: ; preds = %51, %35
%56 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %35 ], [ %54, %51 ]
br label %57
57: ; preds = %55, %29
%58 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %29 ], [ %56, %55 ]
br label %59
59: ; preds = %57, %23
%60 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %23 ], [ %58, %57 ]
br label %61
61: ; preds = %59, %17
%62 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %17 ], [ %60, %59 ]
br label %63
63: ; preds = %61, %11
%64 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %11 ], [ %62, %61 ]
%65 = call i32 @printf(i8* %64)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"@\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [2 x i8] c"=\00"
@.str.3 = [2 x i8] c"|\00"
@.str.4 = [3 x i8] c"%%\00"
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IXOTH = global i32 0
@.str.5 = [2 x i8] c"*\00"
@.str.6 = [2 x i8] c"?\00"
define void @printindicator(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strmode(i32 %0, i8* %3)
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 108, label %23
i8 100, label %19
i8 115, label %20
i8 112, label %21
i8 119, label %22
]
6: ; preds = %1
%7 = load i32, i32* @S_IXUSR
%8 = and i32 %7, %0
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* @S_IXGRP
%12 = and i32 %11, %0
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32, i32* @S_IXOTH
%16 = and i32 %15, %0
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0)
br label %23
19: ; preds = %1
br label %23
20: ; preds = %1
br label %23
21: ; preds = %1
br label %23
22: ; preds = %1
br label %23
23: ; preds = %6, %10, %14, %1, %22, %21, %20, %19
%24 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %19 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %20 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %21 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %22 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), %6 ], [ %18, %14 ]
%25 = call i32 @printf(i8* dereferenceable(1) %24)
ret void
}