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

; 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._LIST_ENTRY = type { ptr, ptr }
%struct._EFI_EDITOR_LINE = type { i64, ptr, i64, i64, i32, %struct._LIST_ENTRY }

@FileBuffer = external dso_local global %struct.EFI_EDITOR_FILE_BUFFER, align 8
@.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.18 = external hidden unnamed_addr constant [32 x i32], align 4
@.str.19 = external hidden unnamed_addr constant [27 x i32], align 4
@.str.20 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.21 = external hidden unnamed_addr constant [19 x i32], align 4
@gUnicodeFileTag = external constant i16, align 2
@.str.22 = external hidden unnamed_addr constant [15 x i32], align 4

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

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

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

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

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 @ShellCloseFile(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @GetNewLine(i32 noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i64 @FileBufferSave(ptr noundef %0) #2 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca [4 x i8], align 1
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, 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 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, 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 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store i64 0, ptr %9, align 8, !tbaa !9
  store i64 2097152, ptr %16, align 8, !tbaa !9
  store i64 0, ptr %14, align 8, !tbaa !9
  %22 = load ptr, ptr @FileBuffer, align 8, !tbaa !11
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %39

24:                                               ; preds = %1
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = load ptr, ptr @FileBuffer, align 8, !tbaa !11
  %27 = call i64 @StrCmp(ptr noundef %25, ptr noundef %26)
  %28 = icmp eq i64 %27, 0
  br i1 %28, label %29, label %39

29:                                               ; preds = %24
  %30 = load i8, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 9), align 8, !tbaa !15
  %31 = icmp ne i8 %30, 0
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i64 0, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

33:                                               ; preds = %29
  %34 = load i8, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 11), align 2, !tbaa !16
  %35 = icmp ne i8 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %33
  %37 = call i64 @StatusBarSetStatusString(ptr noundef @.str.18)
  store i64 0, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

38:                                               ; preds = %33
  br label %39

39:                                               ; preds = %38, %24, %1
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = call i64 @ShellOpenFileByName(ptr noundef %40, ptr noundef %4, i64 noundef 3, i64 noundef 0)
  store i64 %41, ptr %8, align 8, !tbaa !9
  %42 = load i64, ptr %8, align 8, !tbaa !9
  %43 = icmp slt i64 %42, 0
  br i1 %43, label %79, label %44

44:                                               ; preds = %39
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = call ptr @ShellGetFileInfo(ptr noundef %45)
  store ptr %46, ptr %13, align 8, !tbaa !5
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %60

49:                                               ; preds = %44
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.EFI_FILE_INFO, ptr %50, i32 0, i32 6
  %52 = load i64, ptr %51, align 8, !tbaa !17
  %53 = and i64 %52, 16
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %60

55:                                               ; preds = %49
  %56 = call i64 @StatusBarSetStatusString(ptr noundef @.str.19)
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = call i64 @ShellCloseFile(ptr noundef %57)
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  call void @FreePool(ptr noundef %59)
  store i64 -9223372036854775807, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

60:                                               ; preds = %49, %44
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %69

63:                                               ; preds = %60
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.EFI_FILE_INFO, ptr %64, i32 0, i32 6
  %66 = load i64, ptr %65, align 8, !tbaa !17
  %67 = and i64 %66, -2
  store i64 %67, ptr %14, align 8, !tbaa !9
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  call void @FreePool(ptr noundef %68)
  br label %69

69:                                               ; preds = %63, %60
  %70 = call i64 @ShellDeleteFile(ptr noundef %4)
  store i64 %70, ptr %8, align 8, !tbaa !9
  %71 = load i64, ptr %8, align 8, !tbaa !9
  %72 = icmp slt i64 %71, 0
  br i1 %72, label %76, label %73

73:                                               ; preds = %69
  %74 = load i64, ptr %8, align 8, !tbaa !9
  %75 = icmp eq i64 %74, 2
  br i1 %75, label %76, label %78

76:                                               ; preds = %73, %69
  %77 = call i64 @StatusBarSetStatusString(ptr noundef @.str.20)
  store i64 -9223372036854775807, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

78:                                               ; preds = %73
  br label %79

79:                                               ; preds = %78, %39
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = load i64, ptr %14, align 8, !tbaa !9
  %82 = call i64 @ShellOpenFileByName(ptr noundef %80, ptr noundef %4, i64 noundef -9223372036854775805, i64 noundef %81)
  store i64 %82, ptr %8, align 8, !tbaa !9
  %83 = load i64, ptr %8, align 8, !tbaa !9
  %84 = icmp slt i64 %83, 0
  br i1 %84, label %85, label %87

85:                                               ; preds = %79
  %86 = call i64 @StatusBarSetStatusString(ptr noundef @.str.21)
  store i64 -9223372036854775807, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

87:                                               ; preds = %79
  %88 = load i32, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !21
  %89 = icmp eq i32 %88, 2
  br i1 %89, label %90, label %98

90:                                               ; preds = %87
  store i64 2, ptr %9, align 8, !tbaa !9
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = call i64 @ShellWriteFile(ptr noundef %91, ptr noundef %9, ptr noundef @gUnicodeFileTag)
  store i64 %92, ptr %8, align 8, !tbaa !9
  %93 = load i64, ptr %8, align 8, !tbaa !9
  %94 = icmp slt i64 %93, 0
  br i1 %94, label %95, label %97

95:                                               ; preds = %90
  %96 = call i64 @ShellDeleteFile(ptr noundef %4)
  store i64 -9223372036854775807, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

97:                                               ; preds = %90
  br label %98

98:                                               ; preds = %97, %87
  %99 = load i64, ptr %16, align 8, !tbaa !9
  %100 = call ptr @AllocateZeroPool(i64 noundef %99)
  store ptr %100, ptr %17, align 8, !tbaa !5
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %105

103:                                              ; preds = %98
  %104 = call i64 @ShellDeleteFile(ptr noundef %4)
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

105:                                              ; preds = %98
  store i64 0, ptr %10, align 8, !tbaa !9
  store i32 3, ptr %15, align 4, !tbaa !22
  %106 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %106, ptr %20, align 8, !tbaa !5
  %107 = load i64, ptr %16, align 8, !tbaa !9
  store i64 %107, ptr %18, align 8, !tbaa !9
  %108 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !23
  %109 = getelementptr inbounds %struct._LIST_ENTRY, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !24
  store ptr %110, ptr %5, align 8, !tbaa !5
  br label %111

111:                                              ; preds = %259, %105
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !23
  %114 = icmp ne ptr %112, %113
  br i1 %114, label %115, label %263

115:                                              ; preds = %111
  %116 = call zeroext i8 @DebugAssertEnabled()
  %117 = zext i8 %116 to i32
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %129

119:                                              ; preds = %115
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = ptrtoint ptr %120 to i64
  %122 = sub i64 %121, ptrtoint (ptr getelementptr inbounds (%struct._EFI_EDITOR_LINE, ptr null, i32 0, i32 5) to i64)
  %123 = inttoptr i64 %122 to ptr
  %124 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %123, i32 0, i32 0
  %125 = load i64, ptr %124, align 8, !tbaa !26
  %126 = icmp ne i64 %125, 1819043173
  br i1 %126, label %127, label %129

127:                                              ; preds = %119
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 1543, ptr noundef @.str.2)
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  br label %134

129:                                              ; preds = %119, %115
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = ptrtoint ptr %130 to i64
  %132 = sub i64 %131, ptrtoint (ptr getelementptr inbounds (%struct._EFI_EDITOR_LINE, ptr null, i32 0, i32 5) to i64)
  %133 = inttoptr i64 %132 to ptr
  br label %134

134:                                              ; preds = %129, %127
  %135 = phi ptr [ %128, %127 ], [ %133, %129 ]
  store ptr %135, ptr %6, align 8, !tbaa !5
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %136, i32 0, i32 4
  %138 = load i32, ptr %137, align 8, !tbaa !28
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %144

140:                                              ; preds = %134
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %141, i32 0, i32 4
  %143 = load i32, ptr %142, align 8, !tbaa !28
  store i32 %143, ptr %15, align 4, !tbaa !22
  br label %144

144:                                              ; preds = %140, %134
  store i64 4, ptr %9, align 8, !tbaa !9
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !29
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %171

149:                                              ; preds = %144
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %150, i32 0, i32 2
  %152 = load i64, ptr %151, align 8, !tbaa !30
  %153 = icmp ne i64 %152, 0
  br i1 %153, label %154, label %171

154:                                              ; preds = %149
  %155 = load i32, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !21
  %156 = icmp eq i32 %155, 1
  br i1 %156, label %157, label %163

157:                                              ; preds = %154
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %158, i32 0, i32 2
  %160 = load i64, ptr %159, align 8, !tbaa !30
  %161 = load i64, ptr %9, align 8, !tbaa !9
  %162 = add i64 %161, %160
  store i64 %162, ptr %9, align 8, !tbaa !9
  br label %170

163:                                              ; preds = %154
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %164, i32 0, i32 2
  %166 = load i64, ptr %165, align 8, !tbaa !30
  %167 = mul i64 %166, 2
  %168 = load i64, ptr %9, align 8, !tbaa !9
  %169 = add i64 %168, %167
  store i64 %169, ptr %9, align 8, !tbaa !9
  br label %170

170:                                              ; preds = %163, %157
  br label %171

171:                                              ; preds = %170, %149, %144
  %172 = load i64, ptr %18, align 8, !tbaa !9
  %173 = load i64, ptr %9, align 8, !tbaa !9
  %174 = icmp ult i64 %172, %173
  br i1 %174, label %175, label %190

175:                                              ; preds = %171
  %176 = load i64, ptr %16, align 8, !tbaa !9
  %177 = load i64, ptr %18, align 8, !tbaa !9
  %178 = sub i64 %176, %177
  store i64 %178, ptr %19, align 8, !tbaa !9
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = load ptr, ptr %17, align 8, !tbaa !5
  %181 = call i64 @ShellWriteFile(ptr noundef %179, ptr noundef %19, ptr noundef %180)
  store i64 %181, ptr %8, align 8, !tbaa !9
  %182 = load i64, ptr %8, align 8, !tbaa !9
  %183 = icmp slt i64 %182, 0
  br i1 %183, label %184, label %187

184:                                              ; preds = %175
  %185 = call i64 @ShellDeleteFile(ptr noundef %4)
  %186 = load ptr, ptr %17, align 8, !tbaa !5
  call void @FreePool(ptr noundef %186)
  store i64 -9223372036854775807, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

187:                                              ; preds = %175
  %188 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %188, ptr %20, align 8, !tbaa !5
  %189 = load i64, ptr %16, align 8, !tbaa !9
  store i64 %189, ptr %18, align 8, !tbaa !9
  br label %190

190:                                              ; preds = %187, %171
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %191, i32 0, i32 1
  %193 = load ptr, ptr %192, align 8, !tbaa !29
  %194 = icmp ne ptr %193, null
  br i1 %194, label %195, label %233

195:                                              ; preds = %190
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %196, i32 0, i32 2
  %198 = load i64, ptr %197, align 8, !tbaa !30
  %199 = icmp ne i64 %198, 0
  br i1 %199, label %200, label %233

200:                                              ; preds = %195
  %201 = load i32, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 1), align 8, !tbaa !21
  %202 = icmp eq i32 %201, 1
  br i1 %202, label %203, label %215

203:                                              ; preds = %200
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %204, i32 0, i32 1
  %206 = load ptr, ptr %205, align 8, !tbaa !29
  %207 = load ptr, ptr %6, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %207, i32 0, i32 2
  %209 = load i64, ptr %208, align 8, !tbaa !30
  %210 = load ptr, ptr %20, align 8, !tbaa !5
  %211 = call i64 @UnicodeToAscii(ptr noundef %206, i64 noundef %209, ptr noundef %210)
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %212, i32 0, i32 2
  %214 = load i64, ptr %213, align 8, !tbaa !30
  store i64 %214, ptr %9, align 8, !tbaa !9
  br label %226

215:                                              ; preds = %200
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %216, i32 0, i32 2
  %218 = load i64, ptr %217, align 8, !tbaa !30
  %219 = mul i64 %218, 2
  store i64 %219, ptr %9, align 8, !tbaa !9
  %220 = load ptr, ptr %20, align 8, !tbaa !5
  %221 = load ptr, ptr %6, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %221, i32 0, i32 1
  %223 = load ptr, ptr %222, align 8, !tbaa !29
  %224 = load i64, ptr %9, align 8, !tbaa !9
  %225 = call ptr @CopyMem(ptr noundef %220, ptr noundef %223, i64 noundef %224)
  br label %226

226:                                              ; preds = %215, %203
  %227 = load i64, ptr %9, align 8, !tbaa !9
  %228 = load ptr, ptr %20, align 8, !tbaa !5
  %229 = getelementptr inbounds i8, ptr %228, i64 %227
  store ptr %229, ptr %20, align 8, !tbaa !5
  %230 = load i64, ptr %9, align 8, !tbaa !9
  %231 = load i64, ptr %18, align 8, !tbaa !9
  %232 = sub i64 %231, %230
  store i64 %232, ptr %18, align 8, !tbaa !9
  br label %233

233:                                              ; preds = %226, %195, %190
  %234 = load ptr, ptr %5, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct._LIST_ENTRY, ptr %234, i32 0, i32 0
  %236 = load ptr, ptr %235, align 8, !tbaa !24
  %237 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !23
  %238 = icmp ne ptr %236, %237
  br i1 %238, label %239, label %256

239:                                              ; preds = %233
  %240 = load i32, ptr %15, align 4, !tbaa !22
  %241 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 0
  call void @GetNewLine(i32 noundef %240, ptr noundef %241, ptr noundef %12)
  %242 = load ptr, ptr %20, align 8, !tbaa !5
  %243 = getelementptr inbounds [4 x i8], ptr %11, i64 0, i64 0
  %244 = load i8, ptr %12, align 1, !tbaa !31
  %245 = zext i8 %244 to i64
  %246 = call ptr @CopyMem(ptr noundef %242, ptr noundef %243, i64 noundef %245)
  %247 = load i8, ptr %12, align 1, !tbaa !31
  %248 = zext i8 %247 to i32
  %249 = load ptr, ptr %20, align 8, !tbaa !5
  %250 = sext i32 %248 to i64
  %251 = getelementptr inbounds i8, ptr %249, i64 %250
  store ptr %251, ptr %20, align 8, !tbaa !5
  %252 = load i8, ptr %12, align 1, !tbaa !31
  %253 = zext i8 %252 to i64
  %254 = load i64, ptr %18, align 8, !tbaa !9
  %255 = sub i64 %254, %253
  store i64 %255, ptr %18, align 8, !tbaa !9
  br label %256

256:                                              ; preds = %239, %233
  %257 = load i64, ptr %10, align 8, !tbaa !9
  %258 = add i64 %257, 1
  store i64 %258, ptr %10, align 8, !tbaa !9
  br label %259

259:                                              ; preds = %256
  %260 = load ptr, ptr %5, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct._LIST_ENTRY, ptr %260, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8, !tbaa !24
  store ptr %262, ptr %5, align 8, !tbaa !5
  br label %111, !llvm.loop !32

263:                                              ; preds = %111
  %264 = load i64, ptr %16, align 8, !tbaa !9
  %265 = load i64, ptr %18, align 8, !tbaa !9
  %266 = icmp ne i64 %264, %265
  br i1 %266, label %267, label %280

267:                                              ; preds = %263
  %268 = load i64, ptr %16, align 8, !tbaa !9
  %269 = load i64, ptr %18, align 8, !tbaa !9
  %270 = sub i64 %268, %269
  store i64 %270, ptr %19, align 8, !tbaa !9
  %271 = load ptr, ptr %4, align 8, !tbaa !5
  %272 = load ptr, ptr %17, align 8, !tbaa !5
  %273 = call i64 @ShellWriteFile(ptr noundef %271, ptr noundef %19, ptr noundef %272)
  store i64 %273, ptr %8, align 8, !tbaa !9
  %274 = load i64, ptr %8, align 8, !tbaa !9
  %275 = icmp slt i64 %274, 0
  br i1 %275, label %276, label %279

276:                                              ; preds = %267
  %277 = call i64 @ShellDeleteFile(ptr noundef %4)
  %278 = load ptr, ptr %17, align 8, !tbaa !5
  call void @FreePool(ptr noundef %278)
  store i64 -9223372036854775807, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

279:                                              ; preds = %267
  br label %280

280:                                              ; preds = %279, %263
  %281 = load ptr, ptr %17, align 8, !tbaa !5
  call void @FreePool(ptr noundef %281)
  %282 = call i64 @ShellCloseFile(ptr noundef %4)
  store i8 0, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 9), align 8, !tbaa !15
  %283 = load i64, ptr %10, align 8, !tbaa !9
  %284 = call ptr (ptr, ptr, ...) @CatSPrint(ptr noundef null, ptr noundef @.str.22, i64 noundef %283)
  store ptr %284, ptr %7, align 8, !tbaa !5
  %285 = load ptr, ptr %7, align 8, !tbaa !5
  %286 = icmp eq ptr %285, null
  br i1 %286, label %287, label %288

287:                                              ; preds = %280
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

288:                                              ; preds = %280
  %289 = load ptr, ptr %7, align 8, !tbaa !5
  %290 = call i64 @StatusBarSetStatusString(ptr noundef %289)
  br label %291

291:                                              ; preds = %288
  %292 = load ptr, ptr %7, align 8, !tbaa !5
  %293 = icmp ne ptr %292, null
  br i1 %293, label %294, label %296

294:                                              ; preds = %291
  %295 = load ptr, ptr %7, align 8, !tbaa !5
  call void @FreePool(ptr noundef %295)
  store ptr null, ptr %7, align 8, !tbaa !5
  br label %296

296:                                              ; preds = %294, %291
  br label %297

297:                                              ; preds = %296
  br label %298

298:                                              ; preds = %297
  %299 = load ptr, ptr %3, align 8, !tbaa !5
  %300 = icmp ne ptr %299, null
  br i1 %300, label %301, label %317

301:                                              ; preds = %298
  %302 = load ptr, ptr @FileBuffer, align 8, !tbaa !11
  %303 = icmp ne ptr %302, null
  br i1 %303, label %304, label %317

304:                                              ; preds = %301
  %305 = load ptr, ptr %3, align 8, !tbaa !5
  %306 = load ptr, ptr @FileBuffer, align 8, !tbaa !11
  %307 = call i64 @StrCmp(ptr noundef %305, ptr noundef %306)
  %308 = icmp ne i64 %307, 0
  br i1 %308, label %309, label %317

309:                                              ; preds = %304
  %310 = load ptr, ptr %3, align 8, !tbaa !5
  %311 = call i64 @FileBufferSetFileName(ptr noundef %310)
  %312 = load ptr, ptr @FileBuffer, align 8, !tbaa !11
  %313 = icmp eq ptr %312, null
  br i1 %313, label %314, label %316

314:                                              ; preds = %309
  %315 = call i64 @ShellDeleteFile(ptr noundef %4)
  store i64 -9223372036854775799, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

316:                                              ; preds = %309
  br label %317

317:                                              ; preds = %316, %304, %301, %298
  store i8 0, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 11), align 2, !tbaa !16
  store i64 0, ptr %2, align 8
  store i32 1, ptr %21, align 4
  br label %318

318:                                              ; preds = %317, %314, %287, %276, %184, %103, %95, %85, %76, %55, %36, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  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 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %319 = load i64, ptr %2, align 8
  ret i64 %319
}

declare i64 @ShellWriteFile(ptr noundef, ptr noundef, 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !6, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !14, i64 40, !14, i64 56, !14, i64 72, !14, i64 88, !7, i64 104, !7, i64 105, !7, i64 106, !6, i64 112}
!13 = !{!"int", !7, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 8}
!15 = !{!12, !7, i64 104}
!16 = !{!12, !7, i64 106}
!17 = !{!18, !10, i64 72}
!18 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !19, i64 40, !19, i64 56, !10, i64 72, !7, i64 80}
!19 = !{!"", !20, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !13, i64 8, !20, i64 12, !7, i64 14, !7, i64 15}
!20 = !{!"short", !7, i64 0}
!21 = !{!12, !13, i64 8}
!22 = !{!13, !13, i64 0}
!23 = !{!12, !6, i64 16}
!24 = !{!25, !6, i64 0}
!25 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!26 = !{!27, !10, i64 0}
!27 = !{!"_EFI_EDITOR_LINE", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !25, i64 40}
!28 = !{!27, !13, i64 32}
!29 = !{!27, !6, i64 8}
!30 = !{!27, !10, i64 16}
!31 = !{!7, !7, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; 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
@.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.18 = external hidden unnamed_addr constant [32 x i32], align 4
@.str.19 = external hidden unnamed_addr constant [27 x i32], align 4
@.str.20 = external hidden unnamed_addr constant [18 x i32], align 4
@.str.21 = external hidden unnamed_addr constant [19 x i32], align 4
@gUnicodeFileTag = external constant i16, align 2
@.str.22 = external hidden unnamed_addr constant [15 x i32], align 4

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

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

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

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 @ShellCloseFile(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @GetNewLine(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775807, 1) i64 @FileBufferSave(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca [4 x i8], align 1
  %5 = alloca i8, align 1
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  store i64 0, ptr %3, align 8, !tbaa !5
  %7 = load ptr, ptr @FileBuffer, align 8, !tbaa !9
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %17, label %8

8:                                                ; preds = %1
  %9 = tail call i64 @StrCmp(ptr noundef %0, ptr noundef nonnull %7) #3
  %10 = icmp eq i64 %9, 0
  br i1 %10, label %11, label %17

11:                                               ; preds = %8
  %12 = load i8, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 104), align 8, !tbaa !14
  %.not96 = icmp eq i8 %12, 0
  br i1 %.not96, label %144, label %13

13:                                               ; preds = %11
  %14 = load i8, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 106), align 2, !tbaa !15
  %.not97 = icmp eq i8 %14, 0
  br i1 %.not97, label %17, label %15

15:                                               ; preds = %13
  %16 = tail call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.18) #3
  br label %144

17:                                               ; preds = %13, %8, %1
  %18 = call i64 @ShellOpenFileByName(ptr noundef %0, ptr noundef nonnull %2, i64 noundef 3, i64 noundef 0) #3
  %19 = icmp slt i64 %18, 0
  br i1 %19, label %38, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr %2, align 8, !tbaa !16
  %22 = call ptr @ShellGetFileInfo(ptr noundef %21) #3
  %.not98 = icmp eq ptr %22, null
  br i1 %.not98, label %.critedge, label %23

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %22, i64 72
  %25 = load i64, ptr %24, align 8, !tbaa !17
  %26 = and i64 %25, 16
  %.not99 = icmp eq i64 %26, 0
  br i1 %.not99, label %31, label %27

27:                                               ; preds = %23
  %28 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.19) #3
  %29 = load ptr, ptr %2, align 8, !tbaa !16
  %30 = call i64 @ShellCloseFile(ptr noundef %29) #3
  call void @FreePool(ptr noundef nonnull %22) #3
  br label %144

31:                                               ; preds = %23
  %32 = and i64 %25, -18
  call void @FreePool(ptr noundef nonnull %22) #3
  br label %.critedge

.critedge:                                        ; preds = %20, %31
  %.082 = phi i64 [ %32, %31 ], [ 0, %20 ]
  %33 = call i64 @ShellDeleteFile(ptr noundef nonnull %2) #3
  %34 = icmp slt i64 %33, 0
  %35 = icmp eq i64 %33, 2
  %or.cond = or i1 %34, %35
  br i1 %or.cond, label %36, label %38

36:                                               ; preds = %.critedge
  %37 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.20) #3
  br label %144

38:                                               ; preds = %.critedge, %17
  %.183 = phi i64 [ 0, %17 ], [ %.082, %.critedge ]
  %39 = call i64 @ShellOpenFileByName(ptr noundef %0, ptr noundef nonnull %2, i64 noundef -9223372036854775805, i64 noundef %.183) #3
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %38
  %42 = call i64 @StatusBarSetStatusString(ptr noundef nonnull @.str.21) #3
  br label %144

43:                                               ; preds = %38
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  %45 = icmp eq i32 %44, 2
  br i1 %45, label %46, label %52

46:                                               ; preds = %43
  store i64 2, ptr %3, align 8, !tbaa !5
  %47 = load ptr, ptr %2, align 8, !tbaa !16
  %48 = call i64 @ShellWriteFile(ptr noundef %47, ptr noundef nonnull %3, ptr noundef nonnull @gUnicodeFileTag) #3
  %49 = icmp slt i64 %48, 0
  br i1 %49, label %50, label %52

50:                                               ; preds = %46
  %51 = call i64 @ShellDeleteFile(ptr noundef nonnull %2) #3
  br label %144

52:                                               ; preds = %46, %43
  %53 = call ptr @AllocateZeroPool(i64 noundef 2097152) #3
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %57

55:                                               ; preds = %52
  %56 = call i64 @ShellDeleteFile(ptr noundef nonnull %2) #3
  br label %144

57:                                               ; preds = %52
  %58 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 16), align 8, !tbaa !22
  %.079113 = load ptr, ptr %58, align 8, !tbaa !23
  %.not100114 = icmp eq ptr %.079113, %58
  br i1 %.not100114, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %57, %111
  %.079119 = phi ptr [ %.079.pre, %111 ], [ %.079113, %57 ]
  %.0118 = phi ptr [ %117, %111 ], [ %53, %57 ]
  %.074117 = phi i64 [ %118, %111 ], [ 2097152, %57 ]
  %.080116 = phi i32 [ %spec.select, %111 ], [ 3, %57 ]
  %.084115 = phi i64 [ %119, %111 ], [ 0, %57 ]
  %59 = call zeroext i8 @DebugAssertEnabled() #3
  %.not103 = icmp eq i8 %59, 0
  %.pre125 = ptrtoint ptr %.079119 to i64
  %.pre126 = add i64 %.pre125, -40
  %.pre128 = inttoptr i64 %.pre126 to ptr
  br i1 %.not103, label %.lr.ph._crit_edge, label %60

60:                                               ; preds = %.lr.ph
  %61 = load i64, ptr %.pre128, align 8, !tbaa !25
  %.not104 = icmp eq i64 %61, 1819043173
  br i1 %.not104, label %.lr.ph._crit_edge, label %62

62:                                               ; preds = %60
  call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 1543, ptr noundef nonnull @.str.2) #3
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %60, %62
  %63 = phi ptr [ %.079119, %62 ], [ %.pre128, %60 ], [ %.pre128, %.lr.ph ]
  %64 = getelementptr inbounds i8, ptr %63, i64 32
  %65 = load i32, ptr %64, align 8, !tbaa !27
  %.not105 = icmp eq i32 %65, 0
  %spec.select = select i1 %.not105, i32 %.080116, i32 %65
  store i64 4, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %63, i64 8
  %67 = load ptr, ptr %66, align 8, !tbaa !28
  %.not106 = icmp eq ptr %67, null
  br i1 %.not106, label %79, label %68

68:                                               ; preds = %.lr.ph._crit_edge
  %69 = getelementptr inbounds i8, ptr %63, i64 16
  %70 = load i64, ptr %69, align 8, !tbaa !29
  %.not107 = icmp eq i64 %70, 0
  br i1 %.not107, label %79, label %71

71:                                               ; preds = %68
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  %73 = icmp eq i32 %72, 1
  br i1 %73, label %74, label %76

74:                                               ; preds = %71
  %75 = add i64 %70, 4
  store i64 %75, ptr %3, align 8, !tbaa !5
  br label %79

76:                                               ; preds = %71
  %77 = shl i64 %70, 1
  %78 = add i64 %77, 4
  store i64 %78, ptr %3, align 8, !tbaa !5
  br label %79

79:                                               ; preds = %74, %76, %68, %.lr.ph._crit_edge
  %80 = phi i64 [ %75, %74 ], [ %78, %76 ], [ 4, %68 ], [ 4, %.lr.ph._crit_edge ]
  %81 = icmp ult i64 %.074117, %80
  br i1 %81, label %82, label %89

82:                                               ; preds = %79
  %83 = sub i64 2097152, %.074117
  store i64 %83, ptr %6, align 8, !tbaa !5
  %84 = load ptr, ptr %2, align 8, !tbaa !16
  %85 = call i64 @ShellWriteFile(ptr noundef %84, ptr noundef nonnull %6, ptr noundef nonnull %53) #3
  %86 = icmp slt i64 %85, 0
  br i1 %86, label %87, label %._crit_edge121

._crit_edge121:                                   ; preds = %82
  %.pre = load ptr, ptr %66, align 8, !tbaa !28
  br label %89

87:                                               ; preds = %82
  %88 = call i64 @ShellDeleteFile(ptr noundef nonnull %2) #3
  call void @FreePool(ptr noundef nonnull %53) #3
  br label %144

89:                                               ; preds = %._crit_edge121, %79
  %90 = phi ptr [ %67, %79 ], [ %.pre, %._crit_edge121 ]
  %.175 = phi i64 [ %.074117, %79 ], [ 2097152, %._crit_edge121 ]
  %.1 = phi ptr [ %.0118, %79 ], [ %53, %._crit_edge121 ]
  %.not108 = icmp eq ptr %90, null
  br i1 %.not108, label %107, label %91

91:                                               ; preds = %89
  %92 = getelementptr inbounds i8, ptr %63, i64 16
  %93 = load i64, ptr %92, align 8, !tbaa !29
  %.not109 = icmp eq i64 %93, 0
  br i1 %.not109, label %107, label %94

94:                                               ; preds = %91
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 8), align 8, !tbaa !21
  %96 = icmp eq i32 %95, 1
  br i1 %96, label %97, label %100

97:                                               ; preds = %94
  %98 = call i64 @UnicodeToAscii(ptr noundef nonnull %90, i64 noundef %93, ptr noundef %.1)
  %99 = load i64, ptr %92, align 8, !tbaa !29
  store i64 %99, ptr %3, align 8, !tbaa !5
  br label %103

100:                                              ; preds = %94
  %101 = shl i64 %93, 1
  store i64 %101, ptr %3, align 8, !tbaa !5
  %102 = call ptr @CopyMem(ptr noundef %.1, ptr noundef nonnull %90, i64 noundef %101) #3
  %.pre122 = load i64, ptr %3, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %100, %97
  %104 = phi i64 [ %.pre122, %100 ], [ %99, %97 ]
  %105 = getelementptr inbounds i8, ptr %.1, i64 %104
  %106 = sub i64 %.175, %104
  br label %107

107:                                              ; preds = %103, %91, %89
  %.276 = phi i64 [ %106, %103 ], [ %.175, %91 ], [ %.175, %89 ]
  %.2 = phi ptr [ %105, %103 ], [ %.1, %91 ], [ %.1, %89 ]
  %108 = load ptr, ptr %.079119, align 8, !tbaa !23
  %109 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 16), align 8, !tbaa !22
  %.not110 = icmp eq ptr %108, %109
  br i1 %.not110, label %.thread, label %111

.thread:                                          ; preds = %107
  %110 = add i64 %.084115, 1
  br label %._crit_edge

111:                                              ; preds = %107
  call void @GetNewLine(i32 noundef %spec.select, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %112 = load i8, ptr %5, align 1, !tbaa !30
  %113 = zext i8 %112 to i64
  %114 = call ptr @CopyMem(ptr noundef %.2, ptr noundef nonnull %4, i64 noundef %113) #3
  %115 = load i8, ptr %5, align 1, !tbaa !30
  %116 = zext i8 %115 to i64
  %117 = getelementptr inbounds i8, ptr %.2, i64 %116
  %118 = sub i64 %.276, %116
  %.079.pre = load ptr, ptr %.079119, align 8, !tbaa !23
  %.pre124 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 16), align 8, !tbaa !22
  %119 = add i64 %.084115, 1
  %.not100 = icmp eq ptr %.079.pre, %.pre124
  br i1 %.not100, label %._crit_edge, label %.lr.ph, !llvm.loop !31

._crit_edge:                                      ; preds = %111, %.thread
  %.084.lcssa = phi i64 [ %110, %.thread ], [ %119, %111 ]
  %.074.lcssa = phi i64 [ %.276, %.thread ], [ %118, %111 ]
  %.not101 = icmp eq i64 %.074.lcssa, 2097152
  br i1 %.not101, label %._crit_edge.thread, label %120

120:                                              ; preds = %._crit_edge
  %121 = sub i64 2097152, %.074.lcssa
  store i64 %121, ptr %6, align 8, !tbaa !5
  %122 = load ptr, ptr %2, align 8, !tbaa !16
  %123 = call i64 @ShellWriteFile(ptr noundef %122, ptr noundef nonnull %6, ptr noundef nonnull %53) #3
  %124 = icmp slt i64 %123, 0
  br i1 %124, label %125, label %._crit_edge.thread

125:                                              ; preds = %120
  %126 = call i64 @ShellDeleteFile(ptr noundef nonnull %2) #3
  call void @FreePool(ptr noundef nonnull %53) #3
  br label %144

._crit_edge.thread:                               ; preds = %57, %120, %._crit_edge
  %.084.lcssa138 = phi i64 [ %.084.lcssa, %120 ], [ %.084.lcssa, %._crit_edge ], [ 0, %57 ]
  call void @FreePool(ptr noundef nonnull %53) #3
  %127 = call i64 @ShellCloseFile(ptr noundef nonnull %2) #3
  store i8 0, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 104), align 8, !tbaa !14
  %128 = call ptr (ptr, ptr, ...) @CatSPrint(ptr noundef null, ptr noundef nonnull @.str.22, i64 noundef %.084.lcssa138) #3
  %129 = icmp eq ptr %128, null
  br i1 %129, label %144, label %130

130:                                              ; preds = %._crit_edge.thread
  %131 = call i64 @StatusBarSetStatusString(ptr noundef nonnull %128) #3
  call void @FreePool(ptr noundef nonnull %128) #3
  %132 = icmp ne ptr %0, null
  %133 = load ptr, ptr @FileBuffer, align 8
  %134 = icmp ne ptr %133, null
  %or.cond3 = select i1 %132, i1 %134, i1 false
  br i1 %or.cond3, label %135, label %143

135:                                              ; preds = %130
  %136 = call i64 @StrCmp(ptr noundef nonnull %0, ptr noundef nonnull %133) #3
  %.not102 = icmp eq i64 %136, 0
  br i1 %.not102, label %143, label %137

137:                                              ; preds = %135
  %138 = call i64 @FileBufferSetFileName(ptr noundef nonnull %0)
  %139 = load ptr, ptr @FileBuffer, align 8, !tbaa !9
  %140 = icmp eq ptr %139, null
  br i1 %140, label %141, label %143

141:                                              ; preds = %137
  %142 = call i64 @ShellDeleteFile(ptr noundef nonnull %2) #3
  br label %144

143:                                              ; preds = %137, %135, %130
  store i8 0, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 106), align 2, !tbaa !15
  br label %144

144:                                              ; preds = %._crit_edge.thread, %11, %143, %141, %125, %87, %55, %50, %41, %36, %27, %15
  %.078 = phi i64 [ 0, %15 ], [ -9223372036854775807, %41 ], [ -9223372036854775807, %50 ], [ -9223372036854775799, %55 ], [ -9223372036854775807, %87 ], [ -9223372036854775807, %125 ], [ -9223372036854775799, %141 ], [ 0, %143 ], [ -9223372036854775807, %27 ], [ -9223372036854775807, %36 ], [ 0, %11 ], [ -9223372036854775799, %._crit_edge.thread ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i64 %.078
}

declare i64 @ShellWriteFile(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #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 = { 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 = { 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !13, i64 40, !13, i64 56, !13, i64 72, !13, i64 88, !7, i64 104, !7, i64 105, !7, i64 106, !11, i64 112}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !6, i64 0, !6, i64 8}
!14 = !{!10, !7, i64 104}
!15 = !{!10, !7, i64 106}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !6, i64 72}
!18 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !19, i64 24, !19, i64 40, !19, i64 56, !6, i64 72, !7, i64 80}
!19 = !{!"", !20, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !12, i64 8, !20, i64 12, !7, i64 14, !7, i64 15}
!20 = !{!"short", !7, i64 0}
!21 = !{!10, !12, i64 8}
!22 = !{!10, !11, i64 16}
!23 = !{!24, !11, i64 0}
!24 = !{!"_LIST_ENTRY", !11, i64 0, !11, i64 8}
!25 = !{!26, !6, i64 0}
!26 = !{!"_EFI_EDITOR_LINE", !6, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !24, i64 40}
!27 = !{!26, !12, i64 32}
!28 = !{!26, !11, i64 8}
!29 = !{!26, !6, i64 16}
!30 = !{!7, !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass