; LLVM IR from mlcommons/tiny :: benchmark/interface/Middlewares/ST/filex/common/src/fx_utility_FAT_entry_write_188f7c71 (write)

; 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_entry_write(ptr noundef %0, i64 noundef %1, i64 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %13, i32 0, i32 93
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %16 = add i64 %15, 1
  store i64 %16, ptr %14, align 8, !tbaa !11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %17, i32 0, i32 96
  %19 = load i64, ptr %18, align 8, !tbaa !18
  %20 = add i64 %19, 1
  store i64 %20, ptr %18, align 8, !tbaa !18
  %21 = load i64, ptr %6, align 8, !tbaa !9
  %22 = and i64 %21, 3
  %23 = mul i64 %22, 4
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %9, align 4, !tbaa !19
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %25, i32 0, i32 119
  %27 = load i32, ptr %9, align 4, !tbaa !19
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %26, i64 0, i64 %28
  store ptr %29, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %10, align 4, !tbaa !19
  br label %30

30:                                               ; preds = %96, %3
  %31 = load i32, ptr %10, align 4, !tbaa !19
  %32 = icmp ult i32 %31, 4
  br i1 %32, label %33, label %99

33:                                               ; preds = %30
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = load i32, ptr %10, align 4, !tbaa !19
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %34, i64 %36
  %38 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %37, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !20
  %40 = load i64, ptr %6, align 8, !tbaa !9
  %41 = icmp eq i64 %39, %40
  br i1 %41, label %42, label %95

42:                                               ; preds = %33
  %43 = load i64, ptr %7, align 8, !tbaa !9
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = load i32, ptr %10, align 4, !tbaa !19
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %44, i64 %46
  %48 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %47, i32 0, i32 1
  store i64 %43, ptr %48, align 8, !tbaa !22
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = load i32, ptr %10, align 4, !tbaa !19
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %49, i64 %51
  %53 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %52, i32 0, i32 2
  store i64 1, ptr %53, align 8, !tbaa !23
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %54, i32 0, i32 41
  %56 = load i32, ptr %55, align 4, !tbaa !24
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %94

58:                                               ; preds = %42
  %59 = load i64, ptr %7, align 8, !tbaa !9
  %60 = icmp eq i64 %59, 0
  br i1 %60, label %61, label %94

61:                                               ; preds = %58
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %62, i32 0, i32 109
  %64 = load i64, ptr %63, align 8, !tbaa !25
  %65 = add i64 %64, 1
  store i64 %65, ptr %63, align 8, !tbaa !25
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %66, i32 0, i32 32
  store i32 6, ptr %67, align 8, !tbaa !26
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %68, i32 0, i32 33
  store i32 144, ptr %69, align 4, !tbaa !27
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %70, i32 0, i32 18
  %72 = load i32, ptr %71, align 4, !tbaa !28
  %73 = zext i32 %72 to i64
  %74 = load i64, ptr %6, align 8, !tbaa !9
  %75 = sub i64 %74, 2
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %76, i32 0, i32 19
  %78 = load i32, ptr %77, align 8, !tbaa !29
  %79 = zext i32 %78 to i64
  %80 = mul i64 %75, %79
  %81 = add i64 %73, %80
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %82, i32 0, i32 35
  store i64 %81, ptr %83, align 8, !tbaa !30
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %84, i32 0, i32 19
  %86 = load i32, ptr %85, align 8, !tbaa !29
  %87 = zext i32 %86 to i64
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %88, i32 0, i32 36
  store i64 %87, ptr %89, align 8, !tbaa !31
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %90, i32 0, i32 45
  %92 = load ptr, ptr %91, align 8, !tbaa !32
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  call void %92(ptr noundef %93)
  br label %94

94:                                               ; preds = %61, %58, %42
  store i32 0, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %186

95:                                               ; preds = %33
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %10, align 4, !tbaa !19
  %98 = add i32 %97, 1
  store i32 %98, ptr %10, align 4, !tbaa !19
  br label %30, !llvm.loop !33

99:                                               ; preds = %30
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %100, i32 0, i32 96
  %102 = load i64, ptr %101, align 8, !tbaa !18
  %103 = add i64 %102, -1
  store i64 %103, ptr %101, align 8, !tbaa !18
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %104, i32 0, i32 97
  %106 = load i64, ptr %105, align 8, !tbaa !35
  %107 = add i64 %106, 1
  store i64 %107, ptr %105, align 8, !tbaa !35
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %108, i32 0, i32 119
  %110 = load i32, ptr %9, align 4, !tbaa !19
  %111 = add i32 %110, 3
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %109, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %113, i32 0, i32 2
  %115 = load i64, ptr %114, align 8, !tbaa !23
  %116 = icmp eq i64 %115, 1
  br i1 %116, label %117, label %125

117:                                              ; preds = %99
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = call i32 @_fx_utility_FAT_flush(ptr noundef %118)
  store i32 %119, ptr %8, align 4, !tbaa !19
  %120 = load i32, ptr %8, align 4, !tbaa !19
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %124

122:                                              ; preds = %117
  %123 = load i32, ptr %8, align 4, !tbaa !19
  store i32 %123, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %186

124:                                              ; preds = %117
  br label %125

125:                                              ; preds = %124, %99
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %126, i64 3
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %128, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %127, ptr align 8 %129, i64 24, i1 false), !tbaa.struct !36
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %130, i64 2
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %132, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %131, ptr align 8 %133, i64 24, i1 false), !tbaa.struct !36
  %134 = load ptr, ptr %11, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %134, i64 1
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %135, ptr align 8 %136, i64 24, i1 false), !tbaa.struct !36
  %137 = load ptr, ptr %11, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %137, i32 0, i32 2
  store i64 1, ptr %138, align 8, !tbaa !23
  %139 = load i64, ptr %6, align 8, !tbaa !9
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %140, i32 0, i32 0
  store i64 %139, ptr %141, align 8, !tbaa !20
  %142 = load i64, ptr %7, align 8, !tbaa !9
  %143 = load ptr, ptr %11, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %143, i32 0, i32 1
  store i64 %142, ptr %144, align 8, !tbaa !22
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %145, i32 0, i32 41
  %147 = load i32, ptr %146, align 4, !tbaa !24
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %185

149:                                              ; preds = %125
  %150 = load i64, ptr %7, align 8, !tbaa !9
  %151 = icmp eq i64 %150, 0
  br i1 %151, label %152, label %185

152:                                              ; preds = %149
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %153, i32 0, i32 109
  %155 = load i64, ptr %154, align 8, !tbaa !25
  %156 = add i64 %155, 1
  store i64 %156, ptr %154, align 8, !tbaa !25
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %157, i32 0, i32 32
  store i32 6, ptr %158, align 8, !tbaa !26
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %159, i32 0, i32 33
  store i32 144, ptr %160, align 4, !tbaa !27
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %161, i32 0, i32 18
  %163 = load i32, ptr %162, align 4, !tbaa !28
  %164 = zext i32 %163 to i64
  %165 = load i64, ptr %6, align 8, !tbaa !9
  %166 = sub i64 %165, 2
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %167, i32 0, i32 19
  %169 = load i32, ptr %168, align 8, !tbaa !29
  %170 = zext i32 %169 to i64
  %171 = mul i64 %166, %170
  %172 = add i64 %164, %171
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %173, i32 0, i32 35
  store i64 %172, ptr %174, align 8, !tbaa !30
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %175, i32 0, i32 19
  %177 = load i32, ptr %176, align 8, !tbaa !29
  %178 = zext i32 %177 to i64
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %179, i32 0, i32 36
  store i64 %178, ptr %180, align 8, !tbaa !31
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %181, i32 0, i32 45
  %183 = load ptr, ptr %182, align 8, !tbaa !32
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  call void %183(ptr noundef %184)
  br label %185

185:                                              ; preds = %152, %149, %125
  store i32 0, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %186

186:                                              ; preds = %185, %122, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %187 = load i32, ptr %4, align 4
  ret i32 %187
}

; 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_FAT_flush(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

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


; 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.FX_FAT_CACHE_ENTRY_STRUCT = type { i64, i64, i64 }

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_utility_FAT_entry_write(ptr noundef %0, i64 noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 672
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = add i64 %5, 1
  store i64 %6, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 696
  %8 = load i64, ptr %7, align 8, !tbaa !16
  %9 = add i64 %8, 1
  store i64 %9, ptr %7, align 8, !tbaa !16
  %.tr = trunc i64 %1 to i32
  %10 = shl i32 %.tr, 2
  %11 = and i32 %10, 12
  %12 = getelementptr inbounds i8, ptr %0, i64 2368
  %13 = zext nneg i32 %11 to i64
  %14 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %12, i64 0, i64 %13
  %15 = load i64, ptr %14, align 8, !tbaa !17
  %16 = icmp eq i64 %15, %1
  br i1 %16, label %38, label %17

17:                                               ; preds = %3
  %18 = getelementptr inbounds i8, ptr %14, i64 24
  %19 = load i64, ptr %18, align 8, !tbaa !17
  %20 = icmp eq i64 %19, %1
  br i1 %20, label %38, label %21

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %14, i64 48
  %23 = load i64, ptr %22, align 8, !tbaa !17
  %24 = icmp eq i64 %23, %1
  br i1 %24, label %38, label %25

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %14, i64 72
  %27 = load i64, ptr %26, align 8, !tbaa !17
  %28 = icmp eq i64 %27, %1
  br i1 %28, label %38, label %29

29:                                               ; preds = %25
  store i64 %8, ptr %7, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %0, i64 704
  %31 = load i64, ptr %30, align 8, !tbaa !19
  %32 = add i64 %31, 1
  store i64 %32, ptr %30, align 8, !tbaa !19
  %33 = or disjoint i32 %11, 3
  %34 = zext nneg i32 %33 to i64
  %35 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %12, i64 0, i64 %34, i32 2
  %36 = load i64, ptr %35, align 8, !tbaa !20
  %37 = icmp eq i64 %36, 1
  br i1 %37, label %45, label %47

38:                                               ; preds = %25, %21, %17, %3
  %.lcssa = phi ptr [ %14, %3 ], [ %18, %17 ], [ %22, %21 ], [ %26, %25 ]
  %39 = getelementptr inbounds i8, ptr %.lcssa, i64 8
  store i64 %2, ptr %39, align 8, !tbaa !21
  %40 = getelementptr inbounds i8, ptr %.lcssa, i64 16
  store i64 1, ptr %40, align 8, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %0, i64 268
  %42 = load i32, ptr %41, align 4, !tbaa !22
  %43 = icmp ne i32 %42, 0
  %44 = icmp eq i64 %2, 0
  %or.cond = and i1 %44, %43
  br i1 %or.cond, label %.sink.split, label %72

45:                                               ; preds = %29
  %46 = tail call i32 @_fx_utility_FAT_flush(ptr noundef nonnull %0) #3
  %.not = icmp eq i32 %46, 0
  br i1 %.not, label %47, label %72

47:                                               ; preds = %45, %29
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(24) %22, i64 24, i1 false), !tbaa.struct !23
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %18, i64 24, i1 false), !tbaa.struct !23
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %14, i64 24, i1 false), !tbaa.struct !23
  %48 = getelementptr inbounds i8, ptr %14, i64 16
  store i64 1, ptr %48, align 8, !tbaa !20
  store i64 %1, ptr %14, align 8, !tbaa !17
  %49 = getelementptr inbounds i8, ptr %14, i64 8
  store i64 %2, ptr %49, align 8, !tbaa !21
  %50 = getelementptr inbounds i8, ptr %0, i64 268
  %51 = load i32, ptr %50, align 4, !tbaa !22
  %52 = icmp ne i32 %51, 0
  %53 = icmp eq i64 %2, 0
  %or.cond3 = and i1 %53, %52
  br i1 %or.cond3, label %.sink.split, label %72

.sink.split:                                      ; preds = %47, %38
  %54 = getelementptr inbounds i8, ptr %0, i64 800
  %55 = load i64, ptr %54, align 8, !tbaa !25
  %56 = add i64 %55, 1
  store i64 %56, ptr %54, align 8, !tbaa !25
  %57 = getelementptr inbounds i8, ptr %0, i64 216
  store i32 6, ptr %57, align 8, !tbaa !26
  %58 = getelementptr inbounds i8, ptr %0, i64 220
  store i32 144, ptr %58, align 4, !tbaa !27
  %59 = getelementptr inbounds i8, ptr %0, i64 124
  %60 = load i32, ptr %59, align 4, !tbaa !28
  %61 = zext i32 %60 to i64
  %62 = add i64 %1, -2
  %63 = getelementptr inbounds i8, ptr %0, i64 128
  %64 = load i32, ptr %63, align 8, !tbaa !29
  %65 = zext i32 %64 to i64
  %66 = mul i64 %62, %65
  %67 = add i64 %66, %61
  %68 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 %67, ptr %68, align 8, !tbaa !30
  %69 = getelementptr inbounds i8, ptr %0, i64 240
  store i64 %65, ptr %69, align 8, !tbaa !31
  %70 = getelementptr inbounds i8, ptr %0, i64 288
  %71 = load ptr, ptr %70, align 8, !tbaa !32
  tail call void %71(ptr noundef nonnull %0) #3
  br label %72

72:                                               ; preds = %.sink.split, %47, %45, %38
  %.0 = phi i32 [ 0, %38 ], [ %46, %45 ], [ 0, %47 ], [ 0, %.sink.split ]
  ret i32 %.0
}

declare i32 @_fx_utility_FAT_flush(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 672}
!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 = !{!6, !7, i64 696}
!17 = !{!18, !7, i64 0}
!18 = !{!"FX_FAT_CACHE_ENTRY_STRUCT", !7, i64 0, !7, i64 8, !7, i64 16}
!19 = !{!6, !7, i64 704}
!20 = !{!18, !7, i64 16}
!21 = !{!18, !7, i64 8}
!22 = !{!6, !11, i64 268}
!23 = !{i64 0, i64 8, !24, i64 8, i64 8, !24, i64 16, i64 8, !24}
!24 = !{!7, !7, i64 0}
!25 = !{!6, !7, i64 800}
!26 = !{!6, !11, i64 216}
!27 = !{!6, !11, i64 220}
!28 = !{!6, !11, i64 124}
!29 = !{!6, !11, i64 128}
!30 = !{!6, !7, i64 232}
!31 = !{!6, !7, i64 240}
!32 = !{!6, !10, i64 288}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass