#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 /*<<< orphan*/ time;
struct tm {
  int dummy;
};
struct stat {
  int st_mode;
  int /*<<< orphan*/ st_mtime;
  scalar_t__ st_size;
  int /*<<< orphan*/ st_gid;
  int /*<<< orphan*/ st_uid;
  scalar_t__ st_nlink;
};
struct passwd {
  char *pw_name;
};
struct group {
  char *gr_name;
};
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ cwd;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ S_ISBLK(int);
scalar_t__ S_ISCHR(int);
scalar_t__ S_ISDIR(int);
scalar_t__ S_ISFIFO(int);
scalar_t__ S_ISLNK(int);
scalar_t__ S_ISREG(int);
scalar_t__ S_ISSOCK(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ getcwd(char *, int);
struct group *getgrgid(int /*<<< orphan*/);
struct passwd *getpwuid(int /*<<< orphan*/);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ stat(char *, struct stat *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int executeLsMinusLCommand() {
  char cwd[1024];
  DIR *dp;
  dp = opendir(getcwd(cwd, sizeof(cwd)));
  struct dirent *sd;
  struct stat buf;
  struct passwd *p;
  struct group *g;
  struct tm *t;
  char time[26];
  char P[10] = "rwxrwxrwx", AP[10] = " ";
  int i, j;
  while ((sd = readdir(dp)) != NULL) {
    stat(sd->d_name, &buf);
    if (S_ISDIR(buf.st_mode))
      printf("d");
    else if (S_ISREG(buf.st_mode))
      printf("-");
    else if (S_ISCHR(buf.st_mode))
      printf("c");
    else if (S_ISBLK(buf.st_mode))
      printf("b");
    else if (S_ISLNK(buf.st_mode))
      printf("l");
    else if (S_ISFIFO(buf.st_mode))
      printf("p");
    else if (S_ISSOCK(buf.st_mode))
      printf("s");
    for (i = 0, j = (1 << 8); i < 9; i++, j >>= 1)
      AP[i] = (buf.st_mode & j) ? P[i] : '-';
    printf("%s", AP);
    printf("%5d", (int)buf.st_nlink);
    p = getpwuid(buf.st_uid);
    printf(" %.8s", p->pw_name);
    g = getgrgid(buf.st_gid);
    printf(" %-8.8s", g->gr_name);
    printf(" %8d", (int)buf.st_size);
    t = localtime(&buf.st_mtime);
    strftime(time, sizeof(time), "%b %d %H:%M", t);
    printf(" %s", time);
    printf(" %s\n", sd->d_name);
  }
  closedir(dp);
  return 0;
}


x86 assembly (clang, -O0):
<executeLsMinusLCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   10c0 <getcwd@plt>
mov    %eax,%edi
call   1050 <opendir@plt>
mov    %rax,-0x408(%rbp)
mov    0xdbf(%rip),%rax
mov    %rax,-0x47a(%rbp)
mov    0xdb9(%rip),%ax
mov    %ax,-0x472(%rbp)
mov    0xde3(%rip),%rax
mov    %rax,-0x484(%rbp)
mov    0xddd(%rip),%ax
mov    %ax,-0x47c(%rbp)
mov    -0x408(%rbp),%rdi
call   1100 <readdir@plt>
mov    %rax,-0x410(%rbp)
cmp    $0x0,%rax
je     156e <executeLsMinusLCommand+0x35e>
mov    -0x410(%rbp),%rax
mov    (%rax),%rdi
lea    -0x430(%rbp),%rsi
call   10e0 <stat@plt>
mov    -0x430(%rbp),%edi
call   10a0 <S_ISDIR@plt>
cmp    $0x0,%rax
je     12cd <executeLsMinusLCommand+0xbd>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    13d6 <executeLsMinusLCommand+0x1c6>
mov    -0x430(%rbp),%edi
call   10f0 <S_ISREG@plt>
cmp    $0x0,%rax
je     12f5 <executeLsMinusLCommand+0xe5>
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    13d1 <executeLsMinusLCommand+0x1c1>
mov    -0x430(%rbp),%edi
call   1110 <S_ISCHR@plt>
cmp    $0x0,%rax
je     131d <executeLsMinusLCommand+0x10d>
lea    0xcfb(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    13cc <executeLsMinusLCommand+0x1bc>
mov    -0x430(%rbp),%edi
call   1120 <S_ISBLK@plt>
cmp    $0x0,%rax
je     1345 <executeLsMinusLCommand+0x135>
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    13c7 <executeLsMinusLCommand+0x1b7>
mov    -0x430(%rbp),%edi
call   1040 <S_ISLNK@plt>
cmp    $0x0,%rax
je     136d <executeLsMinusLCommand+0x15d>
lea    0xcaf(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    13c2 <executeLsMinusLCommand+0x1b2>
mov    -0x430(%rbp),%edi
call   1070 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     1395 <executeLsMinusLCommand+0x185>
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    13bd <executeLsMinusLCommand+0x1ad>
mov    -0x430(%rbp),%edi
call   1080 <S_ISSOCK@plt>
cmp    $0x0,%rax
je     13b8 <executeLsMinusLCommand+0x1a8>
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    13bd <executeLsMinusLCommand+0x1ad>
jmp    13c2 <executeLsMinusLCommand+0x1b2>
jmp    13c7 <executeLsMinusLCommand+0x1b7>
jmp    13cc <executeLsMinusLCommand+0x1bc>
jmp    13d1 <executeLsMinusLCommand+0x1c1>
jmp    13d6 <executeLsMinusLCommand+0x1c6>
movl   $0x0,-0x488(%rbp)
movl   $0x100,-0x48c(%rbp)
cmpl   $0x9,-0x488(%rbp)
jge    146f <executeLsMinusLCommand+0x25f>
mov    -0x430(%rbp),%eax
and    -0x48c(%rbp),%eax
cmp    $0x0,%eax
je     1426 <executeLsMinusLCommand+0x216>
movslq -0x488(%rbp),%rax
movsbl -0x47a(%rbp,%rax,1),%eax
ff
mov    %eax,-0x490(%rbp)
jmp    1436 <executeLsMinusLCommand+0x226>
mov    $0x2d,%eax
mov    %eax,-0x490(%rbp)
jmp    1436 <executeLsMinusLCommand+0x226>
mov    -0x490(%rbp),%eax
mov    %al,%cl
movslq -0x488(%rbp),%rax
mov    %cl,-0x484(%rbp,%rax,1)
mov    -0x488(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x488(%rbp)
mov    -0x48c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x48c(%rbp)
jmp    13ea <executeLsMinusLCommand+0x1da>
lea    -0x484(%rbp),%rsi
lea    0xbbb(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x418(%rbp),%rax
mov    %eax,%esi
lea    0xb80(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x41c(%rbp),%edi
call   1060 <getpwuid@plt>
mov    %rax,-0x438(%rbp)
mov    -0x438(%rbp),%rax
mov    (%rax),%rsi
lea    0xb5a(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x420(%rbp),%edi
call   10b0 <getgrgid@plt>
mov    %rax,-0x440(%rbp)
mov    -0x440(%rbp),%rax
mov    (%rax),%rsi
lea    0xb36(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x428(%rbp),%rax
mov    %eax,%esi
lea    0xb27(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x430(%rbp),%rdi
add    $0x4,%rdi
call   1030 <localtime@plt>
mov    %rax,-0x448(%rbp)
lea    -0x470(%rbp),%rdi
mov    -0x448(%rbp),%rcx
mov    $0x1a,%esi
lea    0xaf4(%rip),%rdx
call   1130 <strftime@plt>
lea    -0x470(%rbp),%rsi
lea    0xaed(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x410(%rbp),%rax
mov    (%rax),%rsi
lea    0xad9(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    1272 <executeLsMinusLCommand+0x62>
mov    -0x408(%rbp),%rdi
call   10d0 <closedir@plt>
xor    %eax,%eax
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeLsMinusLCommand>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x458,%rsp
lea    0x50(%rsp),%rdi
mov    $0x400,%esi
call   10d0 <getcwd@plt>
mov    %eax,%edi
call   1060 <opendir@plt>
mov    %rax,%r12
movw   $0x0,0x8(%rsp)
movq   $0x20,(%rsp)
mov    %rax,%rdi
call   1110 <readdir@plt>
test   %rax,%rax
je     14af <executeLsMinusLCommand+0x28f>
mov    %rax,%rbx
mov    $0x2d,%r14d
lea    0x30(%rsp),%r15
lea    0xdce(%rip),%r13
lea    0xdcb(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%rdi
lea    0x10(%rsp),%rsi
call   10f0 <stat@plt>
mov    0x10(%rsp),%edi
call   10b0 <S_ISDIR@plt>
mov    $0x64,%edi
test   %rax,%rax
jne    1330 <executeLsMinusLCommand+0x110>
mov    0x10(%rsp),%edi
call   1100 <S_ISREG@plt>
mov    $0x2d,%edi
test   %rax,%rax
jne    1330 <executeLsMinusLCommand+0x110>
mov    0x10(%rsp),%edi
call   1120 <S_ISCHR@plt>
mov    $0x63,%edi
test   %rax,%rax
jne    1330 <executeLsMinusLCommand+0x110>
mov    0x10(%rsp),%edi
call   1130 <S_ISBLK@plt>
mov    $0x62,%edi
test   %rax,%rax
jne    1330 <executeLsMinusLCommand+0x110>
mov    0x10(%rsp),%edi
call   1050 <S_ISLNK@plt>
mov    $0x6c,%edi
test   %rax,%rax
jne    1330 <executeLsMinusLCommand+0x110>
mov    0x10(%rsp),%edi
call   1080 <S_ISFIFO@plt>
mov    $0x70,%edi
test   %rax,%rax
jne    1330 <executeLsMinusLCommand+0x110>
mov    0x10(%rsp),%edi
call   1090 <S_ISSOCK@plt>
mov    $0x73,%edi
test   %rax,%rax
je     1335 <executeLsMinusLCommand+0x115>
cs nopw 0x0(%rax,%rax,1)
call   1030 <putchar@plt>
mov    0x10(%rsp),%eax
test   $0x100,%eax
mov    $0x72,%ecx
cmove  %r14d,%ecx
mov    %cl,(%rsp)
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pand   0xca1(%rip),%xmm1
pand   0xca9(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%eax
test   $0x80,%al
mov    $0x77,%ecx
cmovne %r14d,%ecx
test   $0x40,%al
mov    $0x78,%edx
cmovne %r14d,%edx
mov    %cl,0x1(%rsp)
mov    %dl,0x2(%rsp)
test   $0x20,%al
mov    $0x72,%ecx
cmovne %r14d,%ecx
mov    %cl,0x3(%rsp)
test   $0x10,%al
mov    $0x77,%ecx
cmovne %r14d,%ecx
mov    %cl,0x4(%rsp)
test   $0x8,%al
mov    $0x78,%ecx
cmovne %r14d,%ecx
test   $0x4,%al
mov    $0x72,%edx
cmovne %r14d,%edx
mov    %cl,0x5(%rsp)
mov    %dl,0x6(%rsp)
test   $0x2,%al
mov    $0x77,%ecx
cmovne %r14d,%ecx
mov    %cl,0x7(%rsp)
test   $0x1,%al
mov    $0x78,%eax
cmovne %r14d,%eax
mov    %al,0x8(%rsp)
lea    0xc50(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x28(%rsp),%esi
lea    0xc17(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x24(%rsp),%edi
call   1070 <getpwuid@plt>
mov    (%rax),%rsi
lea    0xc01(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x20(%rsp),%edi
call   10c0 <getgrgid@plt>
mov    (%rax),%rsi
lea    0xbed(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xbe3(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0x14(%rsp),%rdi
call   1040 <localtime@plt>
mov    %r15,%rdi
mov    $0x1a,%esi
lea    0xbc8(%rip),%rdx
mov    %rax,%rcx
call   1140 <strftime@plt>
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%rbx),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %r12,%rdi
call   1110 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1290 <executeLsMinusLCommand+0x70>
mov    %r12,%rdi
call   10e0 <closedir@plt>
xor    %eax,%eax
add    $0x458,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32, i32, i64, i32, i32, i64 }
%struct.passwd = type { i8* }
%struct.group = type { i8* }
%struct.tm = type { i32 }
@__const.executeLsMinusLCommand.P = [10 x i8] c"rwxrwxrwx\00"
@__const.executeLsMinusLCommand.AP = [10 x i8] c" \00\00\00\00\00\00\00\00\00"
@.str = [2 x i8] c"d\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [2 x i8] c"c\00"
@.str.3 = [2 x i8] c"b\00"
@.str.4 = [2 x i8] c"l\00"
@.str.5 = [2 x i8] c"p\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [4 x i8] c"%5d\00"
@.str.9 = [6 x i8] c" %.8s\00"
@.str.10 = [8 x i8] c" %-8.8s\00"
@.str.11 = [5 x i8] c" %8d\00"
@.str.12 = [12 x i8] c"%b %d %H:%M\00"
@.str.13 = [4 x i8] c" %s\00"
@.str.14 = [5 x i8] c" %s\0A\00"
define i32 @executeLsMinusLCommand() {
%1 = alloca [1024 x i8]
%2 = alloca i32*
%3 = alloca %struct.dirent*
%4 = alloca %struct.stat
%5 = alloca %struct.passwd*
%6 = alloca %struct.group*
%7 = alloca %struct.tm*
%8 = alloca [26 x i8]
%9 = alloca [10 x i8]
%10 = alloca [10 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%14 = call i32 @getcwd(i8* %13, i32 1024)
%15 = call i32* @opendir(i32 %14)
store i32* %15, i32** %2
%16 = bitcast [10 x i8]* %9 to i8*
%17 = bitcast [10 x i8]* %10 to i8*
br label %18
18: ; preds = %109, %0
%19 = load i32*, i32** %2
%20 = call %struct.dirent* @readdir(i32* %19)
store %struct.dirent* %20, %struct.dirent** %3
%21 = icmp ne %struct.dirent* %20, null
br i1 %21, label %22, label %145
22: ; preds = %18
%23 = load %struct.dirent*, %struct.dirent** %3
%24 = getelementptr inbounds %struct.dirent, %struct.dirent* %23, i32 0, i32 0
%25 = load i8*, i8** %24
%26 = call i32 @stat(i8* %25, %struct.stat* %4)
%27 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%28 = load i32, i32* %27
%29 = call i64 @S_ISDIR(i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %22
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %81
33: ; preds = %22
%34 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%35 = load i32, i32* %34
%36 = call i64 @S_ISREG(i32 %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %33
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %80
40: ; preds = %33
%41 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%42 = load i32, i32* %41
%43 = call i64 @S_ISCHR(i32 %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %40
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %79
47: ; preds = %40
%48 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%49 = load i32, i32* %48
%50 = call i64 @S_ISBLK(i32 %49)
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %47
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %78
54: ; preds = %47
%55 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%56 = load i32, i32* %55
%57 = call i64 @S_ISLNK(i32 %56)
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %77
61: ; preds = %54
%62 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%63 = load i32, i32* %62
%64 = call i64 @S_ISFIFO(i32 %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %61
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %76
68: ; preds = %61
%69 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%70 = load i32, i32* %69
%71 = call i64 @S_ISSOCK(i32 %70)
%72 = icmp ne i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %68
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %75
75: ; preds = %73, %68
br label %76
76: ; preds = %75, %66
br label %77
77: ; preds = %76, %59
br label %78
78: ; preds = %77, %52
br label %79
79: ; preds = %78, %45
br label %80
80: ; preds = %79, %38
br label %81
81: ; preds = %80, %31
store i32 0, i32* %11
store i32 256, i32* %12
br label %82
82: ; preds = %104, %81
%83 = load i32, i32* %11
%84 = icmp slt i32 %83, 9
br i1 %84, label %85, label %109
85: ; preds = %82
%86 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%87 = load i32, i32* %86
%88 = load i32, i32* %12
%89 = and i32 %87, %88
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %97
91: ; preds = %85
%92 = load i32, i32* %11
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 %93
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
br label %98
97: ; preds = %85
br label %98
98: ; preds = %97, %91
%99 = phi i32 [ %96, %91 ], [ 45, %97 ]
%100 = trunc i32 %99 to i8
%101 = load i32, i32* %11
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 %102
store i8 %100, i8* %103
br label %104
104: ; preds = %98
%105 = load i32, i32* %11
%106 = add nsw i32 %105, 1
store i32 %106, i32* %11
%107 = load i32, i32* %12
%108 = ashr i32 %107, 1
store i32 %108, i32* %12
br label %82
109: ; preds = %82
%110 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %110)
%112 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 5
%113 = load i64, i64* %112
%114 = trunc i64 %113 to i32
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %114)
%116 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 4
%117 = load i32, i32* %116
%118 = call %struct.passwd* @getpwuid(i32 %117)
store %struct.passwd* %118, %struct.passwd** %5
%119 = load %struct.passwd*, %struct.passwd** %5
%120 = getelementptr inbounds %struct.passwd, %struct.passwd* %119, i32 0, i32 0
%121 = load i8*, i8** %120
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %121)
%123 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 3
%124 = load i32, i32* %123
%125 = call %struct.group* @getgrgid(i32 %124)
store %struct.group* %125, %struct.group** %6
%126 = load %struct.group*, %struct.group** %6
%127 = getelementptr inbounds %struct.group, %struct.group* %126, i32 0, i32 0
%128 = load i8*, i8** %127
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* %128)
%130 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 2
%131 = load i64, i64* %130
%132 = trunc i64 %131 to i32
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 %132)
%134 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 1
%135 = call %struct.tm* @localtime(i32* %134)
store %struct.tm* %135, %struct.tm** %7
%136 = getelementptr inbounds [26 x i8], [26 x i8]* %8, i64 0, i64 0
%137 = load %struct.tm*, %struct.tm** %7
%138 = call i32 @strftime(i8* %136, i32 26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), %struct.tm* %137)
%139 = getelementptr inbounds [26 x i8], [26 x i8]* %8, i64 0, i64 0
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %139)
%141 = load %struct.dirent*, %struct.dirent** %3
%142 = getelementptr inbounds %struct.dirent, %struct.dirent* %141, i32 0, i32 0
%143 = load i8*, i8** %142
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8* %143)
br label %18
145: ; preds = %18
%146 = load i32*, i32** %2
%147 = call i32 @closedir(i32* %146)
ret i32 0
}

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