#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 timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ elapsed_time_hr(struct timespec, struct timespec, char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ rmdir(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stdout;
int mk_rm_dir(unsigned int N) {
  char d[32];
  int i = 0, nanosleepInterval = 0;
  struct timespec start, end;
  struct timespec timeToSleep, timeRemaining;
  timeToSleep.tv_sec = 0;
  timeToSleep.tv_nsec = 250000000L;
  if (N == 2000000)
    N = 100000;
  for (i = 0; i < 100; i++) {
    sprintf(d, "warmupdir_%d", i);
    mkdir(d, 777);
  }
  clock_gettime(CLOCK_MONOTONIC, &start);
  for (i = 0; i < N; i++) {
    sprintf(d, "testdir_%d", i);
    mkdir(d, 777);
    if (i % 10000 == 0) {
      nanosleep(&timeToSleep, &timeRemaining);
      nanosleepInterval++;
    }
  }
  clock_gettime(CLOCK_MONOTONIC, &end);
  elapsed_time_hr(start, end, "mkdir");
  printf("Slept for :%6.3f, ms.\n", 1000 * nanosleepInterval * 0.25);
  nanosleepInterval = 0;
  sleep(5);
  for (i = 0; i < 100; i++) {
    sprintf(d, "warmupdir_%d", i);
    rmdir(d);
  }
  clock_gettime(CLOCK_MONOTONIC, &start);
  for (i = 0; i < N; i++) {
    sprintf(d, "testdir_%d", i);
    rmdir(d);
    if (i % 10000 == 0) {
      nanosleep(&timeToSleep, &timeRemaining);
      nanosleepInterval++;
    }
  }
  clock_gettime(CLOCK_MONOTONIC, &end);
  elapsed_time_hr(start, end, "rmdir");
  printf("Slept for :%6.3f, ms.\n", 1000 * nanosleepInterval * 0.25);
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<mk_rm_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0xee6b280,-0x68(%rbp)
0e
cmpl   $0x1e8480,-0x4(%rbp)
jne    11d0 <mk_rm_dir+0x40>
movl   $0x186a0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x64,-0x34(%rbp)
jge    1210 <mk_rm_dir+0x80>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xe19(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x309,%esi
call   1040 <mkdir@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11d7 <mk_rm_dir+0x47>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1050 <clock_gettime@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1293 <mk_rm_dir+0x103>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xdd2(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x309,%esi
call   1040 <mkdir@plt>
mov    -0x34(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1280 <mk_rm_dir+0xf0>
lea    -0x68(%rbp),%rdi
lea    -0x78(%rbp),%rsi
call   1080 <nanosleep@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1285 <mk_rm_dir+0xf5>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1229 <mk_rm_dir+0x99>
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
lea    -0x58(%rbp),%rsi
call   1050 <clock_gettime@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x50(%rbp),%rcx
lea    0xd64(%rip),%r8
call   1030 <elapsed_time_hr@plt>
imul   $0x3e8,-0x38(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xd2c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xd43(%rip),%rdi
call   1070 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    $0x5,%edi
call   10b0 <sleep@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x64,-0x34(%rbp)
jge    1334 <mk_rm_dir+0x1a4>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xcf0(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1060 <rmdir@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1300 <mk_rm_dir+0x170>
mov    0x2cad(%rip),%rax
mov    (%rax),%edi
lea    -0x48(%rbp),%rsi
call   1050 <clock_gettime@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    13b2 <mk_rm_dir+0x222>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xcae(%rip),%rsi
call   10a0 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1060 <rmdir@plt>
mov    -0x34(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    139f <mk_rm_dir+0x20f>
lea    -0x68(%rbp),%rdi
lea    -0x78(%rbp),%rsi
call   1080 <nanosleep@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    13a4 <mk_rm_dir+0x214>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    134d <mk_rm_dir+0x1bd>
mov    0x2c2f(%rip),%rax
mov    (%rax),%edi
lea    -0x58(%rbp),%rsi
call   1050 <clock_gettime@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x50(%rbp),%rcx
lea    0xc62(%rip),%r8
call   1030 <elapsed_time_hr@plt>
imul   $0x3e8,-0x38(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xc0d(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xc24(%rip),%rdi
call   1070 <printf@plt>
mov    0x2bca(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rm_dir>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %edi,%r14d
movaps 0xe58(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xor    %ebp,%ebp
lea    0xe62(%rip),%r15
lea    0x30(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   10a0 <sprintf@plt>
mov    %rbx,%rdi
mov    $0x309,%esi
call   1040 <mkdir@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
jne    11c0 <mk_rm_dir+0x30>
cmp    $0x1e8480,%r14d
mov    $0x186a0,%r13d
cmovne %r14d,%r13d
mov    0x2dee(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rsi
call   1050 <clock_gettime@plt>
xor    %ebx,%ebx
mov    $0x0,%r12d
test   %r13d,%r13d
je     1276 <mk_rm_dir+0xe6>
xor    %r12d,%r12d
lea    0x30(%rsp),%r15
xor    %ebp,%ebp
jmp    1228 <mk_rm_dir+0x98>
nop
add    $0x1,%ebp
cmp    %ebp,%r13d
je     1276 <mk_rm_dir+0xe6>
mov    %ebp,%eax
mov    $0xd1b71759,%ecx
imul   %rcx,%rax
shr    $0x2d,%rax
imul   $0x2710,%eax,%r14d
mov    %r15,%rdi
lea    0xddd(%rip),%rsi
mov    %ebp,%edx
call   10a0 <sprintf@plt>
mov    %r15,%rdi
mov    $0x309,%esi
call   1040 <mkdir@plt>
cmp    %ebp,%r14d
jne    1220 <mk_rm_dir+0x90>
lea    0x20(%rsp),%rdi
lea    0x58(%rsp),%rsi
call   1080 <nanosleep@plt>
add    $0x1,%r12d
jmp    1220 <mk_rm_dir+0x90>
mov    0x2d6b(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1050 <clock_gettime@plt>
mov    0x10(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    (%rsp),%rdx
mov    0x8(%rsp),%rcx
lea    0xd8f(%rip),%r8
call   1030 <elapsed_time_hr@plt>
imul   $0x3e8,%r12d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd54(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xd6f(%rip),%rdi
call   1070 <printf@plt>
mov    $0x5,%edi
call   10b0 <sleep@plt>
lea    0xd3b(%rip),%r14
lea    0x30(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   10a0 <sprintf@plt>
mov    %rbp,%rdi
call   1060 <rmdir@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    12f0 <mk_rm_dir+0x160>
mov    0x2cd4(%rip),%rax
mov    (%rax),%edi
lea    0x10(%rsp),%rsi
call   1050 <clock_gettime@plt>
xor    %r15d,%r15d
test   %r13d,%r13d
je     138d <mk_rm_dir+0x1fd>
lea    0xcf6(%rip),%r14
lea    0x30(%rsp),%rbx
xor    %ebp,%ebp
jmp    1348 <mk_rm_dir+0x1b8>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    %ebp,%r13d
je     138d <mk_rm_dir+0x1fd>
mov    %ebp,%eax
mov    $0xd1b71759,%ecx
imul   %rcx,%rax
shr    $0x2d,%rax
imul   $0x2710,%eax,%r12d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   10a0 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <rmdir@plt>
cmp    %ebp,%r12d
jne    1340 <mk_rm_dir+0x1b0>
lea    0x20(%rsp),%rdi
lea    0x58(%rsp),%rsi
call   1080 <nanosleep@plt>
add    $0x1,%r15d
jmp    1340 <mk_rm_dir+0x1b0>
mov    0x2c54(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1050 <clock_gettime@plt>
mov    0x10(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    (%rsp),%rdx
mov    0x8(%rsp),%rcx
lea    0xc95(%rip),%r8
call   1030 <elapsed_time_hr@plt>
imul   $0x3e8,%r15d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xc3d(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xc58(%rip),%rdi
call   1070 <printf@plt>
mov    0x2bee(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@.str = [13 x i8] c"warmupdir_%d\00"
@CLOCK_MONOTONIC = global i32 0
@.str.1 = [11 x i8] c"testdir_%d\00"
@.str.2 = [6 x i8] c"mkdir\00"
@.str.3 = [23 x i8] c"Slept for :%6.3f, ms.\0A\00"
@.str.4 = [6 x i8] c"rmdir\00"
@stdout = global i32 0
define i32 @mk_rm_dir(i32 %0) {
%2 = alloca i32
%3 = alloca [32 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.timespec
%7 = alloca %struct.timespec
%8 = alloca %struct.timespec
%9 = alloca %struct.timespec
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %5
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i64 0, i64* %10
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
store i64 250000000, i64* %11
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 2000000
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 100000, i32* %2
br label %15
15: ; preds = %14, %1
store i32 0, i32* %4
br label %16
16: ; preds = %25, %15
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 100
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%21 = load i32, i32* %4
%22 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%24 = call i32 @mkdir(i8* %23, i32 777)
br label %25
25: ; preds = %19
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %16
28: ; preds = %16
%29 = load i32, i32* @CLOCK_MONOTONIC
%30 = call i32 @clock_gettime(i32 %29, %struct.timespec* %6)
store i32 0, i32* %4
br label %31
31: ; preds = %49, %28
%32 = load i32, i32* %4
%33 = load i32, i32* %2
%34 = icmp ult i32 %32, %33
br i1 %34, label %35, label %52
35: ; preds = %31
%36 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%37 = load i32, i32* %4
%38 = call i32 @sprintf(i8* %36, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%40 = call i32 @mkdir(i8* %39, i32 777)
%41 = load i32, i32* %4
%42 = srem i32 %41, 10000
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %35
%45 = call i32 @nanosleep(%struct.timespec* %8, %struct.timespec* %9)
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %48
48: ; preds = %44, %35
br label %49
49: ; preds = %48
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %31
52: ; preds = %31
%53 = load i32, i32* @CLOCK_MONOTONIC
%54 = call i32 @clock_gettime(i32 %53, %struct.timespec* %7)
%55 = bitcast %struct.timespec* %6 to { i64, i64 }*
%56 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %55, i32 0, i32 0
%57 = load i64, i64* %56
%58 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %55, i32 0, i32 1
%59 = load i64, i64* %58
%60 = bitcast %struct.timespec* %7 to { i64, i64 }*
%61 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %60, i32 0, i32 0
%62 = load i64, i64* %61
%63 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %60, i32 0, i32 1
%64 = load i64, i64* %63
%65 = call i32 @elapsed_time_hr(i64 %57, i64 %59, i64 %62, i64 %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%66 = load i32, i32* %5
%67 = mul nsw i32 1000, %66
%68 = sitofp i32 %67 to double
%69 = fmul double %68, 2.500000e-01
%70 = fptosi double %69 to i32
%71 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %70)
store i32 0, i32* %5
%72 = call i32 @sleep(i32 5)
store i32 0, i32* %4
br label %73
73: ; preds = %82, %52
%74 = load i32, i32* %4
%75 = icmp slt i32 %74, 100
br i1 %75, label %76, label %85
76: ; preds = %73
%77 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%78 = load i32, i32* %4
%79 = call i32 @sprintf(i8* %77, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%81 = call i32 @rmdir(i8* %80)
br label %82
82: ; preds = %76
%83 = load i32, i32* %4
%84 = add nsw i32 %83, 1
store i32 %84, i32* %4
br label %73
85: ; preds = %73
%86 = load i32, i32* @CLOCK_MONOTONIC
%87 = call i32 @clock_gettime(i32 %86, %struct.timespec* %6)
store i32 0, i32* %4
br label %88
88: ; preds = %106, %85
%89 = load i32, i32* %4
%90 = load i32, i32* %2
%91 = icmp ult i32 %89, %90
br i1 %91, label %92, label %109
92: ; preds = %88
%93 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%94 = load i32, i32* %4
%95 = call i32 @sprintf(i8* %93, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %94)
%96 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%97 = call i32 @rmdir(i8* %96)
%98 = load i32, i32* %4
%99 = srem i32 %98, 10000
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %105
101: ; preds = %92
%102 = call i32 @nanosleep(%struct.timespec* %8, %struct.timespec* %9)
%103 = load i32, i32* %5
%104 = add nsw i32 %103, 1
store i32 %104, i32* %5
br label %105
105: ; preds = %101, %92
br label %106
106: ; preds = %105
%107 = load i32, i32* %4
%108 = add nsw i32 %107, 1
store i32 %108, i32* %4
br label %88
109: ; preds = %88
%110 = load i32, i32* @CLOCK_MONOTONIC
%111 = call i32 @clock_gettime(i32 %110, %struct.timespec* %7)
%112 = bitcast %struct.timespec* %6 to { i64, i64 }*
%113 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %112, i32 0, i32 0
%114 = load i64, i64* %113
%115 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %112, i32 0, i32 1
%116 = load i64, i64* %115
%117 = bitcast %struct.timespec* %7 to { i64, i64 }*
%118 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %117, i32 0, i32 0
%119 = load i64, i64* %118
%120 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %117, i32 0, i32 1
%121 = load i64, i64* %120
%122 = call i32 @elapsed_time_hr(i64 %114, i64 %116, i64 %119, i64 %121, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%123 = load i32, i32* %5
%124 = mul nsw i32 1000, %123
%125 = sitofp i32 %124 to double
%126 = fmul double %125, 2.500000e-01
%127 = fptosi double %126 to i32
%128 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %127)
%129 = load i32, i32* @stdout
%130 = call i32 @fflush(i32 %129)
ret i32 0
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@.str = [13 x i8] c"warmupdir_%d\00"
@CLOCK_MONOTONIC = global i32 0
@.str.1 = [11 x i8] c"testdir_%d\00"
@.str.2 = [6 x i8] c"mkdir\00"
@.str.3 = [23 x i8] c"Slept for :%6.3f, ms.\0A\00"
@.str.4 = [6 x i8] c"rmdir\00"
@stdout = global i32 0
define i32 @mk_rm_dir(i32 %0) {
%2 = alloca [32 x i8]
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = alloca <2 x i64>
%6 = bitcast <2 x i64>* %5 to %struct.timespec*
%7 = alloca %struct.timespec
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%9 = bitcast %struct.timespec* %3 to i8*
%10 = bitcast %struct.timespec* %4 to i8*
%11 = bitcast <2 x i64>* %5 to i8*
%12 = bitcast %struct.timespec* %7 to i8*
store <2 x i64> <i64 250000000, i64 0>, <2 x i64>* %5
%13 = icmp eq i32 %0, 2000000
br label %14
14: ; preds = %1, %14
%15 = phi i32 [ 0, %1 ], [ %18, %14 ]
%16 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @mkdir(i8* %8, i32 777)
%18 = add nuw nsw i32 %15, 1
%19 = icmp eq i32 %18, 100
br i1 %19, label %20, label %14
20: ; preds = %14
%21 = select i1 %13, i32 100000, i32 %0
%22 = load i32, i32* @CLOCK_MONOTONIC
%23 = call i32 @clock_gettime(i32 %22, %struct.timespec* %3)
%24 = icmp eq i32 %21, 0
br i1 %24, label %39, label %25
25: ; preds = %20, %35
%26 = phi i32 [ %36, %35 ], [ 0, %20 ]
%27 = phi i32 [ %37, %35 ], [ 0, %20 ]
%28 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = call i32 @mkdir(i8* %8, i32 777)
%30 = urem i32 %27, 10000
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %25
%33 = call i32 @nanosleep(%struct.timespec* %6, %struct.timespec* %7)
%34 = add nsw i32 %26, 1
br label %35
35: ; preds = %25, %32
%36 = phi i32 [ %34, %32 ], [ %26, %25 ]
%37 = add nuw i32 %27, 1
%38 = icmp eq i32 %37, %21
br i1 %38, label %39, label %25
39: ; preds = %35, %20
%40 = phi i32 [ 0, %20 ], [ %36, %35 ]
%41 = load i32, i32* @CLOCK_MONOTONIC
%42 = call i32 @clock_gettime(i32 %41, %struct.timespec* %4)
%43 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%44 = load i64, i64* %43
%45 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
%46 = load i64, i64* %45
%47 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 0
%48 = load i64, i64* %47
%49 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i64 0, i32 1
%50 = load i64, i64* %49
%51 = call i32 @elapsed_time_hr(i64 %44, i64 %46, i64 %48, i64 %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%52 = mul nsw i32 %40, 1000
%53 = sitofp i32 %52 to double
%54 = fmul double %53, 2.500000e-01
%55 = fptosi double %54 to i32
%56 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %55)
%57 = call i32 @sleep(i32 5)
br label %58
58: ; preds = %39, %58
%59 = phi i32 [ 0, %39 ], [ %62, %58 ]
%60 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %59)
%61 = call i32 @rmdir(i8* %8)
%62 = add nuw nsw i32 %59, 1
%63 = icmp eq i32 %62, 100
br i1 %63, label %64, label %58
64: ; preds = %58
%65 = load i32, i32* @CLOCK_MONOTONIC
%66 = call i32 @clock_gettime(i32 %65, %struct.timespec* %3)
br i1 %24, label %81, label %67
67: ; preds = %64, %77
%68 = phi i32 [ %78, %77 ], [ 0, %64 ]
%69 = phi i32 [ %79, %77 ], [ 0, %64 ]
%70 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %69)
%71 = call i32 @rmdir(i8* %8)
%72 = urem i32 %69, 10000
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %67
%75 = call i32 @nanosleep(%struct.timespec* %6, %struct.timespec* %7)
%76 = add nsw i32 %68, 1
br label %77
77: ; preds = %67, %74
%78 = phi i32 [ %76, %74 ], [ %68, %67 ]
%79 = add nuw i32 %69, 1
%80 = icmp eq i32 %79, %21
br i1 %80, label %81, label %67
81: ; preds = %77, %64
%82 = phi i32 [ 0, %64 ], [ %78, %77 ]
%83 = load i32, i32* @CLOCK_MONOTONIC
%84 = call i32 @clock_gettime(i32 %83, %struct.timespec* %4)
%85 = load i64, i64* %43
%86 = load i64, i64* %45
%87 = load i64, i64* %47
%88 = load i64, i64* %49
%89 = call i32 @elapsed_time_hr(i64 %85, i64 %86, i64 %87, i64 %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%90 = mul nsw i32 %82, 1000
%91 = sitofp i32 %90 to double
%92 = fmul double %91, 2.500000e-01
%93 = fptosi double %92 to i32
%94 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %93)
%95 = load i32, i32* @stdout
%96 = call i32 @fflush(i32 %95)
ret i32 0
}