#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 */

/* Variables and functions */
int errno;
int /*<<< orphan*/ printf(char *, ...);
int rmdir(char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
scalar_t__ strchr(char *, char);
scalar_t__ strcmp(char *, char *);
char *strerror(int);
int strlen(char *);
long strtol(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
long time(int /*<<< orphan*/);
int unlink(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  int i, rc = 0, do_rmdir = 0;
  char format[4096], *fmt;
  char filename[4096];
  long start, last;
  long begin = 0, count;
  if (argc < 3 || argc > 5) {
    usage(argv[0]);
    return 1;
  }
  if (strcmp(argv[1], "-d") == 0) {
    do_rmdir = 1;
    argv++;
    argc--;
  }
  if (strlen(argv[1]) > 4080) {
    printf("name too long\n");
    return 1;
  }
  start = last = time(0);
  if (argc == 3) {
    count = strtol(argv[2], NULL, 0);
    if (count < 1) {
      printf("count must be at least one\n");
      return 1;
    }
  } else {
    begin = strtol(argv[2], NULL, 0);
    count = strtol(argv[3], NULL, 0);
  }
  if (strchr(argv[1], '%')) {
    fmt = argv[1];
  } else {
    sprintf(format, "%s%%d", argv[1]);
    fmt = format;
  }
  for (i = 0; i < count; i++, begin++) {
    sprintf(filename, fmt, begin);
    if (do_rmdir)
      rc = rmdir(filename);
    else
      rc = unlink(filename);
    if (rc) {
      printf("%s(%s) error: %s\n", do_rmdir ? "rmdir" : "unlink", filename,
             strerror(errno));
      rc = errno;
      break;
    }
    if ((i % 10000) == 0) {
      printf(" - unlinked %d (time %ld ; total %ld ; last "
             "%ld)\n",
             i, time(0), time(0) - start, time(0) - last);
      last = time(0);
    }
  }
  printf("total: %d unlinks in %ld seconds: %f unlinks/second\n", i,
         time(0) - start, ((float)i / (time(0) - start)));
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2090,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x2048(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11f6 <main+0x46>
cmpl   $0x5,-0x8(%rbp)
jle    120e <main+0x5e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <usage@plt>
movl   $0x1,-0x4(%rbp)
jmp    155a <main+0x3aa>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde3(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1248 <main+0x98>
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <strlen@plt>
cmp    $0xff0,%eax
jle    127a <main+0xca>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    155a <main+0x3aa>
xor    %edi,%edi
call   10a0 <time@plt>
mov    %rax,-0x2040(%rbp)
mov    %rax,-0x2038(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    12e0 <main+0x130>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1090 <strtol@plt>
mov    %rax,-0x2050(%rbp)
cmpq   $0x1,-0x2050(%rbp)
01
jge    12db <main+0x12b>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    155a <main+0x3aa>
jmp    1314 <main+0x164>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1090 <strtol@plt>
mov    %rax,-0x2048(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1090 <strtol@plt>
mov    %rax,-0x2050(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x25,%esi
call   1060 <strchr@plt>
cmp    $0x0,%rax
je     1344 <main+0x194>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x1028(%rbp)
jmp    136f <main+0x1bf>
lea    -0x1020(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xcd4(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
lea    -0x1020(%rbp),%rax
mov    %rax,-0x1028(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x2050(%rbp),%rax
jge    14eb <main+0x33b>
lea    -0x2030(%rbp),%rdi
mov    -0x1028(%rbp),%rsi
mov    -0x2048(%rbp),%rdx
mov    $0x0,%al
call   10c0 <sprintf@plt>
cmpl   $0x0,-0x1c(%rbp)
je     13c1 <main+0x211>
lea    -0x2030(%rbp),%rdi
call   1040 <rmdir@plt>
mov    %eax,-0x18(%rbp)
jmp    13d0 <main+0x220>
lea    -0x2030(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1445 <main+0x295>
mov    -0x1c(%rbp),%edx
lea    0xc68(%rip),%rax
lea    0xc5b(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x2060(%rbp)
lea    -0x2030(%rbp),%rax
mov    %rax,-0x2058(%rbp)
mov    0x2bd2(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0x2060(%rbp),%rsi
mov    -0x2058(%rbp),%rdx
mov    %rax,%rcx
lea    0xc07(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2ba5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    14eb <main+0x33b>
mov    -0x14(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    14c6 <main+0x316>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2074(%rbp)
xor    %edi,%edi
call   10a0 <time@plt>
mov    %rax,-0x2070(%rbp)
xor    %edi,%edi
call   10a0 <time@plt>
sub    -0x2038(%rbp),%rax
mov    %rax,-0x2068(%rbp)
xor    %edi,%edi
call   10a0 <time@plt>
mov    -0x2074(%rbp),%esi
mov    -0x2070(%rbp),%rdx
mov    -0x2068(%rbp),%rcx
mov    %rax,%r8
sub    -0x2040(%rbp),%r8
lea    0xba2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10a0 <time@plt>
mov    %rax,-0x2040(%rbp)
jmp    14cb <main+0x31b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x2048(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2048(%rbp)
jmp    1376 <main+0x1c6>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2084(%rbp)
xor    %edi,%edi
call   10a0 <time@plt>
sub    -0x2038(%rbp),%rax
mov    %rax,-0x2080(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
movss  %xmm0,-0x2088(%rbp)
ff
xor    %edi,%edi
call   10a0 <time@plt>
movss  -0x2088(%rbp),%xmm0
ff
mov    -0x2084(%rbp),%esi
mov    -0x2080(%rbp),%rdx
sub    -0x2038(%rbp),%rax
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb38(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2090,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2028,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
lea    -0x6(%rbx),%eax
cmp    $0xfffffffc,%eax
ja     11f1 <main+0x31>
mov    0x0(%rbp),%rdi
call   10c0 <usage@plt>
mov    $0x1,%ebp
jmp    1461 <main+0x2a1>
lea    0x8(%rbp),%r14
mov    0x8(%rbp),%rdi
lea    0xe00(%rip),%rsi
call   1090 <strcmp@plt>
mov    %rax,(%rsp)
test   %rax,%rax
cmovne %rbp,%r14
mov    0x8(%r14),%rdi
call   1060 <strlen@plt>
cmp    $0xff1,%eax
jl     1236 <main+0x76>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebp
jmp    1461 <main+0x2a1>
cmpq   $0x1,(%rsp)
sbb    $0x0,%ebx
xor    %edi,%edi
call   10b0 <time@plt>
mov    %rax,0x8(%rsp)
mov    0x10(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <strtol@plt>
mov    %rax,%r15
cmp    $0x3,%ebx
jne    126d <main+0xad>
test   %r15,%r15
jle    1475 <main+0x2b5>
xor    %r12d,%r12d
jmp    1280 <main+0xc0>
mov    0x18(%r14),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <strtol@plt>
mov    %r15,%r12
mov    %rax,%r15
mov    0x8(%r14),%rdi
mov    $0x25,%esi
call   1070 <strchr@plt>
mov    0x8(%r14),%r14
test   %rax,%rax
je     139a <main+0x1da>
test   %r15,%r15
jle    13c2 <main+0x202>
mov    $0xd1b71759,%r13d
lea    0x20(%rsp),%rbp
xor    %ebx,%ebx
mov    0x8(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    %r12,0x18(%rsp)
jmp    12dd <main+0x11d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     140c <main+0x24c>
lea    (%r12,%rbx,1),%rdx
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10d0 <sprintf@plt>
cmpq   $0x0,(%rsp)
je     1310 <main+0x150>
mov    %rbp,%rdi
call   1030 <unlink@plt>
test   %eax,%eax
je     1320 <main+0x160>
jmp    13c8 <main+0x208>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1050 <rmdir@plt>
test   %eax,%eax
jne    13c8 <main+0x208>
mov    %ebx,%eax
imul   %r13,%rax
shr    $0x2d,%rax
imul   $0xffffd8f0,%eax,%eax
add    %ebx,%eax
jne    12d0 <main+0x110>
xor    %edi,%edi
call   10b0 <time@plt>
mov    %r15,%r12
mov    %rax,%r15
xor    %edi,%edi
call   10b0 <time@plt>
mov    %r14,%r13
mov    %rax,%r14
sub    0x8(%rsp),%r14
xor    %edi,%edi
call   10b0 <time@plt>
sub    0x10(%rsp),%rax
lea    0xcc2(%rip),%rdi
mov    %ebx,%esi
mov    %r15,%rdx
mov    %r12,%r15
mov    0x18(%rsp),%r12
mov    %r14,%rcx
mov    %r13,%r14
mov    $0xd1b71759,%r13d
mov    %rax,%r8
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edi,%edi
call   10b0 <time@plt>
mov    %rax,0x10(%rsp)
jmp    12d0 <main+0x110>
lea    0x1020(%rsp),%rbx
lea    0xc5a(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %rbx,%r14
test   %r15,%r15
jg     12a4 <main+0xe4>
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    1411 <main+0x251>
cmpq   $0x0,(%rsp)
lea    0xc47(%rip),%rax
lea    0xc46(%rip),%rbp
cmove  %rax,%rbp
mov    0x2bfa(%rip),%r14
mov    (%r14),%edi
call   10e0 <strerror@plt>
lea    0xc14(%rip),%rdi
lea    0x20(%rsp),%rdx
mov    %rbp,%rsi
mov    %rax,%rcx
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r14),%ebp
jmp    1411 <main+0x251>
xor    %ebp,%ebp
mov    %r15d,%ebx
xor    %edi,%edi
call   10b0 <time@plt>
mov    %rax,%r14
mov    0x8(%rsp),%r15
sub    %r15,%r14
cvtsi2ss %ebx,%xmm0
movss  %xmm0,(%rsp)
xor    %edi,%edi
call   10b0 <time@plt>
sub    %r15,%rax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%rsp),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xc05(%rip),%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    $0x1,%al
call   1080 <printf@plt>
mov    %ebp,%eax
add    $0x2028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc13(%rip),%rdi
jmp    1227 <main+0x67>

LLVM IR (-O0):
@.str = [3 x i8] c"-d\00"
@.str.1 = [15 x i8] c"name too long\0A\00"
@.str.2 = [28 x i8] c"count must be at least one\0A\00"
@.str.3 = [6 x i8] c"%s%%d\00"
@.str.4 = [18 x i8] c"%s(%s) error: %s\0A\00"
@.str.5 = [6 x i8] c"rmdir\00"
@.str.6 = [7 x i8] c"unlink\00"
@errno = global i32 0
@.str.7 = [50 x i8] c" - unlinked %d (time %ld ; total %ld ; last %ld)\0A\00"
@.str.8 = [53 x i8] c"total: %d unlinks in %ld seconds: %f unlinks/second\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4096 x i8]
%10 = alloca i8*
%11 = alloca [4096 x i8]
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 0, i32* %8
store i64 0, i64* %14
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 3
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %4
%20 = icmp sgt i32 %19, 5
br i1 %20, label %21, label %26
21: ; preds = %18, %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 @usage(i8* %24)
store i32 1, i32* %3
br label %153
26: ; preds = %18
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %26
store i32 1, i32* %8
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i32 1
store i8** %34, i8*** %5
%35 = load i32, i32* %4
%36 = add nsw i32 %35, -1
store i32 %36, i32* %4
br label %37
37: ; preds = %32, %26
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @strlen(i8* %40)
%42 = icmp sgt i32 %41, 4080
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %153
45: ; preds = %37
%46 = call i64 @time(i32 0)
store i64 %46, i64* %13
store i64 %46, i64* %12
%47 = load i32, i32* %4
%48 = icmp eq i32 %47, 3
br i1 %48, label %49, label %59
49: ; preds = %45
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i64 @strtol(i8* %52, i32* null, i32 0)
store i64 %53, i64* %15
%54 = load i64, i64* %15
%55 = icmp slt i64 %54, 1
br i1 %55, label %56, label %58
56: ; preds = %49
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %153
58: ; preds = %49
br label %68
59: ; preds = %45
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 2
%62 = load i8*, i8** %61
%63 = call i64 @strtol(i8* %62, i32* null, i32 0)
store i64 %63, i64* %14
%64 = load i8**, i8*** %5
%65 = getelementptr inbounds i8*, i8** %64, i64 3
%66 = load i8*, i8** %65
%67 = call i64 @strtol(i8* %66, i32* null, i32 0)
store i64 %67, i64* %15
br label %68
68: ; preds = %59, %58
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i64 @strchr(i8* %71, i8 signext 37)
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %68
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 1
%77 = load i8*, i8** %76
store i8* %77, i8** %10
br label %85
78: ; preds = %68
%79 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32 (i8*, i8*, ...) @sprintf(i8* %79, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %82)
%84 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
store i8* %84, i8** %10
br label %85
85: ; preds = %78, %74
store i32 0, i32* %6
br label %86
86: ; preds = %133, %85
%87 = load i32, i32* %6
%88 = sext i32 %87 to i64
%89 = load i64, i64* %15
%90 = icmp slt i64 %88, %89
br i1 %90, label %91, label %138
91: ; preds = %86
%92 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%93 = load i8*, i8** %10
%94 = load i64, i64* %14
%95 = call i32 (i8*, i8*, ...) @sprintf(i8* %92, i8* %93, i64 %94)
%96 = load i32, i32* %8
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %91
%99 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%100 = call i32 @rmdir(i8* %99)
store i32 %100, i32* %7
br label %104
101: ; preds = %91
%102 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%103 = call i32 @unlink(i8* %102)
store i32 %103, i32* %7
br label %104
104: ; preds = %101, %98
%105 = load i32, i32* %7
%106 = icmp ne i32 %105, 0
br i1 %106, label %107, label %117
107: ; preds = %104
%108 = load i32, i32* %8
%109 = icmp ne i32 %108, 0
%110 = zext i1 %109 to i64
%111 = select i1 %109, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0)
%112 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%113 = load i32, i32* @errno
%114 = call i8* @strerror(i32 %113)
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %111, i8* %112, i8* %114)
%116 = load i32, i32* @errno
store i32 %116, i32* %7
br label %138
117: ; preds = %104
%118 = load i32, i32* %6
%119 = srem i32 %118, 10000
%120 = icmp eq i32 %119, 0
br i1 %120, label %121, label %132
121: ; preds = %117
%122 = load i32, i32* %6
%123 = call i64 @time(i32 0)
%124 = call i64 @time(i32 0)
%125 = load i64, i64* %12
%126 = sub nsw i64 %124, %125
%127 = call i64 @time(i32 0)
%128 = load i64, i64* %13
%129 = sub nsw i64 %127, %128
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i32 %122, i64 %123, i64 %126, i64 %129)
%131 = call i64 @time(i32 0)
store i64 %131, i64* %13
br label %132
132: ; preds = %121, %117
br label %133
133: ; preds = %132
%134 = load i32, i32* %6
%135 = add nsw i32 %134, 1
store i32 %135, i32* %6
%136 = load i64, i64* %14
%137 = add nsw i64 %136, 1
store i64 %137, i64* %14
br label %86
138: ; preds = %107, %86
%139 = load i32, i32* %6
%140 = call i64 @time(i32 0)
%141 = load i64, i64* %12
%142 = sub nsw i64 %140, %141
%143 = load i32, i32* %6
%144 = sitofp i32 %143 to float
%145 = call i64 @time(i32 0)
%146 = load i64, i64* %12
%147 = sub nsw i64 %145, %146
%148 = sitofp i64 %147 to float
%149 = fdiv float %144, %148
%150 = fpext float %149 to double
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0), i32 %139, i64 %142, double %150)
%152 = load i32, i32* %7
store i32 %152, i32* %3
br label %153
153: ; preds = %138, %56, %43, %21
%154 = load i32, i32* %3
ret i32 %154
}

LLVM IR (-O2):
@.str = [3 x i8] c"-d\00"
@.str.3 = [6 x i8] c"%s%%d\00"
@.str.4 = [18 x i8] c"%s(%s) error: %s\0A\00"
@.str.5 = [6 x i8] c"rmdir\00"
@.str.6 = [7 x i8] c"unlink\00"
@errno = global i32 0
@.str.7 = [50 x i8] c" - unlinked %d (time %ld ; total %ld ; last %ld)\0A\00"
@.str.8 = [53 x i8] c"total: %d unlinks in %ld seconds: %f unlinks/second\0A\00"
@str = [27 x i8] c"count must be at least one\00"
@str.9 = [14 x i8] c"name too long\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%7 = add i32 %0, -6
%8 = icmp ult i32 %7, -3
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 @usage(i8* %10)
br label %102
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8** %13, i8** %1
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = tail call i32 @strlen(i8* %19)
%21 = icmp sgt i32 %20, 4080
br i1 %21, label %22, label %24
22: ; preds = %12
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.9, i64 0, i64 0))
br label %102
24: ; preds = %12
%25 = sext i1 %16 to i32
%26 = add nsw i32 %25, %0
%27 = tail call i64 @time(i32 0)
%28 = icmp eq i32 %26, 3
%29 = getelementptr inbounds i8*, i8** %17, i64 2
%30 = load i8*, i8** %29
%31 = tail call i64 @strtol(i8* nocapture %30, i32* null, i32 0)
br i1 %28, label %32, label %36
32: ; preds = %24
%33 = icmp slt i64 %31, 1
br i1 %33, label %34, label %40
34: ; preds = %32
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %102
36: ; preds = %24
%37 = getelementptr inbounds i8*, i8** %17, i64 3
%38 = load i8*, i8** %37
%39 = tail call i64 @strtol(i8* nocapture %38, i32* null, i32 0)
br label %40
40: ; preds = %32, %36
%41 = phi i64 [ 0, %32 ], [ %31, %36 ]
%42 = phi i64 [ %31, %32 ], [ %39, %36 ]
%43 = load i8*, i8** %18
%44 = tail call i64 @strchr(i8* %43, i8 signext 37)
%45 = icmp eq i64 %44, 0
%46 = load i8*, i8** %18
br i1 %45, label %47, label %49
47: ; preds = %40
%48 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %46)
br label %49
49: ; preds = %40, %47
%50 = phi i8* [ %5, %47 ], [ %46, %40 ]
%51 = icmp sgt i64 %42, 0
br i1 %51, label %52, label %90
52: ; preds = %49, %83
%53 = phi i64 [ %85, %83 ], [ 0, %49 ]
%54 = phi i64 [ %86, %83 ], [ %41, %49 ]
%55 = phi i64 [ %84, %83 ], [ %27, %49 ]
%56 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) %50, i64 %54)
br i1 %16, label %57, label %59
57: ; preds = %52
%58 = call i32 @rmdir(i8* %6)
br label %61
59: ; preds = %52
%60 = call i32 @unlink(i8* %6)
br label %61
61: ; preds = %59, %57
%62 = phi i32 [ %58, %57 ], [ %60, %59 ]
%63 = icmp eq i32 %62, 0
%64 = trunc i64 %53 to i32
br i1 %63, label %72, label %65
65: ; preds = %61
%66 = trunc i64 %53 to i32
%67 = select i1 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0)
%68 = load i32, i32* @errno
%69 = tail call i8* @strerror(i32 %68)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %67, i8* %6, i8* %69)
%71 = load i32, i32* @errno
br label %90
72: ; preds = %61
%73 = urem i32 %64, 10000
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %83
75: ; preds = %72
%76 = tail call i64 @time(i32 0)
%77 = tail call i64 @time(i32 0)
%78 = sub nsw i64 %77, %27
%79 = tail call i64 @time(i32 0)
%80 = sub nsw i64 %79, %55
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i32 %64, i64 %76, i64 %78, i64 %80)
%82 = tail call i64 @time(i32 0)
br label %83
83: ; preds = %72, %75
%84 = phi i64 [ %82, %75 ], [ %55, %72 ]
%85 = add nuw nsw i64 %53, 1
%86 = add nsw i64 %54, 1
%87 = icmp eq i64 %85, %42
br i1 %87, label %88, label %52
88: ; preds = %83
%89 = trunc i64 %42 to i32
br label %90
90: ; preds = %88, %49, %65
%91 = phi i32 [ %66, %65 ], [ 0, %49 ], [ %89, %88 ]
%92 = phi i32 [ %71, %65 ], [ 0, %49 ], [ 0, %88 ]
%93 = call i64 @time(i32 0)
%94 = sub nsw i64 %93, %27
%95 = sitofp i32 %91 to float
%96 = call i64 @time(i32 0)
%97 = sub nsw i64 %96, %27
%98 = sitofp i64 %97 to float
%99 = fdiv float %95, %98
%100 = fpext float %99 to double
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0), i32 %91, i64 %94, double %100)
br label %102
102: ; preds = %90, %34, %22, %9
%103 = phi i32 [ 1, %9 ], [ 1, %22 ], [ 1, %34 ], [ %92, %90 ]
ret i32 %103
}