; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/ShellPkg/Library (FileBufferRead)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EFI_EDITOR_FILE_BUFFER = type { ptr, i32, ptr, ptr, i64, %struct.EFI_EDITOR_POSITION, %struct.EFI_EDITOR_POSITION, %struct.EFI_EDITOR_POSITION, %struct.EFI_EDITOR_POSITION, i8, i8, i8, ptr }
%struct.EFI_EDITOR_POSITION = type { i64, i64 }
%struct.EFI_FILE_INFO = type { i64, i64, i64, %struct.EFI_TIME, %struct.EFI_TIME, %struct.EFI_TIME, i64, [1 x i16] }
%struct.EFI_TIME = type { i16, i8, i8, i8, i8, i8, i8, i32, i16, i8, i8 }
%struct._EFI_EDITOR_LINE = type { i64, ptr, i64, i64, i32, %struct._LIST_ENTRY }
%struct._LIST_ENTRY = type { ptr, ptr }

@FileBuffer = external dso_local global %struct.EFI_EDITOR_FILE_BUFFER, align 8
@FileBufferNeedRefresh = external dso_local global i8, align 1
@FileBufferMouseNeedRefresh = external dso_local global i8, align 1
@FileBufferOnlyLineNeedRefresh = external dso_local global i8, align 1
@.str.1 = external hidden unnamed_addr constant [163 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i32], align 4
@.str.12 = external hidden unnamed_addr constant [28 x i32], align 4
@.str.13 = external hidden unnamed_addr constant [14 x i32], align 4
@.str.14 = external hidden unnamed_addr constant [47 x i32], align 4
@.str.15 = external hidden unnamed_addr constant [17 x i32], align 4
@.str.16 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.17 = external hidden unnamed_addr constant [14 x i32], align 4

declare ptr @AllocateZeroPool(i64 noundef) #0

declare void @FreePool(ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare zeroext i8 @DebugAssertEnabled() #0

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @FileBufferCreateLine() #2

declare ptr @CatSPrint(ptr noundef, ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @FileBufferSetFileName(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @FileBufferFree() #2

; Function Attrs: nounwind uwtable
define dso_local i64 @FileBufferRead(ptr noundef %0, i8 noundef zeroext %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i8 %1, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store ptr null, ptr %6, align 8, !tbaa !5
  store i64 0, ptr %8, align 8, !tbaa !10
  store i64 0, ptr %14, align 8, !tbaa !10
  store ptr null, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %7, align 4, !tbaa !12
  store ptr null, ptr %15, align 8, !tbaa !5
  store i8 0, ptr %16, align 1, !tbaa !9
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call i64 @ShellOpenFileByName(ptr noundef %21, ptr noundef %15, i64 noundef 1, i64 noundef 0)
  store i64 %22, ptr %17, align 8, !tbaa !10
  %23 = load i64, ptr %17, align 8, !tbaa !10
  %24 = icmp slt i64 %23, 0
  br i1 %24, label %54, label %25

25:                                               ; preds = %2
  store i8 0, ptr %16, align 1, !tbaa !9
  %26 = load ptr, ptr %15, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %30

28:                                               ; preds = %25
  %29 = call i64 @StatusBarSetStatusString(ptr noundef @.str.11)
  store i64 -9223372036854775807, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

30:                                               ; preds = %25
  %31 = load ptr, ptr %15, align 8, !tbaa !5
  %32 = call ptr @ShellGetFileInfo(ptr noundef %31)
  store ptr %32, ptr %19, align 8, !tbaa !5
  %33 = load ptr, ptr %19, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.EFI_FILE_INFO, ptr %33, i32 0, i32 6
  %35 = load i64, ptr %34, align 8, !tbaa !14
  %36 = and i64 %35, 16
  %37 = icmp ne i64 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %30
  %39 = call i64 @StatusBarSetStatusString(ptr noundef @.str.12)
  %40 = load ptr, ptr %19, align 8, !tbaa !5
  call void @FreePool(ptr noundef %40)
  store i64 -9223372036854775806, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

41:                                               ; preds = %30
  %42 = load ptr, ptr %19, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.EFI_FILE_INFO, ptr %42, i32 0, i32 6
  %44 = load i64, ptr %43, align 8, !tbaa !14
  %45 = and i64 %44, 1
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %41
  store i8 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 11), align 2, !tbaa !18
  br label %49

48:                                               ; preds = %41
  store i8 0, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 11), align 2, !tbaa !18
  br label %49

49:                                               ; preds = %48, %47
  %50 = load ptr, ptr %19, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.EFI_FILE_INFO, ptr %50, i32 0, i32 1
  %52 = load i64, ptr %51, align 8, !tbaa !21
  store i64 %52, ptr %14, align 8, !tbaa !10
  %53 = load ptr, ptr %19, align 8, !tbaa !5
  call void @FreePool(ptr noundef %53)
  br label %115

54:                                               ; preds = %2
  %55 = load i64, ptr %17, align 8, !tbaa !10
  %56 = icmp eq i64 %55, -9223372036854775794
  br i1 %56, label %57, label %114

57:                                               ; preds = %54
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = call i64 @ShellOpenFileByName(ptr noundef %58, ptr noundef %15, i64 noundef -9223372036854775805, i64 noundef 0)
  store i64 %59, ptr %17, align 8, !tbaa !10
  %60 = load i64, ptr %17, align 8, !tbaa !10
  %61 = icmp slt i64 %60, 0
  br i1 %61, label %62, label %92

62:                                               ; preds = %57
  %63 = load i64, ptr %17, align 8, !tbaa !10
  %64 = icmp eq i64 %63, -9223372036854775800
  br i1 %64, label %74, label %65

65:                                               ; preds = %62
  %66 = load i64, ptr %17, align 8, !tbaa !10
  %67 = icmp eq i64 %66, -9223372036854775793
  br i1 %67, label %74, label %68

68:                                               ; preds = %65
  %69 = load i64, ptr %17, align 8, !tbaa !10
  %70 = icmp eq i64 %69, -9223372036854775796
  br i1 %70, label %74, label %71

71:                                               ; preds = %68
  %72 = load i64, ptr %17, align 8, !tbaa !10
  %73 = icmp eq i64 %72, -9223372036854775795
  br i1 %73, label %74, label %76

74:                                               ; preds = %71, %68, %65, %62
  %75 = call i64 @StatusBarSetStatusString(ptr noundef @.str.13)
  br label %90

76:                                               ; preds = %71
  %77 = load i64, ptr %17, align 8, !tbaa !10
  %78 = icmp eq i64 %77, -9223372036854775801
  br i1 %78, label %85, label %79

79:                                               ; preds = %76
  %80 = load i64, ptr %17, align 8, !tbaa !10
  %81 = icmp eq i64 %80, -9223372036854775798
  br i1 %81, label %85, label %82

82:                                               ; preds = %79
  %83 = load i64, ptr %17, align 8, !tbaa !10
  %84 = icmp eq i64 %83, -9223372036854775797
  br i1 %84, label %85, label %87

85:                                               ; preds = %82, %79, %76
  %86 = call i64 @StatusBarSetStatusString(ptr noundef @.str.11)
  br label %89

87:                                               ; preds = %82
  %88 = call i64 @StatusBarSetStatusString(ptr noundef @.str.14)
  br label %89

89:                                               ; preds = %87, %85
  br label %90

90:                                               ; preds = %89, %74
  %91 = load i64, ptr %17, align 8, !tbaa !10
  store i64 %91, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

92:                                               ; preds = %57
  %93 = call i64 @ShellDeleteFile(ptr noundef %15)
  store i64 %93, ptr %17, align 8, !tbaa !10
  %94 = load i64, ptr %17, align 8, !tbaa !10
  %95 = icmp eq i64 %94, 2
  br i1 %95, label %96, label %97

96:                                               ; preds = %92
  store i64 -9223372036854775793, ptr %17, align 8, !tbaa !10
  br label %97

97:                                               ; preds = %96, %92
  store ptr null, ptr %15, align 8, !tbaa !5
  %98 = load i64, ptr %17, align 8, !tbaa !10
  %99 = icmp slt i64 %98, 0
  br i1 %99, label %100, label %103

100:                                              ; preds = %97
  %101 = call i64 @StatusBarSetStatusString(ptr noundef @.str.13)
  %102 = load i64, ptr %17, align 8, !tbaa !10
  store i64 %102, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

103:                                              ; preds = %97
  br label %104

104:                                              ; preds = %103
  store i8 1, ptr %16, align 1, !tbaa !9
  store i8 0, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 11), align 2, !tbaa !18
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = load ptr, ptr @FileBuffer, align 8, !tbaa !22
  %107 = call i64 @StrCmp(ptr noundef %105, ptr noundef %106)
  %108 = icmp ne i64 %107, 0
  br i1 %108, label %109, label %112

109:                                              ; preds = %104
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = call i64 @FileBufferSetFileName(ptr noundef %110)
  br label %112

112:                                              ; preds = %109, %104
  %113 = call i64 @FileBufferFree()
  br label %114

114:                                              ; preds = %112, %54
  br label %115

115:                                              ; preds = %114, %49
  %116 = load i8, ptr %16, align 1, !tbaa !9
  %117 = icmp ne i8 %116, 0
  br i1 %117, label %467, label %118

118:                                              ; preds = %115
  %119 = load i64, ptr %14, align 8, !tbaa !10
  %120 = call ptr @AllocateZeroPool(i64 noundef %119)
  store ptr %120, ptr %11, align 8, !tbaa !5
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = icmp eq ptr %121, null
  br i1 %122, label %123, label %124

123:                                              ; preds = %118
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

124:                                              ; preds = %118
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = call i64 @ShellReadFile(ptr noundef %125, ptr noundef %14, ptr noundef %126)
  store i64 %127, ptr %17, align 8, !tbaa !10
  %128 = call i64 @ShellCloseFile(ptr noundef %15)
  store ptr null, ptr %15, align 8, !tbaa !5
  %129 = load i64, ptr %17, align 8, !tbaa !10
  %130 = icmp slt i64 %129, 0
  br i1 %130, label %131, label %141

131:                                              ; preds = %124
  %132 = call i64 @StatusBarSetStatusString(ptr noundef @.str.15)
  br label %133

133:                                              ; preds = %131
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %138

136:                                              ; preds = %133
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %137)
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %136, %133
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139
  store i64 -9223372036854775807, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

141:                                              ; preds = %124
  %142 = load i64, ptr %14, align 8, !tbaa !10
  %143 = icmp eq i64 %142, 0
  br i1 %143, label %144, label %153

144:                                              ; preds = %141
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %150

148:                                              ; preds = %145
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %149)
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %148, %145
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  store i32 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !23
  br label %468

153:                                              ; preds = %141
  %154 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %154, ptr %13, align 8, !tbaa !5
  %155 = load i64, ptr %14, align 8, !tbaa !10
  %156 = icmp ult i64 %155, 2
  br i1 %156, label %157, label %158

157:                                              ; preds = %153
  store i32 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !23
  br label %187

158:                                              ; preds = %153
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  %160 = load i16, ptr %159, align 2, !tbaa !24
  %161 = zext i16 %160 to i32
  %162 = icmp eq i32 %161, 65279
  br i1 %162, label %163, label %185

163:                                              ; preds = %158
  %164 = load i64, ptr %14, align 8, !tbaa !10
  %165 = urem i64 %164, 2
  %166 = icmp ne i64 %165, 0
  br i1 %166, label %167, label %177

167:                                              ; preds = %163
  %168 = call i64 @StatusBarSetStatusString(ptr noundef @.str.16)
  br label %169

169:                                              ; preds = %167
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  %171 = icmp ne ptr %170, null
  br i1 %171, label %172, label %174

172:                                              ; preds = %169
  %173 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %173)
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %174

174:                                              ; preds = %172, %169
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  store i64 -9223372036854775807, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

177:                                              ; preds = %163
  %178 = load i64, ptr %14, align 8, !tbaa !10
  %179 = udiv i64 %178, 2
  store i64 %179, ptr %14, align 8, !tbaa !10
  store i32 2, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !23
  %180 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %180, ptr %12, align 8, !tbaa !5
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = getelementptr inbounds i16, ptr %181, i32 1
  store ptr %182, ptr %12, align 8, !tbaa !5
  %183 = load i64, ptr %14, align 8, !tbaa !10
  %184 = add i64 %183, -1
  store i64 %184, ptr %14, align 8, !tbaa !10
  br label %186

185:                                              ; preds = %158
  store i32 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !23
  br label %186

186:                                              ; preds = %185, %177
  br label %187

187:                                              ; preds = %186, %157
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = load ptr, ptr @FileBuffer, align 8, !tbaa !22
  %190 = call i64 @StrCmp(ptr noundef %188, ptr noundef %189)
  %191 = icmp ne i64 %190, 0
  br i1 %191, label %192, label %195

192:                                              ; preds = %187
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = call i64 @FileBufferSetFileName(ptr noundef %193)
  br label %195

195:                                              ; preds = %192, %187
  %196 = call i64 @FileBufferFree()
  store i64 0, ptr %8, align 8, !tbaa !10
  br label %197

197:                                              ; preds = %455, %195
  %198 = load i64, ptr %8, align 8, !tbaa !10
  %199 = load i64, ptr %14, align 8, !tbaa !10
  %200 = icmp ult i64 %198, %199
  br i1 %200, label %201, label %458

201:                                              ; preds = %197
  store i32 5, ptr %7, align 4, !tbaa !12
  %202 = load i64, ptr %8, align 8, !tbaa !10
  store i64 %202, ptr %10, align 8, !tbaa !10
  br label %203

203:                                              ; preds = %307, %201
  %204 = load i64, ptr %10, align 8, !tbaa !10
  %205 = load i64, ptr %14, align 8, !tbaa !10
  %206 = icmp ult i64 %204, %205
  br i1 %206, label %207, label %310

207:                                              ; preds = %203
  %208 = load i32, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !23
  %209 = icmp eq i32 %208, 1
  br i1 %209, label %210, label %258

210:                                              ; preds = %207
  %211 = load ptr, ptr %13, align 8, !tbaa !5
  %212 = load i64, ptr %10, align 8, !tbaa !10
  %213 = getelementptr inbounds i8, ptr %211, i64 %212
  %214 = load i8, ptr %213, align 1, !tbaa !9
  %215 = zext i8 %214 to i32
  %216 = icmp eq i32 %215, 13
  br i1 %216, label %217, label %233

217:                                              ; preds = %210
  store i32 2, ptr %7, align 4, !tbaa !12
  %218 = load i64, ptr %10, align 8, !tbaa !10
  %219 = load i64, ptr %14, align 8, !tbaa !10
  %220 = sub i64 %219, 1
  %221 = icmp ult i64 %218, %220
  br i1 %221, label %222, label %232

222:                                              ; preds = %217
  %223 = load ptr, ptr %13, align 8, !tbaa !5
  %224 = load i64, ptr %10, align 8, !tbaa !10
  %225 = add i64 %224, 1
  %226 = getelementptr inbounds i8, ptr %223, i64 %225
  %227 = load i8, ptr %226, align 1, !tbaa !9
  %228 = zext i8 %227 to i32
  %229 = icmp eq i32 %228, 10
  br i1 %229, label %230, label %231

230:                                              ; preds = %222
  store i32 3, ptr %7, align 4, !tbaa !12
  br label %231

231:                                              ; preds = %230, %222
  br label %232

232:                                              ; preds = %231, %217
  br label %310

233:                                              ; preds = %210
  %234 = load ptr, ptr %13, align 8, !tbaa !5
  %235 = load i64, ptr %10, align 8, !tbaa !10
  %236 = getelementptr inbounds i8, ptr %234, i64 %235
  %237 = load i8, ptr %236, align 1, !tbaa !9
  %238 = zext i8 %237 to i32
  %239 = icmp eq i32 %238, 10
  br i1 %239, label %240, label %256

240:                                              ; preds = %233
  store i32 1, ptr %7, align 4, !tbaa !12
  %241 = load i64, ptr %10, align 8, !tbaa !10
  %242 = load i64, ptr %14, align 8, !tbaa !10
  %243 = sub i64 %242, 1
  %244 = icmp ult i64 %241, %243
  br i1 %244, label %245, label %255

245:                                              ; preds = %240
  %246 = load ptr, ptr %13, align 8, !tbaa !5
  %247 = load i64, ptr %10, align 8, !tbaa !10
  %248 = add i64 %247, 1
  %249 = getelementptr inbounds i8, ptr %246, i64 %248
  %250 = load i8, ptr %249, align 1, !tbaa !9
  %251 = zext i8 %250 to i32
  %252 = icmp eq i32 %251, 13
  br i1 %252, label %253, label %254

253:                                              ; preds = %245
  store i32 4, ptr %7, align 4, !tbaa !12
  br label %254

254:                                              ; preds = %253, %245
  br label %255

255:                                              ; preds = %254, %240
  br label %310

256:                                              ; preds = %233
  br label %257

257:                                              ; preds = %256
  br label %306

258:                                              ; preds = %207
  %259 = load ptr, ptr %12, align 8, !tbaa !5
  %260 = load i64, ptr %10, align 8, !tbaa !10
  %261 = getelementptr inbounds i16, ptr %259, i64 %260
  %262 = load i16, ptr %261, align 2, !tbaa !24
  %263 = zext i16 %262 to i32
  %264 = icmp eq i32 %263, 13
  br i1 %264, label %265, label %281

265:                                              ; preds = %258
  store i32 2, ptr %7, align 4, !tbaa !12
  %266 = load i64, ptr %10, align 8, !tbaa !10
  %267 = load i64, ptr %14, align 8, !tbaa !10
  %268 = sub i64 %267, 1
  %269 = icmp ult i64 %266, %268
  br i1 %269, label %270, label %280

270:                                              ; preds = %265
  %271 = load ptr, ptr %12, align 8, !tbaa !5
  %272 = load i64, ptr %10, align 8, !tbaa !10
  %273 = add i64 %272, 1
  %274 = getelementptr inbounds i16, ptr %271, i64 %273
  %275 = load i16, ptr %274, align 2, !tbaa !24
  %276 = zext i16 %275 to i32
  %277 = icmp eq i32 %276, 10
  br i1 %277, label %278, label %279

278:                                              ; preds = %270
  store i32 3, ptr %7, align 4, !tbaa !12
  br label %279

279:                                              ; preds = %278, %270
  br label %280

280:                                              ; preds = %279, %265
  br label %310

281:                                              ; preds = %258
  %282 = load ptr, ptr %12, align 8, !tbaa !5
  %283 = load i64, ptr %10, align 8, !tbaa !10
  %284 = getelementptr inbounds i16, ptr %282, i64 %283
  %285 = load i16, ptr %284, align 2, !tbaa !24
  %286 = zext i16 %285 to i32
  %287 = icmp eq i32 %286, 10
  br i1 %287, label %288, label %304

288:                                              ; preds = %281
  store i32 1, ptr %7, align 4, !tbaa !12
  %289 = load i64, ptr %10, align 8, !tbaa !10
  %290 = load i64, ptr %14, align 8, !tbaa !10
  %291 = sub i64 %290, 1
  %292 = icmp ult i64 %289, %291
  br i1 %292, label %293, label %303

293:                                              ; preds = %288
  %294 = load ptr, ptr %12, align 8, !tbaa !5
  %295 = load i64, ptr %10, align 8, !tbaa !10
  %296 = add i64 %295, 1
  %297 = getelementptr inbounds i16, ptr %294, i64 %296
  %298 = load i16, ptr %297, align 2, !tbaa !24
  %299 = zext i16 %298 to i32
  %300 = icmp eq i32 %299, 13
  br i1 %300, label %301, label %302

301:                                              ; preds = %293
  store i32 4, ptr %7, align 4, !tbaa !12
  br label %302

302:                                              ; preds = %301, %293
  br label %303

303:                                              ; preds = %302, %288
  br label %310

304:                                              ; preds = %281
  br label %305

305:                                              ; preds = %304
  br label %306

306:                                              ; preds = %305, %257
  br label %307

307:                                              ; preds = %306
  %308 = load i64, ptr %10, align 8, !tbaa !10
  %309 = add i64 %308, 1
  store i64 %309, ptr %10, align 8, !tbaa !10
  br label %203, !llvm.loop !25

310:                                              ; preds = %303, %280, %255, %232, %203
  %311 = load i32, ptr %7, align 4, !tbaa !12
  %312 = icmp eq i32 %311, 5
  br i1 %312, label %313, label %314

313:                                              ; preds = %310
  store i32 0, ptr %7, align 4, !tbaa !12
  br label %314

314:                                              ; preds = %313, %310
  %315 = load i64, ptr %10, align 8, !tbaa !10
  store i64 %315, ptr %18, align 8, !tbaa !10
  %316 = call ptr @FileBufferCreateLine()
  store ptr %316, ptr %6, align 8, !tbaa !5
  %317 = load ptr, ptr %6, align 8, !tbaa !5
  %318 = icmp eq ptr %317, null
  br i1 %318, label %319, label %328

319:                                              ; preds = %314
  br label %320

320:                                              ; preds = %319
  %321 = load ptr, ptr %11, align 8, !tbaa !5
  %322 = icmp ne ptr %321, null
  br i1 %322, label %323, label %325

323:                                              ; preds = %320
  %324 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %324)
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %325

325:                                              ; preds = %323, %320
  br label %326

326:                                              ; preds = %325
  br label %327

327:                                              ; preds = %326
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

328:                                              ; preds = %314
  %329 = load i64, ptr %8, align 8, !tbaa !10
  %330 = load i64, ptr %10, align 8, !tbaa !10
  %331 = sub i64 %330, %329
  store i64 %331, ptr %10, align 8, !tbaa !10
  br label %332

332:                                              ; preds = %328
  %333 = load ptr, ptr %6, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %333, i32 0, i32 1
  %335 = load ptr, ptr %334, align 8, !tbaa !27
  %336 = icmp ne ptr %335, null
  br i1 %336, label %337, label %343

337:                                              ; preds = %332
  %338 = load ptr, ptr %6, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %338, i32 0, i32 1
  %340 = load ptr, ptr %339, align 8, !tbaa !27
  call void @FreePool(ptr noundef %340)
  %341 = load ptr, ptr %6, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %341, i32 0, i32 1
  store ptr null, ptr %342, align 8, !tbaa !27
  br label %343

343:                                              ; preds = %337, %332
  br label %344

344:                                              ; preds = %343
  br label %345

345:                                              ; preds = %344
  %346 = load i64, ptr %10, align 8, !tbaa !10
  %347 = mul i64 %346, 2
  %348 = add i64 %347, 2
  %349 = call ptr @AllocateZeroPool(i64 noundef %348)
  %350 = load ptr, ptr %6, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %350, i32 0, i32 1
  store ptr %349, ptr %351, align 8, !tbaa !27
  %352 = load ptr, ptr %6, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %352, i32 0, i32 1
  %354 = load ptr, ptr %353, align 8, !tbaa !27
  %355 = icmp eq ptr %354, null
  br i1 %355, label %356, label %360

356:                                              ; preds = %345
  %357 = load ptr, ptr %6, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %357, i32 0, i32 5
  %359 = call ptr @RemoveEntryList(ptr noundef %358)
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

360:                                              ; preds = %345
  store i64 0, ptr %9, align 8, !tbaa !10
  br label %361

361:                                              ; preds = %392, %360
  %362 = load i64, ptr %9, align 8, !tbaa !10
  %363 = load i64, ptr %10, align 8, !tbaa !10
  %364 = icmp ult i64 %362, %363
  br i1 %364, label %365, label %395

365:                                              ; preds = %361
  %366 = load i32, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !23
  %367 = icmp eq i32 %366, 1
  br i1 %367, label %368, label %379

368:                                              ; preds = %365
  %369 = load ptr, ptr %13, align 8, !tbaa !5
  %370 = load i64, ptr %8, align 8, !tbaa !10
  %371 = getelementptr inbounds i8, ptr %369, i64 %370
  %372 = load i8, ptr %371, align 1, !tbaa !9
  %373 = zext i8 %372 to i16
  %374 = load ptr, ptr %6, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %374, i32 0, i32 1
  %376 = load ptr, ptr %375, align 8, !tbaa !27
  %377 = load i64, ptr %9, align 8, !tbaa !10
  %378 = getelementptr inbounds i16, ptr %376, i64 %377
  store i16 %373, ptr %378, align 2, !tbaa !24
  br label %389

379:                                              ; preds = %365
  %380 = load ptr, ptr %12, align 8, !tbaa !5
  %381 = load i64, ptr %8, align 8, !tbaa !10
  %382 = getelementptr inbounds i16, ptr %380, i64 %381
  %383 = load i16, ptr %382, align 2, !tbaa !24
  %384 = load ptr, ptr %6, align 8, !tbaa !5
  %385 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %384, i32 0, i32 1
  %386 = load ptr, ptr %385, align 8, !tbaa !27
  %387 = load i64, ptr %9, align 8, !tbaa !10
  %388 = getelementptr inbounds i16, ptr %386, i64 %387
  store i16 %383, ptr %388, align 2, !tbaa !24
  br label %389

389:                                              ; preds = %379, %368
  %390 = load i64, ptr %8, align 8, !tbaa !10
  %391 = add i64 %390, 1
  store i64 %391, ptr %8, align 8, !tbaa !10
  br label %392

392:                                              ; preds = %389
  %393 = load i64, ptr %9, align 8, !tbaa !10
  %394 = add i64 %393, 1
  store i64 %394, ptr %9, align 8, !tbaa !10
  br label %361, !llvm.loop !30

395:                                              ; preds = %361
  %396 = load ptr, ptr %6, align 8, !tbaa !5
  %397 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %396, i32 0, i32 1
  %398 = load ptr, ptr %397, align 8, !tbaa !27
  %399 = load i64, ptr %10, align 8, !tbaa !10
  %400 = getelementptr inbounds i16, ptr %398, i64 %399
  store i16 0, ptr %400, align 2, !tbaa !24
  %401 = load i64, ptr %10, align 8, !tbaa !10
  %402 = load ptr, ptr %6, align 8, !tbaa !5
  %403 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %402, i32 0, i32 2
  store i64 %401, ptr %403, align 8, !tbaa !31
  %404 = load i64, ptr %10, align 8, !tbaa !10
  %405 = load ptr, ptr %6, align 8, !tbaa !5
  %406 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %405, i32 0, i32 3
  store i64 %404, ptr %406, align 8, !tbaa !32
  %407 = load i32, ptr %7, align 4, !tbaa !12
  %408 = load ptr, ptr %6, align 8, !tbaa !5
  %409 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %408, i32 0, i32 4
  store i32 %407, ptr %409, align 8, !tbaa !33
  %410 = load i32, ptr %7, align 4, !tbaa !12
  %411 = icmp eq i32 %410, 3
  br i1 %411, label %415, label %412

412:                                              ; preds = %395
  %413 = load i32, ptr %7, align 4, !tbaa !12
  %414 = icmp eq i32 %413, 4
  br i1 %414, label %415, label %418

415:                                              ; preds = %412, %395
  %416 = load i64, ptr %8, align 8, !tbaa !10
  %417 = add i64 %416, 1
  store i64 %417, ptr %8, align 8, !tbaa !10
  br label %418

418:                                              ; preds = %415, %412
  %419 = load i32, ptr %7, align 4, !tbaa !12
  %420 = icmp eq i32 %419, 3
  br i1 %420, label %424, label %421

421:                                              ; preds = %418
  %422 = load i32, ptr %7, align 4, !tbaa !12
  %423 = icmp eq i32 %422, 4
  br i1 %423, label %424, label %429

424:                                              ; preds = %421, %418
  %425 = load i64, ptr %18, align 8, !tbaa !10
  %426 = load i64, ptr %14, align 8, !tbaa !10
  %427 = sub i64 %426, 2
  %428 = icmp eq i64 %425, %427
  br i1 %428, label %440, label %429

429:                                              ; preds = %424, %421
  %430 = load i32, ptr %7, align 4, !tbaa !12
  %431 = icmp eq i32 %430, 1
  br i1 %431, label %435, label %432

432:                                              ; preds = %429
  %433 = load i32, ptr %7, align 4, !tbaa !12
  %434 = icmp eq i32 %433, 2
  br i1 %434, label %435, label %454

435:                                              ; preds = %432, %429
  %436 = load i64, ptr %18, align 8, !tbaa !10
  %437 = load i64, ptr %14, align 8, !tbaa !10
  %438 = sub i64 %437, 1
  %439 = icmp eq i64 %436, %438
  br i1 %439, label %440, label %454

440:                                              ; preds = %435, %424
  %441 = call ptr @FileBufferCreateLine()
  store ptr %441, ptr %6, align 8, !tbaa !5
  %442 = load ptr, ptr %6, align 8, !tbaa !5
  %443 = icmp eq ptr %442, null
  br i1 %443, label %444, label %453

444:                                              ; preds = %440
  br label %445

445:                                              ; preds = %444
  %446 = load ptr, ptr %11, align 8, !tbaa !5
  %447 = icmp ne ptr %446, null
  br i1 %447, label %448, label %450

448:                                              ; preds = %445
  %449 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %449)
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %450

450:                                              ; preds = %448, %445
  br label %451

451:                                              ; preds = %450
  br label %452

452:                                              ; preds = %451
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

453:                                              ; preds = %440
  br label %454

454:                                              ; preds = %453, %435, %432
  br label %455

455:                                              ; preds = %454
  %456 = load i64, ptr %8, align 8, !tbaa !10
  %457 = add i64 %456, 1
  store i64 %457, ptr %8, align 8, !tbaa !10
  br label %197, !llvm.loop !34

458:                                              ; preds = %197
  br label %459

459:                                              ; preds = %458
  %460 = load ptr, ptr %11, align 8, !tbaa !5
  %461 = icmp ne ptr %460, null
  br i1 %461, label %462, label %464

462:                                              ; preds = %459
  %463 = load ptr, ptr %11, align 8, !tbaa !5
  call void @FreePool(ptr noundef %463)
  store ptr null, ptr %11, align 8, !tbaa !5
  br label %464

464:                                              ; preds = %462, %459
  br label %465

465:                                              ; preds = %464
  br label %466

466:                                              ; preds = %465
  br label %467

467:                                              ; preds = %466, %115
  br label %468

468:                                              ; preds = %467, %152
  store i64 2, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 5), align 8, !tbaa !35
  store i64 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_POSITION, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 5), i32 0, i32 1), align 8, !tbaa !36
  store i64 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 8), align 8, !tbaa !37
  store i64 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_POSITION, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 8), i32 0, i32 1), align 8, !tbaa !38
  store i64 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 6), align 8, !tbaa !39
  store i64 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_POSITION, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 6), i32 0, i32 1), align 8, !tbaa !40
  store i64 2, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 7), align 8, !tbaa !41
  store i64 1, ptr getelementptr inbounds (%struct.EFI_EDITOR_POSITION, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 7), i32 0, i32 1), align 8, !tbaa !42
  %469 = load i8, ptr %5, align 1, !tbaa !9
  %470 = icmp ne i8 %469, 0
  br i1 %470, label %481, label %471

471:                                              ; preds = %468
  %472 = load i64, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 4), align 8, !tbaa !43
  %473 = call ptr (ptr, ptr, ...) @CatSPrint(ptr noundef null, ptr noundef @.str.17, i64 noundef %472)
  store ptr %473, ptr %12, align 8, !tbaa !5
  %474 = load ptr, ptr %12, align 8, !tbaa !5
  %475 = icmp eq ptr %474, null
  br i1 %475, label %476, label %477

476:                                              ; preds = %471
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

477:                                              ; preds = %471
  %478 = load ptr, ptr %12, align 8, !tbaa !5
  %479 = call i64 @StatusBarSetStatusString(ptr noundef %478)
  %480 = load ptr, ptr %12, align 8, !tbaa !5
  call void @FreePool(ptr noundef %480)
  br label %481

481:                                              ; preds = %477, %468
  %482 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 3), align 8, !tbaa !44
  %483 = icmp ne ptr %482, null
  br i1 %483, label %484, label %511

484:                                              ; preds = %481
  %485 = call zeroext i8 @DebugAssertEnabled()
  %486 = zext i8 %485 to i32
  %487 = icmp ne i32 %486, 0
  br i1 %487, label %488, label %502

488:                                              ; preds = %484
  %489 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !45
  %490 = getelementptr inbounds %struct._LIST_ENTRY, ptr %489, i32 0, i32 0
  %491 = load ptr, ptr %490, align 8, !tbaa !46
  %492 = ptrtoint ptr %491 to i64
  %493 = sub i64 %492, ptrtoint (ptr getelementptr inbounds (%struct._EFI_EDITOR_LINE, ptr null, i32 0, i32 5) to i64)
  %494 = inttoptr i64 %493 to ptr
  %495 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %494, i32 0, i32 0
  %496 = load i64, ptr %495, align 8, !tbaa !47
  %497 = icmp ne i64 %496, 1819043173
  br i1 %497, label %498, label %502

498:                                              ; preds = %488
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 1253, ptr noundef @.str.2)
  %499 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !45
  %500 = getelementptr inbounds %struct._LIST_ENTRY, ptr %499, i32 0, i32 0
  %501 = load ptr, ptr %500, align 8, !tbaa !46
  br label %509

502:                                              ; preds = %488, %484
  %503 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !45
  %504 = getelementptr inbounds %struct._LIST_ENTRY, ptr %503, i32 0, i32 0
  %505 = load ptr, ptr %504, align 8, !tbaa !46
  %506 = ptrtoint ptr %505 to i64
  %507 = sub i64 %506, ptrtoint (ptr getelementptr inbounds (%struct._EFI_EDITOR_LINE, ptr null, i32 0, i32 5) to i64)
  %508 = inttoptr i64 %507 to ptr
  br label %509

509:                                              ; preds = %502, %498
  %510 = phi ptr [ %501, %498 ], [ %508, %502 ]
  store ptr %510, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !48
  br label %518

511:                                              ; preds = %481
  %512 = call ptr @FileBufferCreateLine()
  store ptr %512, ptr %6, align 8, !tbaa !5
  %513 = load ptr, ptr %6, align 8, !tbaa !5
  %514 = icmp eq ptr %513, null
  br i1 %514, label %515, label %516

515:                                              ; preds = %511
  store i64 -9223372036854775799, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

516:                                              ; preds = %511
  %517 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %517, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !48
  br label %518

518:                                              ; preds = %516, %509
  store i8 0, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 9), align 8, !tbaa !49
  store i8 1, ptr @FileBufferNeedRefresh, align 1, !tbaa !9
  store i8 0, ptr @FileBufferOnlyLineNeedRefresh, align 1, !tbaa !9
  store i8 1, ptr @FileBufferMouseNeedRefresh, align 1, !tbaa !9
  store i64 0, ptr %3, align 8
  store i32 1, ptr %20, align 4
  br label %519

519:                                              ; preds = %518, %515, %476, %452, %356, %327, %176, %140, %123, %100, %90, %38, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %520 = load i64, ptr %3, align 8
  ret i64 %520
}

declare i64 @ShellOpenFileByName(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #0

declare i64 @StatusBarSetStatusString(ptr noundef) #0

declare ptr @ShellGetFileInfo(ptr noundef) #0

declare i64 @ShellDeleteFile(ptr noundef) #0

declare i64 @StrCmp(ptr noundef, ptr noundef) #0

declare i64 @ShellReadFile(ptr noundef, ptr noundef, ptr noundef) #0

declare i64 @ShellCloseFile(ptr noundef) #0

declare ptr @RemoveEntryList(ptr noundef) #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !11, i64 72}
!15 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !16, i64 24, !16, i64 40, !16, i64 56, !11, i64 72, !7, i64 80}
!16 = !{!"", !17, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !13, i64 8, !17, i64 12, !7, i64 14, !7, i64 15}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !7, i64 106}
!19 = !{!"", !6, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !20, i64 40, !20, i64 56, !20, i64 72, !20, i64 88, !7, i64 104, !7, i64 105, !7, i64 106, !6, i64 112}
!20 = !{!"", !11, i64 0, !11, i64 8}
!21 = !{!15, !11, i64 8}
!22 = !{!19, !6, i64 0}
!23 = !{!19, !13, i64 8}
!24 = !{!17, !17, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !6, i64 8}
!28 = !{!"_EFI_EDITOR_LINE", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 24, !13, i64 32, !29, i64 40}
!29 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!30 = distinct !{!30, !26}
!31 = !{!28, !11, i64 16}
!32 = !{!28, !11, i64 24}
!33 = !{!28, !13, i64 32}
!34 = distinct !{!34, !26}
!35 = !{!19, !11, i64 40}
!36 = !{!19, !11, i64 48}
!37 = !{!19, !11, i64 88}
!38 = !{!19, !11, i64 96}
!39 = !{!19, !11, i64 56}
!40 = !{!19, !11, i64 64}
!41 = !{!19, !11, i64 72}
!42 = !{!19, !11, i64 80}
!43 = !{!19, !11, i64 32}
!44 = !{!19, !6, i64 24}
!45 = !{!19, !6, i64 16}
!46 = !{!29, !6, i64 0}
!47 = !{!28, !11, i64 0}
!48 = !{!19, !6, i64 112}
!49 = !{!19, !7, i64 104}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.EFI_EDITOR_FILE_BUFFER = type { ptr, i32, ptr, ptr, i64, %struct.EFI_EDITOR_POSITION, %struct.EFI_EDITOR_POSITION, %struct.EFI_EDITOR_POSITION, %struct.EFI_EDITOR_POSITION, i8, i8, i8, ptr }
%struct.EFI_EDITOR_POSITION = type { i64, i64 }

@FileBuffer = external dso_local local_unnamed_addr global %struct.EFI_EDITOR_FILE_BUFFER, align 8
@FileBufferNeedRefresh = external dso_local local_unnamed_addr global i8, align 1
@FileBufferMouseNeedRefresh = external dso_local local_unnamed_addr global i8, align 1
@FileBufferOnlyLineNeedRefresh = external dso_local local_unnamed_addr global i8, align 1
@.str.1 = external hidden unnamed_addr constant [163 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i32], align 4
@.str.12 = external hidden unnamed_addr constant [28 x i32], align 4
@.str.13 = external hidden unnamed_addr constant [14 x i32], align 4
@.str.14 = external hidden unnamed_addr constant [47 x i32], align 4
@.str.15 = external hidden unnamed_addr constant [17 x i32], align 4
@.str.16 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.17 = external hidden unnamed_addr constant [14 x i32], align 4

declare ptr @AllocateZeroPool(i64 noundef) local_unnamed_addr #0

declare void @FreePool(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @FileBufferCreateLine() local_unnamed_addr #2

declare ptr @CatSPrint(ptr noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @FileBufferSetFileName(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @FileBufferFree() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775808, 1) i64 @FileBufferRead(ptr noundef %0, i8 noundef zeroext %1) local_unnamed_addr #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  store i64 0, ptr %3, align 8, !tbaa !5
  store ptr null, ptr %4, align 8, !tbaa !9
  %5 = call i64 @ShellOpenFileByName(ptr noundef %0, ptr noundef nonnull %4, i64 noundef 1, i64 noundef 0) #4
  %6 = icmp slt i64 %5, 0
  br i1 %6, label %23, label %7

7:                                                ; preds = %2
  %8 = load ptr, ptr %4, align 8, !tbaa !9
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %12

10:                                               ; preds = %7
  %11 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.11) #4
  br label %212

12:                                               ; preds = %7
  %13 = call ptr @ShellGetFileInfo(ptr noundef nonnull %8) #4
  %14 = getelementptr inbounds i8, ptr %13, i64 72
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %16 = and i64 %15, 16
  %.not = icmp eq i64 %16, 0
  br i1 %.not, label %19, label %17

17:                                               ; preds = %12
  %18 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.12) #4
  call void @FreePool(ptr noundef nonnull %13) #4
  br label %212

19:                                               ; preds = %12
  %20 = trunc i64 %15 to i8
  %. = and i8 %20, 1
  store i8 %., ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 106), align 2, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %13, i64 8
  %22 = load i64, ptr %21, align 8, !tbaa !19
  store i64 %22, ptr %3, align 8, !tbaa !5
  call void @FreePool(ptr noundef nonnull %13) #4
  %.pre = load i64, ptr %3, align 8, !tbaa !5
  br label %47

23:                                               ; preds = %2
  %24 = icmp eq i64 %5, -9223372036854775794
  br i1 %24, label %25, label %47

25:                                               ; preds = %23
  %26 = call i64 @ShellOpenFileByName(ptr noundef %0, ptr noundef nonnull %4, i64 noundef -9223372036854775805, i64 noundef 0) #4
  %27 = icmp slt i64 %26, 0
  br i1 %27, label %28, label %35

28:                                               ; preds = %25
  switch i64 %26, label %33 [
    i64 -9223372036854775793, label %29
    i64 -9223372036854775795, label %29
    i64 -9223372036854775796, label %29
    i64 -9223372036854775800, label %29
    i64 -9223372036854775797, label %31
    i64 -9223372036854775798, label %31
    i64 -9223372036854775801, label %31
  ]

29:                                               ; preds = %28, %28, %28, %28
  %30 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.13) #4
  br label %212

31:                                               ; preds = %28, %28, %28
  %32 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.11) #4
  br label %212

33:                                               ; preds = %28
  %34 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.14) #4
  br label %212

35:                                               ; preds = %25
  %36 = call i64 @ShellDeleteFile(ptr noundef nonnull %4) #4
  %37 = icmp eq i64 %36, 2
  %spec.store.select = select i1 %37, i64 -9223372036854775793, i64 %36
  store ptr null, ptr %4, align 8, !tbaa !9
  %38 = icmp slt i64 %spec.store.select, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.13) #4
  br label %212

41:                                               ; preds = %35
  store i8 0, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 106), align 2, !tbaa !16
  %42 = load ptr, ptr @FileBuffer, align 8, !tbaa !20
  %43 = call i64 @StrCmp(ptr noundef %0, ptr noundef %42) #4
  %.not154 = icmp eq i64 %43, 0
  br i1 %.not154, label %.critedge, label %44

44:                                               ; preds = %41
  %45 = call i64 @FileBufferSetFileName(ptr noundef %0)
  br label %.critedge

.critedge:                                        ; preds = %44, %41
  %46 = call i64 @FileBufferFree()
  br label %193

47:                                               ; preds = %19, %23
  %48 = phi i64 [ %.pre, %19 ], [ 0, %23 ]
  %49 = call ptr @AllocateZeroPool(i64 noundef %48) #4
  %50 = icmp eq ptr %49, null
  br i1 %50, label %212, label %51

51:                                               ; preds = %47
  %52 = load ptr, ptr %4, align 8, !tbaa !9
  %53 = call i64 @ShellReadFile(ptr noundef %52, ptr noundef nonnull %3, ptr noundef nonnull %49) #4
  %54 = call i64 @ShellCloseFile(ptr noundef nonnull %4) #4
  store ptr null, ptr %4, align 8, !tbaa !9
  %55 = icmp slt i64 %53, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %51
  %57 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.15) #4
  call void @FreePool(ptr noundef nonnull %49) #4
  br label %212

58:                                               ; preds = %51
  %59 = load i64, ptr %3, align 8, !tbaa !5
  switch i64 %59, label %62 [
    i64 0, label %60
    i64 1, label %61
  ]

60:                                               ; preds = %58
  call void @FreePool(ptr noundef nonnull %49) #4
  store i32 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  br label %193

61:                                               ; preds = %58
  store i32 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  br label %74

62:                                               ; preds = %58
  %63 = load i16, ptr %49, align 2, !tbaa !22
  %64 = icmp eq i16 %63, -257
  br i1 %64, label %65, label %73

65:                                               ; preds = %62
  %66 = and i64 %59, 1
  %.not156 = icmp eq i64 %66, 0
  br i1 %.not156, label %69, label %67

67:                                               ; preds = %65
  %68 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.16) #4
  call void @FreePool(ptr noundef nonnull %49) #4
  br label %212

69:                                               ; preds = %65
  %70 = lshr exact i64 %59, 1
  store i32 2, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  %71 = getelementptr inbounds i8, ptr %49, i64 2
  %72 = add nsw i64 %70, -1
  store i64 %72, ptr %3, align 8, !tbaa !5
  br label %74

73:                                               ; preds = %62
  store i32 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  br label %74

74:                                               ; preds = %69, %73, %61
  %.0136 = phi ptr [ null, %61 ], [ %71, %69 ], [ null, %73 ]
  %.0136244 = ptrtoint ptr %.0136 to i64
  %75 = load ptr, ptr @FileBuffer, align 8, !tbaa !20
  %76 = call i64 @StrCmp(ptr noundef %0, ptr noundef %75) #4
  %.not157 = icmp eq i64 %76, 0
  br i1 %.not157, label %79, label %77

77:                                               ; preds = %74
  %78 = call i64 @FileBufferSetFileName(ptr noundef %0)
  br label %79

79:                                               ; preds = %77, %74
  %80 = call i64 @FileBufferFree()
  %invariant.gep = getelementptr i8, ptr %49, i64 1
  %81 = load i64, ptr %3, align 8, !tbaa !5
  %.not190 = icmp eq i64 %81, 0
  br i1 %.not190, label %._crit_edge189, label %.preheader165

.preheader165:                                    ; preds = %79, %189
  %82 = phi i64 [ %190, %189 ], [ %81, %79 ]
  %.0139188 = phi i64 [ %191, %189 ], [ 0, %79 ]
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  %84 = icmp eq i32 %83, 1
  %85 = add nuw i64 %.0139188, 1
  %umax205 = call i64 @llvm.umax.i64(i64 %82, i64 %85)
  br i1 %84, label %.preheader165.split.us, label %.preheader165.split

.preheader165.split.us:                           ; preds = %.preheader165, %88
  %.0137177.us = phi i64 [ %89, %88 ], [ %.0139188, %.preheader165 ]
  %86 = getelementptr inbounds i8, ptr %49, i64 %.0137177.us
  %87 = load i8, ptr %86, align 1, !tbaa !23
  switch i8 %87, label %88 [
    i8 13, label %.split.us
    i8 10, label %.split180.us
  ]

88:                                               ; preds = %.preheader165.split.us
  %89 = add nuw i64 %.0137177.us, 1
  %.not158.us = icmp ult i64 %89, %82
  br i1 %.not158.us, label %.preheader165.split.us, label %.loopexit, !llvm.loop !24

.split.us:                                        ; preds = %.preheader165.split.us
  %90 = add i64 %82, -1
  %91 = icmp ult i64 %.0137177.us, %90
  br i1 %91, label %96, label %.loopexit

.split180.us:                                     ; preds = %.preheader165.split.us
  %92 = add i64 %82, -1
  %93 = icmp ult i64 %.0137177.us, %92
  br i1 %93, label %100, label %.loopexit

.preheader165.split:                              ; preds = %.preheader165, %122
  %.0137177 = phi i64 [ %123, %122 ], [ %.0139188, %.preheader165 ]
  %94 = getelementptr inbounds i16, ptr %.0136, i64 %.0137177
  %95 = load i16, ptr %94, align 2, !tbaa !22
  switch i16 %95, label %122 [
    i16 13, label %104
    i16 10, label %113
  ]

96:                                               ; preds = %.split.us
  %gep187 = getelementptr i8, ptr %invariant.gep, i64 %.0137177.us
  %97 = load i8, ptr %gep187, align 1, !tbaa !23
  %98 = icmp eq i8 %97, 10
  br i1 %98, label %99, label %.loopexit

99:                                               ; preds = %96
  br label %.loopexit

100:                                              ; preds = %.split180.us
  %gep = getelementptr i8, ptr %invariant.gep, i64 %.0137177.us
  %101 = load i8, ptr %gep, align 1, !tbaa !23
  %102 = icmp eq i8 %101, 13
  br i1 %102, label %103, label %.loopexit

103:                                              ; preds = %100
  br label %.loopexit

104:                                              ; preds = %.preheader165.split
  %105 = add i64 %82, -1
  %106 = icmp ult i64 %.0137177, %105
  br i1 %106, label %107, label %.loopexit

107:                                              ; preds = %104
  %108 = add nuw i64 %.0137177, 1
  %109 = getelementptr inbounds i16, ptr %.0136, i64 %108
  %110 = load i16, ptr %109, align 2, !tbaa !22
  %111 = icmp eq i16 %110, 10
  br i1 %111, label %112, label %.loopexit

112:                                              ; preds = %107
  br label %.loopexit

113:                                              ; preds = %.preheader165.split
  %114 = add i64 %82, -1
  %115 = icmp ult i64 %.0137177, %114
  br i1 %115, label %116, label %.loopexit

116:                                              ; preds = %113
  %117 = add nuw i64 %.0137177, 1
  %118 = getelementptr inbounds i16, ptr %.0136, i64 %117
  %119 = load i16, ptr %118, align 2, !tbaa !22
  %120 = icmp eq i16 %119, 13
  br i1 %120, label %121, label %.loopexit

121:                                              ; preds = %116
  br label %.loopexit

122:                                              ; preds = %.preheader165.split
  %123 = add nuw i64 %.0137177, 1
  %.not158 = icmp ult i64 %123, %82
  br i1 %.not158, label %.preheader165.split, label %.loopexit, !llvm.loop !24

.loopexit:                                        ; preds = %122, %88, %113, %121, %116, %104, %112, %107, %.split180.us, %103, %100, %.split.us, %99, %96
  %.0137170 = phi i64 [ %.0137177.us, %99 ], [ %.0137177.us, %96 ], [ %.0137177.us, %.split.us ], [ %.0137177.us, %103 ], [ %.0137177.us, %100 ], [ %.0137177.us, %.split180.us ], [ %.0137177, %112 ], [ %.0137177, %107 ], [ %.0137177, %104 ], [ %.0137177, %121 ], [ %.0137177, %116 ], [ %.0137177, %113 ], [ %umax205, %88 ], [ %umax205, %122 ]
  %124 = phi i1 [ true, %99 ], [ false, %96 ], [ false, %.split.us ], [ false, %103 ], [ false, %100 ], [ false, %.split180.us ], [ true, %112 ], [ false, %107 ], [ false, %104 ], [ false, %121 ], [ false, %116 ], [ false, %113 ], [ false, %88 ], [ false, %122 ]
  %125 = phi i1 [ false, %99 ], [ false, %96 ], [ false, %.split.us ], [ true, %103 ], [ false, %100 ], [ false, %.split180.us ], [ false, %112 ], [ false, %107 ], [ false, %104 ], [ true, %121 ], [ false, %116 ], [ false, %113 ], [ false, %88 ], [ false, %122 ]
  %126 = phi i1 [ false, %99 ], [ false, %96 ], [ false, %.split.us ], [ false, %103 ], [ true, %100 ], [ true, %.split180.us ], [ false, %112 ], [ false, %107 ], [ false, %104 ], [ false, %121 ], [ true, %116 ], [ true, %113 ], [ false, %88 ], [ false, %122 ]
  %127 = phi i1 [ false, %99 ], [ true, %96 ], [ true, %.split.us ], [ false, %103 ], [ false, %100 ], [ false, %.split180.us ], [ false, %112 ], [ true, %107 ], [ true, %104 ], [ false, %121 ], [ false, %116 ], [ false, %113 ], [ false, %88 ], [ false, %122 ]
  %spec.store.select10 = phi i32 [ 3, %99 ], [ 2, %96 ], [ 2, %.split.us ], [ 4, %103 ], [ 1, %100 ], [ 1, %.split180.us ], [ 3, %112 ], [ 2, %107 ], [ 2, %104 ], [ 4, %121 ], [ 1, %116 ], [ 1, %113 ], [ 0, %88 ], [ 0, %122 ]
  %128 = call ptr @FileBufferCreateLine()
  %129 = icmp eq ptr %128, null
  br i1 %129, label %130, label %131

130:                                              ; preds = %.loopexit
  call void @FreePool(ptr noundef nonnull %49) #4
  br label %212

131:                                              ; preds = %.loopexit
  %132 = sub i64 %.0137170, %.0139188
  %133 = getelementptr inbounds i8, ptr %128, i64 8
  %134 = load ptr, ptr %133, align 8, !tbaa !26
  %.not159 = icmp eq ptr %134, null
  br i1 %.not159, label %136, label %135

135:                                              ; preds = %131
  call void @FreePool(ptr noundef nonnull %134) #4
  store ptr null, ptr %133, align 8, !tbaa !26
  br label %136

136:                                              ; preds = %135, %131
  %137 = shl i64 %132, 1
  %138 = add i64 %137, 2
  %139 = call ptr @AllocateZeroPool(i64 noundef %138) #4
  %140 = ptrtoint ptr %139 to i64
  store ptr %139, ptr %133, align 8, !tbaa !26
  %141 = icmp eq ptr %139, null
  br i1 %141, label %168, label %.preheader

.preheader:                                       ; preds = %136
  %.not191 = icmp eq i64 %.0137170, %.0139188
  br i1 %.not191, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %142 = load i32, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  %143 = icmp eq i32 %142, 1
  %min.iters.check = icmp ult i64 %132, 16
  br i1 %143, label %.lr.ph.split.us.preheader, label %.lr.ph.split.preheader

.lr.ph.split.preheader:                           ; preds = %.lr.ph
  br i1 %min.iters.check, label %.lr.ph.split.preheader262, label %vector.memcheck243

.lr.ph.split.preheader262:                        ; preds = %middle.block245, %vector.memcheck243, %.lr.ph.split.preheader
  %.0138185.ph = phi i64 [ 0, %vector.memcheck243 ], [ 0, %.lr.ph.split.preheader ], [ %n.vec250, %middle.block245 ]
  %.1184.ph = phi i64 [ %.0139188, %vector.memcheck243 ], [ %.0139188, %.lr.ph.split.preheader ], [ %ind.end252, %middle.block245 ]
  br label %.lr.ph.split

vector.memcheck243:                               ; preds = %.lr.ph.split.preheader
  %144 = shl i64 %.0139188, 1
  %145 = add i64 %144, %.0136244
  %146 = sub i64 %140, %145
  %diff.check = icmp ult i64 %146, 32
  br i1 %diff.check, label %.lr.ph.split.preheader262, label %vector.ph248

vector.ph248:                                     ; preds = %vector.memcheck243
  %n.vec250 = and i64 %132, -16
  %ind.end252 = add i64 %.0139188, %n.vec250
  br label %vector.body254

vector.body254:                                   ; preds = %vector.body254, %vector.ph248
  %index255 = phi i64 [ 0, %vector.ph248 ], [ %index.next259, %vector.body254 ]
  %offset.idx256 = add i64 %.0139188, %index255
  %147 = getelementptr inbounds i16, ptr %.0136, i64 %offset.idx256
  %148 = getelementptr inbounds i8, ptr %147, i64 16
  %wide.load257 = load <8 x i16>, ptr %147, align 2, !tbaa !22
  %wide.load258 = load <8 x i16>, ptr %148, align 2, !tbaa !22
  %149 = getelementptr inbounds i16, ptr %139, i64 %index255
  %150 = getelementptr inbounds i8, ptr %149, i64 16
  store <8 x i16> %wide.load257, ptr %149, align 2, !tbaa !22
  store <8 x i16> %wide.load258, ptr %150, align 2, !tbaa !22
  %index.next259 = add nuw i64 %index255, 16
  %151 = icmp eq i64 %index.next259, %n.vec250
  br i1 %151, label %middle.block245, label %vector.body254, !llvm.loop !29

middle.block245:                                  ; preds = %vector.body254
  %cmp.n260 = icmp eq i64 %132, %n.vec250
  br i1 %cmp.n260, label %._crit_edge, label %.lr.ph.split.preheader262

.lr.ph.split.us.preheader:                        ; preds = %.lr.ph
  br i1 %min.iters.check, label %.lr.ph.split.us.preheader261, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph.split.us.preheader
  %152 = sub i64 %.0137170, %.0139188
  %153 = shl i64 %152, 1
  %scevgep = getelementptr i8, ptr %139, i64 %153
  %scevgep239 = getelementptr i8, ptr %49, i64 %.0139188
  %scevgep240 = getelementptr i8, ptr %49, i64 %.0137170
  %bound0 = icmp ult ptr %139, %scevgep240
  %bound1 = icmp ult ptr %scevgep239, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.split.us.preheader261, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %132, -16
  %ind.end = add i64 %.0139188, %n.vec
  %154 = getelementptr i8, ptr %49, i64 %.0139188
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %155 = getelementptr i8, ptr %154, i64 %index
  %156 = getelementptr inbounds i8, ptr %155, i64 8
  %wide.load = load <8 x i8>, ptr %155, align 1, !tbaa !23, !alias.scope !32
  %wide.load242 = load <8 x i8>, ptr %156, align 1, !tbaa !23, !alias.scope !32
  %157 = zext <8 x i8> %wide.load to <8 x i16>
  %158 = zext <8 x i8> %wide.load242 to <8 x i16>
  %159 = getelementptr inbounds i16, ptr %139, i64 %index
  %160 = getelementptr inbounds i8, ptr %159, i64 16
  store <8 x i16> %157, ptr %159, align 2, !tbaa !22, !alias.scope !35, !noalias !32
  store <8 x i16> %158, ptr %160, align 2, !tbaa !22, !alias.scope !35, !noalias !32
  %index.next = add nuw i64 %index, 16
  %161 = icmp eq i64 %index.next, %n.vec
  br i1 %161, label %middle.block, label %vector.body, !llvm.loop !37

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %132, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.split.us.preheader261

.lr.ph.split.us.preheader261:                     ; preds = %middle.block, %vector.memcheck, %.lr.ph.split.us.preheader
  %.0138185.us.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.split.us.preheader ], [ %n.vec, %middle.block ]
  %.1184.us.ph = phi i64 [ %.0139188, %vector.memcheck ], [ %.0139188, %.lr.ph.split.us.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader261, %.lr.ph.split.us
  %.0138185.us = phi i64 [ %167, %.lr.ph.split.us ], [ %.0138185.us.ph, %.lr.ph.split.us.preheader261 ]
  %.1184.us = phi i64 [ %166, %.lr.ph.split.us ], [ %.1184.us.ph, %.lr.ph.split.us.preheader261 ]
  %162 = getelementptr inbounds i8, ptr %49, i64 %.1184.us
  %163 = load i8, ptr %162, align 1, !tbaa !23
  %164 = zext i8 %163 to i16
  %165 = getelementptr inbounds i16, ptr %139, i64 %.0138185.us
  store i16 %164, ptr %165, align 2, !tbaa !22
  %166 = add i64 %.1184.us, 1
  %167 = add nuw i64 %.0138185.us, 1
  %exitcond206.not = icmp eq i64 %167, %132
  br i1 %exitcond206.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !38

168:                                              ; preds = %136
  %169 = getelementptr inbounds i8, ptr %128, i64 40
  %170 = call ptr @RemoveEntryList(ptr noundef nonnull %169) #4
  br label %212

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader262, %.lr.ph.split
  %.0138185 = phi i64 [ %175, %.lr.ph.split ], [ %.0138185.ph, %.lr.ph.split.preheader262 ]
  %.1184 = phi i64 [ %174, %.lr.ph.split ], [ %.1184.ph, %.lr.ph.split.preheader262 ]
  %171 = getelementptr inbounds i16, ptr %.0136, i64 %.1184
  %172 = load i16, ptr %171, align 2, !tbaa !22
  %173 = getelementptr inbounds i16, ptr %139, i64 %.0138185
  store i16 %172, ptr %173, align 2, !tbaa !22
  %174 = add i64 %.1184, 1
  %175 = add nuw i64 %.0138185, 1
  %exitcond.not = icmp eq i64 %175, %132
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !39

._crit_edge:                                      ; preds = %.lr.ph.split, %.lr.ph.split.us, %middle.block245, %middle.block, %.preheader
  %.1.lcssa = phi i64 [ %.0139188, %.preheader ], [ %.0137170, %middle.block ], [ %.0137170, %middle.block245 ], [ %.0137170, %.lr.ph.split.us ], [ %.0137170, %.lr.ph.split ]
  %176 = getelementptr inbounds i16, ptr %139, i64 %132
  store i16 0, ptr %176, align 2, !tbaa !22
  %177 = getelementptr inbounds i8, ptr %128, i64 16
  store i64 %132, ptr %177, align 8, !tbaa !40
  %178 = getelementptr inbounds i8, ptr %128, i64 24
  store i64 %132, ptr %178, align 8, !tbaa !41
  %179 = getelementptr inbounds i8, ptr %128, i64 32
  store i32 %spec.store.select10, ptr %179, align 8, !tbaa !42
  %or.cond12 = or i1 %124, %125
  %.pre209.pre = load i64, ptr %3, align 8, !tbaa !5
  %180 = add i64 %.pre209.pre, -2
  %181 = icmp eq i64 %.0137170, %180
  %or.cond = select i1 %or.cond12, i1 %181, i1 false
  br i1 %or.cond, label %185, label %182

182:                                              ; preds = %._crit_edge
  %or.cond16 = or i1 %126, %127
  %183 = add i64 %.pre209.pre, -1
  %184 = icmp eq i64 %.0137170, %183
  %or.cond229 = select i1 %or.cond16, i1 %184, i1 false
  br i1 %or.cond229, label %185, label %189

185:                                              ; preds = %182, %._crit_edge
  %186 = call ptr @FileBufferCreateLine()
  %187 = icmp eq ptr %186, null
  br i1 %187, label %188, label %._crit_edge207

._crit_edge207:                                   ; preds = %185
  %.pre208 = load i64, ptr %3, align 8, !tbaa !5
  br label %189

188:                                              ; preds = %185
  call void @FreePool(ptr noundef nonnull %49) #4
  br label %212

189:                                              ; preds = %._crit_edge207, %182
  %190 = phi i64 [ %.pre208, %._crit_edge207 ], [ %.pre209.pre, %182 ]
  %spec.select = select i1 %or.cond12, i64 2, i64 1
  %191 = add i64 %spec.select, %.1.lcssa
  %192 = icmp ult i64 %191, %190
  br i1 %192, label %.preheader165, label %._crit_edge189, !llvm.loop !43

._crit_edge189:                                   ; preds = %189, %79
  call void @FreePool(ptr noundef nonnull %49) #4
  br label %193

193:                                              ; preds = %.critedge, %._crit_edge189, %60
  store i64 2, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 40), align 8, !tbaa !44
  store i64 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 48), align 8, !tbaa !45
  store i64 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 88), align 8, !tbaa !46
  store i64 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 96), align 8, !tbaa !47
  store i64 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 56), align 8, !tbaa !48
  store i64 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 64), align 8, !tbaa !49
  store i64 2, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 72), align 8, !tbaa !50
  store i64 1, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 80), align 8, !tbaa !51
  %.not160 = icmp eq i8 %1, 0
  br i1 %.not160, label %194, label %200

194:                                              ; preds = %193
  %195 = load i64, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 32), align 8, !tbaa !52
  %196 = call ptr (ptr, ptr, ...) @CatSPrint(ptr noundef null, ptr noundef nonnull @.str.17, i64 noundef %195) #4
  %197 = icmp eq ptr %196, null
  br i1 %197, label %212, label %198

198:                                              ; preds = %194
  %199 = call i64 @StatusBarSetStatusString(ptr noundef nonnull %196) #4
  call void @FreePool(ptr noundef nonnull %196) #4
  br label %200

200:                                              ; preds = %198, %193
  %201 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 24), align 8, !tbaa !53
  %.not161 = icmp eq ptr %201, null
  br i1 %.not161, label %209, label %202

202:                                              ; preds = %200
  %203 = call zeroext i8 @DebugAssertEnabled() #4
  %.not163 = icmp eq i8 %203, 0
  %.pre210 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 16), align 8, !tbaa !54
  %.pre211 = load ptr, ptr %.pre210, align 8, !tbaa !55
  %.pre213 = ptrtoint ptr %.pre211 to i64
  %.pre214 = add i64 %.pre213, -40
  %.pre216 = inttoptr i64 %.pre214 to ptr
  br i1 %.not163, label %._crit_edge212, label %204

204:                                              ; preds = %202
  %205 = load i64, ptr %.pre216, align 8, !tbaa !56
  %.not164 = icmp eq i64 %205, 1819043173
  br i1 %.not164, label %._crit_edge212, label %206

206:                                              ; preds = %204
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 1253, ptr noundef nonnull @.str.2) #4
  %207 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 16), align 8, !tbaa !54
  %208 = load ptr, ptr %207, align 8, !tbaa !55
  br label %._crit_edge212

209:                                              ; preds = %200
  %210 = call ptr @FileBufferCreateLine()
  %211 = icmp eq ptr %210, null
  br i1 %211, label %212, label %._crit_edge212

._crit_edge212:                                   ; preds = %202, %204, %209, %206
  %storemerge162 = phi ptr [ %208, %206 ], [ %210, %209 ], [ %.pre216, %204 ], [ %.pre216, %202 ]
  store ptr %storemerge162, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 112), align 8, !tbaa !57
  store i8 0, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 104), align 8, !tbaa !58
  store i8 1, ptr @FileBufferNeedRefresh, align 1, !tbaa !23
  store i8 0, ptr @FileBufferOnlyLineNeedRefresh, align 1, !tbaa !23
  store i8 1, ptr @FileBufferMouseNeedRefresh, align 1, !tbaa !23
  br label %212

212:                                              ; preds = %209, %194, %47, %29, %33, %31, %._crit_edge212, %188, %168, %130, %67, %56, %39, %17, %10
  %.0 = phi i64 [ %spec.store.select, %39 ], [ 0, %._crit_edge212 ], [ -9223372036854775807, %56 ], [ -9223372036854775799, %130 ], [ -9223372036854775799, %168 ], [ -9223372036854775799, %188 ], [ -9223372036854775807, %67 ], [ -9223372036854775807, %10 ], [ -9223372036854775806, %17 ], [ %26, %31 ], [ %26, %33 ], [ %26, %29 ], [ -9223372036854775799, %47 ], [ -9223372036854775799, %194 ], [ -9223372036854775799, %209 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i64 %.0
}

declare i64 @ShellOpenFileByName(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

declare i64 @StatusBarSetStatusString(ptr noundef) local_unnamed_addr #0

declare ptr @ShellGetFileInfo(ptr noundef) local_unnamed_addr #0

declare i64 @ShellDeleteFile(ptr noundef) local_unnamed_addr #0

declare i64 @StrCmp(ptr noundef, ptr noundef) local_unnamed_addr #0

declare i64 @ShellReadFile(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i64 @ShellCloseFile(ptr noundef) local_unnamed_addr #0

declare ptr @RemoveEntryList(ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #3

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 72}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 40, !13, i64 56, !6, i64 72, !7, i64 80}
!13 = !{!"", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !15, i64 8, !14, i64 12, !7, i64 14, !7, i64 15}
!14 = !{!"short", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !7, i64 106}
!17 = !{!"", !10, i64 0, !15, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !18, i64 40, !18, i64 56, !18, i64 72, !18, i64 88, !7, i64 104, !7, i64 105, !7, i64 106, !10, i64 112}
!18 = !{!"", !6, i64 0, !6, i64 8}
!19 = !{!12, !6, i64 8}
!20 = !{!17, !10, i64 0}
!21 = !{!17, !15, i64 8}
!22 = !{!14, !14, i64 0}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !10, i64 8}
!27 = !{!"_EFI_EDITOR_LINE", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !15, i64 32, !28, i64 40}
!28 = !{!"_LIST_ENTRY", !10, i64 0, !10, i64 8}
!29 = distinct !{!29, !25, !30, !31}
!30 = !{!"llvm.loop.isvectorized", i32 1}
!31 = !{!"llvm.loop.unroll.runtime.disable"}
!32 = !{!33}
!33 = distinct !{!33, !34}
!34 = distinct !{!34, !"LVerDomain"}
!35 = !{!36}
!36 = distinct !{!36, !34}
!37 = distinct !{!37, !25, !30, !31}
!38 = distinct !{!38, !25, !30}
!39 = distinct !{!39, !25, !30}
!40 = !{!27, !6, i64 16}
!41 = !{!27, !6, i64 24}
!42 = !{!27, !15, i64 32}
!43 = distinct !{!43, !25}
!44 = !{!17, !6, i64 40}
!45 = !{!17, !6, i64 48}
!46 = !{!17, !6, i64 88}
!47 = !{!17, !6, i64 96}
!48 = !{!17, !6, i64 56}
!49 = !{!17, !6, i64 64}
!50 = !{!17, !6, i64 72}
!51 = !{!17, !6, i64 80}
!52 = !{!17, !6, i64 32}
!53 = !{!17, !10, i64 24}
!54 = !{!17, !10, i64 16}
!55 = !{!28, !10, i64 0}
!56 = !{!27, !6, i64 0}
!57 = !{!17, !10, i64 112}
!58 = !{!17, !7, i64 104}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass