; LLVM IR from mlcommons/tiny :: benchmark/interface/Middlewares/ST/filex/common/src/fx_utility_FAT_entry_read._77c5ed66 (read)

; 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_FAT_CACHE_ENTRY_STRUCT = type { 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_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_CACHED_SECTOR_STRUCT = type { ptr, i64, i8, i8, i8, i8, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_utility_FAT_entry_read(ptr noundef %0, i64 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %struct.FX_FAT_CACHE_ENTRY_STRUCT, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #4
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %18, i32 0, i32 92
  %20 = load i64, ptr %19, align 8, !tbaa !11
  %21 = add i64 %20, 1
  store i64 %21, ptr %19, align 8, !tbaa !11
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %22, i32 0, i32 94
  %24 = load i64, ptr %23, align 8, !tbaa !18
  %25 = add i64 %24, 1
  store i64 %25, ptr %23, align 8, !tbaa !18
  %26 = load i64, ptr %6, align 8, !tbaa !9
  %27 = and i64 %26, 3
  %28 = mul i64 %27, 4
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %13, align 4, !tbaa !19
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %30, i32 0, i32 119
  %32 = load i32, ptr %13, align 4, !tbaa !19
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %31, i64 0, i64 %33
  store ptr %34, ptr %15, align 8, !tbaa !5
  %35 = load ptr, ptr %15, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !20
  %38 = load i64, ptr %6, align 8, !tbaa !9
  %39 = icmp eq i64 %37, %38
  br i1 %39, label %40, label %45

40:                                               ; preds = %3
  %41 = load ptr, ptr %15, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %41, i32 0, i32 1
  %43 = load i64, ptr %42, align 8, !tbaa !22
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %43, ptr %44, align 8, !tbaa !9
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

45:                                               ; preds = %3
  %46 = load ptr, ptr %15, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %46, i64 1
  %48 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %47, i32 0, i32 0
  %49 = load i64, ptr %48, align 8, !tbaa !20
  %50 = load i64, ptr %6, align 8, !tbaa !9
  %51 = icmp eq i64 %49, %50
  br i1 %51, label %52, label %64

52:                                               ; preds = %45
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %53, i64 1
  %55 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %54, i32 0, i32 1
  %56 = load i64, ptr %55, align 8, !tbaa !22
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %56, ptr %57, align 8, !tbaa !9
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %58, i64 24, i1 false), !tbaa.struct !23
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = load ptr, ptr %15, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %60, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %59, ptr align 8 %61, i64 24, i1 false), !tbaa.struct !23
  %62 = load ptr, ptr %15, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %62, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %63, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

64:                                               ; preds = %45
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %65, i64 2
  %67 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %66, i32 0, i32 0
  %68 = load i64, ptr %67, align 8, !tbaa !20
  %69 = load i64, ptr %6, align 8, !tbaa !9
  %70 = icmp eq i64 %68, %69
  br i1 %70, label %71, label %87

71:                                               ; preds = %64
  %72 = load ptr, ptr %15, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %72, i64 2
  %74 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %73, i32 0, i32 1
  %75 = load i64, ptr %74, align 8, !tbaa !22
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %75, ptr %76, align 8, !tbaa !9
  %77 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %77, i64 24, i1 false), !tbaa.struct !23
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = load ptr, ptr %15, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %79, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %78, ptr align 8 %80, i64 24, i1 false), !tbaa.struct !23
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %81, i64 2
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %83, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %82, ptr align 8 %84, i64 24, i1 false), !tbaa.struct !23
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %85, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %86, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

87:                                               ; preds = %64
  %88 = load ptr, ptr %15, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %88, i64 3
  %90 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %89, i32 0, i32 0
  %91 = load i64, ptr %90, align 8, !tbaa !20
  %92 = load i64, ptr %6, align 8, !tbaa !9
  %93 = icmp eq i64 %91, %92
  br i1 %93, label %94, label %114

94:                                               ; preds = %87
  %95 = load ptr, ptr %15, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %95, i64 3
  %97 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %96, i32 0, i32 1
  %98 = load i64, ptr %97, align 8, !tbaa !22
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %98, ptr %99, align 8, !tbaa !9
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %100, i64 24, i1 false), !tbaa.struct !23
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %102, i64 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %101, ptr align 8 %103, i64 24, i1 false), !tbaa.struct !23
  %104 = load ptr, ptr %15, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %104, i64 3
  %106 = load ptr, ptr %15, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %106, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %105, ptr align 8 %107, i64 24, i1 false), !tbaa.struct !23
  %108 = load ptr, ptr %15, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %108, i64 2
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %110, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %109, ptr align 8 %111, i64 24, i1 false), !tbaa.struct !23
  %112 = load ptr, ptr %15, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %112, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %113, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

114:                                              ; preds = %87
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %118, i32 0, i32 119
  %120 = load i32, ptr %13, align 4, !tbaa !19
  %121 = add i32 %120, 3
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %119, i64 0, i64 %122
  %124 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %123, i32 0, i32 2
  %125 = load i64, ptr %124, align 8, !tbaa !24
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %127, label %135

127:                                              ; preds = %117
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = call i32 @_fx_utility_FAT_flush(ptr noundef %128)
  store i32 %129, ptr %14, align 4, !tbaa !19
  %130 = load i32, ptr %14, align 4, !tbaa !19
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %127
  %133 = load i32, ptr %14, align 4, !tbaa !19
  store i32 %133, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

134:                                              ; preds = %127
  br label %135

135:                                              ; preds = %134, %117
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %136, i32 0, i32 94
  %138 = load i64, ptr %137, align 8, !tbaa !18
  %139 = add i64 %138, -1
  store i64 %139, ptr %137, align 8, !tbaa !18
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %140, i32 0, i32 95
  %142 = load i64, ptr %141, align 8, !tbaa !25
  %143 = add i64 %142, 1
  store i64 %143, ptr %141, align 8, !tbaa !25
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %144, i32 0, i32 22
  %146 = load i32, ptr %145, align 4, !tbaa !26
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %287

148:                                              ; preds = %135
  %149 = load i64, ptr %6, align 8, !tbaa !9
  %150 = shl i64 %149, 1
  %151 = load i64, ptr %6, align 8, !tbaa !9
  %152 = add i64 %150, %151
  %153 = lshr i64 %152, 1
  store i64 %153, ptr %9, align 8, !tbaa !9
  %154 = load i64, ptr %9, align 8, !tbaa !9
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %155, i32 0, i32 10
  %157 = load i32, ptr %156, align 8, !tbaa !27
  %158 = zext i32 %157 to i64
  %159 = udiv i64 %154, %158
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %160, i32 0, i32 15
  %162 = load i32, ptr %161, align 8, !tbaa !28
  %163 = zext i32 %162 to i64
  %164 = add i64 %159, %163
  store i64 %164, ptr %8, align 8, !tbaa !9
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = load i64, ptr %8, align 8, !tbaa !9
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %167, i32 0, i32 2
  %169 = load ptr, ptr %168, align 8, !tbaa !29
  %170 = call i32 @_fx_utility_logical_sector_read(ptr noundef %165, i64 noundef %166, ptr noundef %169, i64 noundef 1, i8 noundef zeroext 2)
  store i32 %170, ptr %14, align 4, !tbaa !19
  %171 = load i32, ptr %14, align 4, !tbaa !19
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %173, label %175

173:                                              ; preds = %148
  %174 = load i32, ptr %14, align 4, !tbaa !19
  store i32 %174, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

175:                                              ; preds = %148
  %176 = load i64, ptr %9, align 8, !tbaa !9
  %177 = load i64, ptr %8, align 8, !tbaa !9
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %178, i32 0, i32 15
  %180 = load i32, ptr %179, align 8, !tbaa !28
  %181 = zext i32 %180 to i64
  %182 = sub i64 %177, %181
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %183, i32 0, i32 10
  %185 = load i32, ptr %184, align 8, !tbaa !27
  %186 = zext i32 %185 to i64
  %187 = mul i64 %182, %186
  %188 = sub i64 %176, %187
  store i64 %188, ptr %9, align 8, !tbaa !9
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %189, i32 0, i32 2
  %191 = load ptr, ptr %190, align 8, !tbaa !29
  %192 = load i64, ptr %9, align 8, !tbaa !9
  %193 = trunc i64 %192 to i32
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds i8, ptr %191, i64 %194
  store ptr %195, ptr %11, align 8, !tbaa !5
  %196 = load i64, ptr %6, align 8, !tbaa !9
  %197 = and i64 %196, 1
  %198 = icmp ne i64 %197, 0
  br i1 %198, label %199, label %238

199:                                              ; preds = %175
  %200 = load ptr, ptr %11, align 8, !tbaa !5
  %201 = load i8, ptr %200, align 1, !tbaa !30
  %202 = zext i8 %201 to i32
  %203 = and i32 %202, 240
  %204 = lshr i32 %203, 4
  store i32 %204, ptr %12, align 4, !tbaa !19
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = getelementptr inbounds i8, ptr %205, i32 1
  store ptr %206, ptr %11, align 8, !tbaa !5
  %207 = load i64, ptr %9, align 8, !tbaa !9
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %208, i32 0, i32 10
  %210 = load i32, ptr %209, align 8, !tbaa !27
  %211 = sub i32 %210, 1
  %212 = zext i32 %211 to i64
  %213 = icmp eq i64 %207, %212
  br i1 %213, label %214, label %231

214:                                              ; preds = %199
  %215 = load i64, ptr %8, align 8, !tbaa !9
  %216 = add i64 %215, 1
  store i64 %216, ptr %8, align 8, !tbaa !9
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = load i64, ptr %8, align 8, !tbaa !9
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %219, i32 0, i32 2
  %221 = load ptr, ptr %220, align 8, !tbaa !29
  %222 = call i32 @_fx_utility_logical_sector_read(ptr noundef %217, i64 noundef %218, ptr noundef %221, i64 noundef 1, i8 noundef zeroext 2)
  store i32 %222, ptr %14, align 4, !tbaa !19
  %223 = load i32, ptr %14, align 4, !tbaa !19
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %225, label %227

225:                                              ; preds = %214
  %226 = load i32, ptr %14, align 4, !tbaa !19
  store i32 %226, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

227:                                              ; preds = %214
  %228 = load ptr, ptr %5, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %228, i32 0, i32 2
  %230 = load ptr, ptr %229, align 8, !tbaa !29
  store ptr %230, ptr %11, align 8, !tbaa !5
  br label %231

231:                                              ; preds = %227, %199
  %232 = load i32, ptr %12, align 4, !tbaa !19
  %233 = load ptr, ptr %11, align 8, !tbaa !5
  %234 = load i8, ptr %233, align 1, !tbaa !30
  %235 = zext i8 %234 to i32
  %236 = shl i32 %235, 4
  %237 = or i32 %232, %236
  store i32 %237, ptr %12, align 4, !tbaa !19
  br label %277

238:                                              ; preds = %175
  %239 = load ptr, ptr %11, align 8, !tbaa !5
  %240 = load i8, ptr %239, align 1, !tbaa !30
  %241 = zext i8 %240 to i32
  %242 = and i32 %241, 255
  store i32 %242, ptr %12, align 4, !tbaa !19
  %243 = load ptr, ptr %11, align 8, !tbaa !5
  %244 = getelementptr inbounds i8, ptr %243, i32 1
  store ptr %244, ptr %11, align 8, !tbaa !5
  %245 = load i64, ptr %9, align 8, !tbaa !9
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %246, i32 0, i32 10
  %248 = load i32, ptr %247, align 8, !tbaa !27
  %249 = sub i32 %248, 1
  %250 = zext i32 %249 to i64
  %251 = icmp eq i64 %245, %250
  br i1 %251, label %252, label %269

252:                                              ; preds = %238
  %253 = load i64, ptr %8, align 8, !tbaa !9
  %254 = add i64 %253, 1
  store i64 %254, ptr %8, align 8, !tbaa !9
  %255 = load ptr, ptr %5, align 8, !tbaa !5
  %256 = load i64, ptr %8, align 8, !tbaa !9
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %257, i32 0, i32 2
  %259 = load ptr, ptr %258, align 8, !tbaa !29
  %260 = call i32 @_fx_utility_logical_sector_read(ptr noundef %255, i64 noundef %256, ptr noundef %259, i64 noundef 1, i8 noundef zeroext 2)
  store i32 %260, ptr %14, align 4, !tbaa !19
  %261 = load i32, ptr %14, align 4, !tbaa !19
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %263, label %265

263:                                              ; preds = %252
  %264 = load i32, ptr %14, align 4, !tbaa !19
  store i32 %264, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

265:                                              ; preds = %252
  %266 = load ptr, ptr %5, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %266, i32 0, i32 2
  %268 = load ptr, ptr %267, align 8, !tbaa !29
  store ptr %268, ptr %11, align 8, !tbaa !5
  br label %269

269:                                              ; preds = %265, %238
  %270 = load i32, ptr %12, align 4, !tbaa !19
  %271 = load ptr, ptr %11, align 8, !tbaa !5
  %272 = load i8, ptr %271, align 1, !tbaa !30
  %273 = zext i8 %272 to i32
  %274 = and i32 %273, 15
  %275 = shl i32 %274, 8
  %276 = or i32 %270, %275
  store i32 %276, ptr %12, align 4, !tbaa !19
  br label %277

277:                                              ; preds = %269, %231
  %278 = load i32, ptr %12, align 4, !tbaa !19
  %279 = icmp uge i32 %278, 4080
  br i1 %279, label %280, label %283

280:                                              ; preds = %277
  %281 = load i32, ptr %12, align 4, !tbaa !19
  %282 = or i32 %281, 61440
  store i32 %282, ptr %12, align 4, !tbaa !19
  br label %283

283:                                              ; preds = %280, %277
  %284 = load i32, ptr %12, align 4, !tbaa !19
  %285 = zext i32 %284 to i64
  %286 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %285, ptr %286, align 8, !tbaa !9
  br label %385

287:                                              ; preds = %135
  %288 = load ptr, ptr %5, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %288, i32 0, i32 23
  %290 = load i32, ptr %289, align 8, !tbaa !31
  %291 = icmp ne i32 %290, 0
  br i1 %291, label %342, label %292

292:                                              ; preds = %287
  %293 = load i64, ptr %6, align 8, !tbaa !9
  %294 = mul i64 %293, 2
  store i64 %294, ptr %9, align 8, !tbaa !9
  %295 = load i64, ptr %9, align 8, !tbaa !9
  %296 = load ptr, ptr %5, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %296, i32 0, i32 10
  %298 = load i32, ptr %297, align 8, !tbaa !27
  %299 = zext i32 %298 to i64
  %300 = udiv i64 %295, %299
  %301 = load ptr, ptr %5, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %301, i32 0, i32 15
  %303 = load i32, ptr %302, align 8, !tbaa !28
  %304 = zext i32 %303 to i64
  %305 = add i64 %300, %304
  store i64 %305, ptr %8, align 8, !tbaa !9
  %306 = load ptr, ptr %5, align 8, !tbaa !5
  %307 = load i64, ptr %8, align 8, !tbaa !9
  %308 = load ptr, ptr %5, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %308, i32 0, i32 2
  %310 = load ptr, ptr %309, align 8, !tbaa !29
  %311 = call i32 @_fx_utility_logical_sector_read(ptr noundef %306, i64 noundef %307, ptr noundef %310, i64 noundef 1, i8 noundef zeroext 2)
  store i32 %311, ptr %14, align 4, !tbaa !19
  %312 = load i32, ptr %14, align 4, !tbaa !19
  %313 = icmp ne i32 %312, 0
  br i1 %313, label %314, label %316

314:                                              ; preds = %292
  %315 = load i32, ptr %14, align 4, !tbaa !19
  store i32 %315, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

316:                                              ; preds = %292
  %317 = load i64, ptr %9, align 8, !tbaa !9
  %318 = load i64, ptr %8, align 8, !tbaa !9
  %319 = load ptr, ptr %5, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %319, i32 0, i32 15
  %321 = load i32, ptr %320, align 8, !tbaa !28
  %322 = zext i32 %321 to i64
  %323 = sub i64 %318, %322
  %324 = load ptr, ptr %5, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %324, i32 0, i32 10
  %326 = load i32, ptr %325, align 8, !tbaa !27
  %327 = zext i32 %326 to i64
  %328 = mul i64 %323, %327
  %329 = sub i64 %317, %328
  store i64 %329, ptr %9, align 8, !tbaa !9
  %330 = load ptr, ptr %5, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %330, i32 0, i32 2
  %332 = load ptr, ptr %331, align 8, !tbaa !29
  %333 = load i64, ptr %9, align 8, !tbaa !9
  %334 = trunc i64 %333 to i32
  %335 = zext i32 %334 to i64
  %336 = getelementptr inbounds i8, ptr %332, i64 %335
  store ptr %336, ptr %11, align 8, !tbaa !5
  %337 = load ptr, ptr %11, align 8, !tbaa !5
  %338 = call i32 @_fx_utility_16_unsigned_read(ptr noundef %337)
  store i32 %338, ptr %12, align 4, !tbaa !19
  %339 = load i32, ptr %12, align 4, !tbaa !19
  %340 = zext i32 %339 to i64
  %341 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %340, ptr %341, align 8, !tbaa !9
  br label %384

342:                                              ; preds = %287
  %343 = load i64, ptr %6, align 8, !tbaa !9
  %344 = mul i64 %343, 4
  store i64 %344, ptr %9, align 8, !tbaa !9
  %345 = load i64, ptr %9, align 8, !tbaa !9
  %346 = load ptr, ptr %5, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %346, i32 0, i32 10
  %348 = load i32, ptr %347, align 8, !tbaa !27
  %349 = zext i32 %348 to i64
  %350 = udiv i64 %345, %349
  %351 = load ptr, ptr %5, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %351, i32 0, i32 15
  %353 = load i32, ptr %352, align 8, !tbaa !28
  %354 = zext i32 %353 to i64
  %355 = add i64 %350, %354
  store i64 %355, ptr %8, align 8, !tbaa !9
  %356 = load i64, ptr %9, align 8, !tbaa !9
  %357 = load ptr, ptr %5, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %357, i32 0, i32 10
  %359 = load i32, ptr %358, align 8, !tbaa !27
  %360 = zext i32 %359 to i64
  %361 = urem i64 %356, %360
  store i64 %361, ptr %9, align 8, !tbaa !9
  %362 = load ptr, ptr %5, align 8, !tbaa !5
  %363 = load i64, ptr %8, align 8, !tbaa !9
  %364 = load ptr, ptr %5, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %364, i32 0, i32 2
  %366 = load ptr, ptr %365, align 8, !tbaa !29
  %367 = call i32 @_fx_utility_logical_sector_read(ptr noundef %362, i64 noundef %363, ptr noundef %366, i64 noundef 1, i8 noundef zeroext 2)
  store i32 %367, ptr %14, align 4, !tbaa !19
  %368 = load i32, ptr %14, align 4, !tbaa !19
  %369 = icmp ne i32 %368, 0
  br i1 %369, label %370, label %372

370:                                              ; preds = %342
  %371 = load i32, ptr %14, align 4, !tbaa !19
  store i32 %371, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

372:                                              ; preds = %342
  %373 = load ptr, ptr %5, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct.FX_MEDIA_STRUCT, ptr %373, i32 0, i32 2
  %375 = load ptr, ptr %374, align 8, !tbaa !29
  %376 = load i64, ptr %9, align 8, !tbaa !9
  %377 = getelementptr inbounds i8, ptr %375, i64 %376
  store ptr %377, ptr %11, align 8, !tbaa !5
  %378 = load ptr, ptr %11, align 8, !tbaa !5
  %379 = call i64 @_fx_utility_32_unsigned_read(ptr noundef %378)
  store i64 %379, ptr %10, align 8, !tbaa !9
  %380 = load i64, ptr %10, align 8, !tbaa !9
  %381 = and i64 %380, 268435455
  store i64 %381, ptr %10, align 8, !tbaa !9
  %382 = load i64, ptr %10, align 8, !tbaa !9
  %383 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %382, ptr %383, align 8, !tbaa !9
  br label %384

384:                                              ; preds = %372, %316
  br label %385

385:                                              ; preds = %384, %283
  %386 = load ptr, ptr %15, align 8, !tbaa !5
  %387 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %386, i64 3
  %388 = load ptr, ptr %15, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %388, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %387, ptr align 8 %389, i64 24, i1 false), !tbaa.struct !23
  %390 = load ptr, ptr %15, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %390, i64 2
  %392 = load ptr, ptr %15, align 8, !tbaa !5
  %393 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %392, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %391, ptr align 8 %393, i64 24, i1 false), !tbaa.struct !23
  %394 = load ptr, ptr %15, align 8, !tbaa !5
  %395 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %394, i64 1
  %396 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %395, ptr align 8 %396, i64 24, i1 false), !tbaa.struct !23
  %397 = load i64, ptr %6, align 8, !tbaa !9
  %398 = load ptr, ptr %15, align 8, !tbaa !5
  %399 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %398, i32 0, i32 0
  store i64 %397, ptr %399, align 8, !tbaa !20
  %400 = load ptr, ptr %7, align 8, !tbaa !5
  %401 = load i64, ptr %400, align 8, !tbaa !9
  %402 = load ptr, ptr %15, align 8, !tbaa !5
  %403 = getelementptr inbounds %struct.FX_FAT_CACHE_ENTRY_STRUCT, ptr %402, i32 0, i32 1
  store i64 %401, ptr %403, align 8, !tbaa !22
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %404

404:                                              ; preds = %385, %370, %314, %263, %225, %173, %132, %94, %71, %52, %40
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %405 = load i32, ptr %4, align 4
  ret i32 %405
}

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

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

declare i32 @_fx_utility_FAT_flush(ptr noundef) #3

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

declare i32 @_fx_utility_16_unsigned_read(ptr noundef) #3

declare i64 @_fx_utility_32_unsigned_read(ptr noundef) #3

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.FX_FAT_CACHE_ENTRY_STRUCT = type { i64, i64, i64 }

; Function Attrs: nounwind uwtable
define dso_local i32 @_fx_utility_FAT_entry_read(ptr noundef %0, i64 noundef %1, ptr nocapture noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.FX_FAT_CACHE_ENTRY_STRUCT, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 664
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = add i64 %6, 1
  store i64 %7, ptr %5, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 680
  %9 = load i64, ptr %8, align 8, !tbaa !16
  %10 = add i64 %9, 1
  store i64 %10, ptr %8, align 8, !tbaa !16
  %.tr = trunc i64 %1 to i32
  %11 = shl i32 %.tr, 2
  %12 = and i32 %11, 12
  %13 = getelementptr inbounds i8, ptr %0, i64 2368
  %14 = zext nneg i32 %12 to i64
  %15 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %13, i64 0, i64 %14
  %16 = load i64, ptr %15, align 8, !tbaa !17
  %17 = icmp eq i64 %16, %1
  br i1 %17, label %18, label %21

18:                                               ; preds = %3
  %19 = getelementptr inbounds i8, ptr %15, i64 8
  %20 = load i64, ptr %19, align 8, !tbaa !19
  store i64 %20, ptr %2, align 8, !tbaa !20
  br label %153

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

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %15, i64 32
  %27 = load i64, ptr %26, align 8, !tbaa !19
  store i64 %27, ptr %2, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %15, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %22, i64 24, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !21
  br label %153

28:                                               ; preds = %21
  %29 = getelementptr inbounds i8, ptr %15, i64 48
  %30 = load i64, ptr %29, align 8, !tbaa !17
  %31 = icmp eq i64 %30, %1
  br i1 %31, label %32, label %35

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %15, i64 56
  %34 = load i64, ptr %33, align 8, !tbaa !19
  store i64 %34, ptr %2, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %15, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %29, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 8 dereferenceable(24) %22, i64 24, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !21
  br label %153

35:                                               ; preds = %28
  %36 = getelementptr inbounds i8, ptr %15, i64 72
  %37 = load i64, ptr %36, align 8, !tbaa !17
  %38 = icmp eq i64 %37, %1
  br i1 %38, label %39, label %42

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %15, i64 80
  %41 = load i64, ptr %40, align 8, !tbaa !19
  store i64 %41, ptr %2, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %15, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %36, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %29, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 8 dereferenceable(24) %22, i64 24, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !21
  br label %153

42:                                               ; preds = %35
  %43 = or disjoint i32 %12, 3
  %44 = zext nneg i32 %43 to i64
  %45 = getelementptr inbounds [16 x %struct.FX_FAT_CACHE_ENTRY_STRUCT], ptr %13, i64 0, i64 %44, i32 2
  %46 = load i64, ptr %45, align 8, !tbaa !22
  %.not = icmp eq i64 %46, 0
  br i1 %.not, label %50, label %47

47:                                               ; preds = %42
  %48 = tail call i32 @_fx_utility_FAT_flush(ptr noundef nonnull %0) #4
  %.not150 = icmp eq i32 %48, 0
  br i1 %.not150, label %._crit_edge, label %153

._crit_edge:                                      ; preds = %47
  %.pre = load i64, ptr %8, align 8, !tbaa !16
  %49 = add i64 %.pre, -1
  br label %50

50:                                               ; preds = %._crit_edge, %42
  %51 = phi i64 [ %49, %._crit_edge ], [ %9, %42 ]
  store i64 %51, ptr %8, align 8, !tbaa !16
  %52 = getelementptr inbounds i8, ptr %0, i64 688
  %53 = load i64, ptr %52, align 8, !tbaa !23
  %54 = add i64 %53, 1
  store i64 %54, ptr %52, align 8, !tbaa !23
  %55 = getelementptr inbounds i8, ptr %0, i64 140
  %56 = load i32, ptr %55, align 4, !tbaa !24
  %.not151 = icmp eq i32 %56, 0
  %57 = getelementptr inbounds i8, ptr %0, i64 112
  %58 = load i32, ptr %57, align 8, !tbaa !25
  %59 = zext i32 %58 to i64
  br i1 %.not151, label %115, label %60

60:                                               ; preds = %50
  %61 = mul i64 %1, 3
  %62 = lshr i64 %61, 1
  %63 = getelementptr inbounds i8, ptr %0, i64 80
  %64 = load i32, ptr %63, align 8, !tbaa !26
  %65 = zext i32 %64 to i64
  %66 = udiv i64 %62, %65
  %67 = add nuw i64 %66, %59
  %68 = getelementptr inbounds i8, ptr %0, i64 16
  %69 = load ptr, ptr %68, align 8, !tbaa !27
  %70 = tail call i32 @_fx_utility_logical_sector_read(ptr noundef nonnull %0, i64 noundef %67, ptr noundef %69, i64 noundef 1, i8 noundef zeroext 2) #4
  %.not156 = icmp eq i32 %70, 0
  br i1 %.not156, label %71, label %153

71:                                               ; preds = %60
  %72 = load i32, ptr %57, align 8, !tbaa !25
  %73 = zext i32 %72 to i64
  %.neg157 = sub i64 %73, %67
  %74 = load i32, ptr %63, align 8, !tbaa !26
  %75 = zext i32 %74 to i64
  %.neg158 = mul i64 %.neg157, %75
  %76 = add i64 %.neg158, %62
  %77 = load ptr, ptr %68, align 8, !tbaa !27
  %78 = and i64 %76, 4294967295
  %79 = getelementptr inbounds i8, ptr %77, i64 %78
  %80 = and i64 %1, 1
  %.not159 = icmp eq i64 %80, 0
  %81 = load i8, ptr %79, align 1, !tbaa !28
  br i1 %.not159, label %95, label %82

82:                                               ; preds = %71
  %83 = lshr i8 %81, 4
  %84 = getelementptr inbounds i8, ptr %79, i64 1
  %85 = add i32 %74, -1
  %86 = zext i32 %85 to i64
  %87 = icmp eq i64 %76, %86
  br i1 %87, label %88, label %93

88:                                               ; preds = %82
  %89 = add nuw i64 %67, 1
  %90 = tail call i32 @_fx_utility_logical_sector_read(ptr noundef nonnull %0, i64 noundef %89, ptr noundef nonnull %77, i64 noundef 1, i8 noundef zeroext 2) #4
  %.not161 = icmp eq i32 %90, 0
  br i1 %.not161, label %91, label %153

91:                                               ; preds = %88
  %92 = load ptr, ptr %68, align 8, !tbaa !27
  br label %93

93:                                               ; preds = %91, %82
  %.0141 = phi ptr [ %92, %91 ], [ %84, %82 ]
  %94 = load i8, ptr %.0141, align 1, !tbaa !28
  br label %108

95:                                               ; preds = %71
  %96 = getelementptr inbounds i8, ptr %79, i64 1
  %97 = add i32 %74, -1
  %98 = zext i32 %97 to i64
  %99 = icmp eq i64 %76, %98
  br i1 %99, label %100, label %105

100:                                              ; preds = %95
  %101 = add nuw i64 %67, 1
  %102 = tail call i32 @_fx_utility_logical_sector_read(ptr noundef nonnull %0, i64 noundef %101, ptr noundef nonnull %77, i64 noundef 1, i8 noundef zeroext 2) #4
  %.not160 = icmp eq i32 %102, 0
  br i1 %.not160, label %103, label %153

103:                                              ; preds = %100
  %104 = load ptr, ptr %68, align 8, !tbaa !27
  br label %105

105:                                              ; preds = %103, %95
  %.1142 = phi ptr [ %104, %103 ], [ %96, %95 ]
  %106 = load i8, ptr %.1142, align 1, !tbaa !28
  %107 = and i8 %106, 15
  br label %108

108:                                              ; preds = %105, %93
  %.sink = phi i8 [ %107, %105 ], [ %94, %93 ]
  %.sink164 = phi i32 [ 8, %105 ], [ 4, %93 ]
  %.sink162.in = phi i8 [ %81, %105 ], [ %83, %93 ]
  %.sink162 = zext i8 %.sink162.in to i32
  %109 = zext i8 %.sink to i32
  %110 = shl nuw nsw i32 %109, %.sink164
  %111 = or disjoint i32 %110, %.sink162
  %112 = icmp ugt i32 %111, 4079
  %113 = or i32 %111, 61440
  %spec.select = select i1 %112, i32 %113, i32 %111
  %114 = zext nneg i32 %spec.select to i64
  br label %150

115:                                              ; preds = %50
  %116 = getelementptr inbounds i8, ptr %0, i64 144
  %117 = load i32, ptr %116, align 8, !tbaa !29
  %.not152 = icmp eq i32 %117, 0
  %118 = getelementptr inbounds i8, ptr %0, i64 80
  %119 = load i32, ptr %118, align 8, !tbaa !26
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds i8, ptr %0, i64 16
  %122 = load ptr, ptr %121, align 8, !tbaa !27
  br i1 %.not152, label %123, label %139

123:                                              ; preds = %115
  %124 = shl i64 %1, 1
  %125 = udiv i64 %124, %120
  %126 = add i64 %125, %59
  %127 = tail call i32 @_fx_utility_logical_sector_read(ptr noundef nonnull %0, i64 noundef %126, ptr noundef %122, i64 noundef 1, i8 noundef zeroext 2) #4
  %.not153 = icmp eq i32 %127, 0
  br i1 %.not153, label %128, label %153

128:                                              ; preds = %123
  %129 = load i32, ptr %57, align 8, !tbaa !25
  %130 = zext i32 %129 to i64
  %.neg = sub i64 %130, %126
  %131 = load i32, ptr %118, align 8, !tbaa !26
  %132 = zext i32 %131 to i64
  %.neg154 = mul i64 %.neg, %132
  %133 = add i64 %.neg154, %124
  %134 = load ptr, ptr %121, align 8, !tbaa !27
  %135 = and i64 %133, 4294967295
  %136 = getelementptr inbounds i8, ptr %134, i64 %135
  %137 = tail call i32 @_fx_utility_16_unsigned_read(ptr noundef %136) #4
  %138 = zext i32 %137 to i64
  br label %150

139:                                              ; preds = %115
  %140 = shl i64 %1, 2
  %141 = udiv i64 %140, %120
  %142 = urem i64 %140, %120
  %143 = add i64 %141, %59
  %144 = tail call i32 @_fx_utility_logical_sector_read(ptr noundef nonnull %0, i64 noundef %143, ptr noundef %122, i64 noundef 1, i8 noundef zeroext 2) #4
  %.not155 = icmp eq i32 %144, 0
  br i1 %.not155, label %145, label %153

145:                                              ; preds = %139
  %146 = load ptr, ptr %121, align 8, !tbaa !27
  %147 = getelementptr inbounds i8, ptr %146, i64 %142
  %148 = tail call i64 @_fx_utility_32_unsigned_read(ptr noundef %147) #4
  %149 = and i64 %148, 268435455
  br label %150

150:                                              ; preds = %128, %145, %108
  %.sink165 = phi i64 [ %138, %128 ], [ %149, %145 ], [ %114, %108 ]
  store i64 %.sink165, ptr %2, align 8, !tbaa !20
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(24) %29, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %29, ptr noundef nonnull align 8 dereferenceable(24) %22, i64 24, i1 false), !tbaa.struct !21
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(24) %15, i64 24, i1 false), !tbaa.struct !21
  store i64 %1, ptr %15, align 8, !tbaa !17
  %151 = load i64, ptr %2, align 8, !tbaa !20
  %152 = getelementptr inbounds i8, ptr %15, i64 8
  store i64 %151, ptr %152, align 8, !tbaa !19
  br label %153

153:                                              ; preds = %139, %123, %100, %88, %60, %47, %150, %39, %32, %25, %18
  %.0 = phi i32 [ 0, %18 ], [ 0, %25 ], [ 0, %32 ], [ 0, %39 ], [ 0, %150 ], [ %48, %47 ], [ %70, %60 ], [ %90, %88 ], [ %102, %100 ], [ %127, %123 ], [ %144, %139 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4)
  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

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

declare i32 @_fx_utility_FAT_flush(ptr noundef) local_unnamed_addr #3

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

declare i32 @_fx_utility_16_unsigned_read(ptr noundef) local_unnamed_addr #3

declare i64 @_fx_utility_32_unsigned_read(ptr noundef) local_unnamed_addr #3

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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, !7, i64 664}
!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 680}
!17 = !{!18, !7, i64 0}
!18 = !{!"FX_FAT_CACHE_ENTRY_STRUCT", !7, i64 0, !7, i64 8, !7, i64 16}
!19 = !{!18, !7, i64 8}
!20 = !{!7, !7, i64 0}
!21 = !{i64 0, i64 8, !20, i64 8, i64 8, !20, i64 16, i64 8, !20}
!22 = !{!18, !7, i64 16}
!23 = !{!6, !7, i64 688}
!24 = !{!6, !11, i64 140}
!25 = !{!6, !11, i64 112}
!26 = !{!6, !11, i64 80}
!27 = !{!6, !10, i64 16}
!28 = !{!8, !8, i64 0}
!29 = !{!6, !11, i64 144}


; Effective O3 passes: CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass