#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 */
char EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(char);
int main() {
  FILE *fp;
  int i, j, n, i1;
  char c[100], t, ch;
  if ((fp = fopen("a1", "r")) == NULL) {
    printf("\ncan not open file\n");
    exit(0);
  }
  printf("file A:\n");
  for (i = 0; (ch = fgetc(fp)) != EOF; i++) {
    c[i] = ch;
    putchar(c[i]);
  }
  fclose(fp);
  i1 = i;
  if ((fp = fopen("b1", "r")) == NULL) {
    printf("\ncan not open file\n");
    exit(0);
  }
  printf("\nfile B:\n");
  for (i = i1; (ch = fgetc(fp)) != EOF; i++) {
    c[i] = ch;
    putchar(c[i]);
  }
  fclose(fp);
  n = i;
  for (i = 0; i < n; i++)
    for (j = i + 1; j < n; j++)
      if (c[i] > c[j]) {
        t = c[i];
        c[i] = c[j];
        c[j] = t;
      }
  printf("\nfile C:\n");
  fp = fopen("c1", "w");
  for (i = 0; i < n; i++) {
    putc(c[i], fp);
    putchar(c[i]);
  }
  printf("\n");
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
lea    0xe73(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11b6 <main+0x46>
lea    0xe5b(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
lea    0xe5c(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x92(%rbp)
movsbl %al,%eax
mov    0x2e06(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     121d <main+0xad>
mov    -0x92(%rbp),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
movslq -0x14(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%edi
ff
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c9 <main+0x59>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    0xdef(%rip),%rdi
lea    0xdc9(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1260 <main+0xf0>
lea    0xdb1(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
lea    0xdbe(%rip),%rdi
call   1050 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x92(%rbp)
movsbl %al,%eax
mov    0x2d5d(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     12c6 <main+0x156>
mov    -0x92(%rbp),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
movslq -0x14(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%edi
ff
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1272 <main+0x102>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    137b <main+0x20b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1368 <main+0x1f8>
movslq -0x14(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%eax
ff
movslq -0x18(%rbp),%rcx
movsbl -0x90(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jle    1355 <main+0x1e5>
movslq -0x14(%rbp),%rax
mov    -0x90(%rbp,%rax,1),%al
mov    %al,-0x91(%rbp)
movslq -0x18(%rbp),%rax
mov    -0x90(%rbp,%rax,1),%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0x91(%rbp),%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
jmp    135a <main+0x1ea>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12f1 <main+0x181>
jmp    136d <main+0x1fd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12dc <main+0x16c>
lea    0xcad(%rip),%rdi
call   1050 <printf@plt>
lea    0xcab(%rip),%rdi
lea    0xca7(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13e7 <main+0x277>
movslq -0x14(%rbp),%rax
mov    -0x90(%rbp,%rax,1),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1070 <putc@plt>
movslq -0x14(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%edi
ff
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13a5 <main+0x235>
lea    0xc32(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
lea    0xe7d(%rip),%rdi
lea    0xe79(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     131f <main+0x1af>
mov    %rax,%rbx
lea    0xe6b(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <fgetc@plt>
mov    0x2e32(%rip),%r14
xor    %r12d,%r12d
cmp    (%r14),%al
je     11ed <main+0x7d>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %al,(%rsp,%r12,1)
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
mov    %rbx,%rdi
call   1060 <fgetc@plt>
cmp    (%r14),%al
jne    11d0 <main+0x60>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xe09(%rip),%rdi
lea    0xe00(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     131f <main+0x1af>
mov    %rax,%rbx
lea    0xdfa(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <fgetc@plt>
cmp    (%r14),%al
je     124d <main+0xdd>
mov    %r12d,%r12d
mov    %al,(%rsp,%r12,1)
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
mov    %rbx,%rdi
call   1060 <fgetc@plt>
cmp    (%r14),%al
jne    1230 <main+0xc0>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r12d,%r15d
test   %r12d,%r12d
je     12ad <main+0x13d>
lea    0x1(%rsp),%rax
lea    -0x1(%r15),%rcx
xor    %ebp,%ebp
jmp    127d <main+0x10d>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0xffffffffffffffff,%rcx
cmp    %r15,%rbp
je     12ad <main+0x13d>
mov    %rbp,%rsi
add    $0x1,%rbp
cmp    %r15,%rbp
jae    1270 <main+0x100>
xor    %edi,%edi
jmp    1299 <main+0x129>
nopl   (%rax)
add    $0x1,%rdi
cmp    %rdi,%rcx
je     1270 <main+0x100>
movzbl (%rsp,%rsi,1),%ebx
movzbl (%rax,%rdi,1),%edx
cmp    %dl,%bl
jle    1290 <main+0x120>
mov    %dl,(%rsp,%rsi,1)
mov    %bl,(%rax,%rdi,1)
jmp    1290 <main+0x120>
lea    0xd6a(%rip),%rdi
call   1040 <puts@plt>
lea    0xd48(%rip),%rdi
lea    0xd44(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
test   %r12d,%r12d
je     12fe <main+0x18e>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rsp,%rbx,1),%ebp
mov    %ebp,%edi
mov    %r14,%rsi
call   1070 <putc@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    12e0 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd01(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"a1\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [20 x i8] c"\0Acan not open file\0A\00"
@.str.3 = [9 x i8] c"file A:\0A\00"
@EOF = global i8 0
@.str.4 = [3 x i8] c"b1\00"
@.str.5 = [10 x i8] c"\0Afile B:\0A\00"
@.str.6 = [10 x i8] c"\0Afile C:\0A\00"
@.str.7 = [3 x i8] c"c1\00"
@.str.8 = [2 x i8] c"w\00"
@.str.9 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca i8
%9 = alloca i8
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %2
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %17
17: ; preds = %34, %15
%18 = load i32*, i32** %2
%19 = call signext i8 @fgetc(i32* %18)
store i8 %19, i8* %9
%20 = sext i8 %19 to i32
%21 = load i8, i8* @EOF
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %20, %22
br i1 %23, label %24, label %37
24: ; preds = %17
%25 = load i8, i8* %9
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %27
store i8 %25, i8* %28
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = call i32 @putchar(i8 signext %32)
br label %34
34: ; preds = %24
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %17
37: ; preds = %17
%38 = load i32*, i32** %2
%39 = call i32 @fclose(i32* %38)
%40 = load i32, i32* %3
store i32 %40, i32* %6
%41 = call i32* @fopen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %41, i32** %2
%42 = icmp eq i32* %41, null
br i1 %42, label %43, label %46
43: ; preds = %37
%44 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%45 = call i32 @exit(i32 0)
unreachable
46: ; preds = %37
%47 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%48 = load i32, i32* %6
store i32 %48, i32* %3
br label %49
49: ; preds = %66, %46
%50 = load i32*, i32** %2
%51 = call signext i8 @fgetc(i32* %50)
store i8 %51, i8* %9
%52 = sext i8 %51 to i32
%53 = load i8, i8* @EOF
%54 = sext i8 %53 to i32
%55 = icmp ne i32 %52, %54
br i1 %55, label %56, label %69
56: ; preds = %49
%57 = load i8, i8* %9
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %59
store i8 %57, i8* %60
%61 = load i32, i32* %3
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = call i32 @putchar(i8 signext %64)
br label %66
66: ; preds = %56
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 1
store i32 %68, i32* %3
br label %49
69: ; preds = %49
%70 = load i32*, i32** %2
%71 = call i32 @fclose(i32* %70)
%72 = load i32, i32* %3
store i32 %72, i32* %5
store i32 0, i32* %3
br label %73
73: ; preds = %117, %69
%74 = load i32, i32* %3
%75 = load i32, i32* %5
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %120
77: ; preds = %73
%78 = load i32, i32* %3
%79 = add nsw i32 %78, 1
store i32 %79, i32* %4
br label %80
80: ; preds = %113, %77
%81 = load i32, i32* %4
%82 = load i32, i32* %5
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %116
84: ; preds = %80
%85 = load i32, i32* %3
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %86
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = load i32, i32* %4
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %91
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp sgt i32 %89, %94
br i1 %95, label %96, label %112
96: ; preds = %84
%97 = load i32, i32* %3
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %98
%100 = load i8, i8* %99
store i8 %100, i8* %8
%101 = load i32, i32* %4
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %102
%104 = load i8, i8* %103
%105 = load i32, i32* %3
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %106
store i8 %104, i8* %107
%108 = load i8, i8* %8
%109 = load i32, i32* %4
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %110
store i8 %108, i8* %111
br label %112
112: ; preds = %96, %84
br label %113
113: ; preds = %112
%114 = load i32, i32* %4
%115 = add nsw i32 %114, 1
store i32 %115, i32* %4
br label %80
116: ; preds = %80
br label %117
117: ; preds = %116
%118 = load i32, i32* %3
%119 = add nsw i32 %118, 1
store i32 %119, i32* %3
br label %73
120: ; preds = %73
%121 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
%122 = call i32* @fopen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %122, i32** %2
store i32 0, i32* %3
br label %123
123: ; preds = %139, %120
%124 = load i32, i32* %3
%125 = load i32, i32* %5
%126 = icmp slt i32 %124, %125
br i1 %126, label %127, label %142
127: ; preds = %123
%128 = load i32, i32* %3
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %129
%131 = load i8, i8* %130
%132 = load i32*, i32** %2
%133 = call i32 @putc(i8 signext %131, i32* %132)
%134 = load i32, i32* %3
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %135
%137 = load i8, i8* %136
%138 = call i32 @putchar(i8 signext %137)
br label %139
139: ; preds = %127
%140 = load i32, i32* %3
%141 = add nsw i32 %140, 1
store i32 %141, i32* %3
br label %123
142: ; preds = %123
%143 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%144 = load i32*, i32** %2
%145 = call i32 @fclose(i32* %144)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"a1\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i8 0
@.str.4 = [3 x i8] c"b1\00"
@.str.7 = [3 x i8] c"c1\00"
@.str.8 = [2 x i8] c"w\00"
@str = [8 x i8] c"file A:\00"
@str.10 = [9 x i8] c"\0Afile B:\00"
@str.11 = [9 x i8] c"\0Afile C:\00"
@str.13 = [19 x i8] c"\0Acan not open file\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.13, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%10 = tail call signext i8 @fgetc(i32* %3)
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %24, label %13
13: ; preds = %8, %13
%14 = phi i64 [ %18, %13 ], [ 0, %8 ]
%15 = phi i8 [ %19, %13 ], [ %10, %8 ]
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %14
store i8 %15, i8* %16
%17 = tail call i32 @putchar(i8 signext %15)
%18 = add nuw i64 %14, 1
%19 = tail call signext i8 @fgetc(i32* %3)
%20 = load i8, i8* @EOF
%21 = icmp eq i8 %19, %20
br i1 %21, label %22, label %13
22: ; preds = %13
%23 = trunc i64 %18 to i32
br label %24
24: ; preds = %22, %8
%25 = phi i32 [ 0, %8 ], [ %23, %22 ]
%26 = tail call i32 @fclose(i32* %3)
%27 = tail call i32* @fopen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.13, i64 0, i64 0))
%31 = tail call i32 @exit(i32 0)
unreachable
32: ; preds = %24
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0))
%34 = tail call signext i8 @fgetc(i32* %27)
%35 = load i8, i8* @EOF
%36 = icmp eq i8 %34, %35
br i1 %36, label %50, label %37
37: ; preds = %32
%38 = zext i32 %25 to i64
br label %39
39: ; preds = %37, %39
%40 = phi i64 [ %38, %37 ], [ %44, %39 ]
%41 = phi i8 [ %34, %37 ], [ %45, %39 ]
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %40
store i8 %41, i8* %42
%43 = tail call i32 @putchar(i8 signext %41)
%44 = add nuw i64 %40, 1
%45 = tail call signext i8 @fgetc(i32* %27)
%46 = load i8, i8* @EOF
%47 = icmp eq i8 %45, %46
br i1 %47, label %48, label %39
48: ; preds = %39
%49 = trunc i64 %44 to i32
br label %50
50: ; preds = %48, %32
%51 = phi i32 [ %25, %32 ], [ %49, %48 ]
%52 = tail call i32 @fclose(i32* %27)
%53 = icmp eq i32 %51, 0
br i1 %53, label %76, label %54
54: ; preds = %50
%55 = zext i32 %51 to i64
br label %59
56: ; preds = %73, %59
%57 = add nuw nsw i64 %61, 1
%58 = icmp eq i64 %62, %55
br i1 %58, label %76, label %59
59: ; preds = %54, %56
%60 = phi i64 [ 0, %54 ], [ %62, %56 ]
%61 = phi i64 [ 1, %54 ], [ %57, %56 ]
%62 = add nuw nsw i64 %60, 1
%63 = icmp ult i64 %62, %55
br i1 %63, label %64, label %56
64: ; preds = %59
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %60
br label %66
66: ; preds = %64, %73
%67 = phi i64 [ %61, %64 ], [ %74, %73 ]
%68 = load i8, i8* %65
%69 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %67
%70 = load i8, i8* %69
%71 = icmp sgt i8 %68, %70
br i1 %71, label %72, label %73
72: ; preds = %66
store i8 %70, i8* %65
store i8 %68, i8* %69
br label %73
73: ; preds = %66, %72
%74 = add nuw nsw i64 %67, 1
%75 = icmp eq i64 %74, %55
br i1 %75, label %56, label %66
76: ; preds = %56, %50
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.11, i64 0, i64 0))
%78 = tail call i32* @fopen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br i1 %53, label %89, label %79
79: ; preds = %76
%80 = zext i32 %51 to i64
br label %81
81: ; preds = %79, %81
%82 = phi i64 [ 0, %79 ], [ %87, %81 ]
%83 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %82
%84 = load i8, i8* %83
%85 = tail call i32 @putc(i8 signext %84, i32* %78)
%86 = tail call i32 @putchar(i8 signext %84)
%87 = add nuw nsw i64 %82, 1
%88 = icmp eq i64 %87, %80
br i1 %88, label %89, label %81
89: ; preds = %81, %76
%90 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
%91 = tail call i32 @fclose(i32* %78)
ret i32 0
}