#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*/ filename;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ *fdopen(int, char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
char *getenv(char *);
int /*<<< orphan*/ *mkdtemp(char *);
int mkstemp(char *);
int /*<<< orphan*/ printf(char *, ...);
int rmdir(char *);
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int unlink(char *);
int main() {
  long int count = 0;
  int fd;
  int rc;
  FILE *fp;
  char filename[100];
  char dir1[100];
  char dir2[100];
  char *dir = getenv("DMTCP_TMPDIR");
  if (!dir) {
    dir = getenv("TMPDIR");
  }
  if (!dir) {
    dir = "/tmp";
  }
  if (sizeof(filename) < strlen(dir) + 3 * sizeof("/dmtcp_file_XXXXXX")) {
    printf("Directory string too large.\n");
    return 1;
  }
  strcpy(filename, dir);
  strcat(filename, "/dmtcp_dir1_XXXXXX");
  strcpy(dir1, filename);
  strcat(filename, "/dmtcp_dir2_XXXXXX");
  strcpy(dir2, filename);
  strcat(filename, "/dmtcp_file_XXXXXX");
  if (mkdtemp(dir1) == NULL) {
    abort();
  }
  strncpy(dir2, dir1, strlen(dir1));
  if (mkdtemp(dir2) == NULL) {
    abort();
  }
  strncpy(filename, dir2, strlen(dir2));
  fd = mkstemp(filename);
  if (fd == -1) {
    abort();
  }
  fp = fdopen(fd, "w");
  fprintf(stdout, "Opened %s\n", filename);
  fprintf(stdout, "Deleting %s\n", filename);
  rc = unlink(filename);
  if (rc == -1) {
    abort();
  }
  fprintf(stdout, "Deleting %s\n", dir2);
  rc = rmdir(dir2);
  if (rc == -1) {
    abort();
  }
  fprintf(stdout, "Deleting %s\n", dir1);
  rc = rmdir(dir1);
  if (rc == -1) {
    abort();
  }
  while (1) {
    if (count % (int)1e6 == 0) {
      printf("%ld ", count);
      fflush(stdout);
    }
    fprintf(fp, "%ld", count++);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xdff(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x178(%rbp)
cmpq   $0x0,-0x178(%rbp)
jne    122e <main+0x4e>
lea    0xde4(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x178(%rbp)
cmpq   $0x0,-0x178(%rbp)
jne    124a <main+0x6a>
lea    0xdca(%rip),%rax
mov    %rax,-0x178(%rbp)
mov    -0x178(%rbp),%rdi
call   1090 <strlen@plt>
movslq %eax,%rcx
add    $0x39,%rcx
mov    $0x64,%eax
cmp    %rcx,%rax
jae    1287 <main+0xa7>
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x1,%eax
add    $0x1a0,%rsp
pop    %rbp
ret
lea    -0x90(%rbp),%rdi
mov    -0x178(%rbp),%rsi
call   1070 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xd87(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x100(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1070 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xd74(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x170(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1070 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   1100 <strcat@plt>
lea    -0x100(%rbp),%rdi
call   10f0 <mkdtemp@plt>
cmp    $0x0,%rax
jne    1316 <main+0x136>
mov    $0x0,%al
call   1040 <abort@plt>
lea    -0x170(%rbp),%rax
mov    %rax,-0x188(%rbp)
lea    -0x100(%rbp),%rax
mov    %rax,-0x180(%rbp)
lea    -0x100(%rbp),%rdi
call   1090 <strlen@plt>
mov    -0x188(%rbp),%rdi
mov    -0x180(%rbp),%rsi
mov    %eax,%edx
call   1060 <strncpy@plt>
lea    -0x170(%rbp),%rdi
call   10f0 <mkdtemp@plt>
cmp    $0x0,%rax
jne    1370 <main+0x190>
mov    $0x0,%al
call   1040 <abort@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x198(%rbp)
lea    -0x170(%rbp),%rax
mov    %rax,-0x190(%rbp)
lea    -0x170(%rbp),%rdi
call   1090 <strlen@plt>
mov    -0x198(%rbp),%rdi
mov    -0x190(%rbp),%rsi
mov    %eax,%edx
call   1060 <strncpy@plt>
lea    -0x90(%rbp),%rdi
call   10d0 <mkstemp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    13cd <main+0x1ed>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x14(%rbp),%edi
lea    0xc91(%rip),%rsi
call   10e0 <fdopen@plt>
mov    %rax,-0x20(%rbp)
mov    0x2bf9(%rip),%rax
mov    (%rax),%rdi
lea    -0x90(%rbp),%rdx
lea    0xc72(%rip),%rsi
call   10b0 <fprintf@plt>
mov    0x2bdc(%rip),%rax
mov    (%rax),%rdi
lea    -0x90(%rbp),%rdx
lea    0xc60(%rip),%rsi
call   10b0 <fprintf@plt>
lea    -0x90(%rbp),%rdi
call   1050 <unlink@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    143a <main+0x25a>
mov    $0x0,%al
call   1040 <abort@plt>
mov    0x2b9f(%rip),%rax
mov    (%rax),%rdi
lea    -0x170(%rbp),%rdx
lea    0xc23(%rip),%rsi
call   10b0 <fprintf@plt>
lea    -0x170(%rbp),%rdi
call   1080 <rmdir@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1477 <main+0x297>
mov    $0x0,%al
call   1040 <abort@plt>
mov    0x2b62(%rip),%rax
mov    (%rax),%rdi
lea    -0x100(%rbp),%rdx
lea    0xbe6(%rip),%rsi
call   10b0 <fprintf@plt>
lea    -0x100(%rbp),%rdi
call   1080 <rmdir@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    14b4 <main+0x2d4>
mov    $0x0,%al
call   1040 <abort@plt>
jmp    14b9 <main+0x2d9>
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    14f2 <main+0x312>
mov    -0x10(%rbp),%rsi
lea    0xba6(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    0x2af6(%rip),%rax
mov    (%rax),%rdi
call   10c0 <fflush@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    %rdx,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
lea    0xb7b(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    14b9 <main+0x2d9>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
lea    0xdf8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
jne    121e <main+0x2e>
lea    0xded(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xde5(%rip),%rbx
cmovne %rax,%rbx
mov    %rbx,%rdi
call   10a0 <strlen@plt>
cltq
add    $0xffffffffffffffd4,%rax
cmp    $0xffffffffffffff9a,%rax
ja     1263 <main+0x73>
lea    0xe27(%rip),%rdi
call   1080 <puts@plt>
mov    $0x1,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe0(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcpy@plt>
lea    0xd95(%rip),%rsi
mov    %r14,%rdi
call   1110 <strcat@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcpy@plt>
lea    0xd89(%rip),%rsi
mov    %r14,%rdi
call   1110 <strcat@plt>
mov    %rsp,%rdi
mov    %r14,%rsi
call   1070 <strcpy@plt>
lea    0xd82(%rip),%rsi
mov    %r14,%rdi
call   1110 <strcat@plt>
mov    %rbx,%rdi
call   1100 <mkdtemp@plt>
test   %rax,%rax
je     1441 <main+0x251>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   10a0 <strlen@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1060 <strncpy@plt>
mov    %rbx,%rdi
call   1100 <mkdtemp@plt>
test   %rax,%rax
je     1441 <main+0x251>
mov    %rsp,%r14
mov    %r14,%rdi
call   10a0 <strlen@plt>
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1060 <strncpy@plt>
mov    %rbx,%rdi
call   10e0 <mkstemp@plt>
cmp    $0xffffffff,%eax
je     1441 <main+0x251>
lea    0xd16(%rip),%rsi
mov    %eax,%edi
call   10f0 <fdopen@plt>
mov    %rax,%r15
mov    0x2c9a(%rip),%rbp
mov    0x0(%rbp),%rdi
lea    0xcfc(%rip),%rsi
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdx
call   10c0 <fprintf@plt>
mov    0x0(%rbp),%rdi
lea    0xcec(%rip),%rsi
mov    %rbx,%rdx
call   10c0 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <unlink@plt>
cmp    $0xffffffff,%eax
je     1441 <main+0x251>
mov    0x0(%rbp),%rdi
lea    0xcc8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   10c0 <fprintf@plt>
mov    %rbx,%rdi
call   1090 <rmdir@plt>
cmp    $0xffffffff,%eax
je     1441 <main+0x251>
mov    0x0(%rbp),%rdi
lea    0xca1(%rip),%rsi
lea    0x70(%rsp),%rbx
mov    %rbx,%rdx
call   10c0 <fprintf@plt>
mov    %rbx,%rdi
call   1090 <rmdir@plt>
cmp    $0xffffffff,%eax
je     1441 <main+0x251>
movabs $0x431bde82d7b634db,%rbp
de 1b 43
lea    0xc88(%rip),%r12
xor    %r13d,%r13d
xor    %ebx,%ebx
jmp    1409 <main+0x219>
nopl   0x0(%rax)
lea    0x1(%rbx),%r14
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   10c0 <fprintf@plt>
add    $0xffffffffffffffff,%r13
mov    %r14,%rbx
mov    %rbx,%rax
mul    %rbp
shr    $0x12,%rdx
imul   $0xf4240,%rdx,%rax
add    %r13,%rax
jne    13f0 <main+0x200>
lea    0xc3f(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    0x2ba9(%rip),%rax
mov    (%rax),%rdi
call   10d0 <fflush@plt>
jmp    13f0 <main+0x200>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"DMTCP_TMPDIR\00"
@.str.1 = [7 x i8] c"TMPDIR\00"
@.str.2 = [5 x i8] c"/tmp\00"
@.str.3 = [29 x i8] c"Directory string too large.\0A\00"
@.str.4 = [19 x i8] c"/dmtcp_dir1_XXXXXX\00"
@.str.5 = [19 x i8] c"/dmtcp_dir2_XXXXXX\00"
@.str.6 = [19 x i8] c"/dmtcp_file_XXXXXX\00"
@.str.7 = [2 x i8] c"w\00"
@stdout = global i32* null
@.str.8 = [11 x i8] c"Opened %s\0A\00"
@.str.9 = [13 x i8] c"Deleting %s\0A\00"
@.str.10 = [5 x i8] c"%ld \00"
@.str.11 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
%9 = alloca i8*
store i32 0, i32* %1
store i64 0, i64* %2
%10 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %9
%11 = load i8*, i8** %9
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %0
%14 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* %14, i8** %9
br label %15
15: ; preds = %13, %0
%16 = load i8*, i8** %9
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %15
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %9
br label %19
19: ; preds = %18, %15
%20 = load i8*, i8** %9
%21 = call i32 @strlen(i8* %20)
%22 = sext i32 %21 to i64
%23 = add i64 %22, 57
%24 = icmp ult i64 100, %23
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
ret i32 1
27: ; preds = %19
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%29 = load i8*, i8** %9
%30 = call i32 @strcpy(i8* %28, i8* %29)
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%32 = call i32 @strcat(i8* %31, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%35 = call i32 @strcpy(i8* %33, i8* %34)
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%37 = call i32 @strcat(i8* %36, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%40 = call i32 @strcpy(i8* %38, i8* %39)
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%42 = call i32 @strcat(i8* %41, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%44 = call i32* @mkdtemp(i8* %43)
%45 = icmp eq i32* %44, null
br i1 %45, label %46, label %48
46: ; preds = %27
%47 = call i32 (...) @abort()
unreachable
48: ; preds = %27
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%52 = call i32 @strlen(i8* %51)
%53 = call i32 @strncpy(i8* %49, i8* %50, i32 %52)
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%55 = call i32* @mkdtemp(i8* %54)
%56 = icmp eq i32* %55, null
br i1 %56, label %57, label %59
57: ; preds = %48
%58 = call i32 (...) @abort()
unreachable
59: ; preds = %48
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%63 = call i32 @strlen(i8* %62)
%64 = call i32 @strncpy(i8* %60, i8* %61, i32 %63)
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%66 = call i32 @mkstemp(i8* %65)
store i32 %66, i32* %3
%67 = load i32, i32* %3
%68 = icmp eq i32 %67, -1
br i1 %68, label %69, label %71
69: ; preds = %59
%70 = call i32 (...) @abort()
unreachable
71: ; preds = %59
%72 = load i32, i32* %3
%73 = call i32* @fdopen(i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %73, i32** %5
%74 = load i32*, i32** @stdout
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%76 = call i32 @fprintf(i32* %74, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %75)
%77 = load i32*, i32** @stdout
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%79 = call i32 @fprintf(i32* %77, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %78)
%80 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%81 = call i32 @unlink(i8* %80)
store i32 %81, i32* %4
%82 = load i32, i32* %4
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %86
84: ; preds = %71
%85 = call i32 (...) @abort()
unreachable
86: ; preds = %71
%87 = load i32*, i32** @stdout
%88 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%89 = call i32 @fprintf(i32* %87, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %88)
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%91 = call i32 @rmdir(i8* %90)
store i32 %91, i32* %4
%92 = load i32, i32* %4
%93 = icmp eq i32 %92, -1
br i1 %93, label %94, label %96
94: ; preds = %86
%95 = call i32 (...) @abort()
unreachable
96: ; preds = %86
%97 = load i32*, i32** @stdout
%98 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%99 = call i32 @fprintf(i32* %97, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %98)
%100 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%101 = call i32 @rmdir(i8* %100)
store i32 %101, i32* %4
%102 = load i32, i32* %4
%103 = icmp eq i32 %102, -1
br i1 %103, label %104, label %106
104: ; preds = %96
%105 = call i32 (...) @abort()
unreachable
106: ; preds = %96
br label %107
107: ; preds = %106, %116
%108 = load i64, i64* %2
%109 = srem i64 %108, 1000000
%110 = icmp eq i64 %109, 0
br i1 %110, label %111, label %116
111: ; preds = %107
%112 = load i64, i64* %2
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 %112)
%114 = load i32*, i32** @stdout
%115 = call i32 @fflush(i32* %114)
br label %116
116: ; preds = %111, %107
%117 = load i32*, i32** %5
%118 = load i64, i64* %2
%119 = add nsw i64 %118, 1
store i64 %119, i64* %2
%120 = inttoptr i64 %118 to i8*
%121 = call i32 @fprintf(i32* %117, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %120)
br label %107
}

LLVM IR (-O2):
@.str = [13 x i8] c"DMTCP_TMPDIR\00"
@.str.1 = [7 x i8] c"TMPDIR\00"
@.str.2 = [5 x i8] c"/tmp\00"
@.str.4 = [19 x i8] c"/dmtcp_dir1_XXXXXX\00"
@.str.5 = [19 x i8] c"/dmtcp_dir2_XXXXXX\00"
@.str.6 = [19 x i8] c"/dmtcp_file_XXXXXX\00"
@.str.7 = [2 x i8] c"w\00"
@stdout = global i32* null
@.str.8 = [11 x i8] c"Opened %s\0A\00"
@.str.9 = [13 x i8] c"Deleting %s\0A\00"
@.str.10 = [5 x i8] c"%ld \00"
@.str.11 = [4 x i8] c"%ld\00"
@str = [28 x i8] c"Directory string too large.\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = phi i8* [ %7, %0 ], [ %10, %9 ]
%13 = icmp eq i8* %12, null
%14 = select i1 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %12
%15 = tail call i32 @strlen(i8* %14)
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, -44
%18 = icmp ult i64 %17, -101
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 1
21: ; preds = %11
%22 = call i32 @strcpy(i8* %4, i8* %14)
%23 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 @strcpy(i8* %5, i8* %4)
%25 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%26 = call i32 @strcpy(i8* %6, i8* %4)
%27 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32* @mkdtemp(i8* %5)
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %32
30: ; preds = %21
%31 = call i32 (...) @abort()
unreachable
32: ; preds = %21
%33 = call i32 @strlen(i8* %5)
%34 = call i32 @strncpy(i8* %6, i8* %5, i32 %33)
%35 = call i32* @mkdtemp(i8* %6)
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 (...) @abort()
unreachable
39: ; preds = %32
%40 = call i32 @strlen(i8* %6)
%41 = call i32 @strncpy(i8* %4, i8* %6, i32 %40)
%42 = call i32 @mkstemp(i8* %4)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 (...) @abort()
unreachable
46: ; preds = %39
%47 = call i32* @fdopen(i32 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%48 = load i32*, i32** @stdout
%49 = call i32 @fprintf(i32* %48, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %4)
%50 = load i32*, i32** @stdout
%51 = call i32 @fprintf(i32* %50, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%52 = call i32 @unlink(i8* %4)
%53 = icmp eq i32 %52, -1
br i1 %53, label %54, label %56
54: ; preds = %46
%55 = call i32 (...) @abort()
unreachable
56: ; preds = %46
%57 = load i32*, i32** @stdout
%58 = call i32 @fprintf(i32* %57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %6)
%59 = call i32 @rmdir(i8* %6)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %63
61: ; preds = %56
%62 = call i32 (...) @abort()
unreachable
63: ; preds = %56
%64 = load i32*, i32** @stdout
%65 = call i32 @fprintf(i32* %64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %5)
%66 = call i32 @rmdir(i8* %5)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %70
68: ; preds = %63
%69 = call i32 (...) @abort()
unreachable
70: ; preds = %63, %78
%71 = phi i64 [ %79, %78 ], [ 0, %63 ]
%72 = urem i64 %71, 1000000
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %70
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i64 %71)
%76 = load i32*, i32** @stdout
%77 = call i32 @fflush(i32* %76)
br label %78
78: ; preds = %74, %70
%79 = add nuw nsw i64 %71, 1
%80 = inttoptr i64 %71 to i8*
%81 = call i32 @fprintf(i32* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %80)
br label %70
}