#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 */
scalar_t__ EMFILE;
int PATH_MAX;
int WEXITSTATUS(int);
int /*<<< orphan*/ abortx(char *, ...);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ delete_files();
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int mkstemp(char *);
int sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ write_something(int);
int main(int argc, char *argv[]) {
  int filedes[25500];
  int i, n, first, n_files;
  int cid, fork_number;
  int status;
  char filename[PATH_MAX];
  if (argc != 2) {
    fprintf(stderr, "Usage: %s <number of files>\n", argv[0]);
    exit(1);
  }
  n = sscanf(argv[1], "%d", &n_files);
  if (n != 1) {
    fprintf(stderr, "Usage: %s <number of files>\n", argv[0]);
    exit(1);
  }
  first = 0;
  fork_number = 0;
  for (n = 0; n < n_files; n++) {
    strcpy(filename, "ltpXXXXXX");
    filedes[n] = mkstemp(filename);
    if (filedes[n] == -1) {
      if (errno != EMFILE)
        abortx("open() error: file = \"%s\", errno = %d", filename, errno);
      else {
        if ((cid = fork())) {
          if (cid == -1)
            abortx("Error forking child");
          else {
            waitpid(cid, &status, 0);
            for (i = first; i < n; i++)
              if (!write_something(filedes[i]))
                abortx("Error writing to files");
            if (fork_number == 0)
              delete_files();
            exit(WEXITSTATUS(status));
          }
        } else {
          fork_number++;
          for (i = first; i < n; i++)
            close(filedes[i]);
          first = n;
          n--;
        }
      }
    }
  }
  for (i = first; i < n; i++)
    if (!write_something(filedes[i]))
      abortx("Error writing to files");
  if (fork_number == 0)
    delete_files();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x18ec0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e10(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18ea8(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x18eb8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18eb0(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     123e <main+0x7e>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdd1(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdfd(%rip),%rsi
lea    -0x18e90(%rbp),%rdx
call   1080 <sscanf@plt>
mov    %eax,-0x18e88(%rbp)
cmpl   $0x1,-0x18e88(%rbp)
je     1292 <main+0xd2>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd7d(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movl   $0x0,-0x18e8c(%rbp)
movl   $0x0,-0x18e98(%rbp)
movl   $0x0,-0x18e88(%rbp)
mov    -0x18e88(%rbp),%eax
cmp    -0x18e90(%rbp),%eax
jge    14ac <main+0x2ec>
mov    -0x18eb8(%rbp),%rdi
lea    0xd4d(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18eb8(%rbp),%rdi
call   1090 <mkstemp@plt>
mov    %eax,%ecx
movslq -0x18e88(%rbp),%rax
mov    %ecx,-0x18e80(%rbp,%rax,4)
movslq -0x18e88(%rbp),%rax
cmpl   $0xffffffff,-0x18e80(%rbp,%rax,4)
ff
jne    1493 <main+0x2d3>
mov    0x2cc3(%rip),%rax
mov    (%rax),%rax
mov    0x2ca9(%rip),%rcx
cmp    (%rcx),%rax
je     1344 <main+0x184>
mov    -0x18eb8(%rbp),%rsi
mov    0x2ca2(%rip),%rax
mov    (%rax),%rdx
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   10a0 <abortx@plt>
jmp    148e <main+0x2ce>
mov    $0x0,%al
call   10e0 <fork@plt>
mov    %eax,-0x18e94(%rbp)
cmp    $0x0,%eax
je     141a <main+0x25a>
cmpl   $0xffffffff,-0x18e94(%rbp)
jne    137a <main+0x1ba>
lea    0xcdf(%rip),%rdi
mov    $0x0,%al
call   10a0 <abortx@plt>
jmp    1415 <main+0x255>
mov    -0x18e94(%rbp),%edi
lea    -0x18e9c(%rbp),%rsi
xor    %edx,%edx
call   10c0 <waitpid@plt>
mov    -0x18e8c(%rbp),%eax
mov    %eax,-0x18e84(%rbp)
mov    -0x18e84(%rbp),%eax
cmp    -0x18e88(%rbp),%eax
jge    13ef <main+0x22f>
movslq -0x18e84(%rbp),%rax
mov    -0x18e80(%rbp,%rax,4),%edi
call   1070 <write_something@plt>
cmp    $0x0,%eax
jne    13d6 <main+0x216>
lea    0xc92(%rip),%rdi
mov    $0x0,%al
call   10a0 <abortx@plt>
jmp    13db <main+0x21b>
mov    -0x18e84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18e84(%rbp)
jmp    139a <main+0x1da>
cmpl   $0x0,-0x18e98(%rbp)
jne    1403 <main+0x243>
mov    $0x0,%al
call   1040 <delete_files@plt>
mov    -0x18e9c(%rbp),%edi
call   10b0 <WEXITSTATUS@plt>
mov    %eax,%edi
call   10d0 <exit@plt>
jmp    1489 <main+0x2c9>
mov    -0x18e98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18e98(%rbp)
mov    -0x18e8c(%rbp),%eax
mov    %eax,-0x18e84(%rbp)
mov    -0x18e84(%rbp),%eax
cmp    -0x18e88(%rbp),%eax
jge    146e <main+0x2ae>
movslq -0x18e84(%rbp),%rax
mov    -0x18e80(%rbp,%rax,4),%edi
call   1050 <close@plt>
mov    -0x18e84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18e84(%rbp)
jmp    1435 <main+0x275>
mov    -0x18e88(%rbp),%eax
mov    %eax,-0x18e8c(%rbp)
mov    -0x18e88(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18e88(%rbp)
jmp    148e <main+0x2ce>
jmp    1493 <main+0x2d3>
jmp    1498 <main+0x2d8>
mov    -0x18e88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18e88(%rbp)
jmp    12b0 <main+0xf0>
mov    -0x18e8c(%rbp),%eax
mov    %eax,-0x18e84(%rbp)
mov    -0x18e84(%rbp),%eax
cmp    -0x18e88(%rbp),%eax
jge    150d <main+0x34d>
movslq -0x18e84(%rbp),%rax
mov    -0x18e80(%rbp,%rax,4),%edi
call   1070 <write_something@plt>
cmp    $0x0,%eax
jne    14f4 <main+0x334>
lea    0xb74(%rip),%rdi
mov    $0x0,%al
call   10a0 <abortx@plt>
jmp    14f9 <main+0x339>
mov    -0x18e84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18e84(%rbp)
jmp    14b8 <main+0x2f8>
cmpl   $0x0,-0x18e98(%rbp)
jne    1521 <main+0x361>
mov    $0x0,%al
call   1040 <delete_files@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18e88,%rsp
mov    %rsi,%r14
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
cmp    $0x2,%edi
jne    1300 <main+0x140>
mov    0x8(%r14),%rdi
lea    0xe45(%rip),%rsi
lea    -0x34(%rbp),%rdx
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jne    1300 <main+0x140>
cmpl   $0x0,-0x34(%rbp)
jle    1330 <main+0x170>
lea    0xdf5(%rip),%rbx
mov    0x2da1(%rip),%r14
xor    %r15d,%r15d
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
jmp    1265 <main+0xa5>
lea    0xdde(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10a0 <abortx@plt>
mov    %r15d,%r12d
lea    0x1(%r12),%r15d
cmp    -0x34(%rbp),%r15d
jge    1322 <main+0x162>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
call   1090 <mkstemp@plt>
movslq %r15d,%r12
mov    %eax,-0x18eb0(%rbp,%r12,4)
ff
cmp    $0xffffffff,%eax
jne    1253 <main+0x93>
mov    (%r14),%rdx
mov    0x2d2e(%rip),%rax
cmp    (%rax),%rdx
jne    1242 <main+0x82>
xor    %eax,%eax
call   10e0 <fork@plt>
test   %eax,%eax
je     12bb <main+0xfb>
cmp    $0xffffffff,%eax
jne    1382 <main+0x1c2>
lea    0xd9b(%rip),%rdi
xor    %eax,%eax
call   10a0 <abortx@plt>
jmp    1253 <main+0x93>
mov    -0x2c(%rbp),%eax
cmp    %r15d,%eax
jge    12e5 <main+0x125>
movslq %eax,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    -0x18eb0(%rbp,%rbx,4),%edi
call   1050 <close@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    12d0 <main+0x110>
addl   $0x1,-0x30(%rbp)
lea    -0x1(%r15),%r12d
mov    %r15d,%eax
mov    %r15d,-0x2c(%rbp)
lea    0xd22(%rip),%rbx
jmp    1256 <main+0x96>
mov    0x2cd1(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
lea    0xced(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x2c(%rbp),%ecx
cmp    %r12d,%ecx
jle    133e <main+0x17e>
cmpl   $0x0,-0x30(%rbp)
jne    1337 <main+0x177>
xor    %eax,%eax
call   1040 <delete_files@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
movslq %ecx,%rax
lea    -0x18eb0(,%rax,4),%r15
ff
add    %rbp,%r15
sub    %ecx,%r12d
add    $0x1,%r12d
lea    0xd07(%rip),%r14
xor    %ebx,%ebx
jmp    1369 <main+0x1a9>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %ebx,%r12d
je     132a <main+0x16a>
mov    (%r15,%rbx,4),%edi
call   1070 <write_something@plt>
test   %eax,%eax
jne    1360 <main+0x1a0>
mov    %r14,%rdi
xor    %eax,%eax
call   10a0 <abortx@plt>
jmp    1360 <main+0x1a0>
lea    -0x38(%rbp),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   10c0 <waitpid@plt>
mov    -0x2c(%rbp),%ecx
cmp    %r15d,%ecx
jge    13e2 <main+0x222>
movslq %ecx,%rax
lea    -0x18eb0(,%rax,4),%r12
ff
add    %rbp,%r12
sub    %ecx,%r15d
lea    0xcb2(%rip),%r14
xor    %ebx,%ebx
jmp    13c9 <main+0x209>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %ebx,%r15d
je     13e2 <main+0x222>
mov    (%r12,%rbx,4),%edi
call   1070 <write_something@plt>
test   %eax,%eax
jne    13c0 <main+0x200>
mov    %r14,%rdi
xor    %eax,%eax
call   10a0 <abortx@plt>
jmp    13c0 <main+0x200>
cmpl   $0x0,-0x30(%rbp)
jne    13ef <main+0x22f>
xor    %eax,%eax
call   1040 <delete_files@plt>
mov    -0x38(%rbp),%edi
call   10b0 <WEXITSTATUS@plt>
mov    %eax,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@PATH_MAX = global i32 0
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s <number of files>\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"ltpXXXXXX\00"
@errno = global i64 0
@EMFILE = global i64 0
@.str.3 = [38 x i8] c"open() error: file = \22%s\22, errno = %d\00"
@.str.4 = [20 x i8] c"Error forking child\00"
@.str.5 = [23 x i8] c"Error writing to files\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [25500 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32, i32* @PATH_MAX
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %14
%19 = alloca i8, i64 %17
store i64 %17, i64* %15
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 2
br i1 %21, label %22, label %29
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @sscanf(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = icmp ne i32 %34, 1
br i1 %35, label %36, label %43
36: ; preds = %29
%37 = load i32, i32* @stderr
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 0
%40 = load i8*, i8** %39
%41 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %40)
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %29
store i32 0, i32* %9
store i32 0, i32* %12
store i32 0, i32* %8
br label %44
44: ; preds = %129, %43
%45 = load i32, i32* %8
%46 = load i32, i32* %10
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %132
48: ; preds = %44
%49 = call i32 @strcpy(i8* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%50 = call i32 @mkstemp(i8* %19)
%51 = load i32, i32* %8
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [25500 x i32], [25500 x i32]* %6, i64 0, i64 %52
store i32 %50, i32* %53
%54 = load i32, i32* %8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [25500 x i32], [25500 x i32]* %6, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %128
59: ; preds = %48
%60 = load i64, i64* @errno
%61 = load i64, i64* @EMFILE
%62 = icmp ne i64 %60, %61
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = load i64, i64* @errno
%65 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %19, i64 %64)
br label %127
66: ; preds = %59
%67 = call i32 (...) @fork()
store i32 %67, i32* %11
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %105
69: ; preds = %66
%70 = load i32, i32* %11
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %104
74: ; preds = %69
%75 = load i32, i32* %11
%76 = call i32 @waitpid(i32 %75, i32* %13, i32 0)
%77 = load i32, i32* %9
store i32 %77, i32* %7
br label %78
78: ; preds = %92, %74
%79 = load i32, i32* %7
%80 = load i32, i32* %8
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %95
82: ; preds = %78
%83 = load i32, i32* %7
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [25500 x i32], [25500 x i32]* %6, i64 0, i64 %84
%86 = load i32, i32* %85
%87 = call i32 @write_something(i32 %86)
%88 = icmp ne i32 %87, 0
br i1 %88, label %91, label %89
89: ; preds = %82
%90 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %91
91: ; preds = %89, %82
br label %92
92: ; preds = %91
%93 = load i32, i32* %7
%94 = add nsw i32 %93, 1
store i32 %94, i32* %7
br label %78
95: ; preds = %78
%96 = load i32, i32* %12
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %95
%99 = call i32 (...) @delete_files()
br label %100
100: ; preds = %98, %95
%101 = load i32, i32* %13
%102 = call i32 @WEXITSTATUS(i32 %101)
%103 = call i32 @exit(i32 %102)
unreachable
104: ; preds = %72
br label %126
105: ; preds = %66
%106 = load i32, i32* %12
%107 = add nsw i32 %106, 1
store i32 %107, i32* %12
%108 = load i32, i32* %9
store i32 %108, i32* %7
br label %109
109: ; preds = %119, %105
%110 = load i32, i32* %7
%111 = load i32, i32* %8
%112 = icmp slt i32 %110, %111
br i1 %112, label %113, label %122
113: ; preds = %109
%114 = load i32, i32* %7
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [25500 x i32], [25500 x i32]* %6, i64 0, i64 %115
%117 = load i32, i32* %116
%118 = call i32 @close(i32 %117)
br label %119
119: ; preds = %113
%120 = load i32, i32* %7
%121 = add nsw i32 %120, 1
store i32 %121, i32* %7
br label %109
122: ; preds = %109
%123 = load i32, i32* %8
store i32 %123, i32* %9
%124 = load i32, i32* %8
%125 = add nsw i32 %124, -1
store i32 %125, i32* %8
br label %126
126: ; preds = %122, %104
br label %127
127: ; preds = %126, %63
br label %128
128: ; preds = %127, %48
br label %129
129: ; preds = %128
%130 = load i32, i32* %8
%131 = add nsw i32 %130, 1
store i32 %131, i32* %8
br label %44
132: ; preds = %44
%133 = load i32, i32* %9
store i32 %133, i32* %7
br label %134
134: ; preds = %148, %132
%135 = load i32, i32* %7
%136 = load i32, i32* %8
%137 = icmp slt i32 %135, %136
br i1 %137, label %138, label %151
138: ; preds = %134
%139 = load i32, i32* %7
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [25500 x i32], [25500 x i32]* %6, i64 0, i64 %140
%142 = load i32, i32* %141
%143 = call i32 @write_something(i32 %142)
%144 = icmp ne i32 %143, 0
br i1 %144, label %147, label %145
145: ; preds = %138
%146 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %147
147: ; preds = %145, %138
br label %148
148: ; preds = %147
%149 = load i32, i32* %7
%150 = add nsw i32 %149, 1
store i32 %150, i32* %7
br label %134
151: ; preds = %134
%152 = load i32, i32* %12
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %156
154: ; preds = %151
%155 = call i32 (...) @delete_files()
br label %156
156: ; preds = %154, %151
%157 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@stderr = global i32 0
@.str = [29 x i8] c"Usage: %s <number of files>\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"ltpXXXXXX\00"
@errno = global i64 0
@EMFILE = global i64 0
@.str.3 = [38 x i8] c"open() error: file = \22%s\22, errno = %d\00"
@.str.4 = [20 x i8] c"Error forking child\00"
@.str.5 = [23 x i8] c"Error writing to files\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [25500 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [25500 x i32]* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = load i32, i32* @PATH_MAX
%10 = zext i32 %9 to i64
%11 = alloca i8, i64 %10
%12 = icmp eq i32 %0, 2
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %1
%16 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i32, i32* %4
%25 = icmp sgt i32 %24, 0
br i1 %25, label %35, label %114
26: ; preds = %18
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %1
%29 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %93
%32 = icmp sgt i32 %94, %96
br i1 %32, label %112, label %33
33: ; preds = %31
%34 = sext i32 %94 to i64
br label %100
35: ; preds = %23, %93
%36 = phi i32 [ %97, %93 ], [ 0, %23 ]
%37 = phi i32 [ %95, %93 ], [ 0, %23 ]
%38 = phi i32 [ %94, %93 ], [ 0, %23 ]
%39 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%40 = call i32 @mkstemp(i8* %11)
%41 = sext i32 %36 to i64
%42 = getelementptr inbounds [25500 x i32], [25500 x i32]* %3, i64 0, i64 %41
store i32 %40, i32* %42
%43 = icmp eq i32 %40, -1
br i1 %43, label %44, label %93
44: ; preds = %35
%45 = load i64, i64* @errno
%46 = load i64, i64* @EMFILE
%47 = icmp eq i64 %45, %46
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %11, i64 %45)
br label %93
50: ; preds = %44
%51 = call i32 (...) @fork()
switch i32 %51, label %54 [
i32 0, label %79
i32 -1, label %52
]
52: ; preds = %50
%53 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %93
54: ; preds = %50
%55 = call i32 @waitpid(i32 %51, i32* %5, i32 0)
%56 = icmp slt i32 %38, %36
br i1 %56, label %57, label %71
57: ; preds = %54
%58 = sext i32 %38 to i64
br label %59
59: ; preds = %57, %67
%60 = phi i64 [ %58, %57 ], [ %68, %67 ]
%61 = getelementptr inbounds [25500 x i32], [25500 x i32]* %3, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = call i32 @write_something(i32 %62)
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %59
%66 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %67
67: ; preds = %59, %65
%68 = add nsw i64 %60, 1
%69 = trunc i64 %68 to i32
%70 = icmp eq i32 %36, %69
br i1 %70, label %71, label %59
71: ; preds = %67, %54
%72 = icmp eq i32 %37, 0
br i1 %72, label %73, label %75
73: ; preds = %71
%74 = call i32 (...) @delete_files()
br label %75
75: ; preds = %73, %71
%76 = load i32, i32* %5
%77 = call i32 @WEXITSTATUS(i32 %76)
%78 = call i32 @exit(i32 %77)
unreachable
79: ; preds = %50
%80 = add nsw i32 %37, 1
%81 = icmp slt i32 %38, %36
br i1 %81, label %82, label %91
82: ; preds = %79
%83 = sext i32 %38 to i64
br label %84
84: ; preds = %82, %84
%85 = phi i64 [ %83, %82 ], [ %89, %84 ]
%86 = getelementptr inbounds [25500 x i32], [25500 x i32]* %3, i64 0, i64 %85
%87 = load i32, i32* %86
%88 = call i32 @close(i32 %87)
%89 = add nsw i64 %85, 1
%90 = icmp eq i64 %89, %41
br i1 %90, label %91, label %84
91: ; preds = %84, %79
%92 = add nsw i32 %36, -1
br label %93
93: ; preds = %35, %52, %91, %48
%94 = phi i32 [ %38, %48 ], [ %38, %52 ], [ %36, %91 ], [ %38, %35 ]
%95 = phi i32 [ %37, %48 ], [ %37, %52 ], [ %80, %91 ], [ %37, %35 ]
%96 = phi i32 [ %36, %48 ], [ %36, %52 ], [ %92, %91 ], [ %36, %35 ]
%97 = add nsw i32 %96, 1
%98 = load i32, i32* %4
%99 = icmp slt i32 %97, %98
br i1 %99, label %35, label %31
100: ; preds = %33, %108
%101 = phi i64 [ %34, %33 ], [ %109, %108 ]
%102 = getelementptr inbounds [25500 x i32], [25500 x i32]* %3, i64 0, i64 %101
%103 = load i32, i32* %102
%104 = call i32 @write_something(i32 %103)
%105 = icmp eq i32 %104, 0
br i1 %105, label %106, label %108
106: ; preds = %100
%107 = call i32 (i8*, ...) @abortx(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %108
108: ; preds = %100, %106
%109 = add nsw i64 %101, 1
%110 = trunc i64 %109 to i32
%111 = icmp eq i32 %97, %110
br i1 %111, label %112, label %100
112: ; preds = %108, %31
%113 = icmp eq i32 %95, 0
br i1 %113, label %114, label %116
114: ; preds = %23, %112
%115 = call i32 (...) @delete_files()
br label %116
116: ; preds = %114, %112
%117 = call i32 @exit(i32 0)
unreachable
}