#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 *allocMemory(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
unsigned long long checkFileContent(FILE *gridFile, char *fileName) {
  char *row;
  unsigned long long rowLen = 0;
  unsigned long long checkIndex = 0;
  unsigned long long rowCounter = 0;
  row = allocMemory(100000000);
  while (NULL != fgets(row, 100000000, gridFile)) {
    while ('\0' != row[checkIndex]) {
      if (row[checkIndex] != '-' && row[checkIndex] != '*' &&
          row[checkIndex] != '\n') {
        printf("\nError: Processed file %s has character(s) other than \"*\" "
               "or \"-\"",
               fileName);
        if ('\0' == row[checkIndex]) {
          printf("\n[DEBUG] \'\\0\' == row[checkIndex] =(\n");
        }
        printf("\n(row #%d has character(%d) ", rowCounter + 1, row[checkIndex],
               checkIndex);
        printf("@ column %d)\n\n", checkIndex);
        free(row);
        fclose(gridFile);
        exit(0);
      }
      checkIndex++;
    }
    if ('\n' == row[checkIndex - 1]) {
      checkIndex--;
    }
    printf("\ncheckIndex == %d after while\n\n", checkIndex);
    if (checkIndex > 10) {
      printf("\nError: Processed file %s has too long row of characters\n",
             fileName);
      printf("Maximum allowed amount of characters per row is: %d\n", 10);
      printf("(row #%d had ", rowCounter + 1);
      printf("%d characters)\n\n", checkIndex);
      free(row);
      fclose(gridFile);
      exit(0);
    }
    if (0 == checkIndex) {
      printf("\nError: Processed file %s has an empty row\n", fileName);
      free(row);
      fclose(gridFile);
      exit(0);
    }
    if (0 == rowLen) {
      rowLen = checkIndex;
    }
    if (checkIndex != rowLen) {
      printf("\nError: Processed file %s has rows with different lengths\n",
             fileName);
      printf("(row #%d)\n", rowCounter + 1);
      free(row);
      fclose(gridFile);
      exit(0);
    }
    rowCounter++;
    checkIndex = 0;
  }
  free(row);
  rewind(gridFile);
  return rowLen;
}


x86 assembly (clang, -O0):
<checkFileContent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    $0x5f5e100,%edi
call   1080 <allocMemory@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x5f5e100,%esi
call   1070 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1417 <checkFileContent+0x2a7>
jmp    11cb <checkFileContent+0x5b>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     12b8 <checkFileContent+0x148>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
je     12a7 <checkFileContent+0x137>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
je     12a7 <checkFileContent+0x137>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     12a7 <checkFileContent+0x137>
mov    -0x10(%rbp),%rsi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1256 <checkFileContent+0xe6>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
mov    -0x28(%rbp),%rcx
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11cb <checkFileContent+0x5b>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    12e1 <checkFileContent+0x171>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpq   $0xa,-0x28(%rbp)
jbe    1364 <checkFileContent+0x1f4>
mov    -0x10(%rbp),%rsi
lea    0xda9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdd5(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rsi
add    $0x1,%rsi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1090 <exit@plt>
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    139b <checkFileContent+0x22b>
mov    -0x10(%rbp),%rsi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1090 <exit@plt>
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    13af <checkFileContent+0x23f>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     13fe <checkFileContent+0x28e>
mov    -0x10(%rbp),%rsi
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%rsi
add    $0x1,%rsi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
jmp    11a6 <checkFileContent+0x36>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1060 <rewind@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkFileContent>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbp
mov    $0x5f5e100,%edi
call   1090 <allocMemory@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5f5e100,%esi
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
je     127b <checkFileContent+0xfb>
mov    %r14,0x10(%rsp)
mov    $0x1,%r15d
lea    0xe9c(%rip),%rbp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %r12d,%r12d
jmp    11f8 <checkFileContent+0x78>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0xa,%al
jne    1210 <checkFileContent+0x90>
add    $0x1,%r12
movzbl (%rbx,%r12,1),%eax
cmp    $0x29,%al
jle    11f0 <checkFileContent+0x70>
cmp    $0x2a,%al
je     11f4 <checkFileContent+0x74>
cmp    $0x2d,%al
je     11f4 <checkFileContent+0x74>
jmp    12a2 <checkFileContent+0x122>
xchg   %ax,%ax
test   %al,%al
jne    12a2 <checkFileContent+0x122>
lea    -0x1(%r12),%r13
cmpb   $0xa,-0x1(%rbx,%r12,1)
cmovne %r12,%r13
mov    %rbp,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0xb,%r13
jae    130e <checkFileContent+0x18e>
test   %r13,%r13
je     1351 <checkFileContent+0x1d1>
test   %r14,%r14
cmove  %r13,%r14
cmp    %r14,%r13
jne    135f <checkFileContent+0x1df>
add    $0x1,%r15
mov    %rbx,%rdi
mov    $0x5f5e100,%esi
mov    0x8(%rsp),%rdx
call   1080 <fgets@plt>
mov    %r13,%r14
test   %rax,%rax
jne    11e0 <checkFileContent+0x60>
jmp    127e <checkFileContent+0xfe>
xor    %r13d,%r13d
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1070 <rewind@plt>
mov    %r13,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd57(%rip),%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rbx,%r12,1),%al
test   %al,%al
jne    12cd <checkFileContent+0x14d>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx,%r12,1),%al
movsbl %al,%edx
lea    0xd6a(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd73(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
lea    0xd78(%rip),%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd9f(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdc1(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdbe(%rip),%rdi
mov    %r13,%rsi
jmp    12ee <checkFileContent+0x16e>
lea    0xdc3(%rip),%rdi
mov    0x10(%rsp),%rsi
jmp    12ee <checkFileContent+0x16e>
lea    0xde1(%rip),%rdi
mov    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe09(%rip),%rdi
mov    %r15,%rsi
jmp    12ee <checkFileContent+0x16e>

LLVM IR (-O0):
@.str = [65 x i8] c"\0AError: Processed file %s has character(s) other than \22*\22 or \22-\22\00"
@.str.1 = [37 x i8] c"\0A[DEBUG] '\\0' == row[checkIndex] =(\0A\00"
@.str.2 = [29 x i8] c"\0A(row #%d has character(%d) \00"
@.str.3 = [15 x i8] c"@ column %d)\0A\0A\00"
@.str.4 = [32 x i8] c"\0AcheckIndex == %d after while\0A\0A\00"
@.str.5 = [58 x i8] c"\0AError: Processed file %s has too long row of characters\0A\00"
@.str.6 = [53 x i8] c"Maximum allowed amount of characters per row is: %d\0A\00"
@.str.7 = [14 x i8] c"(row #%d had \00"
@.str.8 = [17 x i8] c"%d characters)\0A\0A\00"
@.str.9 = [44 x i8] c"\0AError: Processed file %s has an empty row\0A\00"
@.str.10 = [59 x i8] c"\0AError: Processed file %s has rows with different lengths\0A\00"
@.str.11 = [11 x i8] c"(row #%d)\0A\00"
define i64 @checkFileContent(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %3
store i8* %1, i8** %4
store i64 0, i64* %6
store i64 0, i64* %7
store i64 0, i64* %8
%9 = call i8* @allocMemory(i32 100000000)
store i8* %9, i8** %5
br label %10
10: ; preds = %136, %2
%11 = load i8*, i8** %5
%12 = load i32*, i32** %3
%13 = call i32* @fgets(i8* %11, i32 100000000, i32* %12)
%14 = icmp ne i32* null, %13
br i1 %14, label %15, label %139
15: ; preds = %10
br label %16
16: ; preds = %72, %15
%17 = load i8*, i8** %5
%18 = load i64, i64* %7
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 0, %21
br i1 %22, label %23, label %75
23: ; preds = %16
%24 = load i8*, i8** %5
%25 = load i64, i64* %7
%26 = getelementptr inbounds i8, i8* %24, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 45
br i1 %29, label %30, label %72
30: ; preds = %23
%31 = load i8*, i8** %5
%32 = load i64, i64* %7
%33 = getelementptr inbounds i8, i8* %31, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 42
br i1 %36, label %37, label %72
37: ; preds = %30
%38 = load i8*, i8** %5
%39 = load i64, i64* %7
%40 = getelementptr inbounds i8, i8* %38, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 10
br i1 %43, label %44, label %72
44: ; preds = %37
%45 = load i8*, i8** %4
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %45)
%47 = load i8*, i8** %5
%48 = load i64, i64* %7
%49 = getelementptr inbounds i8, i8* %47, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 0, %51
br i1 %52, label %53, label %55
53: ; preds = %44
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %55
55: ; preds = %53, %44
%56 = load i64, i64* %8
%57 = add i64 %56, 1
%58 = load i8*, i8** %5
%59 = load i64, i64* %7
%60 = getelementptr inbounds i8, i8* %58, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = load i64, i64* %7
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i64 %57, i32 %62, i64 %63)
%65 = load i64, i64* %7
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i64 %65)
%67 = load i8*, i8** %5
%68 = call i32 @free(i8* %67)
%69 = load i32*, i32** %3
%70 = call i32 @fclose(i32* %69)
%71 = call i32 @exit(i32 0)
unreachable
72: ; preds = %37, %30, %23
%73 = load i64, i64* %7
%74 = add i64 %73, 1
store i64 %74, i64* %7
br label %16
75: ; preds = %16
%76 = load i8*, i8** %5
%77 = load i64, i64* %7
%78 = sub i64 %77, 1
%79 = getelementptr inbounds i8, i8* %76, i64 %78
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 10, %81
br i1 %82, label %83, label %86
83: ; preds = %75
%84 = load i64, i64* %7
%85 = add i64 %84, -1
store i64 %85, i64* %7
br label %86
86: ; preds = %83, %75
%87 = load i64, i64* %7
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i64 %87)
%89 = load i64, i64* %7
%90 = icmp ugt i64 %89, 10
br i1 %90, label %91, label %105
91: ; preds = %86
%92 = load i8*, i8** %4
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i8* %92)
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 10)
%95 = load i64, i64* %8
%96 = add i64 %95, 1
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i64 %96)
%98 = load i64, i64* %7
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i64 %98)
%100 = load i8*, i8** %5
%101 = call i32 @free(i8* %100)
%102 = load i32*, i32** %3
%103 = call i32 @fclose(i32* %102)
%104 = call i32 @exit(i32 0)
unreachable
105: ; preds = %86
%106 = load i64, i64* %7
%107 = icmp eq i64 0, %106
br i1 %107, label %108, label %116
108: ; preds = %105
%109 = load i8*, i8** %4
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0), i8* %109)
%111 = load i8*, i8** %5
%112 = call i32 @free(i8* %111)
%113 = load i32*, i32** %3
%114 = call i32 @fclose(i32* %113)
%115 = call i32 @exit(i32 0)
unreachable
116: ; preds = %105
%117 = load i64, i64* %6
%118 = icmp eq i64 0, %117
br i1 %118, label %119, label %121
119: ; preds = %116
%120 = load i64, i64* %7
store i64 %120, i64* %6
br label %121
121: ; preds = %119, %116
%122 = load i64, i64* %7
%123 = load i64, i64* %6
%124 = icmp ne i64 %122, %123
br i1 %124, label %125, label %136
125: ; preds = %121
%126 = load i8*, i8** %4
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.10, i64 0, i64 0), i8* %126)
%128 = load i64, i64* %8
%129 = add i64 %128, 1
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i64 %129)
%131 = load i8*, i8** %5
%132 = call i32 @free(i8* %131)
%133 = load i32*, i32** %3
%134 = call i32 @fclose(i32* %133)
%135 = call i32 @exit(i32 0)
unreachable
136: ; preds = %121
%137 = load i64, i64* %8
%138 = add i64 %137, 1
store i64 %138, i64* %8
store i64 0, i64* %7
br label %10
139: ; preds = %10
%140 = load i8*, i8** %5
%141 = call i32 @free(i8* %140)
%142 = load i32*, i32** %3
%143 = call i32 @rewind(i32* %142)
%144 = load i64, i64* %6
ret i64 %144
}

LLVM IR (-O2):
@.str = [65 x i8] c"\0AError: Processed file %s has character(s) other than \22*\22 or \22-\22\00"
@.str.2 = [29 x i8] c"\0A(row #%d has character(%d) \00"
@.str.3 = [15 x i8] c"@ column %d)\0A\0A\00"
@.str.4 = [32 x i8] c"\0AcheckIndex == %d after while\0A\0A\00"
@.str.5 = [58 x i8] c"\0AError: Processed file %s has too long row of characters\0A\00"
@.str.6 = [53 x i8] c"Maximum allowed amount of characters per row is: %d\0A\00"
@.str.7 = [14 x i8] c"(row #%d had \00"
@.str.8 = [17 x i8] c"%d characters)\0A\0A\00"
@.str.9 = [44 x i8] c"\0AError: Processed file %s has an empty row\0A\00"
@.str.10 = [59 x i8] c"\0AError: Processed file %s has rows with different lengths\0A\00"
@.str.11 = [11 x i8] c"(row #%d)\0A\00"
@str = [36 x i8] c"\0A[DEBUG] '\\0' == row[checkIndex] =(\00"
define i64 @checkFileContent(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @allocMemory(i32 100000000)
%4 = tail call i32* @fgets(i8* %3, i32 100000000, i32* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %68, label %6
6: ; preds = %2, %64
%7 = phi i64 [ %65, %64 ], [ 1, %2 ]
%8 = phi i64 [ %36, %64 ], [ 0, %2 ]
br label %9
9: ; preds = %6, %29
%10 = phi i64 [ %30, %29 ], [ 0, %6 ]
%11 = getelementptr inbounds i8, i8* %3, i64 %10
%12 = load i8, i8* %11
switch i8 %12, label %13 [
i8 0, label %31
i8 45, label %29
i8 42, label %29
i8 10, label %29
]
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %3, i64 %10
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %1)
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%20 = load i8, i8* %14
br label %21
21: ; preds = %18, %13
%22 = phi i8 [ %20, %18 ], [ %16, %13 ]
%23 = sext i8 %22 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i64 %7, i32 %23, i64 %10)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i64 %10)
%26 = tail call i32 @free(i8* %3)
%27 = tail call i32 @fclose(i32* %0)
%28 = tail call i32 @exit(i32 0)
unreachable
29: ; preds = %9, %9, %9
%30 = add i64 %10, 1
br label %9
31: ; preds = %9
%32 = add i64 %10, -1
%33 = getelementptr inbounds i8, i8* %3, i64 %32
%34 = load i8, i8* %33
%35 = icmp eq i8 %34, 10
%36 = select i1 %35, i64 %32, i64 %10
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i64 %36)
%38 = icmp ugt i64 %36, 10
br i1 %38, label %39, label %47
39: ; preds = %31
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 10)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i64 %7)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i64 %36)
%44 = tail call i32 @free(i8* %3)
%45 = tail call i32 @fclose(i32* %0)
%46 = tail call i32 @exit(i32 0)
unreachable
47: ; preds = %31
%48 = icmp eq i64 %36, 0
br i1 %48, label %49, label %54
49: ; preds = %47
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%51 = tail call i32 @free(i8* %3)
%52 = tail call i32 @fclose(i32* %0)
%53 = tail call i32 @exit(i32 0)
unreachable
54: ; preds = %47
%55 = icmp eq i64 %8, 0
%56 = select i1 %55, i64 %36, i64 %8
%57 = icmp eq i64 %36, %56
br i1 %57, label %64, label %58
58: ; preds = %54
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.10, i64 0, i64 0), i8* %1)
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i64 %7)
%61 = tail call i32 @free(i8* %3)
%62 = tail call i32 @fclose(i32* %0)
%63 = tail call i32 @exit(i32 0)
unreachable
64: ; preds = %54
%65 = add i64 %7, 1
%66 = tail call i32* @fgets(i8* %3, i32 100000000, i32* %0)
%67 = icmp eq i32* %66, null
br i1 %67, label %68, label %6
68: ; preds = %64, %2
%69 = phi i64 [ 0, %2 ], [ %36, %64 ]
%70 = tail call i32 @free(i8* %3)
%71 = tail call i32 @rewind(i32* %0)
ret i64 %69
}