; LLVM IR from mlcommons/tiny :: benchmark/interface/Middlewares/ST/filex/common/src/fx_utility_FAT_map_flush.l_93a0a46c (flush)

; 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.FX_MEDIA_STRUCT = type { i64, ptr, ptr, i64, i32, i64, ptr, ptr, i64, i64, i32, i32, i32, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i64, i64, i32, i64, i64, ptr, i32, i32, ptr, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i64, ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.TX_MUTEX_STRUCT, i32, %struct.FX_DIR_ENTRY_STRUCT, %struct.FX_DIR_ENTRY_STRUCT, [256 x i8], [256 x i8], %struct.FX_PATH_STRUCT, [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], [128 x i8], i64, [1024 x i8], [256 x %struct.FX_CACHED_SECTOR_STRUCT], i64, i64, i64, i64, i8 }
%struct.TX_MUTEX_STRUCT = type { i64, ptr, i32, ptr, i32, i32, ptr, i32, ptr, ptr, i32, ptr, ptr }
%struct.FX_DIR_ENTRY_STRUCT = type { ptr, [13 x i8], i32, i32, i8, i8, i8, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.FX_PATH_STRUCT = type { %struct.FX_DIR_ENTRY_STRUCT, [256 x i8], [256 x i8], i64 }
%struct.FX_FAT_CACHE_ENTRY_STRUCT = type { i64, i64, i64 }
%struct.FX_CACHED_SECTOR_STRUCT = type { ptr, i64, i8, i8, i8, i8, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_utility_FAT_map_flush(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = 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 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %11, i32 0, i32 20
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = urem i32 %13, 1024
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %22

16:                                               ; preds = %1
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %17, i32 0, i32 20
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = udiv i32 %19, 1024
  %21 = trunc i32 %20 to i8
  store i8 %21, ptr %9, align 1, !tbaa !17
  br label %29

22:                                               ; preds = %1
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %23, i32 0, i32 20
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = udiv i32 %25, 1024
  %27 = add i32 %26, 1
  %28 = trunc i32 %27 to i8
  store i8 %28, ptr %9, align 1, !tbaa !17
  br label %29

29:                                               ; preds = %22, %16
  store i32 0, ptr %6, align 4, !tbaa !18
  br label %30

30:                                               ; preds = %132, %29
  %31 = load i32, ptr %6, align 4, !tbaa !18
  %32 = icmp ult i32 %31, 1024
  br i1 %32, label %33, label %135

33:                                               ; preds = %30
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %34, i32 0, i32 120
  %36 = load i32, ptr %6, align 4, !tbaa !18
  %37 = lshr i32 %36, 3
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds [128 x i8], ptr %35, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !17
  %41 = zext i8 %40 to i32
  %42 = load i32, ptr %6, align 4, !tbaa !18
  %43 = and i32 %42, 7
  %44 = shl i32 1, %43
  %45 = and i32 %41, %44
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %33
  br label %132

48:                                               ; preds = %33
  %49 = load i32, ptr %6, align 4, !tbaa !18
  %50 = load i8, ptr %9, align 1, !tbaa !17
  %51 = zext i8 %50 to i32
  %52 = mul i32 %49, %51
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %53, i32 0, i32 15
  %55 = load i32, ptr %54, align 8, !tbaa !19
  %56 = add i32 %52, %55
  %57 = zext i32 %56 to i64
  store i64 %57, ptr %4, align 8, !tbaa !20
  %58 = load i64, ptr %4, align 8, !tbaa !20
  %59 = load i8, ptr %9, align 1, !tbaa !17
  %60 = zext i8 %59 to i64
  %61 = add i64 %58, %60
  store i64 %61, ptr %5, align 8, !tbaa !20
  %62 = load i64, ptr %5, align 8, !tbaa !20
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %63, i32 0, i32 20
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %66, i32 0, i32 15
  %68 = load i32, ptr %67, align 8, !tbaa !19
  %69 = add i32 %65, %68
  %70 = zext i32 %69 to i64
  %71 = icmp ugt i64 %62, %70
  br i1 %71, label %72, label %81

72:                                               ; preds = %48
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %73, i32 0, i32 20
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %76, i32 0, i32 15
  %78 = load i32, ptr %77, align 8, !tbaa !19
  %79 = add i32 %75, %78
  %80 = zext i32 %79 to i64
  store i64 %80, ptr %5, align 8, !tbaa !20
  br label %81

81:                                               ; preds = %72, %48
  br label %82

82:                                               ; preds = %128, %81
  %83 = load i64, ptr %4, align 8, !tbaa !20
  %84 = load i64, ptr %5, align 8, !tbaa !20
  %85 = icmp ult i64 %83, %84
  br i1 %85, label %86, label %131

86:                                               ; preds = %82
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load i64, ptr %4, align 8, !tbaa !20
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !21
  %92 = call i32 @_fx_utility_logical_sector_read(ptr noundef %87, i64 noundef %88, ptr noundef %91, i64 noundef 1, i8 noundef zeroext 2)
  store i32 %92, ptr %7, align 4, !tbaa !18
  %93 = load i32, ptr %7, align 4, !tbaa !18
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %97

95:                                               ; preds = %86
  %96 = load i32, ptr %7, align 4, !tbaa !18
  store i32 %96, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %149

97:                                               ; preds = %86
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %98, i32 0, i32 21
  %100 = load i32, ptr %99, align 8, !tbaa !22
  %101 = sub i32 %100, 1
  store i32 %101, ptr %8, align 4, !tbaa !18
  br label %102

102:                                              ; preds = %124, %97
  %103 = load i32, ptr %8, align 4, !tbaa !18
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %127

105:                                              ; preds = %102
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = load i64, ptr %4, align 8, !tbaa !20
  %108 = load i32, ptr %8, align 4, !tbaa !18
  %109 = zext i32 %108 to i64
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %110, i32 0, i32 20
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = mul i64 %109, %113
  %115 = add i64 %107, %114
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %116, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !21
  %119 = call i32 @_fx_utility_logical_sector_write(ptr noundef %106, i64 noundef %115, ptr noundef %118, i64 noundef 1, i8 noundef zeroext 2)
  store i32 %119, ptr %7, align 4, !tbaa !18
  %120 = load i32, ptr %7, align 4, !tbaa !18
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %124

122:                                              ; preds = %105
  %123 = load i32, ptr %7, align 4, !tbaa !18
  store i32 %123, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %149

124:                                              ; preds = %105
  %125 = load i32, ptr %8, align 4, !tbaa !18
  %126 = add i32 %125, -1
  store i32 %126, ptr %8, align 4, !tbaa !18
  br label %102, !llvm.loop !23

127:                                              ; preds = %102
  br label %128

128:                                              ; preds = %127
  %129 = load i64, ptr %4, align 8, !tbaa !20
  %130 = add i64 %129, 1
  store i64 %130, ptr %4, align 8, !tbaa !20
  br label %82, !llvm.loop !25

131:                                              ; preds = %82
  br label %132

132:                                              ; preds = %131, %47
  %133 = load i32, ptr %6, align 4, !tbaa !18
  %134 = add i32 %133, 1
  store i32 %134, ptr %6, align 4, !tbaa !18
  br label %30, !llvm.loop !26

135:                                              ; preds = %30
  store i32 0, ptr %6, align 4, !tbaa !18
  br label %136

136:                                              ; preds = %145, %135
  %137 = load i32, ptr %6, align 4, !tbaa !18
  %138 = icmp ult i32 %137, 128
  br i1 %138, label %139, label %148

139:                                              ; preds = %136
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %140, i32 0, i32 120
  %142 = load i32, ptr %6, align 4, !tbaa !18
  %143 = zext i32 %142 to i64
  %144 = getelementptr inbounds [128 x i8], ptr %141, i64 0, i64 %143
  store i8 0, ptr %144, align 1, !tbaa !17
  br label %145

145:                                              ; preds = %139
  %146 = load i32, ptr %6, align 4, !tbaa !18
  %147 = add i32 %146, 1
  store i32 %147, ptr %6, align 4, !tbaa !18
  br label %136, !llvm.loop !27

148:                                              ; preds = %136
  store i32 0, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %149

149:                                              ; preds = %148, %122, %95
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  %150 = load i32, ptr %2, align 4
  ret i32 %150
}

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

declare i32 @_fx_utility_logical_sector_read(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i8 noundef zeroext) #2

declare i32 @_fx_utility_logical_sector_write(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i8 noundef zeroext) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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, !12, i64 132}
!10 = !{!"FX_MEDIA_STRUCT", !11, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !12, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !11, i64 72, !12, i64 80, !12, i64 84, !12, i64 88, !13, i64 96, !11, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !11, i64 152, !12, i64 160, !11, i64 168, !11, i64 176, !12, i64 184, !11, i64 192, !11, i64 200, !6, i64 208, !12, i64 216, !12, i64 220, !6, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !12, i64 256, !12, i64 260, !12, i64 264, !12, i64 268, !12, i64 272, !12, i64 276, !12, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !11, i64 320, !6, i64 328, !6, i64 336, !11, i64 344, !11, i64 352, !11, i64 360, !11, i64 368, !11, i64 376, !11, i64 384, !11, i64 392, !11, i64 400, !11, i64 408, !11, i64 416, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !11, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !11, i64 576, !11, i64 584, !11, i64 592, !11, i64 600, !11, i64 608, !11, i64 616, !11, i64 624, !11, i64 632, !11, i64 640, !11, i64 648, !11, i64 656, !11, i64 664, !11, i64 672, !11, i64 680, !11, i64 688, !11, i64 696, !11, i64 704, !11, i64 712, !11, i64 720, !11, i64 728, !11, i64 736, !11, i64 744, !11, i64 752, !11, i64 760, !11, i64 768, !11, i64 776, !11, i64 784, !11, i64 792, !11, i64 800, !11, i64 808, !11, i64 816, !14, i64 824, !12, i64 920, !15, i64 928, !15, i64 1064, !7, i64 1200, !7, i64 1456, !16, i64 1712, !7, i64 2368, !7, i64 2752, !11, i64 2880, !7, i64 2888, !7, i64 3912, !11, i64 12104, !11, i64 12112, !11, i64 12120, !11, i64 12128, !7, i64 12136}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"TX_MUTEX_STRUCT", !11, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !12, i64 36, !6, i64 40, !12, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !6, i64 88}
!15 = !{!"FX_DIR_ENTRY_STRUCT", !6, i64 0, !7, i64 8, !12, i64 24, !12, i64 28, !7, i64 32, !7, i64 33, !7, i64 34, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !11, i64 56, !13, i64 64, !13, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !13, i64 112, !11, i64 120, !13, i64 128}
!16 = !{!"FX_PATH_STRUCT", !15, i64 0, !7, i64 136, !7, i64 392, !11, i64 648}
!17 = !{!7, !7, i64 0}
!18 = !{!12, !12, i64 0}
!19 = !{!10, !12, i64 112}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !6, i64 16}
!22 = !{!10, !12, i64 136}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !24}


; 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"

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_utility_FAT_map_flush(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 132
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = and i32 %3, 1023
  %5 = icmp ne i32 %4, 0
  %6 = lshr i32 %3, 10
  %7 = trunc i32 %6 to i8
  %8 = zext i1 %5 to i8
  %.0 = add i8 %8, %7
  %9 = getelementptr inbounds i8, ptr %0, i64 2752
  %10 = zext i8 %.0 to i32
  %11 = getelementptr inbounds i8, ptr %0, i64 112
  %12 = zext i8 %.0 to i64
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = getelementptr inbounds i8, ptr %0, i64 136
  br label %15

.preheader:                                       ; preds = %.loopexit52
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(128) %9, i8 0, i64 128, i1 false), !tbaa !16
  br label %.loopexit

15:                                               ; preds = %1, %.loopexit52
  %.04157 = phi i32 [ 0, %1 ], [ %51, %.loopexit52 ]
  %16 = lshr i32 %.04157, 3
  %17 = zext nneg i32 %16 to i64
  %18 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !16
  %20 = zext i8 %19 to i32
  %21 = and i32 %.04157, 7
  %22 = shl nuw nsw i32 1, %21
  %23 = and i32 %22, %20
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %.loopexit52, label %25

25:                                               ; preds = %15
  %26 = mul nuw nsw i32 %.04157, %10
  %27 = load i32, ptr %11, align 8, !tbaa !17
  %28 = add i32 %27, %26
  %29 = zext i32 %28 to i64
  %30 = add nuw nsw i64 %29, %12
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add i32 %31, %27
  %33 = zext i32 %32 to i64
  %spec.select = tail call i64 @llvm.umin.i64(i64 %30, i64 %33)
  %34 = icmp ugt i64 %spec.select, %29
  br i1 %34, label %.lr.ph, label %.loopexit52

.lr.ph:                                           ; preds = %25, %48
  %.04356 = phi i64 [ %49, %48 ], [ %29, %25 ]
  %35 = load ptr, ptr %13, align 8, !tbaa !18
  %36 = tail call i32 @_fx_utility_logical_sector_read(ptr noundef nonnull %0, i64 noundef %.04356, ptr noundef %35, i64 noundef 1, i8 noundef zeroext 2) #4
  %.not = icmp eq i32 %36, 0
  br i1 %.not, label %37, label %.loopexit

37:                                               ; preds = %.lr.ph
  %38 = load i32, ptr %14, align 8, !tbaa !19
  br label %39

39:                                               ; preds = %40, %37
  %.040.in = phi i32 [ %38, %37 ], [ %.040, %40 ]
  %.040 = add i32 %.040.in, -1
  %.not49 = icmp eq i32 %.040, 0
  br i1 %.not49, label %48, label %40

40:                                               ; preds = %39
  %41 = zext i32 %.040 to i64
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = zext i32 %42 to i64
  %44 = mul nuw i64 %43, %41
  %45 = add nuw i64 %44, %.04356
  %46 = load ptr, ptr %13, align 8, !tbaa !18
  %47 = tail call i32 @_fx_utility_logical_sector_write(ptr noundef nonnull %0, i64 noundef %45, ptr noundef %46, i64 noundef 1, i8 noundef zeroext 2) #4
  %.not50 = icmp eq i32 %47, 0
  br i1 %.not50, label %39, label %.loopexit, !llvm.loop !20

48:                                               ; preds = %39
  %49 = add nuw nsw i64 %.04356, 1
  %50 = icmp ult i64 %49, %spec.select
  br i1 %50, label %.lr.ph, label %.loopexit52, !llvm.loop !22

.loopexit52:                                      ; preds = %48, %25, %15
  %51 = add nuw nsw i32 %.04157, 1
  %exitcond.not = icmp eq i32 %51, 1024
  br i1 %exitcond.not, label %.preheader, label %15, !llvm.loop !23

.loopexit:                                        ; preds = %.lr.ph, %40, %.preheader
  %.044 = phi i32 [ 0, %.preheader ], [ %47, %40 ], [ %36, %.lr.ph ]
  ret i32 %.044
}

declare i32 @_fx_utility_logical_sector_read(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #1

declare i32 @_fx_utility_logical_sector_write(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 132}
!6 = !{!"FX_MEDIA_STRUCT", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !11, i64 32, !7, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !12, i64 96, !7, i64 104, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !7, i64 152, !11, i64 160, !7, i64 168, !7, i64 176, !11, i64 184, !7, i64 192, !7, i64 200, !10, i64 208, !11, i64 216, !11, i64 220, !10, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !7, i64 320, !10, i64 328, !10, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !7, i64 528, !7, i64 536, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !7, i64 576, !7, i64 584, !7, i64 592, !7, i64 600, !7, i64 608, !7, i64 616, !7, i64 624, !7, i64 632, !7, i64 640, !7, i64 648, !7, i64 656, !7, i64 664, !7, i64 672, !7, i64 680, !7, i64 688, !7, i64 696, !7, i64 704, !7, i64 712, !7, i64 720, !7, i64 728, !7, i64 736, !7, i64 744, !7, i64 752, !7, i64 760, !7, i64 768, !7, i64 776, !7, i64 784, !7, i64 792, !7, i64 800, !7, i64 808, !7, i64 816, !13, i64 824, !11, i64 920, !14, i64 928, !14, i64 1064, !8, i64 1200, !8, i64 1456, !15, i64 1712, !8, i64 2368, !8, i64 2752, !7, i64 2880, !8, i64 2888, !8, i64 3912, !7, i64 12104, !7, i64 12112, !7, i64 12120, !7, i64 12128, !8, i64 12136}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"TX_MUTEX_STRUCT", !7, i64 0, !10, i64 8, !11, i64 16, !10, i64 24, !11, i64 32, !11, i64 36, !10, i64 40, !11, i64 48, !10, i64 56, !10, i64 64, !11, i64 72, !10, i64 80, !10, i64 88}
!14 = !{!"FX_DIR_ENTRY_STRUCT", !10, i64 0, !8, i64 8, !11, i64 24, !11, i64 28, !8, i64 32, !8, i64 33, !8, i64 34, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !7, i64 56, !12, i64 64, !12, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !12, i64 112, !7, i64 120, !12, i64 128}
!15 = !{!"FX_PATH_STRUCT", !14, i64 0, !8, i64 136, !8, i64 392, !7, i64 648}
!16 = !{!8, !8, i64 0}
!17 = !{!6, !11, i64 112}
!18 = !{!6, !10, i64 16}
!19 = !{!6, !11, i64 136}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}


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