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

/* Variables and functions */
char *doencrypt(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
scalar_t__ rename(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ *stderr;
char *strchr(char *, char);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  FILE *old, *new;
  char newpath[1024], line[1024];
  char *oldpass, *newpass, *ch;
  int ii;
  if (argc < 2) {
    fprintf(stderr, "Usage: %s <database1> [database2 database3 ...]\n",
            argv[0]);
    return 0;
  }
  for (ii = 1; ii < argc; ii++) {
    sprintf(newpath, "%s.orig", argv[ii]);
    if (rename(argv[ii], newpath) < 0) {
      fprintf(stderr, "Unable to rename %s to %s.orig: %s\n", argv[ii],
              argv[ii], strerror(errno));
      return 0;
    }
    if (!(old = fopen(newpath, "r"))) {
      fprintf(stderr, "Unable to open %s: %s\n", newpath, strerror(errno));
      return 0;
    }
    if (!(new = fopen(argv[ii], "w"))) {
      fprintf(stderr, "Unable to open %s: %s\n", argv[ii], strerror(errno));
      return 0;
    }
    while (fgets(line, sizeof(line) - 1, old)) {
      if (!strncmp(line, "->PASS", 6)) {
        oldpass = line + 7;
        if ((ch = strchr(oldpass, '\n')))
          *ch = '\0';
        if ((ch = strchr(oldpass, '\r')))
          *ch = '\0';
        newpass = doencrypt(oldpass);
        fprintf(new, "->PASS %s\n", newpass);
      } else {
        fprintf(new, "%s", line);
      }
    }
    fclose(old);
    fclose(new);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x880,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11ee <main+0x4e>
mov    0x2e16(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe25(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f8 <main+0x358>
movl   $0x1,-0x83c(%rbp)
mov    -0x83c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14f1 <main+0x351>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x83c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe0d(%rip),%rsi
call   10b0 <sprintf@plt>
mov    -0x10(%rbp),%rax
movslq -0x83c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x420(%rbp),%rsi
call   10a0 <rename@plt>
cmp    $0x0,%rax
jge    12cb <main+0x12b>
mov    0x2d8b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x858(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x83c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x850(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x83c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x848(%rbp)
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x858(%rbp),%rdi
mov    -0x850(%rbp),%rdx
mov    -0x848(%rbp),%rcx
mov    %rax,%r8
lea    0xd81(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f8 <main+0x358>
lea    -0x420(%rbp),%rdi
lea    0xd84(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1344 <main+0x1a4>
mov    0x2ced(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x868(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x860(%rbp)
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x868(%rbp),%rdi
mov    -0x860(%rbp),%rdx
mov    %rax,%rcx
lea    0xd2e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f8 <main+0x358>
mov    -0x10(%rbp),%rax
movslq -0x83c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd1c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    13cd <main+0x22d>
mov    0x2c6c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x878(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x83c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x870(%rbp)
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
call   10c0 <strerror@plt>
mov    -0x878(%rbp),%rdi
mov    -0x870(%rbp),%rdx
mov    %rax,%rcx
lea    0xca5(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    14f8 <main+0x358>
jmp    13d2 <main+0x232>
lea    -0x820(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x3ff,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     14cb <main+0x32b>
lea    -0x820(%rbp),%rdi
lea    0xc79(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    14ad <main+0x30d>
lea    -0x820(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x828(%rbp)
mov    -0x828(%rbp),%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
mov    %rax,-0x838(%rbp)
cmp    $0x0,%rax
je     1450 <main+0x2b0>
mov    -0x838(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x828(%rbp),%rdi
mov    $0xd,%esi
call   1060 <strchr@plt>
mov    %rax,-0x838(%rbp)
cmp    $0x0,%rax
je     147c <main+0x2dc>
mov    -0x838(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x828(%rbp),%rdi
call   1050 <doencrypt@plt>
mov    %rax,-0x830(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x830(%rbp),%rdx
lea    0xbde(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    14c6 <main+0x326>
mov    -0x20(%rbp),%rdi
lea    -0x820(%rbp),%rdx
lea    0xbcb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    13d2 <main+0x232>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x83c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x83c(%rbp)
jmp    11f8 <main+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x880,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x828,%rsp
mov    %rsi,%r14
cmp    $0x2,%edi
jge    11e9 <main+0x39>
mov    0x2e10(%rip),%rax
mov    (%rax),%rdi
mov    (%r14),%rdx
lea    0xe23(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    13fd <main+0x24d>
lea    0x427(%rsp),%r15
mov    %edi,%eax
mov    %rax,0x18(%rsp)
mov    $0x1,%ebx
lea    0x20(%rsp),%r12
lea    0x420(%rsp),%rbp
lea    0xe67(%rip),%r13
mov    %r14,0x8(%rsp)
jmp    124e <main+0x9e>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x10(%rsp),%rbx
add    $0x1,%rbx
cmp    0x18(%rsp),%rbx
mov    0x8(%rsp),%r14
lea    0x20(%rsp),%r12
je     13fd <main+0x24d>
mov    (%r14,%rbx,8),%rdx
mov    %r12,%rdi
lea    0xdd5(%rip),%rsi
call   10c0 <sprintf@plt>
mov    (%r14,%rbx,8),%rdi
mov    %r12,%rsi
call   10b0 <rename@plt>
test   %rax,%rax
js     135c <main+0x1ac>
mov    %r12,%rdi
lea    0xddd(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1397 <main+0x1e7>
mov    %rax,%r12
mov    %rbx,0x10(%rsp)
mov    (%r14,%rbx,8),%rdi
lea    0xdd5(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13c0 <main+0x210>
mov    %rax,%r14
mov    %rbp,%rdi
mov    $0x3ff,%esi
mov    %r12,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
lea    0xdb3(%rip),%rbx
jne    1304 <main+0x154>
jmp    1220 <main+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %r14,%rsi
call   1070 <fputs@plt>
mov    %rbp,%rdi
mov    $0x3ff,%esi
mov    %r12,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     1220 <main+0x70>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    12e0 <main+0x130>
mov    %r15,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     132d <main+0x17d>
movb   $0x0,(%rax)
mov    %r15,%rdi
mov    $0xd,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1342 <main+0x192>
movb   $0x0,(%rax)
mov    %r15,%rdi
call   1050 <doencrypt@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    12eb <main+0x13b>
mov    0x2c7d(%rip),%rax
mov    %rbx,%rcx
mov    (%rax),%rbx
mov    (%r14,%rcx,8),%rbp
mov    0x2c64(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xcb7(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %rbp,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    13fd <main+0x24d>
mov    0x2c42(%rip),%rax
mov    (%rax),%rbx
mov    0x2c30(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xca9(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %rbx,%rdi
jmp    13f3 <main+0x243>
mov    0x2c19(%rip),%rax
mov    (%rax),%rbx
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%rcx
mov    (%rax,%rcx,8),%rbp
mov    0x2bf9(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
lea    0xc72(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1090 <fprintf@plt>
xor    %eax,%eax
add    $0x828,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@stderr = global i32* null
@.str = [49 x i8] c"Usage: %s <database1> [database2 database3 ...]\0A\00"
@.str.1 = [8 x i8] c"%s.orig\00"
@.str.2 = [36 x i8] c"Unable to rename %s to %s.orig: %s\0A\00"
@errno = global i32 0
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [23 x i8] c"Unable to open %s: %s\0A\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [7 x i8] c"->PASS\00"
@.str.7 = [11 x i8] c"->PASS %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 2
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 7
%10 = zext i32 %0 to i64
br label %15
11: ; preds = %2
%12 = load i32*, i32** @stderr
%13 = load i8*, i8** %1
%14 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %74
15: ; preds = %8, %69
%16 = phi i64 [ 1, %8 ], [ %72, %69 ]
%17 = getelementptr inbounds i8*, i8** %1, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %17
%21 = call i64 @rename(i8* %20, i8* %5)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %15
%24 = load i32*, i32** @stderr
%25 = load i8*, i8** %17
%26 = load i32, i32* @errno
%27 = call i8* @strerror(i32 %26)
%28 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %25, i8* %25, i8* %27)
br label %74
29: ; preds = %15
%30 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i32*, i32** @stderr
%34 = load i32, i32* @errno
%35 = call i8* @strerror(i32 %34)
%36 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %5, i8* %35)
br label %74
37: ; preds = %29
%38 = load i8*, i8** %17
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i32* %39, null
br i1 %40, label %44, label %41
41: ; preds = %37
%42 = call i64 @fgets(i8* %6, i32 1023, i32* %30)
%43 = icmp eq i64 %42, 0
br i1 %43, label %69, label %50
44: ; preds = %37
%45 = load i32*, i32** @stderr
%46 = load i8*, i8** %17
%47 = load i32, i32* @errno
%48 = call i8* @strerror(i32 %47)
%49 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %46, i8* %48)
br label %74
50: ; preds = %41, %66
%51 = call i32 @strncmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 6)
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %64
53: ; preds = %50
%54 = call i8* @strchr(i8* %9, i8 signext 10)
%55 = icmp eq i8* %54, null
br i1 %55, label %57, label %56
56: ; preds = %53
store i8 0, i8* %54
br label %57
57: ; preds = %56, %53
%58 = call i8* @strchr(i8* %9, i8 signext 13)
%59 = icmp eq i8* %58, null
br i1 %59, label %61, label %60
60: ; preds = %57
store i8 0, i8* %58
br label %61
61: ; preds = %60, %57
%62 = call i8* @doencrypt(i8* %9)
%63 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %62)
br label %66
64: ; preds = %50
%65 = call i32 @fputs(i8* %6, i32* %39)
br label %66
66: ; preds = %64, %61
%67 = call i64 @fgets(i8* %6, i32 1023, i32* %30)
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %50
69: ; preds = %66, %41
%70 = call i32 @fclose(i32* %30)
%71 = call i32 @fclose(i32* %39)
%72 = add nuw nsw i64 %16, 1
%73 = icmp eq i64 %72, %10
br i1 %73, label %74, label %15
74: ; preds = %69, %44, %32, %23, %11
ret i32 0
}