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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ *stderr;
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ unlink(char *);
int main(int argc, char **argv) {
  printf("Usage: profcleaner files\n");
  int i;
  for (i = 1; i < argc; i++) {
    FILE *fp = fopen(argv[i], "r");
    if (!fp) {
      fprintf(stderr, "Error: cannot open %s\n", argv[i]);
      return 1;
    }
    FILE *fpout = fopen("profcleaner-tmp", "w");
    if (!fpout) {
      fprintf(stderr, "Error: cannot open output file\n");
      return 1;
    }
    char buf[4096];
    while (fgets(buf, 4096, fp)) {
      if (strncmp(buf, "blacklist-nolog", 15) == 0)
        fprintf(fpout, "deny-nolog %s", buf + 15);
      else if (strncmp(buf, "blacklist", 9) == 0)
        fprintf(fpout, "deny %s", buf + 9);
      else if (strncmp(buf, "noblacklist", 11) == 0)
        fprintf(fpout, "nodeny %s", buf + 11);
      else if (strncmp(buf, "whitelist", 9) == 0)
        fprintf(fpout, "allow %s", buf + 9);
      else if (strncmp(buf, "nowhitelist", 11) == 0)
        fprintf(fpout, "noallow %s", buf + 11);
      else
        fprintf(fpout, "%s", buf);
    }
    fclose(fp);
    fclose(fpout);
    unlink(argv[i]);
    rename("profcleaner-tmp", argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1030,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe60(%rip),%rdi
call   1060 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1448 <main+0x2c8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe4f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    120f <main+0x8f>
mov    0x2dfa(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    144f <main+0x2cf>
lea    0xe1d(%rip),%rdi
lea    0xe26(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1255 <main+0xd5>
mov    0x2da8(%rip),%rax
mov    (%rax),%rdi
lea    0xe03(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    144f <main+0x2cf>
jmp    125a <main+0xda>
lea    -0x1030(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x1000,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     13ff <main+0x27f>
lea    -0x1030(%rbp),%rdi
lea    0xdde(%rip),%rsi
mov    $0xf,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    12bd <main+0x13d>
mov    -0x28(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
add    $0xf,%rdx
lea    0xdc4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13fa <main+0x27a>
lea    -0x1030(%rbp),%rdi
lea    0xdba(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1301 <main+0x181>
mov    -0x28(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
add    $0x9,%rdx
lea    0xd9c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13f5 <main+0x275>
lea    -0x1030(%rbp),%rdi
lea    0xd74(%rip),%rsi
mov    $0xb,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1345 <main+0x1c5>
mov    -0x28(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
add    $0xb,%rdx
lea    0xd56(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13f0 <main+0x270>
lea    -0x1030(%rbp),%rdi
lea    0xd48(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1389 <main+0x209>
mov    -0x28(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
add    $0x9,%rdx
lea    0xd2a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13eb <main+0x26b>
lea    -0x1030(%rbp),%rdi
lea    0xd02(%rip),%rsi
mov    $0xb,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13cd <main+0x24d>
mov    -0x28(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
add    $0xb,%rdx
lea    0xce4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13e6 <main+0x266>
mov    -0x28(%rbp),%rdi
lea    -0x1030(%rbp),%rdx
lea    0xca1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13eb <main+0x26b>
jmp    13f0 <main+0x270>
jmp    13f5 <main+0x275>
jmp    13fa <main+0x27a>
jmp    125a <main+0xda>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xbfe(%rip),%rdi
call   10a0 <rename@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ac <main+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1018,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
lea    0xed9(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
jl     13c0 <main+0x220>
mov    %ebx,%eax
mov    %rax,0x8(%rsp)
mov    $0x1,%r12d
lea    0xe38(%rip),%r14
lea    0x10(%rsp),%r13
lea    0xe5e(%rip),%r15
jmp    122d <main+0x8d>
nop
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    0x0(%rbp,%r12,8),%rdi
call   1030 <unlink@plt>
mov    0x0(%rbp,%r12,8),%rsi
lea    0xe03(%rip),%r14
mov    %r14,%rdi
call   10b0 <rename@plt>
add    $0x1,%r12
cmp    0x8(%rsp),%r12
je     1378 <main+0x1d8>
mov    0x0(%rbp,%r12,8),%rdi
lea    0xdc7(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     137c <main+0x1dc>
mov    %rax,%rbx
mov    %r14,%rdi
lea    0xdd5(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     139b <main+0x1fb>
mov    %rax,%r14
jmp    1286 <main+0xe6>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
lea    0xde1(%rip),%rsi
lea    0x1f(%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r13,%rdi
mov    $0x1000,%esi
mov    %rbx,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     11f0 <main+0x50>
mov    %r13,%rdi
mov    %r15,%rsi
mov    $0xf,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1270 <main+0xd0>
mov    %r13,%rdi
lea    0xdad(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1330 <main+0x190>
mov    %r13,%rdi
lea    0xd92(%rip),%rsi
mov    $0xb,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     133c <main+0x19c>
mov    %r13,%rdi
lea    0xd91(%rip),%rsi
mov    $0x9,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1350 <main+0x1b0>
mov    %r13,%rdi
lea    0xd76(%rip),%rsi
mov    $0xb,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1364 <main+0x1c4>
mov    %r13,%rdi
mov    %r14,%rsi
call   1070 <fputs@plt>
jmp    1286 <main+0xe6>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
lea    0xd3d(%rip),%rsi
jmp    135a <main+0x1ba>
mov    %r14,%rdi
lea    0xd2f(%rip),%rsi
lea    0x1b(%rsp),%rdx
jmp    127f <main+0xdf>
mov    %r14,%rdi
lea    0xd33(%rip),%rsi
lea    0x19(%rsp),%rdx
jmp    127f <main+0xdf>
mov    %r14,%rdi
lea    0xd1d(%rip),%rsi
lea    0x1b(%rsp),%rdx
jmp    127f <main+0xdf>
xor    %eax,%eax
jmp    13c0 <main+0x220>
mov    0x2c5d(%rip),%rax
mov    (%rax),%rdi
mov    0x0(%rbp,%r12,8),%rdx
lea    0xc70(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    13bb <main+0x21b>
mov    0x2c3e(%rip),%rax
mov    (%rax),%rcx
lea    0xc7f(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    $0x1,%eax
add    $0x1018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: profcleaner files\0A\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32* null
@.str.2 = [23 x i8] c"Error: cannot open %s\0A\00"
@.str.3 = [16 x i8] c"profcleaner-tmp\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [32 x i8] c"Error: cannot open output file\0A\00"
@.str.6 = [16 x i8] c"blacklist-nolog\00"
@.str.7 = [14 x i8] c"deny-nolog %s\00"
@.str.8 = [10 x i8] c"blacklist\00"
@.str.9 = [8 x i8] c"deny %s\00"
@.str.10 = [12 x i8] c"noblacklist\00"
@.str.11 = [10 x i8] c"nodeny %s\00"
@.str.12 = [10 x i8] c"whitelist\00"
@.str.13 = [9 x i8] c"allow %s\00"
@.str.14 = [12 x i8] c"nowhitelist\00"
@.str.15 = [11 x i8] c"noallow %s\00"
@.str.16 = [3 x i8] c"%s\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]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %11
11: ; preds = %116, %2
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %119
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %21, i32** %7
%22 = load i32*, i32** %7
%23 = icmp ne i32* %22, null
br i1 %23, label %32, label %24
24: ; preds = %15
%25 = load i32*, i32** @stderr
%26 = load i8**, i8*** %5
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %30)
store i32 1, i32* %3
br label %120
32: ; preds = %15
%33 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %33, i32** %8
%34 = load i32*, i32** %8
%35 = icmp ne i32* %34, null
br i1 %35, label %39, label %36
36: ; preds = %32
%37 = load i32*, i32** @stderr
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %120
39: ; preds = %32
br label %40
40: ; preds = %98, %39
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%42 = load i32*, i32** %7
%43 = call i64 @fgets(i8* %41, i32 4096, i32* %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %99
45: ; preds = %40
%46 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%47 = call i64 @strncmp(i8* %46, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 15)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %54
49: ; preds = %45
%50 = load i32*, i32** %8
%51 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%52 = getelementptr inbounds i8, i8* %51, i64 15
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %52)
br label %98
54: ; preds = %45
%55 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%56 = call i64 @strncmp(i8* %55, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 9)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %63
58: ; preds = %54
%59 = load i32*, i32** %8
%60 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%61 = getelementptr inbounds i8, i8* %60, i64 9
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* %61)
br label %97
63: ; preds = %54
%64 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%65 = call i64 @strncmp(i8* %64, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 11)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %63
%68 = load i32*, i32** %8
%69 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%70 = getelementptr inbounds i8, i8* %69, i64 11
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* %70)
br label %96
72: ; preds = %63
%73 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%74 = call i64 @strncmp(i8* %73, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 9)
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %81
76: ; preds = %72
%77 = load i32*, i32** %8
%78 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%79 = getelementptr inbounds i8, i8* %78, i64 9
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %79)
br label %95
81: ; preds = %72
%82 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%83 = call i64 @strncmp(i8* %82, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 11)
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %90
85: ; preds = %81
%86 = load i32*, i32** %8
%87 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%88 = getelementptr inbounds i8, i8* %87, i64 11
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8* %88)
br label %94
90: ; preds = %81
%91 = load i32*, i32** %8
%92 = getelementptr inbounds [4096 x i8], [4096 x i8]* %9, i64 0, i64 0
%93 = call i32 (i32*, i8*, ...) @fprintf(i32* %91, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* %92)
br label %94
94: ; preds = %90, %85
br label %95
95: ; preds = %94, %76
br label %96
96: ; preds = %95, %67
br label %97
97: ; preds = %96, %58
br label %98
98: ; preds = %97, %49
br label %40
99: ; preds = %40
%100 = load i32*, i32** %7
%101 = call i32 @fclose(i32* %100)
%102 = load i32*, i32** %8
%103 = call i32 @fclose(i32* %102)
%104 = load i8**, i8*** %5
%105 = load i32, i32* %6
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8*, i8** %104, i64 %106
%108 = load i8*, i8** %107
%109 = call i32 @unlink(i8* %108)
%110 = load i8**, i8*** %5
%111 = load i32, i32* %6
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %110, i64 %112
%114 = load i8*, i8** %113
%115 = call i32 @rename(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %114)
br label %116
116: ; preds = %99
%117 = load i32, i32* %6
%118 = add nsw i32 %117, 1
store i32 %118, i32* %6
br label %11
119: ; preds = %11
store i32 0, i32* %3
br label %120
120: ; preds = %119, %36, %24
%121 = load i32, i32* %3
ret i32 %121
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32* null
@.str.2 = [23 x i8] c"Error: cannot open %s\0A\00"
@.str.3 = [16 x i8] c"profcleaner-tmp\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [32 x i8] c"Error: cannot open output file\0A\00"
@.str.6 = [16 x i8] c"blacklist-nolog\00"
@.str.7 = [14 x i8] c"deny-nolog %s\00"
@.str.8 = [10 x i8] c"blacklist\00"
@.str.9 = [8 x i8] c"deny %s\00"
@.str.10 = [12 x i8] c"noblacklist\00"
@.str.11 = [10 x i8] c"nodeny %s\00"
@.str.12 = [10 x i8] c"whitelist\00"
@.str.13 = [9 x i8] c"allow %s\00"
@.str.14 = [12 x i8] c"nowhitelist\00"
@.str.15 = [11 x i8] c"noallow %s\00"
@str = [25 x i8] c"Usage: profcleaner files\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4096 x i8]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %70
6: ; preds = %2
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 11
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 9
%10 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 15
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %6, %61
%13 = phi i64 [ 1, %6 ], [ %68, %61 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %22
18: ; preds = %12
%19 = load i32*, i32** @stderr
%20 = load i8*, i8** %14
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %20)
br label %70
22: ; preds = %12
%23 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32*, i32** @stderr
%27 = call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i64 31, i64 1, i32* %26)
br label %70
28: ; preds = %22
%29 = call i64 @fgets(i8* %7, i32 4096, i32* %16)
%30 = icmp eq i64 %29, 0
br i1 %30, label %61, label %31
31: ; preds = %28, %58
%32 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 15)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* %10)
br label %58
36: ; preds = %31
%37 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 9)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8* %9)
br label %58
41: ; preds = %36
%42 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 11)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* %8)
br label %58
46: ; preds = %41
%47 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 9)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %9)
br label %58
51: ; preds = %46
%52 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 11)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i8* %8)
br label %58
56: ; preds = %51
%57 = call i32 @fputs(i8* %7, i32* %23)
br label %58
58: ; preds = %39, %49, %56, %54, %44, %34
%59 = call i64 @fgets(i8* %7, i32 4096, i32* %16)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %31
61: ; preds = %58, %28
%62 = call i32 @fclose(i32* %16)
%63 = call i32 @fclose(i32* %23)
%64 = load i8*, i8** %14
%65 = call i32 @unlink(i8* %64)
%66 = load i8*, i8** %14
%67 = call i32 @rename(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %66)
%68 = add nuw nsw i64 %13, 1
%69 = icmp eq i64 %68, %11
br i1 %69, label %70, label %12
70: ; preds = %61, %2, %25, %18
%71 = phi i32 [ 1, %18 ], [ 1, %25 ], [ 0, %2 ], [ 0, %61 ]
ret i32 %71
}