; LLVM IR from mlcommons/tiny :: benchmark/interface/Middlewares/ST/filex/common/src/fx_media_flush.ll (fx_media_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 }
%struct.FX_FILE_STRUCT = type { i64, ptr, i64, i8, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, %struct.FX_DIR_ENTRY_STRUCT, [256 x i8], i64, ptr }

@_fx_system_time = external global i32, align 4
@_fx_system_date = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_media_flush(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %11, i32 0, i32 85
  %13 = load i64, ptr %12, align 8, !tbaa !9
  %14 = add i64 %13, 1
  store i64 %14, ptr %12, align 8, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %15, i32 0, i32 0
  %17 = load i64, ptr %16, align 8, !tbaa !17
  %18 = icmp ne i64 %17, 1296385097
  br i1 %18, label %19, label %20

19:                                               ; preds = %1
  store i32 17, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

20:                                               ; preds = %1
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %21, i32 0, i32 0
  %23 = load i64, ptr %22, align 8, !tbaa !17
  %24 = icmp ne i64 %23, 1296385097
  br i1 %24, label %25, label %26

25:                                               ; preds = %20
  store i32 17, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

26:                                               ; preds = %20
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %27, i32 0, i32 112
  %29 = call i32 @_tx_mutex_get(ptr noundef %28, i64 noundef 4294967295)
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %26
  store i32 17, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

32:                                               ; preds = %26
  br label %33

33:                                               ; preds = %32
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %34, i32 0, i32 40
  %36 = load i32, ptr %35, align 8, !tbaa !18
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %42

38:                                               ; preds = %33
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %39, i32 0, i32 112
  %41 = call i32 @_tx_mutex_put(ptr noundef %40)
  store i32 35, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

42:                                               ; preds = %33
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %43, i32 0, i32 49
  %45 = load i64, ptr %44, align 8, !tbaa !19
  store i64 %45, ptr %5, align 8, !tbaa !20
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %46, i32 0, i32 48
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  store ptr %48, ptr %6, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %94, %42
  %50 = load i64, ptr %5, align 8, !tbaa !20
  %51 = icmp ne i64 %50, 0
  br i1 %51, label %52, label %100

52:                                               ; preds = %49
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %53, i32 0, i32 2
  %55 = load i64, ptr %54, align 8, !tbaa !22
  %56 = icmp eq i64 %55, 1
  br i1 %56, label %57, label %94

57:                                               ; preds = %52
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %58, i32 0, i32 3
  %60 = load i8, ptr %59, align 8, !tbaa !24
  %61 = zext i8 %60 to i32
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %94

63:                                               ; preds = %57
  %64 = call i32 @__disable_interrupts()
  store i32 %64, ptr %7, align 4, !tbaa !25
  %65 = load i32, ptr @_fx_system_time, align 4, !tbaa !25
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %66, i32 0, i32 19
  %68 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %67, i32 0, i32 10
  store i32 %65, ptr %68, align 8, !tbaa !26
  %69 = load i32, ptr @_fx_system_date, align 4, !tbaa !25
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %70, i32 0, i32 19
  %72 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %71, i32 0, i32 11
  store i32 %69, ptr %72, align 4, !tbaa !27
  %73 = load i32, ptr %7, align 4, !tbaa !25
  call void @__restore_interrupt(i32 noundef %73)
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %74, i32 0, i32 14
  %76 = load i64, ptr %75, align 8, !tbaa !28
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %77, i32 0, i32 19
  %79 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %78, i32 0, i32 13
  store i64 %76, ptr %79, align 8, !tbaa !29
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %81, i32 0, i32 19
  %83 = call i32 @_fx_directory_entry_write(ptr noundef %80, ptr noundef %82)
  store i32 %83, ptr %4, align 4, !tbaa !25
  %84 = load i32, ptr %4, align 4, !tbaa !25
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %91

86:                                               ; preds = %63
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %87, i32 0, i32 112
  %89 = call i32 @_tx_mutex_put(ptr noundef %88)
  %90 = load i32, ptr %4, align 4, !tbaa !25
  store i32 %90, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

91:                                               ; preds = %63
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %92, i32 0, i32 3
  store i8 0, ptr %93, align 8, !tbaa !24
  br label %94

94:                                               ; preds = %91, %57, %52
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %95, i32 0, i32 17
  %97 = load ptr, ptr %96, align 8, !tbaa !30
  store ptr %97, ptr %6, align 8, !tbaa !5
  %98 = load i64, ptr %5, align 8, !tbaa !20
  %99 = add i64 %98, -1
  store i64 %99, ptr %5, align 8, !tbaa !20
  br label %49, !llvm.loop !31

100:                                              ; preds = %49
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = call i32 @_fx_utility_FAT_flush(ptr noundef %101)
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = call i32 @_fx_utility_FAT_map_flush(ptr noundef %103)
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %106, i32 0, i32 13
  %108 = load i64, ptr %107, align 8, !tbaa !33
  %109 = call i32 @_fx_utility_logical_sector_flush(ptr noundef %105, i64 noundef 1, i64 noundef %108, i32 noundef 0)
  store i32 %109, ptr %4, align 4, !tbaa !25
  %110 = load i32, ptr %4, align 4, !tbaa !25
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %117

112:                                              ; preds = %100
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %113, i32 0, i32 112
  %115 = call i32 @_tx_mutex_put(ptr noundef %114)
  %116 = load i32, ptr %4, align 4, !tbaa !25
  store i32 %116, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

117:                                              ; preds = %100
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %118, i32 0, i32 24
  %120 = load i64, ptr %119, align 8, !tbaa !34
  %121 = icmp ne i64 %120, 0
  br i1 %121, label %122, label %251

122:                                              ; preds = %117
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %123, i32 0, i32 25
  %125 = load i32, ptr %124, align 8, !tbaa !35
  %126 = zext i32 %125 to i64
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %127, i32 0, i32 29
  %129 = load i64, ptr %128, align 8, !tbaa !36
  %130 = icmp ne i64 %126, %129
  br i1 %130, label %131, label %251

131:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %132, i32 0, i32 7
  %134 = load ptr, ptr %133, align 8, !tbaa !37
  %135 = getelementptr inbounds %struct.FX_CACHED_SECTOR_STRUCT, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !38
  store ptr %136, ptr %9, align 8, !tbaa !5
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %137, i32 0, i32 7
  %139 = load ptr, ptr %138, align 8, !tbaa !37
  %140 = getelementptr inbounds %struct.FX_CACHED_SECTOR_STRUCT, ptr %139, i32 0, i32 1
  store i64 -1, ptr %140, align 8, !tbaa !40
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %141, i32 0, i32 7
  %143 = load ptr, ptr %142, align 8, !tbaa !37
  %144 = getelementptr inbounds %struct.FX_CACHED_SECTOR_STRUCT, ptr %143, i32 0, i32 3
  store i8 0, ptr %144, align 1, !tbaa !41
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %145, i32 0, i32 32
  store i32 0, ptr %146, align 8, !tbaa !42
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %147, i32 0, i32 33
  store i32 144, ptr %148, align 4, !tbaa !43
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %150, i32 0, i32 34
  store ptr %149, ptr %151, align 8, !tbaa !44
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %152, i32 0, i32 24
  %154 = load i64, ptr %153, align 8, !tbaa !34
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %155, i32 0, i32 35
  store i64 %154, ptr %156, align 8, !tbaa !45
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %157, i32 0, i32 36
  store i64 1, ptr %158, align 8, !tbaa !46
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %159, i32 0, i32 44
  store i32 3, ptr %160, align 8, !tbaa !47
  %161 = load ptr, ptr %3, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %161, i32 0, i32 105
  %163 = load i64, ptr %162, align 8, !tbaa !48
  %164 = add i64 %163, 1
  store i64 %164, ptr %162, align 8, !tbaa !48
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %165, i32 0, i32 45
  %167 = load ptr, ptr %166, align 8, !tbaa !49
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  call void %167(ptr noundef %168)
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %169, i32 0, i32 33
  %171 = load i32, ptr %170, align 4, !tbaa !43
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %173, label %177

173:                                              ; preds = %131
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %174, i32 0, i32 112
  %176 = call i32 @_tx_mutex_put(ptr noundef %175)
  store i32 144, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %248

177:                                              ; preds = %131
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %178, i32 0, i32 34
  %180 = load ptr, ptr %179, align 8, !tbaa !44
  store ptr %180, ptr %9, align 8, !tbaa !5
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = getelementptr inbounds i8, ptr %181, i64 0
  %183 = call i64 @_fx_utility_32_unsigned_read(ptr noundef %182)
  store i64 %183, ptr %10, align 8, !tbaa !20
  %184 = load i64, ptr %10, align 8, !tbaa !20
  %185 = icmp eq i64 %184, 1096897106
  br i1 %185, label %186, label %247

186:                                              ; preds = %177
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = getelementptr inbounds i8, ptr %187, i64 484
  %189 = call i64 @_fx_utility_32_unsigned_read(ptr noundef %188)
  store i64 %189, ptr %10, align 8, !tbaa !20
  %190 = load i64, ptr %10, align 8, !tbaa !20
  %191 = icmp eq i64 %190, 1631679090
  br i1 %191, label %192, label %246

192:                                              ; preds = %186
  %193 = load ptr, ptr %9, align 8, !tbaa !5
  %194 = getelementptr inbounds i8, ptr %193, i64 488
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %195, i32 0, i32 29
  %197 = load i64, ptr %196, align 8, !tbaa !36
  call void @_fx_utility_32_unsigned_write(ptr noundef %194, i64 noundef %197)
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = getelementptr inbounds i8, ptr %198, i64 492
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %200, i32 0, i32 30
  %202 = load i64, ptr %201, align 8, !tbaa !50
  call void @_fx_utility_32_unsigned_write(ptr noundef %199, i64 noundef %202)
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %203, i32 0, i32 32
  store i32 1, ptr %204, align 8, !tbaa !42
  %205 = load ptr, ptr %3, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %205, i32 0, i32 33
  store i32 144, ptr %206, align 4, !tbaa !43
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %208, i32 0, i32 34
  store ptr %207, ptr %209, align 8, !tbaa !44
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %210, i32 0, i32 24
  %212 = load i64, ptr %211, align 8, !tbaa !34
  %213 = load ptr, ptr %3, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %213, i32 0, i32 35
  store i64 %212, ptr %214, align 8, !tbaa !45
  %215 = load ptr, ptr %3, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %215, i32 0, i32 36
  store i64 1, ptr %216, align 8, !tbaa !46
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %217, i32 0, i32 44
  store i32 3, ptr %218, align 8, !tbaa !47
  %219 = load ptr, ptr %3, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %219, i32 0, i32 42
  store i32 1, ptr %220, align 8, !tbaa !51
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %221, i32 0, i32 106
  %223 = load i64, ptr %222, align 8, !tbaa !52
  %224 = add i64 %223, 1
  store i64 %224, ptr %222, align 8, !tbaa !52
  %225 = load ptr, ptr %3, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %225, i32 0, i32 45
  %227 = load ptr, ptr %226, align 8, !tbaa !49
  %228 = load ptr, ptr %3, align 8, !tbaa !5
  call void %227(ptr noundef %228)
  %229 = load ptr, ptr %3, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %229, i32 0, i32 42
  store i32 0, ptr %230, align 8, !tbaa !51
  %231 = load ptr, ptr %3, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %231, i32 0, i32 33
  %233 = load i32, ptr %232, align 4, !tbaa !43
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %239

235:                                              ; preds = %192
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %236, i32 0, i32 112
  %238 = call i32 @_tx_mutex_put(ptr noundef %237)
  store i32 144, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %248

239:                                              ; preds = %192
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %240, i32 0, i32 29
  %242 = load i64, ptr %241, align 8, !tbaa !36
  %243 = trunc i64 %242 to i32
  %244 = load ptr, ptr %3, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %244, i32 0, i32 25
  store i32 %243, ptr %245, align 8, !tbaa !35
  br label %246

246:                                              ; preds = %239, %186
  br label %247

247:                                              ; preds = %246, %177
  store i32 0, ptr %8, align 4
  br label %248

248:                                              ; preds = %247, %235, %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %249 = load i32, ptr %8, align 4
  switch i32 %249, label %276 [
    i32 0, label %250
  ]

250:                                              ; preds = %248
  br label %251

251:                                              ; preds = %250, %122, %117
  %252 = load ptr, ptr %3, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %252, i32 0, i32 110
  %254 = load i64, ptr %253, align 8, !tbaa !53
  %255 = add i64 %254, 1
  store i64 %255, ptr %253, align 8, !tbaa !53
  %256 = load ptr, ptr %3, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %256, i32 0, i32 32
  store i32 2, ptr %257, align 8, !tbaa !42
  %258 = load ptr, ptr %3, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %258, i32 0, i32 33
  store i32 144, ptr %259, align 4, !tbaa !43
  %260 = load ptr, ptr %3, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %260, i32 0, i32 45
  %262 = load ptr, ptr %261, align 8, !tbaa !49
  %263 = load ptr, ptr %3, align 8, !tbaa !5
  call void %262(ptr noundef %263)
  %264 = load ptr, ptr %3, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %264, i32 0, i32 33
  %266 = load i32, ptr %265, align 4, !tbaa !43
  %267 = icmp ne i32 %266, 0
  br i1 %267, label %268, label %272

268:                                              ; preds = %251
  %269 = load ptr, ptr %3, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %269, i32 0, i32 112
  %271 = call i32 @_tx_mutex_put(ptr noundef %270)
  store i32 144, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

272:                                              ; preds = %251
  %273 = load ptr, ptr %3, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %273, i32 0, i32 112
  %275 = call i32 @_tx_mutex_put(ptr noundef %274)
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %276

276:                                              ; preds = %272, %268, %248, %112, %86, %38, %31, %25, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %277 = load i32, ptr %2, align 4
  ret i32 %277
}

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

declare i32 @_tx_mutex_get(ptr noundef, i64 noundef) #2

declare i32 @_tx_mutex_put(ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @__disable_interrupts() #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @__restore_interrupt(i32 noundef) #3

declare i32 @_fx_directory_entry_write(ptr noundef, ptr noundef) #2

declare i32 @_fx_utility_FAT_flush(ptr noundef) #2

declare i32 @_fx_utility_FAT_map_flush(ptr noundef) #2

declare i32 @_fx_utility_logical_sector_flush(ptr noundef, i64 noundef, i64 noundef, i32 noundef) #2

declare i64 @_fx_utility_32_unsigned_read(ptr noundef) #2

declare void @_fx_utility_32_unsigned_write(ptr noundef, i64 noundef) #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 = { alwaysinline 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 #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, !11, i64 608}
!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 = !{!10, !11, i64 0}
!18 = !{!10, !12, i64 264}
!19 = !{!10, !11, i64 320}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !6, i64 312}
!22 = !{!23, !11, i64 16}
!23 = !{!"FX_FILE_STRUCT", !11, i64 0, !6, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !13, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !15, i64 152, !7, i64 288, !11, i64 544, !6, i64 552}
!24 = !{!23, !7, i64 24}
!25 = !{!12, !12, i64 0}
!26 = !{!23, !12, i64 200}
!27 = !{!23, !12, i64 204}
!28 = !{!23, !13, i64 112}
!29 = !{!23, !13, i64 216}
!30 = !{!23, !6, i64 136}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!10, !13, i64 96}
!34 = !{!10, !11, i64 152}
!35 = !{!10, !12, i64 160}
!36 = !{!10, !11, i64 192}
!37 = !{!10, !6, i64 56}
!38 = !{!39, !6, i64 0}
!39 = !{!"FX_CACHED_SECTOR_STRUCT", !6, i64 0, !13, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !6, i64 24}
!40 = !{!39, !13, i64 8}
!41 = !{!39, !7, i64 17}
!42 = !{!10, !12, i64 216}
!43 = !{!10, !12, i64 220}
!44 = !{!10, !6, i64 224}
!45 = !{!10, !11, i64 232}
!46 = !{!10, !11, i64 240}
!47 = !{!10, !12, i64 280}
!48 = !{!10, !11, i64 768}
!49 = !{!10, !6, i64 288}
!50 = !{!10, !11, i64 200}
!51 = !{!10, !12, i64 272}
!52 = !{!10, !11, i64 776}
!53 = !{!10, !11, i64 808}


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

@_fx_system_time = external local_unnamed_addr global i32, align 4
@_fx_system_date = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_media_flush(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 608
  %3 = load i64, ptr %2, align 8, !tbaa !5
  %4 = add i64 %3, 1
  store i64 %4, ptr %2, align 8, !tbaa !5
  %5 = load i64, ptr %0, align 8, !tbaa !16
  %.not = icmp eq i64 %5, 1296385097
  br i1 %.not, label %6, label %.critedge

6:                                                ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 824
  %8 = tail call i32 @_tx_mutex_get(ptr noundef nonnull %7, i64 noundef 4294967295) #3
  %.not90 = icmp eq i32 %8, 0
  br i1 %.not90, label %9, label %.critedge

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 264
  %11 = load i32, ptr %10, align 8, !tbaa !17
  %.not91 = icmp eq i32 %11, 0
  br i1 %.not91, label %14, label %12

12:                                               ; preds = %9
  %13 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %7) #3
  br label %.critedge

14:                                               ; preds = %9
  %15 = getelementptr inbounds i8, ptr %0, i64 320
  %16 = load i64, ptr %15, align 8, !tbaa !18
  %.not92102 = icmp eq i64 %16, 0
  br i1 %.not92102, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %14
  %17 = getelementptr inbounds i8, ptr %0, i64 312
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %38
  %.086104.in = phi ptr [ %39, %38 ], [ %17, %.lr.ph.preheader ]
  %.087103 = phi i64 [ %40, %38 ], [ %16, %.lr.ph.preheader ]
  %.086104 = load ptr, ptr %.086104.in, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %.086104, i64 16
  %19 = load i64, ptr %18, align 8, !tbaa !20
  %20 = icmp eq i64 %19, 1
  br i1 %20, label %21, label %38

21:                                               ; preds = %.lr.ph
  %22 = getelementptr inbounds i8, ptr %.086104, i64 24
  %23 = load i8, ptr %22, align 8, !tbaa !22
  %.not99 = icmp eq i8 %23, 0
  br i1 %.not99, label %38, label %24

24:                                               ; preds = %21
  %25 = tail call i32 @__disable_interrupts()
  %26 = load i32, ptr @_fx_system_time, align 4, !tbaa !23
  %27 = getelementptr inbounds i8, ptr %.086104, i64 152
  %28 = getelementptr inbounds i8, ptr %.086104, i64 200
  store i32 %26, ptr %28, align 8, !tbaa !24
  %29 = load i32, ptr @_fx_system_date, align 4, !tbaa !23
  %30 = getelementptr inbounds i8, ptr %.086104, i64 204
  store i32 %29, ptr %30, align 4, !tbaa !25
  tail call void @__restore_interrupt(i32 noundef %25)
  %31 = getelementptr inbounds i8, ptr %.086104, i64 112
  %32 = load i64, ptr %31, align 8, !tbaa !26
  %33 = getelementptr inbounds i8, ptr %.086104, i64 216
  store i64 %32, ptr %33, align 8, !tbaa !27
  %34 = tail call i32 @_fx_directory_entry_write(ptr noundef %0, ptr noundef nonnull %27) #3
  %.not100 = icmp eq i32 %34, 0
  br i1 %.not100, label %37, label %35

35:                                               ; preds = %24
  %36 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %7) #3
  br label %.critedge

37:                                               ; preds = %24
  store i8 0, ptr %22, align 8, !tbaa !22
  br label %38

38:                                               ; preds = %37, %21, %.lr.ph
  %39 = getelementptr inbounds i8, ptr %.086104, i64 136
  %40 = add i64 %.087103, -1
  %.not92 = icmp eq i64 %40, 0
  br i1 %.not92, label %._crit_edge, label %.lr.ph, !llvm.loop !28

._crit_edge:                                      ; preds = %38, %14
  %41 = tail call i32 @_fx_utility_FAT_flush(ptr noundef nonnull %0) #3
  %42 = tail call i32 @_fx_utility_FAT_map_flush(ptr noundef nonnull %0) #3
  %43 = getelementptr inbounds i8, ptr %0, i64 96
  %44 = load i64, ptr %43, align 8, !tbaa !30
  %45 = tail call i32 @_fx_utility_logical_sector_flush(ptr noundef nonnull %0, i64 noundef 1, i64 noundef %44, i32 noundef 0) #3
  %.not93 = icmp eq i32 %45, 0
  br i1 %.not93, label %48, label %46

46:                                               ; preds = %._crit_edge
  %47 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %7) #3
  br label %.critedge

48:                                               ; preds = %._crit_edge
  %49 = getelementptr inbounds i8, ptr %0, i64 152
  %50 = load i64, ptr %49, align 8, !tbaa !31
  %.not94 = icmp eq i64 %50, 0
  br i1 %.not94, label %103, label %51

51:                                               ; preds = %48
  %52 = getelementptr inbounds i8, ptr %0, i64 160
  %53 = load i32, ptr %52, align 8, !tbaa !32
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %0, i64 192
  %56 = load i64, ptr %55, align 8, !tbaa !33
  %.not95 = icmp eq i64 %56, %54
  br i1 %.not95, label %103, label %57

57:                                               ; preds = %51
  %58 = getelementptr inbounds i8, ptr %0, i64 56
  %59 = load ptr, ptr %58, align 8, !tbaa !34
  %60 = load ptr, ptr %59, align 8, !tbaa !35
  %61 = getelementptr inbounds i8, ptr %59, i64 8
  store i64 -1, ptr %61, align 8, !tbaa !37
  %62 = getelementptr inbounds i8, ptr %59, i64 17
  store i8 0, ptr %62, align 1, !tbaa !38
  %63 = getelementptr inbounds i8, ptr %0, i64 216
  store i32 0, ptr %63, align 8, !tbaa !39
  %64 = getelementptr inbounds i8, ptr %0, i64 220
  store i32 144, ptr %64, align 4, !tbaa !40
  %65 = getelementptr inbounds i8, ptr %0, i64 224
  store ptr %60, ptr %65, align 8, !tbaa !41
  %66 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 %50, ptr %66, align 8, !tbaa !42
  %67 = getelementptr inbounds i8, ptr %0, i64 240
  store i64 1, ptr %67, align 8, !tbaa !43
  %68 = getelementptr inbounds i8, ptr %0, i64 280
  store i32 3, ptr %68, align 8, !tbaa !44
  %69 = getelementptr inbounds i8, ptr %0, i64 768
  %70 = load i64, ptr %69, align 8, !tbaa !45
  %71 = add i64 %70, 1
  store i64 %71, ptr %69, align 8, !tbaa !45
  %72 = getelementptr inbounds i8, ptr %0, i64 288
  %73 = load ptr, ptr %72, align 8, !tbaa !46
  tail call void %73(ptr noundef nonnull %0) #3
  %74 = load i32, ptr %64, align 4, !tbaa !40
  %.not96 = icmp eq i32 %74, 0
  br i1 %.not96, label %77, label %75

75:                                               ; preds = %57
  %76 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %7) #3
  br label %.critedge

77:                                               ; preds = %57
  %78 = load ptr, ptr %65, align 8, !tbaa !41
  %79 = tail call i64 @_fx_utility_32_unsigned_read(ptr noundef %78) #3
  %80 = icmp eq i64 %79, 1096897106
  br i1 %80, label %81, label %103

81:                                               ; preds = %77
  %82 = getelementptr inbounds i8, ptr %78, i64 484
  %83 = tail call i64 @_fx_utility_32_unsigned_read(ptr noundef nonnull %82) #3
  %84 = icmp eq i64 %83, 1631679090
  br i1 %84, label %85, label %103

85:                                               ; preds = %81
  %86 = getelementptr inbounds i8, ptr %78, i64 488
  %87 = load i64, ptr %55, align 8, !tbaa !33
  tail call void @_fx_utility_32_unsigned_write(ptr noundef nonnull %86, i64 noundef %87) #3
  %88 = getelementptr inbounds i8, ptr %78, i64 492
  %89 = getelementptr inbounds i8, ptr %0, i64 200
  %90 = load i64, ptr %89, align 8, !tbaa !47
  tail call void @_fx_utility_32_unsigned_write(ptr noundef nonnull %88, i64 noundef %90) #3
  store i32 1, ptr %63, align 8, !tbaa !39
  store i32 144, ptr %64, align 4, !tbaa !40
  store ptr %78, ptr %65, align 8, !tbaa !41
  %91 = load i64, ptr %49, align 8, !tbaa !31
  store i64 %91, ptr %66, align 8, !tbaa !42
  store i64 1, ptr %67, align 8, !tbaa !43
  store i32 3, ptr %68, align 8, !tbaa !44
  %92 = getelementptr inbounds i8, ptr %0, i64 272
  store i32 1, ptr %92, align 8, !tbaa !48
  %93 = getelementptr inbounds i8, ptr %0, i64 776
  %94 = load i64, ptr %93, align 8, !tbaa !49
  %95 = add i64 %94, 1
  store i64 %95, ptr %93, align 8, !tbaa !49
  %96 = load ptr, ptr %72, align 8, !tbaa !46
  tail call void %96(ptr noundef nonnull %0) #3
  store i32 0, ptr %92, align 8, !tbaa !48
  %97 = load i32, ptr %64, align 4, !tbaa !40
  %.not97 = icmp eq i32 %97, 0
  br i1 %.not97, label %100, label %98

98:                                               ; preds = %85
  %99 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %7) #3
  br label %.critedge

100:                                              ; preds = %85
  %101 = load i64, ptr %55, align 8, !tbaa !33
  %102 = trunc i64 %101 to i32
  store i32 %102, ptr %52, align 8, !tbaa !32
  br label %103

103:                                              ; preds = %81, %100, %77, %51, %48
  %104 = getelementptr inbounds i8, ptr %0, i64 808
  %105 = load i64, ptr %104, align 8, !tbaa !50
  %106 = add i64 %105, 1
  store i64 %106, ptr %104, align 8, !tbaa !50
  %107 = getelementptr inbounds i8, ptr %0, i64 216
  store i32 2, ptr %107, align 8, !tbaa !39
  %108 = getelementptr inbounds i8, ptr %0, i64 220
  store i32 144, ptr %108, align 4, !tbaa !40
  %109 = getelementptr inbounds i8, ptr %0, i64 288
  %110 = load ptr, ptr %109, align 8, !tbaa !46
  tail call void %110(ptr noundef nonnull %0) #3
  %111 = load i32, ptr %108, align 4, !tbaa !40
  %.not98 = icmp eq i32 %111, 0
  %112 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %7) #3
  %. = select i1 %.not98, i32 0, i32 144
  br label %.critedge

.critedge:                                        ; preds = %103, %75, %98, %6, %1, %46, %35, %12
  %.1 = phi i32 [ 35, %12 ], [ %34, %35 ], [ %45, %46 ], [ 17, %1 ], [ 17, %6 ], [ 144, %98 ], [ 144, %75 ], [ %., %103 ]
  ret i32 %.1
}

declare i32 @_tx_mutex_get(ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @_tx_mutex_put(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @__disable_interrupts() local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @__restore_interrupt(i32 noundef) local_unnamed_addr #2

declare i32 @_fx_directory_entry_write(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @_fx_utility_FAT_flush(ptr noundef) local_unnamed_addr #1

declare i32 @_fx_utility_FAT_map_flush(ptr noundef) local_unnamed_addr #1

declare i32 @_fx_utility_logical_sector_flush(ptr noundef, i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

declare i64 @_fx_utility_32_unsigned_read(ptr noundef) local_unnamed_addr #1

declare void @_fx_utility_32_unsigned_write(ptr noundef, i64 noundef) local_unnamed_addr #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 = { "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 = { alwaysinline 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, !7, i64 608}
!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 0}
!17 = !{!6, !11, i64 264}
!18 = !{!6, !7, i64 320}
!19 = !{!10, !10, i64 0}
!20 = !{!21, !7, i64 16}
!21 = !{!"FX_FILE_STRUCT", !7, i64 0, !10, i64 8, !7, i64 16, !8, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !12, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !14, i64 152, !8, i64 288, !7, i64 544, !10, i64 552}
!22 = !{!21, !8, i64 24}
!23 = !{!11, !11, i64 0}
!24 = !{!21, !11, i64 200}
!25 = !{!21, !11, i64 204}
!26 = !{!21, !12, i64 112}
!27 = !{!21, !12, i64 216}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!6, !12, i64 96}
!31 = !{!6, !7, i64 152}
!32 = !{!6, !11, i64 160}
!33 = !{!6, !7, i64 192}
!34 = !{!6, !10, i64 56}
!35 = !{!36, !10, i64 0}
!36 = !{!"FX_CACHED_SECTOR_STRUCT", !10, i64 0, !12, i64 8, !8, i64 16, !8, i64 17, !8, i64 18, !8, i64 19, !10, i64 24}
!37 = !{!36, !12, i64 8}
!38 = !{!36, !8, i64 17}
!39 = !{!6, !11, i64 216}
!40 = !{!6, !11, i64 220}
!41 = !{!6, !10, i64 224}
!42 = !{!6, !7, i64 232}
!43 = !{!6, !7, i64 240}
!44 = !{!6, !11, i64 280}
!45 = !{!6, !7, i64 768}
!46 = !{!6, !10, i64 288}
!47 = !{!6, !7, i64 200}
!48 = !{!6, !11, i64 272}
!49 = !{!6, !7, i64 776}
!50 = !{!6, !7, i64 808}


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