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

; 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_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
@.str.1 = external hidden unnamed_addr constant [163 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare zeroext i8 @DebugAssertEnabled() #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @FileBufferSearch(ptr noundef %0, i64 noundef %1) #2 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  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 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #3
  store i64 0, ptr %9, align 8, !tbaa !9
  store i64 0, ptr %7, align 8, !tbaa !9
  %15 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !11
  %16 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %15, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = load i64, 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 !18
  %19 = getelementptr inbounds i16, ptr %17, i64 %18
  %20 = getelementptr inbounds i16, ptr %19, i64 -1
  %21 = load i64, ptr %5, align 8, !tbaa !9
  %22 = getelementptr inbounds i16, ptr %20, i64 %21
  store ptr %22, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !11
  %25 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  %27 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !11
  %28 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %27, i32 0, i32 2
  %29 = load i64, ptr %28, align 8, !tbaa !19
  %30 = getelementptr inbounds i16, ptr %26, i64 %29
  %31 = icmp uge ptr %23, %30
  br i1 %31, label %32, label %40

32:                                               ; preds = %2
  %33 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !11
  %34 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !11
  %37 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %36, i32 0, i32 2
  %38 = load i64, ptr %37, align 8, !tbaa !19
  %39 = getelementptr inbounds i16, ptr %35, i64 %38
  store ptr %39, ptr %6, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %32, %2
  store i8 0, ptr %13, align 1, !tbaa !20
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = call ptr @StrStr(ptr noundef %41, ptr noundef %42)
  store ptr %43, ptr %11, align 8, !tbaa !5
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %54

46:                                               ; preds = %40
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = ptrtoint ptr %47 to i64
  %50 = ptrtoint ptr %48 to i64
  %51 = sub i64 %49, %50
  %52 = sdiv exact i64 %51, 2
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %7, align 8, !tbaa !9
  store i8 1, ptr %13, align 1, !tbaa !20
  br label %54

54:                                               ; preds = %46, %40
  %55 = load i8, ptr %13, align 1, !tbaa !20
  %56 = icmp ne i8 %55, 0
  br i1 %56, label %57, label %65

57:                                               ; preds = %54
  %58 = load i64, ptr %7, align 8, !tbaa !9
  %59 = sub i64 %58, 1
  %60 = load i64, 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 !18
  %61 = add i64 %59, %60
  %62 = load i64, ptr %5, align 8, !tbaa !9
  %63 = add i64 %61, %62
  store i64 %63, ptr %9, align 8, !tbaa !9
  %64 = load i64, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 6), align 8, !tbaa !21
  store i64 %64, ptr %8, align 8, !tbaa !9
  br label %132

65:                                               ; preds = %54
  %66 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 12), align 8, !tbaa !11
  %67 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %66, i32 0, i32 5
  %68 = getelementptr inbounds %struct._LIST_ENTRY, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !22
  store ptr %69, ptr %12, align 8, !tbaa !5
  %70 = load i64, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 6), align 8, !tbaa !21
  %71 = add i64 %70, 1
  store i64 %71, ptr %8, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %119, %65
  %73 = load ptr, ptr %12, align 8, !tbaa !5
  %74 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !23
  %75 = icmp ne ptr %73, %74
  br i1 %75, label %76, label %125

76:                                               ; preds = %72
  %77 = call zeroext i8 @DebugAssertEnabled()
  %78 = zext i8 %77 to i32
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %90

80:                                               ; preds = %76
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = ptrtoint ptr %81 to i64
  %83 = sub i64 %82, ptrtoint (ptr getelementptr inbounds (%struct._EFI_EDITOR_LINE, ptr null, i32 0, i32 5) to i64)
  %84 = inttoptr i64 %83 to ptr
  %85 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 8, !tbaa !24
  %87 = icmp ne i64 %86, 1819043173
  br i1 %87, label %88, label %90

88:                                               ; preds = %80
  call void @DebugAssert(ptr noundef @.str.1, i64 noundef 3010, ptr noundef @.str.2)
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  br label %95

90:                                               ; preds = %80, %76
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = ptrtoint ptr %91 to i64
  %93 = sub i64 %92, ptrtoint (ptr getelementptr inbounds (%struct._EFI_EDITOR_LINE, ptr null, i32 0, i32 5) to i64)
  %94 = inttoptr i64 %93 to ptr
  br label %95

95:                                               ; preds = %90, %88
  %96 = phi ptr [ %89, %88 ], [ %94, %90 ]
  store ptr %96, ptr %10, align 8, !tbaa !5
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !15
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = call ptr @StrStr(ptr noundef %99, ptr noundef %100)
  store ptr %101, ptr %11, align 8, !tbaa !5
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %114

104:                                              ; preds = %95
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._EFI_EDITOR_LINE, ptr %106, i32 0, i32 1
  %108 = load ptr, ptr %107, align 8, !tbaa !15
  %109 = ptrtoint ptr %105 to i64
  %110 = ptrtoint ptr %108 to i64
  %111 = sub i64 %109, %110
  %112 = sdiv exact i64 %111, 2
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %7, align 8, !tbaa !9
  store i8 1, ptr %13, align 1, !tbaa !20
  br label %114

114:                                              ; preds = %104, %95
  %115 = load i8, ptr %13, align 1, !tbaa !20
  %116 = icmp ne i8 %115, 0
  br i1 %116, label %117, label %119

117:                                              ; preds = %114
  %118 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %118, ptr %9, align 8, !tbaa !9
  br label %125

119:                                              ; preds = %114
  %120 = load i64, ptr %8, align 8, !tbaa !9
  %121 = add i64 %120, 1
  store i64 %121, ptr %8, align 8, !tbaa !9
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._LIST_ENTRY, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !25
  store ptr %124, ptr %12, align 8, !tbaa !5
  br label %72, !llvm.loop !26

125:                                              ; preds = %117, %72
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  %127 = load ptr, ptr getelementptr inbounds (%struct.EFI_EDITOR_FILE_BUFFER, ptr @FileBuffer, i32 0, i32 2), align 8, !tbaa !23
  %128 = icmp eq ptr %126, %127
  br i1 %128, label %129, label %130

129:                                              ; preds = %125
  store i8 0, ptr %13, align 1, !tbaa !20
  br label %131

130:                                              ; preds = %125
  store i8 1, ptr %13, align 1, !tbaa !20
  br label %131

131:                                              ; preds = %130, %129
  br label %132

132:                                              ; preds = %131, %57
  %133 = load i8, ptr %13, align 1, !tbaa !20
  %134 = icmp ne i8 %133, 0
  br i1 %134, label %136, label %135

135:                                              ; preds = %132
  store i64 -9223372036854775794, ptr %3, align 8
  store i32 1, ptr %14, align 4
  br label %140

136:                                              ; preds = %132
  %137 = load i64, ptr %8, align 8, !tbaa !9
  %138 = load i64, ptr %9, align 8, !tbaa !9
  call void @FileBufferMovePosition(i64 noundef %137, i64 noundef %138)
  %139 = call i64 @FileBufferRefresh()
  store i64 0, ptr %3, align 8
  store i32 1, ptr %14, align 4
  br label %140

140:                                              ; preds = %136, %135
  call void @llvm.lifetime.end.p0(i64 1, 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 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %141 = load i64, ptr %3, align 8
  ret i64 %141
}

declare ptr @StrStr(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #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 112}
!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 = !{!16, !6, i64 8}
!16 = !{!"_EFI_EDITOR_LINE", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !13, i64 32, !17, i64 40}
!17 = !{!"_LIST_ENTRY", !6, i64 0, !6, i64 8}
!18 = !{!12, !10, i64 64}
!19 = !{!16, !10, i64 16}
!20 = !{!7, !7, i64 0}
!21 = !{!12, !10, i64 56}
!22 = !{!16, !6, i64 40}
!23 = !{!12, !6, i64 16}
!24 = !{!16, !10, i64 0}
!25 = !{!17, !6, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @FileBufferRefresh() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @FileBufferMovePosition(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i64 -9223372036854775794, 1) i64 @FileBufferSearch(ptr noundef %0, i64 noundef %1) local_unnamed_addr #1 {
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 112), align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !13
  %6 = load i64, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 64), align 8, !tbaa !16
  %7 = getelementptr inbounds i16, ptr %5, i64 %6
  %8 = getelementptr inbounds i8, ptr %7, i64 -2
  %9 = getelementptr inbounds i16, ptr %8, i64 %1
  %10 = getelementptr inbounds i8, ptr %3, i64 16
  %11 = load i64, ptr %10, align 8, !tbaa !17
  %12 = getelementptr inbounds i16, ptr %5, i64 %11
  %.not = icmp ult ptr %9, %12
  %spec.select = select i1 %.not, ptr %9, ptr %12
  %13 = tail call ptr @StrStr(ptr noundef %spec.select, ptr noundef %0) #2
  %.not41 = icmp eq ptr %13, null
  br i1 %.not41, label %22, label %.thread50

.thread50:                                        ; preds = %2
  %14 = ptrtoint ptr %13 to i64
  %15 = ptrtoint ptr %spec.select to i64
  %16 = sub i64 %14, %15
  %17 = ashr exact i64 %16, 1
  %18 = load i64, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 64), align 8, !tbaa !16
  %19 = add i64 %17, %1
  %20 = add i64 %19, %18
  %21 = load i64, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 56), align 8, !tbaa !18
  br label %45

22:                                               ; preds = %2
  %23 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 112), align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 40
  %25 = load i64, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 56), align 8, !tbaa !18
  br label %26

26:                                               ; preds = %._crit_edge, %22
  %.031.in = phi i64 [ %25, %22 ], [ %.031, %._crit_edge ]
  %.027.in = phi ptr [ %24, %22 ], [ %.027, %._crit_edge ]
  %.027 = load ptr, ptr %.027.in, align 8, !tbaa !19
  %.031 = add i64 %.031.in, 1
  %27 = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 16), align 8, !tbaa !20
  %.not43 = icmp eq ptr %.027, %27
  br i1 %.not43, label %.loopexit.thread, label %28

28:                                               ; preds = %26
  %29 = tail call zeroext i8 @DebugAssertEnabled() #2
  %.not44 = icmp eq i8 %29, 0
  %.pre67 = ptrtoint ptr %.027 to i64
  %.pre68 = add i64 %.pre67, -40
  %.pre70 = inttoptr i64 %.pre68 to ptr
  br i1 %.not44, label %._crit_edge, label %30

30:                                               ; preds = %28
  %31 = load i64, ptr %.pre70, align 8, !tbaa !21
  %.not45 = icmp eq i64 %31, 1819043173
  br i1 %.not45, label %._crit_edge, label %32

32:                                               ; preds = %30
  tail call void @DebugAssert(ptr noundef nonnull @.str.1, i64 noundef 3010, ptr noundef nonnull @.str.2) #2
  br label %._crit_edge

._crit_edge:                                      ; preds = %28, %30, %32
  %33 = phi ptr [ %.027, %32 ], [ %.pre70, %30 ], [ %.pre70, %28 ]
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = tail call ptr @StrStr(ptr noundef %35, ptr noundef %0) #2
  %.not46 = icmp eq ptr %36, null
  br i1 %.not46, label %26, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %._crit_edge
  %37 = getelementptr inbounds i8, ptr %33, i64 8
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = ptrtoint ptr %36 to i64
  %40 = ptrtoint ptr %38 to i64
  %41 = sub i64 %39, %40
  %42 = ashr exact i64 %41, 1
  %43 = add nsw i64 %42, 1
  %.pre = load ptr, ptr getelementptr inbounds (i8, ptr @FileBuffer, i64 16), align 8, !tbaa !20
  %44 = icmp eq ptr %.027, %.pre
  br i1 %44, label %.loopexit.thread, label %45

45:                                               ; preds = %.thread50, %.loopexit
  %.13055 = phi i64 [ %20, %.thread50 ], [ %43, %.loopexit ]
  %.13254 = phi i64 [ %21, %.thread50 ], [ %.031, %.loopexit ]
  tail call void @FileBufferMovePosition(i64 noundef %.13254, i64 noundef %.13055)
  %46 = tail call i64 @FileBufferRefresh()
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %26, %.loopexit, %45
  %.028 = phi i64 [ 0, %45 ], [ -9223372036854775794, %.loopexit ], [ -9223372036854775794, %26 ]
  ret i64 %.028
}

declare ptr @StrStr(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 = { 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 #2 = { 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, !7, i64 112}
!6 = !{!"", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !12, i64 40, !12, i64 56, !12, i64 72, !12, i64 88, !8, i64 104, !8, i64 105, !8, i64 106, !7, i64 112}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"", !11, i64 0, !11, i64 8}
!13 = !{!14, !7, i64 8}
!14 = !{!"_EFI_EDITOR_LINE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 24, !10, i64 32, !15, i64 40}
!15 = !{!"_LIST_ENTRY", !7, i64 0, !7, i64 8}
!16 = !{!6, !11, i64 64}
!17 = !{!14, !11, i64 16}
!18 = !{!6, !11, i64 56}
!19 = !{!15, !7, i64 0}
!20 = !{!6, !7, i64 16}
!21 = !{!14, !11, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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