#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;
  scalar_t__ st_size;
  int /*<<< orphan*/ st_gid;
  int /*<<< orphan*/ st_uid;
  scalar_t__ st_nlink;
};

/* Variables and functions */
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;
char *get_gid_str(int /*<<< orphan*/);
char *get_time_str(char *);
char *get_uid_str(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int, char *, char *, int, char *,
                          char *);
void ls_dofile(struct stat sb, char *file_name) {
  char perm[11] = "----------";
  if (sb.st_mode & 0400)
    perm[1] = 'r';
  if (sb.st_mode & 0200)
    perm[2] = 'w';
  if (sb.st_mode & 0100)
    perm[3] = 'x';
  if (sb.st_mode & 0040)
    perm[4] = 'r';
  if (sb.st_mode & 0020)
    perm[5] = 'w';
  if (sb.st_mode & 0010)
    perm[6] = 'x';
  if (sb.st_mode & 0004)
    perm[7] = 'r';
  if (sb.st_mode & 0002)
    perm[8] = 'w';
  if (sb.st_mode & 0001)
    perm[9] = 'x';
  if (sb.st_mode & S_ISVTX) {
    if (sb.st_mode & 0001)
      perm[9] = 't';
    else
      perm[9] = 'T';
  }
  if (sb.st_mode & S_ISGID) {
    if (sb.st_mode & 0010)
      perm[6] = 'S';
    else
      perm[6] = 's';
  }
  if (sb.st_mode & S_ISUID) {
    if (sb.st_mode & 0100)
      perm[3] = 'S';
    else
      perm[3] = 's';
  }
  if (S_ISBLK(sb.st_mode))
    perm[0] = 'b';
  if (S_ISCHR(sb.st_mode))
    perm[0] = 'c';
  if (S_ISDIR(sb.st_mode))
    perm[0] = 'd';
  if (S_ISLNK(sb.st_mode))
    perm[0] = 'l';
  if (S_ISFIFO(sb.st_mode))
    perm[0] = 'p';
  if (S_ISSOCK(sb.st_mode))
    perm[0] = 's';
  printf("%s %3i %s %s %6i %s %s\n", perm, (int)sb.st_nlink,
         get_uid_str(sb.st_uid), get_gid_str(sb.st_gid), (int)sb.st_size,
         get_time_str("%b %d %H:%M"), file_name);
}


x86 assembly (clang, -O0):
<ls_dofile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    %rdi,-0x8(%rbp)
mov    0xe45(%rip),%rcx
mov    %rcx,-0x13(%rbp)
mov    0xe42(%rip),%cx
mov    %cx,-0xb(%rbp)
mov    0xe3a(%rip),%cl
mov    %cl,-0x9(%rbp)
mov    (%rax),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     11e7 <ls_dofile+0x47>
movb   $0x72,-0x12(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11ff <ls_dofile+0x5f>
movb   $0x77,-0x11(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1215 <ls_dofile+0x75>
movb   $0x78,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     122b <ls_dofile+0x8b>
movb   $0x72,-0xf(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1241 <ls_dofile+0xa1>
movb   $0x77,-0xe(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1257 <ls_dofile+0xb7>
movb   $0x78,-0xd(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     126d <ls_dofile+0xcd>
movb   $0x72,-0xc(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1283 <ls_dofile+0xe3>
movb   $0x77,-0xb(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1299 <ls_dofile+0xf9>
movb   $0x78,-0xa(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    0x2d42(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12d5 <ls_dofile+0x135>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     12cc <ls_dofile+0x12c>
movb   $0x74,-0xa(%rbp)
jmp    12d0 <ls_dofile+0x130>
movb   $0x54,-0xa(%rbp)
jmp    12d5 <ls_dofile+0x135>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    0x2cee(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1311 <ls_dofile+0x171>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1308 <ls_dofile+0x168>
movb   $0x53,-0xd(%rbp)
jmp    130c <ls_dofile+0x16c>
movb   $0x73,-0xd(%rbp)
jmp    1311 <ls_dofile+0x171>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    0x2cc2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     134d <ls_dofile+0x1ad>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     1344 <ls_dofile+0x1a4>
movb   $0x53,-0x10(%rbp)
jmp    1348 <ls_dofile+0x1a8>
movb   $0x73,-0x10(%rbp)
jmp    134d <ls_dofile+0x1ad>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   10b0 <S_ISBLK@plt>
cmp    $0x0,%rax
je     1366 <ls_dofile+0x1c6>
movb   $0x62,-0x13(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   10a0 <S_ISCHR@plt>
cmp    $0x0,%rax
je     137f <ls_dofile+0x1df>
movb   $0x63,-0x13(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1080 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1398 <ls_dofile+0x1f8>
movb   $0x64,-0x13(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     13b1 <ls_dofile+0x211>
movb   $0x6c,-0x13(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1040 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     13ca <ls_dofile+0x22a>
movb   $0x70,-0x13(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1050 <S_ISSOCK@plt>
cmp    $0x0,%rax
je     13e3 <ls_dofile+0x243>
movb   $0x73,-0x13(%rbp)
mov    -0x20(%rbp),%rax
lea    -0x13(%rbp),%rcx
mov    %rcx,-0x48(%rbp)
mov    0x18(%rax),%rcx
mov    %ecx,-0x3c(%rbp)
mov    0x14(%rax),%edi
call   1090 <get_uid_str@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,-0x38(%rbp)
mov    0x10(%rax),%edi
call   1070 <get_gid_str@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,-0x30(%rbp)
mov    0x8(%rax),%rax
mov    %eax,-0x24(%rbp)
lea    0xbf9(%rip),%rdi
call   10c0 <get_time_str@plt>
mov    -0x48(%rbp),%rsi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    %rax,%r10
mov    -0x8(%rbp),%rax
lea    0xbbb(%rip),%rdi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1060 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_dofile>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
movabs $0x2d2d2d2d2d2d2d2d,%rax
2d 2d 2d
mov    %rax,(%rsp)
movl   $0x2d2d2d,0x7(%rsp)
mov    0x40(%rsp),%ebp
test   $0x100,%ebp
jne    1218 <ls_dofile+0x78>
test   $0x80,%bpl
jne    1223 <ls_dofile+0x83>
test   $0x40,%bpl
jne    122e <ls_dofile+0x8e>
test   $0x20,%bpl
jne    1239 <ls_dofile+0x99>
test   $0x10,%bpl
jne    1244 <ls_dofile+0xa4>
test   $0x8,%bpl
jne    124f <ls_dofile+0xaf>
test   $0x4,%bpl
jne    125a <ls_dofile+0xba>
test   $0x2,%bpl
je     1200 <ls_dofile+0x60>
movb   $0x77,0x8(%rsp)
mov    0x2de1(%rip),%rax
test   $0x1,%bpl
jne    1267 <ls_dofile+0xc7>
test   %ebp,(%rax)
je     1277 <ls_dofile+0xd7>
movb   $0x54,0x9(%rsp)
jmp    1277 <ls_dofile+0xd7>
movb   $0x72,0x1(%rsp)
test   $0x80,%bpl
je     11d7 <ls_dofile+0x37>
movb   $0x77,0x2(%rsp)
test   $0x40,%bpl
je     11dd <ls_dofile+0x3d>
movb   $0x78,0x3(%rsp)
test   $0x20,%bpl
je     11e3 <ls_dofile+0x43>
movb   $0x72,0x4(%rsp)
test   $0x10,%bpl
je     11e9 <ls_dofile+0x49>
movb   $0x77,0x5(%rsp)
test   $0x8,%bpl
je     11ef <ls_dofile+0x4f>
movb   $0x78,0x6(%rsp)
test   $0x4,%bpl
je     11f5 <ls_dofile+0x55>
movb   $0x72,0x7(%rsp)
test   $0x2,%bpl
jne    11fb <ls_dofile+0x5b>
jmp    1200 <ls_dofile+0x60>
mov    (%rax),%eax
and    %ebp,%eax
sete   %al
shl    $0x2,%al
add    $0x74,%al
mov    %al,0x9(%rsp)
mov    0x2d52(%rip),%rax
test   %ebp,(%rax)
je     1292 <ls_dofile+0xf2>
test   $0x8,%bpl
sete   %al
shl    $0x5,%al
or     $0x53,%al
mov    %al,0x6(%rsp)
mov    0x2d47(%rip),%rax
test   %ebp,(%rax)
je     12ad <ls_dofile+0x10d>
test   $0x40,%bpl
sete   %al
shl    $0x5,%al
or     $0x53,%al
mov    %al,0x3(%rsp)
mov    %ebp,%edi
call   10b0 <S_ISBLK@plt>
test   %rax,%rax
je     12bd <ls_dofile+0x11d>
movb   $0x62,(%rsp)
mov    %ebp,%edi
call   10a0 <S_ISCHR@plt>
test   %rax,%rax
je     12cd <ls_dofile+0x12d>
movb   $0x63,(%rsp)
mov    %ebp,%edi
call   1080 <S_ISDIR@plt>
test   %rax,%rax
je     12dd <ls_dofile+0x13d>
movb   $0x64,(%rsp)
mov    %ebp,%edi
call   1030 <S_ISLNK@plt>
test   %rax,%rax
je     12ed <ls_dofile+0x14d>
movb   $0x6c,(%rsp)
mov    %ebp,%edi
call   1040 <S_ISFIFO@plt>
test   %rax,%rax
je     12fd <ls_dofile+0x15d>
movb   $0x70,(%rsp)
lea    0x40(%rsp),%rbx
mov    %ebp,%edi
call   1050 <S_ISSOCK@plt>
test   %rax,%rax
je     1312 <ls_dofile+0x172>
movb   $0x73,(%rsp)
mov    0x14(%rbx),%edi
mov    0x18(%rbx),%r15d
call   1090 <get_uid_str@plt>
mov    %rax,%r12
mov    0x10(%rbx),%edi
call   1070 <get_gid_str@plt>
mov    %rax,%rbp
mov    0x8(%rbx),%ebx
lea    0xced(%rip),%rdi
call   10c0 <get_time_str@plt>
lea    0xcc9(%rip),%rdi
mov    %rsp,%rsi
mov    %r15d,%edx
mov    %r12,%rcx
mov    %rbp,%r8
mov    %ebx,%r9d
push   %r14
push   %rax
call   1060 <printf@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i64, i32, i32, i64 }
@__const.ls_dofile.perm = [11 x i8] c"----------\00"
@S_ISVTX = global i32 0
@S_ISGID = global i32 0
@S_ISUID = global i32 0
@.str = [24 x i8] c"%s %3i %s %s %6i %s %s\0A\00"
@.str.1 = [12 x i8] c"%b %d %H:%M\00"
define void @ls_dofile(%struct.stat* byval(%struct.stat) align 8 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca [11 x i8]
store i8* %1, i8** %3
%5 = bitcast [11 x i8]* %4 to i8*
%6 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 256
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 1
store i8 114, i8* %11
br label %12
12: ; preds = %10, %2
%13 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%14 = load i32, i32* %13
%15 = and i32 %14, 128
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 2
store i8 119, i8* %18
br label %19
19: ; preds = %17, %12
%20 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%21 = load i32, i32* %20
%22 = and i32 %21, 64
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 3
store i8 120, i8* %25
br label %26
26: ; preds = %24, %19
%27 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%28 = load i32, i32* %27
%29 = and i32 %28, 32
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 4
store i8 114, i8* %32
br label %33
33: ; preds = %31, %26
%34 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%35 = load i32, i32* %34
%36 = and i32 %35, 16
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 5
store i8 119, i8* %39
br label %40
40: ; preds = %38, %33
%41 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%42 = load i32, i32* %41
%43 = and i32 %42, 8
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %40
%46 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 6
store i8 120, i8* %46
br label %47
47: ; preds = %45, %40
%48 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%49 = load i32, i32* %48
%50 = and i32 %49, 4
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %47
%53 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 7
store i8 114, i8* %53
br label %54
54: ; preds = %52, %47
%55 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%56 = load i32, i32* %55
%57 = and i32 %56, 2
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 8
store i8 119, i8* %60
br label %61
61: ; preds = %59, %54
%62 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%63 = load i32, i32* %62
%64 = and i32 %63, 1
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %61
%67 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 9
store i8 120, i8* %67
br label %68
68: ; preds = %66, %61
%69 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%70 = load i32, i32* %69
%71 = load i32, i32* @S_ISVTX
%72 = and i32 %70, %71
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %84
74: ; preds = %68
%75 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%76 = load i32, i32* %75
%77 = and i32 %76, 1
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %74
%80 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 9
store i8 116, i8* %80
br label %83
81: ; preds = %74
%82 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 9
store i8 84, i8* %82
br label %83
83: ; preds = %81, %79
br label %84
84: ; preds = %83, %68
%85 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%86 = load i32, i32* %85
%87 = load i32, i32* @S_ISGID
%88 = and i32 %86, %87
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %100
90: ; preds = %84
%91 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%92 = load i32, i32* %91
%93 = and i32 %92, 8
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %97
95: ; preds = %90
%96 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 6
store i8 83, i8* %96
br label %99
97: ; preds = %90
%98 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 6
store i8 115, i8* %98
br label %99
99: ; preds = %97, %95
br label %100
100: ; preds = %99, %84
%101 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%102 = load i32, i32* %101
%103 = load i32, i32* @S_ISUID
%104 = and i32 %102, %103
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %116
106: ; preds = %100
%107 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%108 = load i32, i32* %107
%109 = and i32 %108, 64
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %113
111: ; preds = %106
%112 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 3
store i8 83, i8* %112
br label %115
113: ; preds = %106
%114 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 3
store i8 115, i8* %114
br label %115
115: ; preds = %113, %111
br label %116
116: ; preds = %115, %100
%117 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%118 = load i32, i32* %117
%119 = call i64 @S_ISBLK(i32 %118)
%120 = icmp ne i64 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %116
%122 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
store i8 98, i8* %122
br label %123
123: ; preds = %121, %116
%124 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%125 = load i32, i32* %124
%126 = call i64 @S_ISCHR(i32 %125)
%127 = icmp ne i64 %126, 0
br i1 %127, label %128, label %130
128: ; preds = %123
%129 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
store i8 99, i8* %129
br label %130
130: ; preds = %128, %123
%131 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%132 = load i32, i32* %131
%133 = call i64 @S_ISDIR(i32 %132)
%134 = icmp ne i64 %133, 0
br i1 %134, label %135, label %137
135: ; preds = %130
%136 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
store i8 100, i8* %136
br label %137
137: ; preds = %135, %130
%138 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%139 = load i32, i32* %138
%140 = call i64 @S_ISLNK(i32 %139)
%141 = icmp ne i64 %140, 0
br i1 %141, label %142, label %144
142: ; preds = %137
%143 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
store i8 108, i8* %143
br label %144
144: ; preds = %142, %137
%145 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%146 = load i32, i32* %145
%147 = call i64 @S_ISFIFO(i32 %146)
%148 = icmp ne i64 %147, 0
br i1 %148, label %149, label %151
149: ; preds = %144
%150 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
store i8 112, i8* %150
br label %151
151: ; preds = %149, %144
%152 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 0
%153 = load i32, i32* %152
%154 = call i64 @S_ISSOCK(i32 %153)
%155 = icmp ne i64 %154, 0
br i1 %155, label %156, label %158
156: ; preds = %151
%157 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
store i8 115, i8* %157
br label %158
158: ; preds = %156, %151
%159 = getelementptr inbounds [11 x i8], [11 x i8]* %4, i64 0, i64 0
%160 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 4
%161 = load i64, i64* %160
%162 = trunc i64 %161 to i32
%163 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 3
%164 = load i32, i32* %163
%165 = call i8* @get_uid_str(i32 %164)
%166 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 2
%167 = load i32, i32* %166
%168 = call i8* @get_gid_str(i32 %167)
%169 = getelementptr inbounds %struct.stat, %struct.stat* %0, i32 0, i32 1
%170 = load i64, i64* %169
%171 = trunc i64 %170 to i32
%172 = call i8* @get_time_str(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%173 = load i8*, i8** %3
%174 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %159, i32 %162, i8* %165, i8* %168, i32 %171, i8* %172, i8* %173)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i64, i32, i32, i64 }
@__const.ls_dofile.perm = [11 x i8] c"----------\00"
@S_ISVTX = global i32 0
@S_ISGID = global i32 0
@S_ISUID = global i32 0
@.str = [24 x i8] c"%s %3i %s %s %6i %s %s\0A\00"
@.str.1 = [12 x i8] c"%b %d %H:%M\00"
define void @ls_dofile(%struct.stat* nocapture byval(%struct.stat) align 8 %0, i8* %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = and i32 %6, 256
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 1
store i8 114, i8* %10
br label %11
11: ; preds = %9, %2
%12 = and i32 %6, 128
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 2
store i8 119, i8* %15
br label %16
16: ; preds = %14, %11
%17 = and i32 %6, 64
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 3
store i8 120, i8* %20
br label %21
21: ; preds = %19, %16
%22 = and i32 %6, 32
%23 = icmp eq i32 %22, 0
br i1 %23, label %26, label %24
24: ; preds = %21
%25 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 4
store i8 114, i8* %25
br label %26
26: ; preds = %24, %21
%27 = and i32 %6, 16
%28 = icmp eq i32 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %26
%30 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 5
store i8 119, i8* %30
br label %31
31: ; preds = %29, %26
%32 = and i32 %6, 8
%33 = icmp eq i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 6
store i8 120, i8* %35
br label %36
36: ; preds = %34, %31
%37 = and i32 %6, 4
%38 = icmp eq i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %36
%40 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 7
store i8 114, i8* %40
br label %41
41: ; preds = %39, %36
%42 = and i32 %6, 2
%43 = icmp eq i32 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %41
%45 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 8
store i8 119, i8* %45
br label %46
46: ; preds = %44, %41
%47 = and i32 %6, 1
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %46
%50 = load i32, i32* @S_ISVTX
%51 = and i32 %50, %6
%52 = icmp eq i32 %51, 0
br i1 %52, label %61, label %59
53: ; preds = %46
%54 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 9
store i8 120, i8* %54
%55 = load i32, i32* @S_ISVTX
%56 = and i32 %55, %6
%57 = icmp eq i32 %56, 0
%58 = select i1 %57, i8 120, i8 116
store i8 %58, i8* %54
br label %61
59: ; preds = %49
%60 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 9
store i8 84, i8* %60
br label %61
61: ; preds = %53, %59, %49
%62 = load i32, i32* @S_ISGID
%63 = and i32 %62, %6
%64 = icmp eq i32 %63, 0
br i1 %64, label %68, label %65
65: ; preds = %61
%66 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 6
%67 = select i1 %33, i8 115, i8 83
store i8 %67, i8* %66
br label %68
68: ; preds = %65, %61
%69 = load i32, i32* @S_ISUID
%70 = and i32 %69, %6
%71 = icmp eq i32 %70, 0
br i1 %71, label %75, label %72
72: ; preds = %68
%73 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 3
%74 = select i1 %18, i8 115, i8 83
store i8 %74, i8* %73
br label %75
75: ; preds = %72, %68
%76 = tail call i64 @S_ISBLK(i32 %6)
%77 = icmp eq i64 %76, 0
br i1 %77, label %79, label %78
78: ; preds = %75
store i8 98, i8* %4
br label %79
79: ; preds = %78, %75
%80 = tail call i64 @S_ISCHR(i32 %6)
%81 = icmp eq i64 %80, 0
br i1 %81, label %83, label %82
82: ; preds = %79
store i8 99, i8* %4
br label %83
83: ; preds = %82, %79
%84 = tail call i64 @S_ISDIR(i32 %6)
%85 = icmp eq i64 %84, 0
br i1 %85, label %87, label %86
86: ; preds = %83
store i8 100, i8* %4
br label %87
87: ; preds = %86, %83
%88 = tail call i64 @S_ISLNK(i32 %6)
%89 = icmp eq i64 %88, 0
br i1 %89, label %91, label %90
90: ; preds = %87
store i8 108, i8* %4
br label %91
91: ; preds = %90, %87
%92 = tail call i64 @S_ISFIFO(i32 %6)
%93 = icmp eq i64 %92, 0
br i1 %93, label %95, label %94
94: ; preds = %91
store i8 112, i8* %4
br label %95
95: ; preds = %94, %91
%96 = tail call i64 @S_ISSOCK(i32 %6)
%97 = icmp eq i64 %96, 0
br i1 %97, label %99, label %98
98: ; preds = %95
store i8 115, i8* %4
br label %99
99: ; preds = %98, %95
%100 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 4
%101 = load i64, i64* %100
%102 = trunc i64 %101 to i32
%103 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 3
%104 = load i32, i32* %103
%105 = tail call i8* @get_uid_str(i32 %104)
%106 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 2
%107 = load i32, i32* %106
%108 = tail call i8* @get_gid_str(i32 %107)
%109 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
%110 = load i64, i64* %109
%111 = trunc i64 %110 to i32
%112 = tail call i8* @get_time_str(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%113 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %102, i8* %105, i8* %108, i32 %111, i8* %112, i8* %1)
ret void
}