#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;
char *calloc(int /*<<< orphan*/, int);
scalar_t__ compareString(char *, char *);
char *copyString(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ free(char *);
char *getCombinedFilename(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
size_t strlen(char *);
void analyzeWordsCount(char *fName) {
  FILE *fpIn;
  fpIn = fopen(fName, "r");
  char temp;
  int charCount = 0;
  char *string = calloc(0, sizeof(char));
  char *prevString = calloc(0, sizeof(char));
  int matchCount = 1;
  FILE *fpOut;
  char *fNameCombinedOutput = getCombinedFilename(fName);
  fpOut = fopen(fNameCombinedOutput, "w+");
  while ((temp = fgetc(fpIn)) != EOF) {
    if (temp == '\n') {
      if (charCount > 0) {
        charCount = 0;
        if (strlen(prevString) <= 0) {
          string[strlen(string)] = '\0';
          printf("the first record [%s]-->\n", string);
          prevString = copyString(string);
          prevString[strlen(prevString)] = '\0';
        } else {
          if (compareString(prevString, string) != 0) {
            prevString[strlen(prevString)] = '\0';
            printf("no more match found for [%s] --> %d\n", prevString,
                   matchCount);
            fprintf(fpOut, "%s,%d\n", prevString, matchCount);
            matchCount = 1;
            string[strlen(string)] = '\0';
            prevString = copyString(string);
            prevString[strlen(prevString)] = '\0';
          } else {
            matchCount++;
            printf("a previous match is found for [%s]-->\n", string);
          }
        }
        free(string);
        string = calloc(0, sizeof(char));
      }
    } else {
      if (charCount == 0) {
        free(string);
        string = calloc(0, sizeof(char));
      }
      string[charCount] = temp;
      charCount++;
    }
  }
  if (matchCount <= 1) {
    printf("no more match found for [%s] --> %d\n", prevString, matchCount);
    fprintf(fpOut, "%s,%d\n", prevString, matchCount);
  } else {
    printf("a previous match is found for [%s]-->\n", string);
    fprintf(fpOut, "%s,%d\n", string, matchCount);
  }
  free(string);
  free(prevString);
  free(fNameCombinedOutput);
  fclose(fpIn);
  fclose(fpOut);
}


x86 assembly (clang, -O0):
<analyzeWordsCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,-0x20(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
call   10c0 <getCombinedFilename@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
mov    0x2db3(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     13fa <analyzeWordsCount+0x24a>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    13bb <analyzeWordsCount+0x20b>
cmpl   $0x0,-0x18(%rbp)
jle    13b6 <analyzeWordsCount+0x206>
movl   $0x0,-0x18(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x0,%rax
ja     12cd <analyzeWordsCount+0x11d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rsi
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <copyString@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
jmp    139d <analyzeWordsCount+0x1ed>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <compareString@plt>
cmp    $0x0,%rax
je     137d <analyzeWordsCount+0x1cd>
mov    -0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
lea    0xd1d(%rip),%rsi
call   10b0 <fprintf@plt>
movl   $0x1,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
call   1040 <copyString@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
jmp    1398 <analyzeWordsCount+0x1e8>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xcba(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    139d <analyzeWordsCount+0x1ed>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,-0x20(%rbp)
jmp    13f5 <analyzeWordsCount+0x245>
cmpl   $0x0,-0x18(%rbp)
jne    13de <analyzeWordsCount+0x22e>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x20(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    121f <analyzeWordsCount+0x6f>
cmpl   $0x1,-0x2c(%rbp)
jg     1435 <analyzeWordsCount+0x285>
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    0xc0d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
lea    0xc19(%rip),%rsi
call   10b0 <fprintf@plt>
jmp    145e <analyzeWordsCount+0x2ae>
mov    -0x20(%rbp),%rsi
lea    0xc0b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
lea    0xbeb(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<analyzeWordsCount>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
lea    0xe38(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r12
mov    $0x1,%r13d
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,%rbp
mov    %r14,%rdi
call   10c0 <getCombinedFilename@plt>
mov    %rax,%r15
lea    0xdfc(%rip),%rsi
mov    %rax,%rdi
call   10d0 <fopen@plt>
mov    %rax,0x8(%rsp)
mov    %r12,%rdi
call   1090 <fgetc@plt>
mov    %eax,%r14d
mov    0x2dc3(%rip),%rax
cmp    (%rax),%r14b
je     138e <analyzeWordsCount+0x1de>
mov    %r15,0x10(%rsp)
mov    $0x1,%r13d
xor    %r15d,%r15d
jmp    126f <analyzeWordsCount+0xbf>
xchg   %ax,%ax
test   %r15d,%r15d
je     12fc <analyzeWordsCount+0x14c>
movslq %r15d,%rax
mov    %r14b,(%rbx,%rax,1)
add    $0x1,%r15d
mov    %r12,%rdi
call   1090 <fgetc@plt>
mov    %eax,%r14d
mov    0x2d82(%rip),%rax
cmp    (%rax),%r14b
je     1383 <analyzeWordsCount+0x1d3>
cmp    $0xa,%r14b
jne    1240 <analyzeWordsCount+0x90>
test   %r15d,%r15d
jle    1254 <analyzeWordsCount+0xa4>
cmpb   $0x0,0x0(%rbp)
je     1318 <analyzeWordsCount+0x168>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <compareString@plt>
test   %rax,%rax
je     134f <analyzeWordsCount+0x19f>
mov    %rbp,%rdi
call   1070 <strlen@plt>
movb   $0x0,0x0(%rbp,%rax,1)
lea    0xd73(%rip),%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x8(%rsp),%rdi
lea    0xd7f(%rip),%rsi
mov    %rbp,%rdx
mov    %r13d,%ecx
call   10b0 <fprintf@plt>
mov    %rbx,%rdi
call   1070 <strlen@plt>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rdi
call   1040 <copyString@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1070 <strlen@plt>
movb   $0x0,0x0(%rbp,%rax,1)
mov    $0x1,%r13d
jmp    1364 <analyzeWordsCount+0x1b4>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,%rbx
jmp    1249 <analyzeWordsCount+0x99>
mov    %rbx,%rdi
call   1070 <strlen@plt>
movb   $0x0,(%rbx,%rax,1)
lea    0xcda(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1040 <copyString@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1070 <strlen@plt>
movb   $0x0,0x0(%rbp,%rax,1)
jmp    1364 <analyzeWordsCount+0x1b4>
add    $0x1,%r13d
lea    0xcf1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %r15d,%r15d
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,%rbx
jmp    1254 <analyzeWordsCount+0xa4>
cmp    $0x1,%r13d
jg     13be <analyzeWordsCount+0x20e>
mov    0x10(%rsp),%r15
mov    0x8(%rsp),%r14
lea    0xc85(%rip),%rdi
mov    %rbp,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc96(%rip),%rsi
mov    %r14,%rdi
mov    %rbp,%rdx
mov    %r13d,%ecx
call   10b0 <fprintf@plt>
jmp    13ee <analyzeWordsCount+0x23e>
lea    0xc86(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc6e(%rip),%rsi
mov    0x8(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %r13d,%ecx
call   10b0 <fprintf@plt>
mov    0x10(%rsp),%r15
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"w+\00"
@EOF = global i8 0
@.str.2 = [26 x i8] c"the first record [%s]-->\0A\00"
@.str.3 = [37 x i8] c"no more match found for [%s] --> %d\0A\00"
@.str.4 = [7 x i8] c"%s,%d\0A\00"
@.str.5 = [39 x i8] c"a previous match is found for [%s]-->\0A\00"
define void @analyzeWordsCount(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %2
%11 = load i8*, i8** %2
%12 = call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %12, i32** %3
store i32 0, i32* %5
%13 = call i8* @calloc(i32 0, i32 1)
store i8* %13, i8** %6
%14 = call i8* @calloc(i32 0, i32 1)
store i8* %14, i8** %7
store i32 1, i32* %8
%15 = load i8*, i8** %2
%16 = call i8* @getCombinedFilename(i8* %15)
store i8* %16, i8** %10
%17 = load i8*, i8** %10
%18 = call i32* @fopen(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %18, i32** %9
br label %19
19: ; preds = %103, %1
%20 = load i32*, i32** %3
%21 = call signext i8 @fgetc(i32* %20)
store i8 %21, i8* %4
%22 = sext i8 %21 to i32
%23 = load i8, i8* @EOF
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %22, %24
br i1 %25, label %26, label %104
26: ; preds = %19
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 10
br i1 %29, label %30, label %88
30: ; preds = %26
%31 = load i32, i32* %5
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %87
33: ; preds = %30
store i32 0, i32* %5
%34 = load i8*, i8** %7
%35 = call i64 @strlen(i8* %34)
%36 = icmp ule i64 %35, 0
br i1 %36, label %37, label %50
37: ; preds = %33
%38 = load i8*, i8** %6
%39 = load i8*, i8** %6
%40 = call i64 @strlen(i8* %39)
%41 = getelementptr inbounds i8, i8* %38, i64 %40
store i8 0, i8* %41
%42 = load i8*, i8** %6
%43 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %42)
%44 = load i8*, i8** %6
%45 = call i8* @copyString(i8* %44)
store i8* %45, i8** %7
%46 = load i8*, i8** %7
%47 = load i8*, i8** %7
%48 = call i64 @strlen(i8* %47)
%49 = getelementptr inbounds i8, i8* %46, i64 %48
store i8 0, i8* %49
br label %83
50: ; preds = %33
%51 = load i8*, i8** %7
%52 = load i8*, i8** %6
%53 = call i64 @compareString(i8* %51, i8* %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %77
55: ; preds = %50
%56 = load i8*, i8** %7
%57 = load i8*, i8** %7
%58 = call i64 @strlen(i8* %57)
%59 = getelementptr inbounds i8, i8* %56, i64 %58
store i8 0, i8* %59
%60 = load i8*, i8** %7
%61 = load i32, i32* %8
%62 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* %60, i32 %61)
%63 = load i32*, i32** %9
%64 = load i8*, i8** %7
%65 = load i32, i32* %8
%66 = call i32 @fprintf(i32* %63, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %64, i32 %65)
store i32 1, i32* %8
%67 = load i8*, i8** %6
%68 = load i8*, i8** %6
%69 = call i64 @strlen(i8* %68)
%70 = getelementptr inbounds i8, i8* %67, i64 %69
store i8 0, i8* %70
%71 = load i8*, i8** %6
%72 = call i8* @copyString(i8* %71)
store i8* %72, i8** %7
%73 = load i8*, i8** %7
%74 = load i8*, i8** %7
%75 = call i64 @strlen(i8* %74)
%76 = getelementptr inbounds i8, i8* %73, i64 %75
store i8 0, i8* %76
br label %82
77: ; preds = %50
%78 = load i32, i32* %8
%79 = add nsw i32 %78, 1
store i32 %79, i32* %8
%80 = load i8*, i8** %6
%81 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %80)
br label %82
82: ; preds = %77, %55
br label %83
83: ; preds = %82, %37
%84 = load i8*, i8** %6
%85 = call i32 @free(i8* %84)
%86 = call i8* @calloc(i32 0, i32 1)
store i8* %86, i8** %6
br label %87
87: ; preds = %83, %30
br label %103
88: ; preds = %26
%89 = load i32, i32* %5
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %88
%92 = load i8*, i8** %6
%93 = call i32 @free(i8* %92)
%94 = call i8* @calloc(i32 0, i32 1)
store i8* %94, i8** %6
br label %95
95: ; preds = %91, %88
%96 = load i8, i8* %4
%97 = load i8*, i8** %6
%98 = load i32, i32* %5
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %97, i64 %99
store i8 %96, i8* %100
%101 = load i32, i32* %5
%102 = add nsw i32 %101, 1
store i32 %102, i32* %5
br label %103
103: ; preds = %95, %87
br label %19
104: ; preds = %19
%105 = load i32, i32* %8
%106 = icmp sle i32 %105, 1
br i1 %106, label %107, label %115
107: ; preds = %104
%108 = load i8*, i8** %7
%109 = load i32, i32* %8
%110 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* %108, i32 %109)
%111 = load i32*, i32** %9
%112 = load i8*, i8** %7
%113 = load i32, i32* %8
%114 = call i32 @fprintf(i32* %111, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %112, i32 %113)
br label %122
115: ; preds = %104
%116 = load i8*, i8** %6
%117 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %116)
%118 = load i32*, i32** %9
%119 = load i8*, i8** %6
%120 = load i32, i32* %8
%121 = call i32 @fprintf(i32* %118, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %119, i32 %120)
br label %122
122: ; preds = %115, %107
%123 = load i8*, i8** %6
%124 = call i32 @free(i8* %123)
%125 = load i8*, i8** %7
%126 = call i32 @free(i8* %125)
%127 = load i8*, i8** %10
%128 = call i32 @free(i8* %127)
%129 = load i32*, i32** %3
%130 = call i32 @fclose(i32* %129)
%131 = load i32*, i32** %9
%132 = call i32 @fclose(i32* %131)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"w+\00"
@EOF = global i8 0
@.str.2 = [26 x i8] c"the first record [%s]-->\0A\00"
@.str.3 = [37 x i8] c"no more match found for [%s] --> %d\0A\00"
@.str.4 = [7 x i8] c"%s,%d\0A\00"
@.str.5 = [39 x i8] c"a previous match is found for [%s]-->\0A\00"
define void @analyzeWordsCount(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @calloc(i32 0, i32 1)
%4 = tail call i8* @calloc(i32 0, i32 1)
%5 = tail call i8* @getCombinedFilename(i8* %0)
%6 = tail call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call signext i8 @fgetc(i32* %2)
%8 = load i8, i8* @EOF
%9 = icmp eq i8 %7, %8
br i1 %9, label %70, label %10
10: ; preds = %1, %60
%11 = phi i8 [ %65, %60 ], [ %7, %1 ]
%12 = phi i32 [ %64, %60 ], [ 0, %1 ]
%13 = phi i8* [ %63, %60 ], [ %3, %1 ]
%14 = phi i32 [ %62, %60 ], [ 1, %1 ]
%15 = phi i8* [ %61, %60 ], [ %4, %1 ]
%16 = icmp eq i8 %11, 10
br i1 %16, label %17, label %50
17: ; preds = %10
%18 = icmp sgt i32 %12, 0
br i1 %18, label %19, label %60
19: ; preds = %17
%20 = load i8, i8* %15
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %19
%23 = tail call i64 @strlen(i8* dereferenceable(1) %13)
%24 = getelementptr inbounds i8, i8* %13, i64 %23
store i8 0, i8* %24
%25 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%26 = tail call i8* @copyString(i8* %13)
%27 = tail call i64 @strlen(i8* dereferenceable(1) %26)
%28 = getelementptr inbounds i8, i8* %26, i64 %27
store i8 0, i8* %28
br label %45
29: ; preds = %19
%30 = tail call i64 @compareString(i8* %15, i8* %13)
%31 = icmp eq i64 %30, 0
br i1 %31, label %42, label %32
32: ; preds = %29
%33 = tail call i64 @strlen(i8* %15)
%34 = getelementptr inbounds i8, i8* %15, i64 %33
store i8 0, i8* %34
%35 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* %15, i32 %14)
%36 = tail call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %15, i32 %14)
%37 = tail call i64 @strlen(i8* dereferenceable(1) %13)
%38 = getelementptr inbounds i8, i8* %13, i64 %37
store i8 0, i8* %38
%39 = tail call i8* @copyString(i8* %13)
%40 = tail call i64 @strlen(i8* dereferenceable(1) %39)
%41 = getelementptr inbounds i8, i8* %39, i64 %40
store i8 0, i8* %41
br label %45
42: ; preds = %29
%43 = add nsw i32 %14, 1
%44 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %13)
br label %45
45: ; preds = %32, %42, %22
%46 = phi i8* [ %26, %22 ], [ %39, %32 ], [ %15, %42 ]
%47 = phi i32 [ %14, %22 ], [ 1, %32 ], [ %43, %42 ]
%48 = tail call i32 @free(i8* %13)
%49 = tail call i8* @calloc(i32 0, i32 1)
br label %60
50: ; preds = %10
%51 = icmp eq i32 %12, 0
br i1 %51, label %52, label %55
52: ; preds = %50
%53 = tail call i32 @free(i8* %13)
%54 = tail call i8* @calloc(i32 0, i32 1)
br label %55
55: ; preds = %52, %50
%56 = phi i8* [ %54, %52 ], [ %13, %50 ]
%57 = sext i32 %12 to i64
%58 = getelementptr inbounds i8, i8* %56, i64 %57
store i8 %11, i8* %58
%59 = add nsw i32 %12, 1
br label %60
60: ; preds = %17, %45, %55
%61 = phi i8* [ %46, %45 ], [ %15, %17 ], [ %15, %55 ]
%62 = phi i32 [ %47, %45 ], [ %14, %17 ], [ %14, %55 ]
%63 = phi i8* [ %49, %45 ], [ %13, %17 ], [ %56, %55 ]
%64 = phi i32 [ 0, %45 ], [ %12, %17 ], [ %59, %55 ]
%65 = tail call signext i8 @fgetc(i32* %2)
%66 = load i8, i8* @EOF
%67 = icmp eq i8 %65, %66
br i1 %67, label %68, label %10
68: ; preds = %60
%69 = icmp slt i32 %62, 2
br i1 %69, label %70, label %76
70: ; preds = %1, %68
%71 = phi i8* [ %63, %68 ], [ %3, %1 ]
%72 = phi i32 [ %62, %68 ], [ 1, %1 ]
%73 = phi i8* [ %61, %68 ], [ %4, %1 ]
%74 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* %73, i32 %72)
%75 = tail call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %73, i32 %72)
br label %79
76: ; preds = %68
%77 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %63)
%78 = tail call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %63, i32 %62)
br label %79
79: ; preds = %76, %70
%80 = phi i8* [ %63, %76 ], [ %71, %70 ]
%81 = phi i8* [ %61, %76 ], [ %73, %70 ]
%82 = tail call i32 @free(i8* %80)
%83 = tail call i32 @free(i8* %81)
%84 = tail call i32 @free(i8* %5)
%85 = tail call i32 @fclose(i32* %2)
%86 = tail call i32 @fclose(i32* %6)
ret void
}