#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 tm {
  int dummy;
};
struct stat {
  int st_size;
  scalar_t__ st_gid;
  scalar_t__ st_uid;
  scalar_t__ st_nlink;
  scalar_t__ st_mtime;
  int /*<<< orphan*/ st_mode;
};
struct dirent {
  int /*<<< orphan*/ d_name;
};
typedef int /*<<< orphan*/ datestring;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
struct tm *localtime(scalar_t__ *);
scalar_t__ net_printf(int, char *, ...);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
scalar_t__ stat(int /*<<< orphan*/, struct stat *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
scalar_t__ time(int /*<<< orphan*/ *);
int ftpd_list(int cs, int dp, char *dir) {
  DIR *d;
  struct dirent *de;
  struct stat sb;
  char type;
  struct tm *t;
  char datestring[16];
  unsigned int size;
  char sizet;
  int totlen;
  if (dp < 0) {
    net_printf(cs, "522 Data Connection Problem, did you use PASV?\n");
    return 1;
  }
  net_printf(cs, "150 Ready to download %s\n", "directory");
  totlen = 0;
  if ((d = opendir(dir)) != NULL) {
    while ((de = readdir(d)) != NULL) {
      if (stat(de->d_name, &sb) == 0) {
        if (S_ISREG(sb.st_mode))
          type = '-';
        else if (S_ISDIR(sb.st_mode))
          type = 'd';
        else
          type = '?';
        t = localtime(&(sb.st_mtime));
        if (((unsigned long int)time(NULL) - (unsigned long int)sb.st_mtime) >
            31449600)
          strftime(datestring, sizeof(datestring), "%b %d  %Y", t);
        else
          strftime(datestring, sizeof(datestring), "%b %d %H:%M", t);
        if (sb.st_size < 99999) {
          size = (unsigned int)sb.st_size;
          sizet = ' ';
        } else if (sb.st_size < 99999000) {
          size = (unsigned int)(sb.st_size + 499) / 1E3;
          sizet = 'K';
        } else {
          size = (unsigned int)(sb.st_size + 499999) / 1E6;
          sizet = 'M';
        }
        totlen +=
            net_printf(dp, "%crwxrwxrwx %5d %8d %8d %7u%c %s %s\n", (char)type,
                       (int)sb.st_nlink, (int)sb.st_uid, (int)sb.st_gid,
                       (unsigned int)size, (char)sizet, datestring, de->d_name);
      }
    }
    closedir(d);
  }
  net_printf(cs, "226 Transfer OK - %d bytes received\n", totlen);
  return 0;
}


x86 assembly (clang, -O0):
<ftpd_list>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0xa8,%rsp
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    11dd <ftpd_list+0x3d>
mov    -0x10(%rbp),%edi
lea    0xe46(%rip),%rsi
mov    $0x0,%al
call   10c0 <net_printf@plt>
movl   $0x1,-0xc(%rbp)
jmp    140b <ftpd_list+0x26b>
mov    -0x10(%rbp),%edi
lea    0xe59(%rip),%rsi
lea    0xe6c(%rip),%rdx
mov    $0x0,%al
call   10c0 <net_printf@plt>
movl   $0x0,-0x8c(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     13ed <ftpd_list+0x24d>
jmp    121b <ftpd_list+0x7b>
mov    -0x28(%rbp),%rdi
call   10a0 <readdir@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     13e4 <ftpd_list+0x244>
mov    -0x30(%rbp),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rsi
call   1070 <stat@plt>
cmp    $0x0,%rax
jne    13df <ftpd_list+0x23f>
mov    -0x38(%rbp),%edi
call   1090 <S_ISREG@plt>
cmp    $0x0,%rax
je     1266 <ftpd_list+0xc6>
movb   $0x2d,-0x61(%rbp)
jmp    128a <ftpd_list+0xea>
mov    -0x38(%rbp),%edi
call   1050 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1281 <ftpd_list+0xe1>
movb   $0x64,-0x61(%rbp)
jmp    1285 <ftpd_list+0xe5>
movb   $0x3f,-0x61(%rbp)
jmp    128a <ftpd_list+0xea>
lea    -0x60(%rbp),%rdi
add    $0x20,%rdi
call   1030 <localtime@plt>
mov    %rax,-0x70(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
sub    -0x40(%rbp),%rax
cmp    $0x1dfe200,%rax
jbe    12d2 <ftpd_list+0x132>
lea    -0x80(%rbp),%rdi
mov    -0x70(%rbp),%rcx
mov    $0x10,%esi
lea    0xd9c(%rip),%rdx
call   10b0 <strftime@plt>
jmp    12eb <ftpd_list+0x14b>
lea    -0x80(%rbp),%rdi
mov    -0x70(%rbp),%rcx
mov    $0x10,%esi
lea    0xd88(%rip),%rdx
call   10b0 <strftime@plt>
cmpl   $0x1869f,-0x60(%rbp)
jge    130d <ftpd_list+0x16d>
mov    -0x60(%rbp),%eax
mov    %eax,-0x84(%rbp)
movb   $0x20,-0x85(%rbp)
jmp    137a <ftpd_list+0x1da>
cmpl   $0x5f5dd18,-0x60(%rbp)
jge    134a <ftpd_list+0x1aa>
mov    -0x60(%rbp),%eax
add    $0x1f3,%eax
cvtsi2sd %rax,%xmm0
movsd  0xcd9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x84(%rbp)
movb   $0x4b,-0x85(%rbp)
jmp    1375 <ftpd_list+0x1d5>
mov    -0x60(%rbp),%eax
add    $0x7a11f,%eax
cvtsi2sd %rax,%xmm0
movsd  0xca1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x84(%rbp)
movb   $0x4d,-0x85(%rbp)
jmp    137a <ftpd_list+0x1da>
mov    -0x14(%rbp),%edi
movsbl -0x61(%rbp),%edx
mov    -0x48(%rbp),%rax
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
mov    %eax,%r8d
mov    -0x58(%rbp),%rax
mov    %eax,%r9d
mov    -0x84(%rbp),%ebx
movsbl -0x85(%rbp),%r11d
ff
lea    -0x80(%rbp),%r10
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
lea    0xcc6(%rip),%rsi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   10c0 <net_printf@plt>
mov    %rax,%rcx
movslq -0x8c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8c(%rbp)
jmp    121b <ftpd_list+0x7b>
mov    -0x28(%rbp),%rdi
call   1060 <closedir@plt>
mov    -0x10(%rbp),%edi
mov    -0x8c(%rbp),%edx
lea    0xca2(%rip),%rsi
mov    $0x0,%al
call   10c0 <net_printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftpd_list>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %edi,%ebp
mov    %esi,0xc(%rsp)
test   %esi,%esi
js     1355 <ftpd_list+0x1b5>
mov    %rdx,%r14
lea    0xe7a(%rip),%rsi
lea    0xe8d(%rip),%rdx
xor    %ebx,%ebx
mov    %ebp,%edi
xor    %eax,%eax
call   10c0 <net_printf@plt>
mov    %r14,%rdi
call   1040 <opendir@plt>
mov    $0x0,%r14d
test   %rax,%rax
je     137d <ftpd_list+0x1dd>
mov    %rax,%r12
mov    %ebp,0x8(%rsp)
mov    %rax,%rdi
call   10a0 <readdir@plt>
test   %rax,%rax
je     136c <ftpd_list+0x1cc>
mov    %rax,%r15
lea    0x10(%rsp),%rbx
xor    %r14d,%r14d
jmp    1288 <ftpd_list+0xe8>
add    $0x7a11f,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
divsd  0xdd6(%rip),%xmm0
cvttsd2si %xmm0,%rbp
mov    $0x4d,%r10d
mov    %ebx,%r14d
mov    0x28(%rsp),%ecx
mov    0x18(%rsp),%r9d
mov    0x20(%rsp),%r8d
mov    (%r15),%ebx
mov    0xc(%rsp),%edi
lea    0xe26(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
push   %rbx
lea    0x48(%rsp),%rbx
push   %rbx
push   %r10
push   %rbp
call   10c0 <net_printf@plt>
add    $0x20,%rsp
add    %eax,%r14d
lea    0x10(%rsp),%rbx
mov    %r12,%rdi
call   10a0 <readdir@plt>
mov    %rax,%r15
test   %rax,%rax
je     136f <ftpd_list+0x1cf>
mov    (%r15),%edi
mov    %rbx,%rsi
call   1070 <stat@plt>
test   %rax,%rax
jne    1274 <ftpd_list+0xd4>
mov    %r14d,%ebx
mov    0x38(%rsp),%edi
call   1090 <S_ISREG@plt>
mov    $0x2d,%r13d
test   %rax,%rax
jne    12ca <ftpd_list+0x12a>
mov    0x38(%rsp),%edi
call   1050 <S_ISDIR@plt>
test   %rax,%rax
mov    $0x64,%r13d
mov    $0x3f,%eax
cmove  %eax,%r13d
lea    0x30(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%r14
xor    %edi,%edi
call   1080 <time@plt>
sub    0x30(%rsp),%rax
cmp    $0x1dfe201,%rax
lea    0xd7e(%rip),%rdx
lea    0xd6d(%rip),%rax
cmovae %rax,%rdx
lea    0x40(%rsp),%rdi
mov    $0x10,%esi
mov    %r14,%rcx
call   10b0 <strftime@plt>
mov    0x10(%rsp),%ebp
mov    $0x20,%r10d
cmp    $0x1869f,%ebp
jl     1235 <ftpd_list+0x95>
cmp    $0x5f5dd17,%ebp
ja     1214 <ftpd_list+0x74>
add    $0x1f3,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
divsd  0xcc3(%rip),%xmm0
cvttsd2si %xmm0,%rbp
mov    $0x4b,%r10d
jmp    1235 <ftpd_list+0x95>
lea    0xcb4(%rip),%rsi
mov    %ebp,%edi
xor    %eax,%eax
call   10c0 <net_printf@plt>
mov    $0x1,%ebx
jmp    1390 <ftpd_list+0x1f0>
xor    %r14d,%r14d
mov    %r12,%rdi
call   1060 <closedir@plt>
mov    0x8(%rsp),%ebp
xor    %ebx,%ebx
lea    0xd1b(%rip),%rsi
mov    %ebp,%edi
mov    %r14d,%edx
xor    %eax,%eax
call   10c0 <net_printf@plt>
mov    %ebx,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
%struct.stat = type { i32, i64, i64, i64, i64, i32 }
%struct.tm = type { i32 }
@.str = [48 x i8] c"522 Data Connection Problem, did you use PASV?\0A\00"
@.str.1 = [26 x i8] c"150 Ready to download %s\0A\00"
@.str.2 = [10 x i8] c"directory\00"
@.str.3 = [10 x i8] c"%b %d %Y\00"
@.str.4 = [12 x i8] c"%b %d %H:%M\00"
@.str.5 = [37 x i8] c"%crwxrwxrwx %5d %8d %8d %7u%c %s %s\0A\00"
@.str.6 = [37 x i8] c"226 Transfer OK - %d bytes received\0A\00"
define i32 @ftpd_list(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca %struct.dirent*
%10 = alloca %struct.stat
%11 = alloca i8
%12 = alloca %struct.tm*
%13 = alloca [16 x i8]
%14 = alloca i32
%15 = alloca i8
%16 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = load i32, i32* %5
%21 = call i64 (i32, i8*, ...) @net_printf(i32 %20, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %4
br label %128
22: ; preds = %3
%23 = load i32, i32* %5
%24 = call i64 (i32, i8*, ...) @net_printf(i32 %23, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %16
%25 = load i8*, i8** %7
%26 = call i32* @opendir(i8* %25)
store i32* %26, i32** %8
%27 = icmp ne i32* %26, null
br i1 %27, label %28, label %124
28: ; preds = %22
br label %29
29: ; preds = %120, %28
%30 = load i32*, i32** %8
%31 = call %struct.dirent* @readdir(i32* %30)
store %struct.dirent* %31, %struct.dirent** %9
%32 = icmp ne %struct.dirent* %31, null
br i1 %32, label %33, label %121
33: ; preds = %29
%34 = load %struct.dirent*, %struct.dirent** %9
%35 = getelementptr inbounds %struct.dirent, %struct.dirent* %34, i32 0, i32 0
%36 = load i32, i32* %35
%37 = call i64 @stat(i32 %36, %struct.stat* %10)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %120
39: ; preds = %33
%40 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 5
%41 = load i32, i32* %40
%42 = call i64 @S_ISREG(i32 %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %39
store i8 45, i8* %11
br label %53
45: ; preds = %39
%46 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 5
%47 = load i32, i32* %46
%48 = call i64 @S_ISDIR(i32 %47)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %45
store i8 100, i8* %11
br label %52
51: ; preds = %45
store i8 63, i8* %11
br label %52
52: ; preds = %51, %50
br label %53
53: ; preds = %52, %44
%54 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 4
%55 = call %struct.tm* @localtime(i64* %54)
store %struct.tm* %55, %struct.tm** %12
%56 = call i64 @time(i32* null)
%57 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 4
%58 = load i64, i64* %57
%59 = sub i64 %56, %58
%60 = icmp ugt i64 %59, 31449600
br i1 %60, label %61, label %65
61: ; preds = %53
%62 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%63 = load %struct.tm*, %struct.tm** %12
%64 = call i32 @strftime(i8* %62, i32 16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %63)
br label %69
65: ; preds = %53
%66 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%67 = load %struct.tm*, %struct.tm** %12
%68 = call i32 @strftime(i8* %66, i32 16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), %struct.tm* %67)
br label %69
69: ; preds = %65, %61
%70 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%71 = load i32, i32* %70
%72 = icmp slt i32 %71, 99999
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%75 = load i32, i32* %74
store i32 %75, i32* %14
store i8 32, i8* %15
br label %95
76: ; preds = %69
%77 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%78 = load i32, i32* %77
%79 = icmp slt i32 %78, 99999000
br i1 %79, label %80, label %87
80: ; preds = %76
%81 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%82 = load i32, i32* %81
%83 = add nsw i32 %82, 499
%84 = uitofp i32 %83 to double
%85 = fdiv double %84, 1.000000e+03
%86 = fptoui double %85 to i32
store i32 %86, i32* %14
store i8 75, i8* %15
br label %94
87: ; preds = %76
%88 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%89 = load i32, i32* %88
%90 = add nsw i32 %89, 499999
%91 = uitofp i32 %90 to double
%92 = fdiv double %91, 1.000000e+06
%93 = fptoui double %92 to i32
store i32 %93, i32* %14
store i8 77, i8* %15
br label %94
94: ; preds = %87, %80
br label %95
95: ; preds = %94, %73
%96 = load i32, i32* %6
%97 = load i8, i8* %11
%98 = sext i8 %97 to i32
%99 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 3
%100 = load i64, i64* %99
%101 = trunc i64 %100 to i32
%102 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 2
%103 = load i64, i64* %102
%104 = trunc i64 %103 to i32
%105 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%106 = load i64, i64* %105
%107 = trunc i64 %106 to i32
%108 = load i32, i32* %14
%109 = load i8, i8* %15
%110 = sext i8 %109 to i32
%111 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%112 = load %struct.dirent*, %struct.dirent** %9
%113 = getelementptr inbounds %struct.dirent, %struct.dirent* %112, i32 0, i32 0
%114 = load i32, i32* %113
%115 = call i64 (i32, i8*, ...) @net_printf(i32 %96, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %98, i32 %101, i32 %104, i32 %107, i32 %108, i32 %110, i8* %111, i32 %114)
%116 = load i32, i32* %16
%117 = sext i32 %116 to i64
%118 = add nsw i64 %117, %115
%119 = trunc i64 %118 to i32
store i32 %119, i32* %16
br label %120
120: ; preds = %95, %33
br label %29
121: ; preds = %29
%122 = load i32*, i32** %8
%123 = call i32 @closedir(i32* %122)
br label %124
124: ; preds = %121, %22
%125 = load i32, i32* %5
%126 = load i32, i32* %16
%127 = call i64 (i32, i8*, ...) @net_printf(i32 %125, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %126)
store i32 0, i32* %4
br label %128
128: ; preds = %124, %19
%129 = load i32, i32* %4
ret i32 %129
}

LLVM IR (-O2):
%struct.stat = type { i32, i64, i64, i64, i64, i32 }
%struct.dirent = type { i32 }
%struct.tm = type { i32 }
@.str = [48 x i8] c"522 Data Connection Problem, did you use PASV?\0A\00"
@.str.1 = [26 x i8] c"150 Ready to download %s\0A\00"
@.str.2 = [10 x i8] c"directory\00"
@.str.3 = [10 x i8] c"%b %d %Y\00"
@.str.4 = [12 x i8] c"%b %d %H:%M\00"
@.str.5 = [37 x i8] c"%crwxrwxrwx %5d %8d %8d %7u%c %s %s\0A\00"
@.str.6 = [37 x i8] c"226 Transfer OK - %d bytes received\0A\00"
define i32 @ftpd_list(i32 %0, i32 %1, i8* nocapture %2) {
%4 = alloca %struct.stat
%5 = alloca [16 x i8]
%6 = bitcast %struct.stat* %4 to i8*
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%8 = icmp slt i32 %1, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i64 (i32, i8*, ...) @net_printf(i32 %0, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %87
11: ; preds = %3
%12 = tail call i64 (i32, i8*, ...) @net_printf(i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32* @opendir(i8* %2)
%14 = icmp eq i32* %13, null
br i1 %14, label %84, label %15
15: ; preds = %11
%16 = call %struct.dirent* @readdir(i32* %13)
%17 = icmp eq %struct.dirent* %16, null
br i1 %17, label %81, label %18
18: ; preds = %15
%19 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 5
%20 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 4
%21 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%22 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 3
%23 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 2
%24 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1
br label %25
25: ; preds = %18, %77
%26 = phi %struct.dirent* [ %16, %18 ], [ %79, %77 ]
%27 = phi i32 [ 0, %18 ], [ %78, %77 ]
%28 = getelementptr inbounds %struct.dirent, %struct.dirent* %26, i64 0, i32 0
%29 = load i32, i32* %28
%30 = call i64 @stat(i32 %29, %struct.stat* %4)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %77
32: ; preds = %25
%33 = load i32, i32* %19
%34 = call i64 @S_ISREG(i32 %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = load i32, i32* %19
%38 = call i64 @S_ISDIR(i32 %37)
%39 = icmp eq i64 %38, 0
%40 = select i1 %39, i32 63, i32 100
br label %41
41: ; preds = %36, %32
%42 = phi i32 [ 45, %32 ], [ %40, %36 ]
%43 = call %struct.tm* @localtime(i64* %20)
%44 = call i64 @time(i32* null)
%45 = load i64, i64* %20
%46 = sub i64 %44, %45
%47 = icmp ugt i64 %46, 31449600
%48 = select i1 %47, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0)
%49 = call i32 @strftime(i8* %7, i32 16, i8* %48, %struct.tm* %43)
%50 = load i32, i32* %21
%51 = icmp slt i32 %50, 99999
br i1 %51, label %64, label %52
52: ; preds = %41
%53 = icmp ult i32 %50, 99999000
br i1 %53, label %54, label %59
54: ; preds = %52
%55 = add nuw nsw i32 %50, 499
%56 = uitofp i32 %55 to double
%57 = fdiv double %56, 1.000000e+03
%58 = fptoui double %57 to i32
br label %64
59: ; preds = %52
%60 = add nuw nsw i32 %50, 499999
%61 = uitofp i32 %60 to double
%62 = fdiv double %61, 1.000000e+06
%63 = fptoui double %62 to i32
br label %64
64: ; preds = %41, %54, %59
%65 = phi i32 [ %58, %54 ], [ %63, %59 ], [ %50, %41 ]
%66 = phi i32 [ 75, %54 ], [ 77, %59 ], [ 32, %41 ]
%67 = load i64, i64* %22
%68 = trunc i64 %67 to i32
%69 = load i64, i64* %23
%70 = trunc i64 %69 to i32
%71 = load i64, i64* %24
%72 = trunc i64 %71 to i32
%73 = load i32, i32* %28
%74 = call i64 (i32, i8*, ...) @net_printf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %42, i32 %68, i32 %70, i32 %72, i32 %65, i32 %66, i8* %7, i32 %73)
%75 = trunc i64 %74 to i32
%76 = add i32 %27, %75
br label %77
77: ; preds = %64, %25
%78 = phi i32 [ %76, %64 ], [ %27, %25 ]
%79 = call %struct.dirent* @readdir(i32* %13)
%80 = icmp eq %struct.dirent* %79, null
br i1 %80, label %81, label %25
81: ; preds = %77, %15
%82 = phi i32 [ 0, %15 ], [ %78, %77 ]
%83 = call i32 @closedir(i32* %13)
br label %84
84: ; preds = %81, %11
%85 = phi i32 [ %82, %81 ], [ 0, %11 ]
%86 = call i64 (i32, i8*, ...) @net_printf(i32 %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %84, %9
%88 = phi i32 [ 1, %9 ], [ 0, %84 ]
ret i32 %88
}