#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 */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
scalar_t__ S_ISBLK(int);
scalar_t__ S_ISCHR(int);
scalar_t__ S_ISDIR(int);
scalar_t__ S_ISFIFO(int);
int S_ISGID;
scalar_t__ S_ISLNK(int);
scalar_t__ S_ISSOCK(int);
int S_ISUID;
int S_ISVTX;
int S_IWGRP;
int S_IWOTH;
int S_IWUSR;
int S_IXGRP;
int S_IXOTH;
int S_IXUSR;
int /*<<< orphan*/ printf(char *, char);
void get_file_attribs(const struct stat *file_stat) {
  if (S_ISDIR(file_stat->st_mode)) {
    printf("%c", 'd');
  } else if (S_ISCHR(file_stat->st_mode)) {
    printf("%c", 'c');
  } else if (S_ISBLK(file_stat->st_mode)) {
    printf("%c", 'b');
  } else if (S_ISFIFO(file_stat->st_mode)) {
    printf("%c", 'p');
  } else if (S_ISLNK(file_stat->st_mode)) {
    printf("%c", 'l');
  } else if (S_ISSOCK(file_stat->st_mode)) {
    printf("%c", 's');
  } else {
    printf("%c", '-');
  }
  printf("%c", (file_stat->st_mode & S_IRUSR) ? 'r' : '-');
  printf("%c", (file_stat->st_mode & S_IWUSR) ? 'w' : '-');
  if ((file_stat->st_mode & S_ISUID)) {
    printf("%c", (file_stat->st_mode & S_IXUSR) ? 's' : 'S');
  } else if ((file_stat->st_mode & S_IXUSR)) {
    printf("%c", (file_stat->st_mode & S_IXUSR) ? 'x' : '-');
  } else {
    printf("%c", '-');
  }
  printf("%c", (file_stat->st_mode & S_IRGRP) ? 'r' : '-');
  printf("%c", (file_stat->st_mode & S_IWGRP) ? 'w' : '-');
  if ((file_stat->st_mode & S_ISGID)) {
    printf("%c", (file_stat->st_mode & S_IXGRP) ? 's' : 'S');
  } else if ((file_stat->st_mode & S_IXGRP)) {
    printf("%c", (file_stat->st_mode & S_IXGRP) ? 'x' : '-');
  } else {
    printf("%c", '-');
  }
  printf("%c", (file_stat->st_mode & S_IROTH) ? 'r' : '-');
  printf("%c", (file_stat->st_mode & S_IWOTH) ? 'w' : '-');
  if ((file_stat->st_mode & S_ISVTX)) {
    printf("%c", (file_stat->st_mode & S_IXOTH) ? 't' : 'T');
  } else if ((file_stat->st_mode & S_IXOTH)) {
    printf("%c", (file_stat->st_mode & S_IXOTH) ? 'x' : '-');
  } else {
    printf("%c", '-');
  }
}


x86 assembly (clang, -O0):
<get_file_attribs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1070 <S_ISDIR@plt>
cmp    $0x0,%rax
je     11a7 <get_file_attribs+0x37>
lea    0xe68(%rip),%rdi
mov    $0x64,%esi
call   1060 <printf@plt>
jmp    12a8 <get_file_attribs+0x138>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1080 <S_ISCHR@plt>
cmp    $0x0,%rax
je     11d2 <get_file_attribs+0x62>
lea    0xe3d(%rip),%rdi
mov    $0x63,%esi
call   1060 <printf@plt>
jmp    12a3 <get_file_attribs+0x133>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1090 <S_ISBLK@plt>
cmp    $0x0,%rax
je     11fd <get_file_attribs+0x8d>
lea    0xe12(%rip),%rdi
mov    $0x62,%esi
call   1060 <printf@plt>
jmp    129e <get_file_attribs+0x12e>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     1228 <get_file_attribs+0xb8>
lea    0xde7(%rip),%rdi
mov    $0x70,%esi
call   1060 <printf@plt>
jmp    1299 <get_file_attribs+0x129>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     1253 <get_file_attribs+0xe3>
lea    0xdbc(%rip),%rdi
mov    $0x6c,%esi
call   1060 <printf@plt>
jmp    1294 <get_file_attribs+0x124>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <S_ISSOCK@plt>
cmp    $0x0,%rax
je     127e <get_file_attribs+0x10e>
lea    0xd91(%rip),%rdi
mov    $0x73,%esi
call   1060 <printf@plt>
jmp    128f <get_file_attribs+0x11f>
lea    0xd7b(%rip),%rdi
mov    $0x2d,%esi
call   1060 <printf@plt>
jmp    1294 <get_file_attribs+0x124>
jmp    1299 <get_file_attribs+0x129>
jmp    129e <get_file_attribs+0x12e>
jmp    12a3 <get_file_attribs+0x133>
jmp    12a8 <get_file_attribs+0x138>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2cdb(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x72,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xd32(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2cdd(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x77,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xd04(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2cbf(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     134f <get_file_attribs+0x1df>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2caf(%rip),%rax
and    (%rax),%edx
mov    $0x53,%eax
mov    $0x73,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xcbe(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
jmp    13b0 <get_file_attribs+0x240>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2c7c(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     139a <get_file_attribs+0x22a>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2c64(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x78,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xc73(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
jmp    13ab <get_file_attribs+0x23b>
lea    0xc5f(%rip),%rdi
mov    $0x2d,%esi
call   1060 <printf@plt>
jmp    13b0 <get_file_attribs+0x240>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2be3(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x72,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xc2a(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2bdd(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x77,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xbfc(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2b8f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1457 <get_file_attribs+0x2e7>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2b87(%rip),%rax
and    (%rax),%edx
mov    $0x53,%eax
mov    $0x73,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xbb6(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
jmp    14b8 <get_file_attribs+0x348>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2b54(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     14a2 <get_file_attribs+0x332>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2b3c(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x78,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xb6b(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
jmp    14b3 <get_file_attribs+0x343>
lea    0xb57(%rip),%rdi
mov    $0x2d,%esi
call   1060 <printf@plt>
jmp    14b8 <get_file_attribs+0x348>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2ad3(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x72,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xb22(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2a8d(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x77,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xaf4(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ac7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     155f <get_file_attribs+0x3ef>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2aa7(%rip),%rax
and    (%rax),%edx
mov    $0x54,%eax
mov    $0x74,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xaae(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
jmp    15c0 <get_file_attribs+0x450>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2a74(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     15aa <get_file_attribs+0x43a>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    0x2a5c(%rip),%rax
and    (%rax),%edx
mov    $0x2d,%eax
mov    $0x78,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xa63(%rip),%rdi
movsbl %al,%esi
call   1060 <printf@plt>
jmp    15bb <get_file_attribs+0x44b>
lea    0xa4f(%rip),%rdi
mov    $0x2d,%esi
call   1060 <printf@plt>
jmp    15c0 <get_file_attribs+0x450>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_attribs>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1070 <S_ISDIR@plt>
mov    $0x64,%cl
test   %rax,%rax
jne    11db <get_file_attribs+0x6b>
mov    (%rbx),%edi
call   1080 <S_ISCHR@plt>
mov    $0x63,%cl
test   %rax,%rax
jne    11db <get_file_attribs+0x6b>
mov    (%rbx),%edi
call   1090 <S_ISBLK@plt>
mov    $0x62,%cl
test   %rax,%rax
jne    11db <get_file_attribs+0x6b>
mov    (%rbx),%edi
call   1040 <S_ISFIFO@plt>
mov    $0x70,%cl
test   %rax,%rax
jne    11db <get_file_attribs+0x6b>
mov    (%rbx),%edi
call   1030 <S_ISLNK@plt>
mov    $0x6c,%cl
test   %rax,%rax
jne    11db <get_file_attribs+0x6b>
mov    (%rbx),%edi
call   1050 <S_ISSOCK@plt>
test   %rax,%rax
mov    $0x2d,%eax
mov    $0x73,%ecx
cmove  %eax,%ecx
movzbl %cl,%esi
lea    0xe1b(%rip),%r14
mov    %r14,%rdi
call   1060 <printf@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%eax
and    (%rbx),%eax
mov    $0x2d,%ebp
mov    $0x72,%r15d
mov    $0x72,%esi
cmove  %ebp,%esi
mov    %r14,%rdi
call   1060 <printf@plt>
mov    0x2da6(%rip),%rax
mov    (%rax),%eax
and    (%rbx),%eax
mov    $0x77,%r12d
mov    $0x77,%esi
cmove  %ebp,%esi
mov    %r14,%rdi
call   1060 <printf@plt>
mov    (%rbx),%eax
mov    0x2d93(%rip),%rcx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    0x2d90(%rip),%rdx
and    (%rdx),%eax
setne  %al
mov    $0x78,%edx
cmove  %ebp,%edx
mov    $0x78,%r13d
shl    $0x5,%al
or     $0x53,%al
test   %ecx,%ecx
movzbl %al,%eax
cmove  %edx,%eax
movzbl %al,%esi
mov    %r14,%rdi
call   1060 <printf@plt>
mov    0x2d26(%rip),%rax
mov    (%rax),%eax
and    (%rbx),%eax
mov    $0x72,%esi
cmove  %ebp,%esi
mov    %r14,%rdi
call   1060 <printf@plt>
mov    0x2d33(%rip),%rax
mov    (%rax),%eax
and    (%rbx),%eax
mov    $0x77,%esi
cmove  %ebp,%esi
mov    %r14,%rdi
call   1060 <printf@plt>
mov    (%rbx),%eax
mov    0x2cf6(%rip),%rcx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    0x2cfb(%rip),%rdx
and    (%rdx),%eax
mov    $0x78,%eax
cmove  %ebp,%eax
setne  %dl
shl    $0x5,%dl
or     $0x53,%dl
test   %ecx,%ecx
movzbl %dl,%ecx
cmove  %eax,%ecx
movzbl %cl,%esi
mov    %r14,%rdi
call   1060 <printf@plt>
mov    0x2cae(%rip),%rax
mov    (%rax),%eax
and    (%rbx),%eax
cmove  %ebp,%r15d
mov    %r14,%rdi
mov    %r15d,%esi
call   1060 <printf@plt>
mov    0x2c7c(%rip),%rax
mov    (%rax),%eax
and    (%rbx),%eax
cmove  %ebp,%r12d
mov    %r14,%rdi
mov    %r12d,%esi
call   1060 <printf@plt>
mov    (%rbx),%eax
mov    0x2cc8(%rip),%rcx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    0x2cb5(%rip),%rdx
and    (%rdx),%eax
cmove  %ebp,%r13d
setne  %al
shl    $0x5,%al
or     $0x54,%al
test   %ecx,%ecx
movzbl %al,%eax
cmove  %r13d,%eax
movzbl %al,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <printf@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [3 x i8] c"%c\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_ISUID = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_ISGID = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_ISVTX = global i32 0
@S_IXOTH = global i32 0
define void @get_file_attribs(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i64 @S_ISDIR(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 100)
br label %57
10: ; preds = %1
%11 = load %struct.stat*, %struct.stat** %2
%12 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i64 @S_ISCHR(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 99)
br label %56
18: ; preds = %10
%19 = load %struct.stat*, %struct.stat** %2
%20 = getelementptr inbounds %struct.stat, %struct.stat* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = call i64 @S_ISBLK(i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 98)
br label %55
26: ; preds = %18
%27 = load %struct.stat*, %struct.stat** %2
%28 = getelementptr inbounds %struct.stat, %struct.stat* %27, i32 0, i32 0
%29 = load i32, i32* %28
%30 = call i64 @S_ISFIFO(i32 %29)
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 112)
br label %54
34: ; preds = %26
%35 = load %struct.stat*, %struct.stat** %2
%36 = getelementptr inbounds %struct.stat, %struct.stat* %35, i32 0, i32 0
%37 = load i32, i32* %36
%38 = call i64 @S_ISLNK(i32 %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %34
%41 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 108)
br label %53
42: ; preds = %34
%43 = load %struct.stat*, %struct.stat** %2
%44 = getelementptr inbounds %struct.stat, %struct.stat* %43, i32 0, i32 0
%45 = load i32, i32* %44
%46 = call i64 @S_ISSOCK(i32 %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 115)
br label %52
50: ; preds = %42
%51 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 45)
br label %52
52: ; preds = %50, %48
br label %53
53: ; preds = %52, %40
br label %54
54: ; preds = %53, %32
br label %55
55: ; preds = %54, %24
br label %56
56: ; preds = %55, %16
br label %57
57: ; preds = %56, %8
%58 = load %struct.stat*, %struct.stat** %2
%59 = getelementptr inbounds %struct.stat, %struct.stat* %58, i32 0, i32 0
%60 = load i32, i32* %59
%61 = load i32, i32* @S_IRUSR
%62 = and i32 %60, %61
%63 = icmp ne i32 %62, 0
%64 = zext i1 %63 to i64
%65 = select i1 %63, i32 114, i32 45
%66 = trunc i32 %65 to i8
%67 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %66)
%68 = load %struct.stat*, %struct.stat** %2
%69 = getelementptr inbounds %struct.stat, %struct.stat* %68, i32 0, i32 0
%70 = load i32, i32* %69
%71 = load i32, i32* @S_IWUSR
%72 = and i32 %70, %71
%73 = icmp ne i32 %72, 0
%74 = zext i1 %73 to i64
%75 = select i1 %73, i32 119, i32 45
%76 = trunc i32 %75 to i8
%77 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %76)
%78 = load %struct.stat*, %struct.stat** %2
%79 = getelementptr inbounds %struct.stat, %struct.stat* %78, i32 0, i32 0
%80 = load i32, i32* %79
%81 = load i32, i32* @S_ISUID
%82 = and i32 %80, %81
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %95
84: ; preds = %57
%85 = load %struct.stat*, %struct.stat** %2
%86 = getelementptr inbounds %struct.stat, %struct.stat* %85, i32 0, i32 0
%87 = load i32, i32* %86
%88 = load i32, i32* @S_IXUSR
%89 = and i32 %87, %88
%90 = icmp ne i32 %89, 0
%91 = zext i1 %90 to i64
%92 = select i1 %90, i32 115, i32 83
%93 = trunc i32 %92 to i8
%94 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %93)
br label %116
95: ; preds = %57
%96 = load %struct.stat*, %struct.stat** %2
%97 = getelementptr inbounds %struct.stat, %struct.stat* %96, i32 0, i32 0
%98 = load i32, i32* %97
%99 = load i32, i32* @S_IXUSR
%100 = and i32 %98, %99
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %113
102: ; preds = %95
%103 = load %struct.stat*, %struct.stat** %2
%104 = getelementptr inbounds %struct.stat, %struct.stat* %103, i32 0, i32 0
%105 = load i32, i32* %104
%106 = load i32, i32* @S_IXUSR
%107 = and i32 %105, %106
%108 = icmp ne i32 %107, 0
%109 = zext i1 %108 to i64
%110 = select i1 %108, i32 120, i32 45
%111 = trunc i32 %110 to i8
%112 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %111)
br label %115
113: ; preds = %95
%114 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 45)
br label %115
115: ; preds = %113, %102
br label %116
116: ; preds = %115, %84
%117 = load %struct.stat*, %struct.stat** %2
%118 = getelementptr inbounds %struct.stat, %struct.stat* %117, i32 0, i32 0
%119 = load i32, i32* %118
%120 = load i32, i32* @S_IRGRP
%121 = and i32 %119, %120
%122 = icmp ne i32 %121, 0
%123 = zext i1 %122 to i64
%124 = select i1 %122, i32 114, i32 45
%125 = trunc i32 %124 to i8
%126 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %125)
%127 = load %struct.stat*, %struct.stat** %2
%128 = getelementptr inbounds %struct.stat, %struct.stat* %127, i32 0, i32 0
%129 = load i32, i32* %128
%130 = load i32, i32* @S_IWGRP
%131 = and i32 %129, %130
%132 = icmp ne i32 %131, 0
%133 = zext i1 %132 to i64
%134 = select i1 %132, i32 119, i32 45
%135 = trunc i32 %134 to i8
%136 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %135)
%137 = load %struct.stat*, %struct.stat** %2
%138 = getelementptr inbounds %struct.stat, %struct.stat* %137, i32 0, i32 0
%139 = load i32, i32* %138
%140 = load i32, i32* @S_ISGID
%141 = and i32 %139, %140
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %154
143: ; preds = %116
%144 = load %struct.stat*, %struct.stat** %2
%145 = getelementptr inbounds %struct.stat, %struct.stat* %144, i32 0, i32 0
%146 = load i32, i32* %145
%147 = load i32, i32* @S_IXGRP
%148 = and i32 %146, %147
%149 = icmp ne i32 %148, 0
%150 = zext i1 %149 to i64
%151 = select i1 %149, i32 115, i32 83
%152 = trunc i32 %151 to i8
%153 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %152)
br label %175
154: ; preds = %116
%155 = load %struct.stat*, %struct.stat** %2
%156 = getelementptr inbounds %struct.stat, %struct.stat* %155, i32 0, i32 0
%157 = load i32, i32* %156
%158 = load i32, i32* @S_IXGRP
%159 = and i32 %157, %158
%160 = icmp ne i32 %159, 0
br i1 %160, label %161, label %172
161: ; preds = %154
%162 = load %struct.stat*, %struct.stat** %2
%163 = getelementptr inbounds %struct.stat, %struct.stat* %162, i32 0, i32 0
%164 = load i32, i32* %163
%165 = load i32, i32* @S_IXGRP
%166 = and i32 %164, %165
%167 = icmp ne i32 %166, 0
%168 = zext i1 %167 to i64
%169 = select i1 %167, i32 120, i32 45
%170 = trunc i32 %169 to i8
%171 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %170)
br label %174
172: ; preds = %154
%173 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 45)
br label %174
174: ; preds = %172, %161
br label %175
175: ; preds = %174, %143
%176 = load %struct.stat*, %struct.stat** %2
%177 = getelementptr inbounds %struct.stat, %struct.stat* %176, i32 0, i32 0
%178 = load i32, i32* %177
%179 = load i32, i32* @S_IROTH
%180 = and i32 %178, %179
%181 = icmp ne i32 %180, 0
%182 = zext i1 %181 to i64
%183 = select i1 %181, i32 114, i32 45
%184 = trunc i32 %183 to i8
%185 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %184)
%186 = load %struct.stat*, %struct.stat** %2
%187 = getelementptr inbounds %struct.stat, %struct.stat* %186, i32 0, i32 0
%188 = load i32, i32* %187
%189 = load i32, i32* @S_IWOTH
%190 = and i32 %188, %189
%191 = icmp ne i32 %190, 0
%192 = zext i1 %191 to i64
%193 = select i1 %191, i32 119, i32 45
%194 = trunc i32 %193 to i8
%195 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %194)
%196 = load %struct.stat*, %struct.stat** %2
%197 = getelementptr inbounds %struct.stat, %struct.stat* %196, i32 0, i32 0
%198 = load i32, i32* %197
%199 = load i32, i32* @S_ISVTX
%200 = and i32 %198, %199
%201 = icmp ne i32 %200, 0
br i1 %201, label %202, label %213
202: ; preds = %175
%203 = load %struct.stat*, %struct.stat** %2
%204 = getelementptr inbounds %struct.stat, %struct.stat* %203, i32 0, i32 0
%205 = load i32, i32* %204
%206 = load i32, i32* @S_IXOTH
%207 = and i32 %205, %206
%208 = icmp ne i32 %207, 0
%209 = zext i1 %208 to i64
%210 = select i1 %208, i32 116, i32 84
%211 = trunc i32 %210 to i8
%212 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %211)
br label %234
213: ; preds = %175
%214 = load %struct.stat*, %struct.stat** %2
%215 = getelementptr inbounds %struct.stat, %struct.stat* %214, i32 0, i32 0
%216 = load i32, i32* %215
%217 = load i32, i32* @S_IXOTH
%218 = and i32 %216, %217
%219 = icmp ne i32 %218, 0
br i1 %219, label %220, label %231
220: ; preds = %213
%221 = load %struct.stat*, %struct.stat** %2
%222 = getelementptr inbounds %struct.stat, %struct.stat* %221, i32 0, i32 0
%223 = load i32, i32* %222
%224 = load i32, i32* @S_IXOTH
%225 = and i32 %223, %224
%226 = icmp ne i32 %225, 0
%227 = zext i1 %226 to i64
%228 = select i1 %226, i32 120, i32 45
%229 = trunc i32 %228 to i8
%230 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %229)
br label %233
231: ; preds = %213
%232 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 45)
br label %233
233: ; preds = %231, %220
br label %234
234: ; preds = %233, %202
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [3 x i8] c"%c\00"
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_ISUID = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_ISGID = global i32 0
@S_IXGRP = global i32 0
@S_IROTH = global i32 0
@S_IWOTH = global i32 0
@S_ISVTX = global i32 0
@S_IXOTH = global i32 0
define void @get_file_attribs(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @S_ISDIR(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %27
6: ; preds = %1
%7 = load i32, i32* %2
%8 = tail call i64 @S_ISCHR(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %6
%11 = load i32, i32* %2
%12 = tail call i64 @S_ISBLK(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i32, i32* %2
%16 = tail call i64 @S_ISFIFO(i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %14
%19 = load i32, i32* %2
%20 = tail call i64 @S_ISLNK(i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load i32, i32* %2
%24 = tail call i64 @S_ISSOCK(i32 %23)
%25 = icmp eq i64 %24, 0
%26 = select i1 %25, i8 45, i8 115
br label %27
27: ; preds = %22, %18, %14, %10, %6, %1
%28 = phi i8 [ 100, %1 ], [ 99, %6 ], [ 98, %10 ], [ 112, %14 ], [ 108, %18 ], [ %26, %22 ]
%29 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %28)
%30 = load i32, i32* %2
%31 = load i32, i32* @S_IRUSR
%32 = and i32 %31, %30
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i8 45, i8 114
%35 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %34)
%36 = load i32, i32* %2
%37 = load i32, i32* @S_IWUSR
%38 = and i32 %37, %36
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i8 45, i8 119
%41 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %40)
%42 = load i32, i32* %2
%43 = load i32, i32* @S_ISUID
%44 = and i32 %43, %42
%45 = icmp eq i32 %44, 0
%46 = load i32, i32* @S_IXUSR
%47 = and i32 %46, %42
%48 = icmp eq i32 %47, 0
%49 = select i1 %48, i8 83, i8 115
%50 = select i1 %48, i8 45, i8 120
%51 = select i1 %45, i8 %50, i8 %49
%52 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %51)
%53 = load i32, i32* %2
%54 = load i32, i32* @S_IRGRP
%55 = and i32 %54, %53
%56 = icmp eq i32 %55, 0
%57 = select i1 %56, i8 45, i8 114
%58 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %57)
%59 = load i32, i32* %2
%60 = load i32, i32* @S_IWGRP
%61 = and i32 %60, %59
%62 = icmp eq i32 %61, 0
%63 = select i1 %62, i8 45, i8 119
%64 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %63)
%65 = load i32, i32* %2
%66 = load i32, i32* @S_ISGID
%67 = and i32 %66, %65
%68 = icmp eq i32 %67, 0
%69 = load i32, i32* @S_IXGRP
%70 = and i32 %69, %65
%71 = icmp eq i32 %70, 0
%72 = select i1 %71, i8 83, i8 115
%73 = select i1 %71, i8 45, i8 120
%74 = select i1 %68, i8 %73, i8 %72
%75 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %74)
%76 = load i32, i32* %2
%77 = load i32, i32* @S_IROTH
%78 = and i32 %77, %76
%79 = icmp eq i32 %78, 0
%80 = select i1 %79, i8 45, i8 114
%81 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %80)
%82 = load i32, i32* %2
%83 = load i32, i32* @S_IWOTH
%84 = and i32 %83, %82
%85 = icmp eq i32 %84, 0
%86 = select i1 %85, i8 45, i8 119
%87 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %86)
%88 = load i32, i32* %2
%89 = load i32, i32* @S_ISVTX
%90 = and i32 %89, %88
%91 = icmp eq i32 %90, 0
%92 = load i32, i32* @S_IXOTH
%93 = and i32 %92, %88
%94 = icmp eq i32 %93, 0
%95 = select i1 %94, i8 84, i8 116
%96 = select i1 %94, i8 45, i8 120
%97 = select i1 %91, i8 %96, i8 %95
%98 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %97)
ret void
}