; LLVM IR from mlcommons/tiny :: benchmark/interface/Middlewares/ST/filex/common/src/fx_file_extended_allocate._9e8d38fc (allocate)

; 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_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 }
%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_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_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_file_extended_allocate(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %15, i32 0, i32 0
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = icmp ne i64 %17, 1179208773
  br i1 %18, label %19, label %20

19:                                               ; preds = %2
  store i32 7, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

20:                                               ; preds = %2
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %21, i32 0, i32 16
  %23 = load ptr, ptr %22, align 8, !tbaa !16
  store ptr %23, ptr %13, align 8, !tbaa !5
  %24 = load ptr, ptr %13, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %24, i32 0, i32 69
  %26 = load i64, ptr %25, align 8, !tbaa !17
  %27 = add i64 %26, 1
  store i64 %27, ptr %25, align 8, !tbaa !17
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %28, i32 0, i32 2
  %30 = load i64, ptr %29, align 8, !tbaa !21
  %31 = icmp ne i64 %30, 1
  br i1 %31, label %32, label %33

32:                                               ; preds = %20
  store i32 6, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

33:                                               ; preds = %20
  %34 = load i64, ptr %5, align 8, !tbaa !9
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

37:                                               ; preds = %33
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %38, i32 0, i32 16
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  store ptr %40, ptr %13, align 8, !tbaa !5
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %41, i32 0, i32 0
  %43 = load i64, ptr %42, align 8, !tbaa !22
  %44 = icmp ne i64 %43, 1296385097
  br i1 %44, label %45, label %46

45:                                               ; preds = %37
  store i32 17, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

46:                                               ; preds = %37
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %47, i32 0, i32 112
  %49 = call i32 @_tx_mutex_get(ptr noundef %48, i64 noundef 4294967295)
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  store i32 17, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %54, i32 0, i32 40
  %56 = load i32, ptr %55, align 8, !tbaa !23
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %62

58:                                               ; preds = %53
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %59, i32 0, i32 112
  %61 = call i32 @_tx_mutex_put(ptr noundef %60)
  store i32 35, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

62:                                               ; preds = %53
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %63, i32 0, i32 10
  %65 = load i32, ptr %64, align 8, !tbaa !24
  %66 = zext i32 %65 to i64
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %67, i32 0, i32 19
  %69 = load i32, ptr %68, align 8, !tbaa !25
  %70 = zext i32 %69 to i64
  %71 = mul i64 %66, %70
  store i64 %71, ptr %9, align 8, !tbaa !26
  %72 = load i64, ptr %9, align 8, !tbaa !26
  %73 = icmp eq i64 %72, 0
  br i1 %73, label %74, label %78

74:                                               ; preds = %62
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %75, i32 0, i32 112
  %77 = call i32 @_tx_mutex_put(ptr noundef %76)
  store i32 2, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

78:                                               ; preds = %62
  %79 = load i64, ptr %5, align 8, !tbaa !9
  %80 = load i64, ptr %9, align 8, !tbaa !26
  %81 = add i64 %79, %80
  %82 = sub i64 %81, 1
  %83 = load i64, ptr %9, align 8, !tbaa !26
  %84 = udiv i64 %82, %83
  store i64 %84, ptr %12, align 8, !tbaa !26
  %85 = load i64, ptr %12, align 8, !tbaa !26
  %86 = icmp eq i64 %85, 0
  br i1 %86, label %87, label %91

87:                                               ; preds = %78
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %88, i32 0, i32 112
  %90 = call i32 @_tx_mutex_put(ptr noundef %89)
  store i32 10, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

91:                                               ; preds = %78
  %92 = load i64, ptr %12, align 8, !tbaa !26
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %93, i32 0, i32 29
  %95 = load i64, ptr %94, align 8, !tbaa !27
  %96 = icmp ugt i64 %92, %95
  br i1 %96, label %97, label %101

97:                                               ; preds = %91
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %98, i32 0, i32 112
  %100 = call i32 @_tx_mutex_put(ptr noundef %99)
  store i32 10, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

101:                                              ; preds = %91
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %102, i32 0, i32 15
  %104 = load i64, ptr %103, align 8, !tbaa !28
  %105 = load i64, ptr %12, align 8, !tbaa !26
  %106 = load i64, ptr %9, align 8, !tbaa !26
  %107 = mul i64 %105, %106
  %108 = add i64 %104, %107
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %109, i32 0, i32 15
  %111 = load i64, ptr %110, align 8, !tbaa !28
  %112 = icmp ult i64 %108, %111
  br i1 %112, label %122, label %113

113:                                              ; preds = %101
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %114, i32 0, i32 15
  %116 = load i64, ptr %115, align 8, !tbaa !28
  %117 = load i64, ptr %12, align 8, !tbaa !26
  %118 = load i64, ptr %9, align 8, !tbaa !26
  %119 = mul i64 %117, %118
  %120 = add i64 %116, %119
  %121 = icmp ugt i64 %120, 4294967295
  br i1 %121, label %122, label %126

122:                                              ; preds = %113, %101
  %123 = load ptr, ptr %13, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %123, i32 0, i32 112
  %125 = call i32 @_tx_mutex_put(ptr noundef %124)
  store i32 10, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

126:                                              ; preds = %113
  store i64 2, ptr %10, align 8, !tbaa !26
  store i32 0, ptr %8, align 4, !tbaa !29
  br label %127

127:                                              ; preds = %171, %126
  %128 = load i64, ptr %10, align 8, !tbaa !26
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %129, i32 0, i32 14
  %131 = load i64, ptr %130, align 8, !tbaa !30
  %132 = load i64, ptr %12, align 8, !tbaa !26
  %133 = sub i64 %131, %132
  %134 = add i64 %133, 2
  %135 = icmp ule i64 %128, %134
  br i1 %135, label %136, label %172

136:                                              ; preds = %127
  store i64 0, ptr %7, align 8, !tbaa !26
  br label %137

137:                                              ; preds = %157, %136
  %138 = load ptr, ptr %13, align 8, !tbaa !5
  %139 = load i64, ptr %10, align 8, !tbaa !26
  %140 = load i64, ptr %7, align 8, !tbaa !26
  %141 = add i64 %139, %140
  %142 = call i32 @_fx_utility_FAT_entry_read(ptr noundef %138, i64 noundef %141, ptr noundef %11)
  store i32 %142, ptr %6, align 4, !tbaa !29
  %143 = load i32, ptr %6, align 4, !tbaa !29
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %150

145:                                              ; preds = %137
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %146, i32 0, i32 112
  %148 = call i32 @_tx_mutex_put(ptr noundef %147)
  %149 = load i32, ptr %6, align 4, !tbaa !29
  store i32 %149, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

150:                                              ; preds = %137
  %151 = load i64, ptr %11, align 8, !tbaa !26
  %152 = icmp ne i64 %151, 0
  br i1 %152, label %153, label %154

153:                                              ; preds = %150
  br label %161

154:                                              ; preds = %150
  %155 = load i64, ptr %7, align 8, !tbaa !26
  %156 = add i64 %155, 1
  store i64 %156, ptr %7, align 8, !tbaa !26
  br label %157

157:                                              ; preds = %154
  %158 = load i64, ptr %7, align 8, !tbaa !26
  %159 = load i64, ptr %12, align 8, !tbaa !26
  %160 = icmp ult i64 %158, %159
  br i1 %160, label %137, label %161, !llvm.loop !31

161:                                              ; preds = %157, %153
  %162 = load i64, ptr %7, align 8, !tbaa !26
  %163 = load i64, ptr %12, align 8, !tbaa !26
  %164 = icmp uge i64 %162, %163
  br i1 %164, label %165, label %166

165:                                              ; preds = %161
  store i32 1, ptr %8, align 4, !tbaa !29
  br label %172

166:                                              ; preds = %161
  %167 = load i64, ptr %10, align 8, !tbaa !26
  %168 = load i64, ptr %7, align 8, !tbaa !26
  %169 = add i64 %167, %168
  %170 = add i64 %169, 1
  store i64 %170, ptr %10, align 8, !tbaa !26
  br label %171

171:                                              ; preds = %166
  br label %127, !llvm.loop !33

172:                                              ; preds = %165, %127
  %173 = load i32, ptr %8, align 4, !tbaa !29
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %175, label %361

175:                                              ; preds = %172
  store i64 0, ptr %7, align 8, !tbaa !26
  br label %176

176:                                              ; preds = %199, %175
  %177 = load i64, ptr %7, align 8, !tbaa !26
  %178 = load i64, ptr %12, align 8, !tbaa !26
  %179 = sub i64 %178, 1
  %180 = icmp ult i64 %177, %179
  br i1 %180, label %181, label %202

181:                                              ; preds = %176
  %182 = load ptr, ptr %13, align 8, !tbaa !5
  %183 = load i64, ptr %10, align 8, !tbaa !26
  %184 = load i64, ptr %7, align 8, !tbaa !26
  %185 = add i64 %183, %184
  %186 = load i64, ptr %10, align 8, !tbaa !26
  %187 = load i64, ptr %7, align 8, !tbaa !26
  %188 = add i64 %186, %187
  %189 = add i64 %188, 1
  %190 = call i32 @_fx_utility_FAT_entry_write(ptr noundef %182, i64 noundef %185, i64 noundef %189)
  store i32 %190, ptr %6, align 4, !tbaa !29
  %191 = load i32, ptr %6, align 4, !tbaa !29
  %192 = icmp ne i32 %191, 0
  br i1 %192, label %193, label %198

193:                                              ; preds = %181
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %194, i32 0, i32 112
  %196 = call i32 @_tx_mutex_put(ptr noundef %195)
  %197 = load i32, ptr %6, align 4, !tbaa !29
  store i32 %197, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

198:                                              ; preds = %181
  br label %199

199:                                              ; preds = %198
  %200 = load i64, ptr %7, align 8, !tbaa !26
  %201 = add i64 %200, 1
  store i64 %201, ptr %7, align 8, !tbaa !26
  br label %176, !llvm.loop !34

202:                                              ; preds = %176
  %203 = load ptr, ptr %13, align 8, !tbaa !5
  %204 = load i64, ptr %10, align 8, !tbaa !26
  %205 = load i64, ptr %12, align 8, !tbaa !26
  %206 = add i64 %204, %205
  %207 = sub i64 %206, 1
  %208 = load ptr, ptr %13, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %208, i32 0, i32 127
  %210 = load i64, ptr %209, align 8, !tbaa !35
  %211 = call i32 @_fx_utility_FAT_entry_write(ptr noundef %203, i64 noundef %207, i64 noundef %210)
  store i32 %211, ptr %6, align 4, !tbaa !29
  %212 = load i32, ptr %6, align 4, !tbaa !29
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %219

214:                                              ; preds = %202
  %215 = load ptr, ptr %13, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %215, i32 0, i32 112
  %217 = call i32 @_tx_mutex_put(ptr noundef %216)
  %218 = load i32, ptr %6, align 4, !tbaa !29
  store i32 %218, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

219:                                              ; preds = %202
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %220, i32 0, i32 4
  %222 = load i64, ptr %221, align 8, !tbaa !36
  %223 = icmp ne i64 %222, 0
  br i1 %223, label %224, label %284

224:                                              ; preds = %219
  %225 = load ptr, ptr %13, align 8, !tbaa !5
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %226, i32 0, i32 7
  %228 = load i64, ptr %227, align 8, !tbaa !37
  %229 = load i64, ptr %10, align 8, !tbaa !26
  %230 = call i32 @_fx_utility_FAT_entry_write(ptr noundef %225, i64 noundef %228, i64 noundef %229)
  store i32 %230, ptr %6, align 4, !tbaa !29
  %231 = load i32, ptr %6, align 4, !tbaa !29
  %232 = icmp ne i32 %231, 0
  br i1 %232, label %233, label %238

233:                                              ; preds = %224
  %234 = load ptr, ptr %13, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %234, i32 0, i32 112
  %236 = call i32 @_tx_mutex_put(ptr noundef %235)
  %237 = load i32, ptr %6, align 4, !tbaa !29
  store i32 %237, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

238:                                              ; preds = %224
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %239, i32 0, i32 12
  %241 = load i64, ptr %240, align 8, !tbaa !38
  %242 = load ptr, ptr %13, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %242, i32 0, i32 19
  %244 = load i32, ptr %243, align 8, !tbaa !25
  %245 = sub i32 %244, 1
  %246 = zext i32 %245 to i64
  %247 = icmp uge i64 %241, %246
  br i1 %247, label %248, label %283

248:                                              ; preds = %238
  %249 = load ptr, ptr %4, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %249, i32 0, i32 10
  %251 = load i64, ptr %250, align 8, !tbaa !39
  %252 = load ptr, ptr %13, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %252, i32 0, i32 10
  %254 = load i32, ptr %253, align 8, !tbaa !24
  %255 = zext i32 %254 to i64
  %256 = icmp uge i64 %251, %255
  br i1 %256, label %257, label %283

257:                                              ; preds = %248
  %258 = load i64, ptr %10, align 8, !tbaa !26
  %259 = load ptr, ptr %4, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %259, i32 0, i32 8
  store i64 %258, ptr %260, align 8, !tbaa !40
  %261 = load ptr, ptr %4, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %261, i32 0, i32 11
  %263 = load i64, ptr %262, align 8, !tbaa !41
  %264 = add i64 %263, 1
  store i64 %264, ptr %262, align 8, !tbaa !41
  %265 = load ptr, ptr %4, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %265, i32 0, i32 12
  store i64 0, ptr %266, align 8, !tbaa !38
  %267 = load ptr, ptr %13, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %267, i32 0, i32 18
  %269 = load i32, ptr %268, align 4, !tbaa !42
  %270 = zext i32 %269 to i64
  %271 = load i64, ptr %10, align 8, !tbaa !26
  %272 = sub i64 %271, 2
  %273 = load ptr, ptr %13, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %273, i32 0, i32 19
  %275 = load i32, ptr %274, align 8, !tbaa !25
  %276 = zext i32 %275 to i64
  %277 = mul i64 %272, %276
  %278 = add i64 %270, %277
  %279 = load ptr, ptr %4, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %279, i32 0, i32 9
  store i64 %278, ptr %280, align 8, !tbaa !43
  %281 = load ptr, ptr %4, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %281, i32 0, i32 10
  store i64 0, ptr %282, align 8, !tbaa !39
  br label %283

283:                                              ; preds = %257, %248, %238
  br label %319

284:                                              ; preds = %219
  %285 = load i64, ptr %10, align 8, !tbaa !26
  %286 = load ptr, ptr %4, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %286, i32 0, i32 5
  store i64 %285, ptr %287, align 8, !tbaa !44
  %288 = load ptr, ptr %4, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %288, i32 0, i32 5
  %290 = load i64, ptr %289, align 8, !tbaa !44
  %291 = load ptr, ptr %4, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %291, i32 0, i32 8
  store i64 %290, ptr %292, align 8, !tbaa !40
  %293 = load ptr, ptr %4, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %293, i32 0, i32 11
  store i64 0, ptr %294, align 8, !tbaa !41
  %295 = load ptr, ptr %13, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %295, i32 0, i32 18
  %297 = load i32, ptr %296, align 4, !tbaa !42
  %298 = zext i32 %297 to i64
  %299 = load ptr, ptr %4, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %299, i32 0, i32 5
  %301 = load i64, ptr %300, align 8, !tbaa !44
  %302 = sub i64 %301, 2
  %303 = load ptr, ptr %13, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %303, i32 0, i32 19
  %305 = load i32, ptr %304, align 8, !tbaa !25
  %306 = zext i32 %305 to i64
  %307 = mul i64 %302, %306
  %308 = add i64 %298, %307
  %309 = load ptr, ptr %4, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %309, i32 0, i32 9
  store i64 %308, ptr %310, align 8, !tbaa !43
  %311 = load ptr, ptr %4, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %311, i32 0, i32 10
  store i64 0, ptr %312, align 8, !tbaa !39
  %313 = load ptr, ptr %4, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %313, i32 0, i32 13
  store i64 0, ptr %314, align 8, !tbaa !45
  %315 = load i64, ptr %10, align 8, !tbaa !26
  %316 = load ptr, ptr %4, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %316, i32 0, i32 19
  %318 = getelementptr inbounds %struct.FX_DIR_ENTRY_STRUCT, ptr %317, i32 0, i32 12
  store i64 %315, ptr %318, align 8, !tbaa !46
  br label %319

319:                                              ; preds = %284, %283
  %320 = load i64, ptr %10, align 8, !tbaa !26
  %321 = load i64, ptr %12, align 8, !tbaa !26
  %322 = add i64 %320, %321
  %323 = sub i64 %322, 1
  %324 = load ptr, ptr %4, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %324, i32 0, i32 7
  store i64 %323, ptr %325, align 8, !tbaa !37
  %326 = load ptr, ptr %4, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %326, i32 0, i32 15
  %328 = load i64, ptr %327, align 8, !tbaa !28
  %329 = load i64, ptr %9, align 8, !tbaa !26
  %330 = load i64, ptr %12, align 8, !tbaa !26
  %331 = mul i64 %329, %330
  %332 = add i64 %328, %331
  %333 = load ptr, ptr %4, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %333, i32 0, i32 15
  store i64 %332, ptr %334, align 8, !tbaa !28
  %335 = load ptr, ptr %4, align 8, !tbaa !5
  %336 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %335, i32 0, i32 4
  %337 = load i64, ptr %336, align 8, !tbaa !36
  %338 = load i64, ptr %12, align 8, !tbaa !26
  %339 = add i64 %337, %338
  %340 = load ptr, ptr %4, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %340, i32 0, i32 4
  store i64 %339, ptr %341, align 8, !tbaa !36
  %342 = load ptr, ptr %13, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %342, i32 0, i32 29
  %344 = load i64, ptr %343, align 8, !tbaa !27
  %345 = load i64, ptr %12, align 8, !tbaa !26
  %346 = sub i64 %344, %345
  %347 = load ptr, ptr %13, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %347, i32 0, i32 29
  store i64 %346, ptr %348, align 8, !tbaa !27
  %349 = load ptr, ptr %13, align 8, !tbaa !5
  %350 = load ptr, ptr %4, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.FX_FILE_STRUCT, ptr %350, i32 0, i32 19
  %352 = call i32 @_fx_directory_entry_write(ptr noundef %349, ptr noundef %351)
  store i32 %352, ptr %6, align 4, !tbaa !29
  %353 = load i32, ptr %6, align 4, !tbaa !29
  %354 = icmp ne i32 %353, 0
  br i1 %354, label %355, label %360

355:                                              ; preds = %319
  %356 = load ptr, ptr %13, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %356, i32 0, i32 112
  %358 = call i32 @_tx_mutex_put(ptr noundef %357)
  %359 = load i32, ptr %6, align 4, !tbaa !29
  store i32 %359, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

360:                                              ; preds = %319
  br label %365

361:                                              ; preds = %172
  %362 = load ptr, ptr %13, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %362, i32 0, i32 112
  %364 = call i32 @_tx_mutex_put(ptr noundef %363)
  store i32 10, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

365:                                              ; preds = %360
  %366 = load ptr, ptr %13, align 8, !tbaa !5
  %367 = load ptr, ptr %13, align 8, !tbaa !5
  %368 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %367, i32 0, i32 20
  %369 = load i32, ptr %368, align 4, !tbaa !47
  %370 = zext i32 %369 to i64
  %371 = call i32 @_fx_utility_logical_sector_flush(ptr noundef %366, i64 noundef 1, i64 noundef %370, i32 noundef 0)
  store i32 %371, ptr %6, align 4, !tbaa !29
  %372 = load ptr, ptr %13, align 8, !tbaa !5
  %373 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %372, i32 0, i32 112
  %374 = call i32 @_tx_mutex_put(ptr noundef %373)
  %375 = load i32, ptr %6, align 4, !tbaa !29
  store i32 %375, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %376

376:                                              ; preds = %365, %361, %355, %233, %214, %193, %145, %122, %97, %87, %74, %58, %51, %45, %36, %32, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %377 = load i32, ptr %3, align 4
  ret i32 %377
}

; 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

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

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

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

declare i32 @_fx_utility_logical_sector_flush(ptr noundef, i64 noundef, i64 noundef, i32 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 = { nounwind }

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

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


; 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_file_extended_allocate(ptr noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %4 = load i64, ptr %0, align 8, !tbaa !5
  %.not = icmp eq i64 %4, 1179208773
  br i1 %.not, label %5, label %161

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 128
  %7 = load ptr, ptr %6, align 8, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %7, i64 480
  %9 = load i64, ptr %8, align 8, !tbaa !15
  %10 = add i64 %9, 1
  store i64 %10, ptr %8, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load i64, ptr %11, align 8, !tbaa !19
  %.not135 = icmp eq i64 %12, 1
  br i1 %.not135, label %13, label %161

13:                                               ; preds = %5
  %14 = icmp eq i64 %1, 0
  br i1 %14, label %161, label %15

15:                                               ; preds = %13
  %16 = load i64, ptr %7, align 8, !tbaa !20
  %.not136 = icmp eq i64 %16, 1296385097
  br i1 %.not136, label %17, label %161

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %7, i64 824
  %19 = tail call i32 @_tx_mutex_get(ptr noundef nonnull %18, i64 noundef 4294967295) #3
  %.not137 = icmp eq i32 %19, 0
  br i1 %.not137, label %20, label %161

20:                                               ; preds = %17
  %21 = getelementptr inbounds i8, ptr %7, i64 264
  %22 = load i32, ptr %21, align 8, !tbaa !21
  %.not138 = icmp eq i32 %22, 0
  br i1 %.not138, label %25, label %23

23:                                               ; preds = %20
  %24 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %7, i64 80
  %27 = load i32, ptr %26, align 8, !tbaa !22
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds i8, ptr %7, i64 128
  %30 = load i32, ptr %29, align 8, !tbaa !23
  %31 = zext i32 %30 to i64
  %32 = mul nuw i64 %31, %28
  %33 = icmp eq i64 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %25
  %35 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

36:                                               ; preds = %25
  %37 = add i64 %1, -1
  %38 = add i64 %37, %32
  %39 = udiv i64 %38, %32
  %40 = icmp ugt i64 %32, %38
  br i1 %40, label %41, label %43

41:                                               ; preds = %36
  %42 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

43:                                               ; preds = %36
  %44 = getelementptr inbounds i8, ptr %7, i64 192
  %45 = load i64, ptr %44, align 8, !tbaa !24
  %46 = icmp ugt i64 %39, %45
  br i1 %46, label %47, label %49

47:                                               ; preds = %43
  %48 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

49:                                               ; preds = %43
  %50 = getelementptr inbounds i8, ptr %0, i64 120
  %51 = load i64, ptr %50, align 8, !tbaa !25
  %52 = mul i64 %39, %32
  %53 = add i64 %51, %52
  %54 = icmp ult i64 %53, %51
  %55 = icmp ugt i64 %53, 4294967295
  %or.cond = or i1 %54, %55
  br i1 %or.cond, label %60, label %.preheader152

.preheader152:                                    ; preds = %49
  %56 = getelementptr inbounds i8, ptr %7, i64 104
  %57 = sub i64 2, %39
  %58 = load i64, ptr %56, align 8, !tbaa !26
  %59 = add i64 %57, %58
  %.not139157 = icmp ult i64 %59, 2
  br i1 %.not139157, label %.critedge, label %.preheader151

60:                                               ; preds = %49
  %61 = tail call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

.preheader151:                                    ; preds = %.preheader152, %73
  %.0121158 = phi i64 [ %75, %73 ], [ 2, %.preheader152 ]
  br label %62

62:                                               ; preds = %.preheader151, %69
  %.0123 = phi i64 [ %70, %69 ], [ 0, %.preheader151 ]
  %63 = add i64 %.0123, %.0121158
  %64 = call i32 @_fx_utility_FAT_entry_read(ptr noundef nonnull %7, i64 noundef %63, ptr noundef nonnull %3) #3
  %.not140 = icmp eq i32 %64, 0
  br i1 %.not140, label %67, label %65

65:                                               ; preds = %62
  %66 = call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

67:                                               ; preds = %62
  %68 = load i64, ptr %3, align 8, !tbaa !27
  %.not141 = icmp eq i64 %68, 0
  br i1 %.not141, label %69, label %72

69:                                               ; preds = %67
  %70 = add nuw i64 %.0123, 1
  %71 = icmp ult i64 %70, %39
  br i1 %71, label %62, label %72, !llvm.loop !28

72:                                               ; preds = %67, %69
  %.1 = phi i64 [ %.0123, %67 ], [ %70, %69 ]
  %.not142 = icmp ult i64 %.1, %39
  br i1 %.not142, label %73, label %.preheader

73:                                               ; preds = %72
  %74 = add i64 %.0121158, 1
  %75 = add i64 %74, %.1
  %76 = load i64, ptr %56, align 8, !tbaa !26
  %77 = add i64 %57, %76
  %.not139 = icmp ugt i64 %75, %77
  br i1 %.not139, label %.critedge, label %.preheader151, !llvm.loop !30

.preheader:                                       ; preds = %72
  %78 = add i64 %39, -1
  %.not160 = icmp eq i64 %78, 0
  br i1 %.not160, label %._crit_edge, label %.lr.ph

79:                                               ; preds = %.lr.ph
  %80 = add nuw i64 %.2159, 1
  %81 = icmp ult i64 %80, %78
  br i1 %81, label %.lr.ph, label %._crit_edge, !llvm.loop !31

.lr.ph:                                           ; preds = %.preheader, %79
  %.2159 = phi i64 [ %80, %79 ], [ 0, %.preheader ]
  %82 = add i64 %.2159, %.0121158
  %83 = add i64 %82, 1
  %84 = call i32 @_fx_utility_FAT_entry_write(ptr noundef nonnull %7, i64 noundef %82, i64 noundef %83) #3
  %.not150 = icmp eq i32 %84, 0
  br i1 %.not150, label %79, label %85

85:                                               ; preds = %.lr.ph
  %86 = call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

._crit_edge:                                      ; preds = %79, %.preheader
  %87 = add i64 %78, %.0121158
  %88 = getelementptr inbounds i8, ptr %7, i64 12128
  %89 = load i64, ptr %88, align 8, !tbaa !32
  %90 = call i32 @_fx_utility_FAT_entry_write(ptr noundef nonnull %7, i64 noundef %87, i64 noundef %89) #3
  %.not144 = icmp eq i32 %90, 0
  br i1 %.not144, label %93, label %91

91:                                               ; preds = %._crit_edge
  %92 = call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

93:                                               ; preds = %._crit_edge
  %94 = getelementptr inbounds i8, ptr %0, i64 32
  %95 = load i64, ptr %94, align 8, !tbaa !33
  %.not145 = icmp eq i64 %95, 0
  br i1 %.not145, label %126, label %96

96:                                               ; preds = %93
  %97 = getelementptr inbounds i8, ptr %0, i64 56
  %98 = load i64, ptr %97, align 8, !tbaa !34
  %99 = call i32 @_fx_utility_FAT_entry_write(ptr noundef nonnull %7, i64 noundef %98, i64 noundef %.0121158) #3
  %.not146 = icmp eq i32 %99, 0
  br i1 %.not146, label %102, label %100

100:                                              ; preds = %96
  %101 = call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

102:                                              ; preds = %96
  %103 = getelementptr inbounds i8, ptr %0, i64 96
  %104 = load i64, ptr %103, align 8, !tbaa !35
  %105 = load i32, ptr %29, align 8, !tbaa !23
  %106 = add i32 %105, -1
  %107 = zext i32 %106 to i64
  %.not147 = icmp ult i64 %104, %107
  br i1 %.not147, label %142, label %108

108:                                              ; preds = %102
  %109 = getelementptr inbounds i8, ptr %0, i64 80
  %110 = load i64, ptr %109, align 8, !tbaa !36
  %111 = load i32, ptr %26, align 8, !tbaa !22
  %112 = zext i32 %111 to i64
  %.not148 = icmp ult i64 %110, %112
  br i1 %.not148, label %142, label %113

113:                                              ; preds = %108
  %114 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 %.0121158, ptr %114, align 8, !tbaa !37
  %115 = getelementptr inbounds i8, ptr %0, i64 88
  %116 = load i64, ptr %115, align 8, !tbaa !38
  %117 = add i64 %116, 1
  store i64 %117, ptr %115, align 8, !tbaa !38
  store i64 0, ptr %103, align 8, !tbaa !35
  %118 = getelementptr inbounds i8, ptr %7, i64 124
  %119 = load i32, ptr %118, align 4, !tbaa !39
  %120 = zext i32 %119 to i64
  %121 = add i64 %.0121158, -2
  %122 = zext i32 %105 to i64
  %123 = mul i64 %121, %122
  %124 = add i64 %123, %120
  %125 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 %124, ptr %125, align 8, !tbaa !40
  store i64 0, ptr %109, align 8, !tbaa !36
  br label %142

126:                                              ; preds = %93
  %127 = getelementptr inbounds i8, ptr %0, i64 40
  store i64 %.0121158, ptr %127, align 8, !tbaa !41
  %128 = getelementptr inbounds i8, ptr %0, i64 64
  store i64 %.0121158, ptr %128, align 8, !tbaa !37
  %129 = getelementptr inbounds i8, ptr %0, i64 88
  store i64 0, ptr %129, align 8, !tbaa !38
  %130 = getelementptr inbounds i8, ptr %7, i64 124
  %131 = load i32, ptr %130, align 4, !tbaa !39
  %132 = zext i32 %131 to i64
  %133 = add i64 %.0121158, -2
  %134 = load i32, ptr %29, align 8, !tbaa !23
  %135 = zext i32 %134 to i64
  %136 = mul i64 %133, %135
  %137 = add i64 %136, %132
  %138 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 %137, ptr %138, align 8, !tbaa !40
  %139 = getelementptr inbounds i8, ptr %0, i64 80
  store i64 0, ptr %139, align 8, !tbaa !36
  %140 = getelementptr inbounds i8, ptr %0, i64 104
  store i64 0, ptr %140, align 8, !tbaa !42
  %141 = getelementptr inbounds i8, ptr %0, i64 208
  store i64 %.0121158, ptr %141, align 8, !tbaa !43
  br label %142

142:                                              ; preds = %102, %108, %113, %126
  %143 = getelementptr inbounds i8, ptr %0, i64 56
  store i64 %87, ptr %143, align 8, !tbaa !34
  %144 = load i64, ptr %50, align 8, !tbaa !25
  %145 = add i64 %144, %52
  store i64 %145, ptr %50, align 8, !tbaa !25
  %146 = load i64, ptr %94, align 8, !tbaa !33
  %147 = add i64 %146, %39
  store i64 %147, ptr %94, align 8, !tbaa !33
  %148 = load i64, ptr %44, align 8, !tbaa !24
  %149 = sub i64 %148, %39
  store i64 %149, ptr %44, align 8, !tbaa !24
  %150 = getelementptr inbounds i8, ptr %0, i64 152
  %151 = call i32 @_fx_directory_entry_write(ptr noundef nonnull %7, ptr noundef nonnull %150) #3
  %.not149 = icmp eq i32 %151, 0
  br i1 %.not149, label %155, label %152

152:                                              ; preds = %142
  %153 = call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

.critedge:                                        ; preds = %73, %.preheader152
  %154 = call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

155:                                              ; preds = %142
  %156 = getelementptr inbounds i8, ptr %7, i64 132
  %157 = load i32, ptr %156, align 4, !tbaa !44
  %158 = zext i32 %157 to i64
  %159 = call i32 @_fx_utility_logical_sector_flush(ptr noundef nonnull %7, i64 noundef 1, i64 noundef %158, i32 noundef 0) #3
  %160 = call i32 @_tx_mutex_put(ptr noundef nonnull %18) #3
  br label %161

161:                                              ; preds = %17, %15, %13, %5, %2, %155, %.critedge, %152, %100, %91, %85, %65, %60, %47, %41, %34, %23
  %.0 = phi i32 [ 35, %23 ], [ 2, %34 ], [ 10, %41 ], [ 10, %47 ], [ 10, %60 ], [ %64, %65 ], [ %84, %85 ], [ %90, %91 ], [ %99, %100 ], [ %151, %152 ], [ %159, %155 ], [ 10, %.critedge ], [ 7, %2 ], [ 6, %5 ], [ 0, %13 ], [ 17, %15 ], [ 17, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i32 %.0
}

; Function Attrs: mustprogress 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) local_unnamed_addr #2

declare i32 @_tx_mutex_put(ptr noundef) local_unnamed_addr #2

declare i32 @_fx_utility_FAT_entry_read(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @_fx_utility_FAT_entry_write(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress 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 = { mustprogress 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, !7, i64 0}
!6 = !{!"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, !11, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !12, i64 152, !8, i64 288, !7, i64 544, !10, i64 552}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"FX_DIR_ENTRY_STRUCT", !10, i64 0, !8, i64 8, !13, i64 24, !13, i64 28, !8, i64 32, !8, i64 33, !8, i64 34, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !7, i64 56, !11, i64 64, !11, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !11, i64 112, !7, i64 120, !11, i64 128}
!13 = !{!"int", !8, i64 0}
!14 = !{!6, !10, i64 128}
!15 = !{!16, !7, i64 480}
!16 = !{!"FX_MEDIA_STRUCT", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !13, i64 32, !7, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 72, !13, i64 80, !13, i64 84, !13, i64 88, !11, i64 96, !7, 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, !7, i64 152, !13, i64 160, !7, i64 168, !7, i64 176, !13, i64 184, !7, i64 192, !7, i64 200, !10, i64 208, !13, i64 216, !13, i64 220, !10, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !13, i64 256, !13, i64 260, !13, i64 264, !13, i64 268, !13, i64 272, !13, i64 276, !13, 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, !17, i64 824, !13, i64 920, !12, i64 928, !12, i64 1064, !8, i64 1200, !8, i64 1456, !18, 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}
!17 = !{!"TX_MUTEX_STRUCT", !7, i64 0, !10, i64 8, !13, i64 16, !10, i64 24, !13, i64 32, !13, i64 36, !10, i64 40, !13, i64 48, !10, i64 56, !10, i64 64, !13, i64 72, !10, i64 80, !10, i64 88}
!18 = !{!"FX_PATH_STRUCT", !12, i64 0, !8, i64 136, !8, i64 392, !7, i64 648}
!19 = !{!6, !7, i64 16}
!20 = !{!16, !7, i64 0}
!21 = !{!16, !13, i64 264}
!22 = !{!16, !13, i64 80}
!23 = !{!16, !13, i64 128}
!24 = !{!16, !7, i64 192}
!25 = !{!6, !11, i64 120}
!26 = !{!16, !7, i64 104}
!27 = !{!7, !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}
!32 = !{!16, !7, i64 12128}
!33 = !{!6, !7, i64 32}
!34 = !{!6, !7, i64 56}
!35 = !{!6, !7, i64 96}
!36 = !{!6, !7, i64 80}
!37 = !{!6, !7, i64 64}
!38 = !{!6, !7, i64 88}
!39 = !{!16, !13, i64 124}
!40 = !{!6, !11, i64 72}
!41 = !{!6, !7, i64 40}
!42 = !{!6, !11, i64 104}
!43 = !{!6, !7, i64 208}
!44 = !{!16, !13, i64 132}


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