; LLVM IR from ctlst-tech/catpilot :: bsp/mcu/core/stm32/h753/hal/src (stm32h7xx_hal_sd)

; 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.SDMMC_DataInitTypeDef = type { i32, i32, i32, i32, i32, i32 }
%struct.SD_HandleTypeDef = type { ptr, %struct.SDMMC_InitTypeDef, i32, ptr, i32, ptr, i32, i32, i32, i32, %struct.HAL_SD_CardInfoTypeDef, [4 x i32], [4 x i32] }
%struct.SDMMC_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.HAL_SD_CardInfoTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SDMMC_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], i32, i32, i32, i32, [8 x i32], i32, [222 x i32], i32 }

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

declare i32 @HAL_GetTick() #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_SD_ReadBlocks(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.SDMMC_DataInitTypeDef, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %21 = call i32 @HAL_GetTick()
  store i32 %21, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %22 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %22, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %23, ptr %19, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = icmp eq ptr null, %24
  br i1 %25, label %26, label %31

26:                                               ; preds = %5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %27, i32 0, i32 9
  %29 = load volatile i32, ptr %28, align 4, !tbaa !11
  %30 = or i32 %29, 134217728
  store volatile i32 %30, ptr %28, align 4, !tbaa !11
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

31:                                               ; preds = %5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %32, i32 0, i32 8
  %34 = load volatile i32, ptr %33, align 8, !tbaa !15
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %36, label %338

36:                                               ; preds = %31
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %37, i32 0, i32 9
  store volatile i32 0, ptr %38, align 4, !tbaa !11
  %39 = load i32, ptr %18, align 4, !tbaa !9
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = add i32 %39, %40
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %42, i32 0, i32 10
  %44 = getelementptr inbounds %struct.HAL_SD_CardInfoTypeDef, ptr %43, i32 0, i32 6
  %45 = load i32, ptr %44, align 8, !tbaa !16
  %46 = icmp ugt i32 %41, %45
  br i1 %46, label %47, label %52

47:                                               ; preds = %36
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %48, i32 0, i32 9
  %50 = load volatile i32, ptr %49, align 4, !tbaa !11
  %51 = or i32 %50, 33554432
  store volatile i32 %51, ptr %49, align 4, !tbaa !11
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

52:                                               ; preds = %36
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %53, i32 0, i32 8
  store volatile i32 3, ptr %54, align 8, !tbaa !15
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %58 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %57, i32 0, i32 11
  store volatile i32 0, ptr %58, align 4, !tbaa !18
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %59, i32 0, i32 10
  %61 = getelementptr inbounds %struct.HAL_SD_CardInfoTypeDef, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !20
  %63 = icmp ne i32 %62, 1
  br i1 %63, label %64, label %67

64:                                               ; preds = %52
  %65 = load i32, ptr %18, align 4, !tbaa !9
  %66 = mul i32 %65, 512
  store i32 %66, ptr %18, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %64, %52
  %68 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 0
  store i32 -1, ptr %68, align 4, !tbaa !21
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = mul i32 %69, 512
  %71 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 1
  store i32 %70, ptr %71, align 4, !tbaa !23
  %72 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 2
  store i32 144, ptr %72, align 4, !tbaa !24
  %73 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 3
  store i32 2, ptr %73, align 4, !tbaa !25
  %74 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 4
  store i32 0, ptr %74, align 4, !tbaa !26
  %75 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 5
  store i32 0, ptr %75, align 4, !tbaa !27
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  %79 = call i32 @SDMMC_ConfigData(ptr noundef %78, ptr noundef %12)
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  %83 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %82, i32 0, i32 3
  %84 = load volatile i32, ptr %83, align 4, !tbaa !28
  %85 = zext i32 %84 to i64
  %86 = or i64 %85, 64
  %87 = trunc i64 %86 to i32
  store volatile i32 %87, ptr %83, align 4, !tbaa !28
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = icmp ugt i32 %88, 1
  br i1 %89, label %90, label %98

90:                                               ; preds = %67
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %91, i32 0, i32 7
  store volatile i32 2, ptr %92, align 4, !tbaa !29
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !17
  %96 = load i32, ptr %18, align 4, !tbaa !9
  %97 = call i32 @SDMMC_CmdReadMultiBlock(ptr noundef %95, i32 noundef %96)
  store i32 %97, ptr %13, align 4, !tbaa !9
  br label %106

98:                                               ; preds = %67
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %99, i32 0, i32 7
  store volatile i32 1, ptr %100, align 4, !tbaa !29
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !17
  %104 = load i32, ptr %18, align 4, !tbaa !9
  %105 = call i32 @SDMMC_CmdReadSingleBlock(ptr noundef %103, i32 noundef %104)
  store i32 %105, ptr %13, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %98, %90
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %123

109:                                              ; preds = %106
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !17
  %113 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %112, i32 0, i32 14
  store volatile i32 534777855, ptr %113, align 4, !tbaa !30
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %115, i32 0, i32 9
  %117 = load volatile i32, ptr %116, align 4, !tbaa !11
  %118 = or i32 %117, %114
  store volatile i32 %118, ptr %116, align 4, !tbaa !11
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %119, i32 0, i32 8
  store volatile i32 1, ptr %120, align 8, !tbaa !15
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %121, i32 0, i32 7
  store volatile i32 0, ptr %122, align 4, !tbaa !29
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

123:                                              ; preds = %106
  %124 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !23
  store i32 %125, ptr %17, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %212, %123
  %127 = load ptr, ptr %7, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %127, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !17
  %130 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %129, i32 0, i32 13
  %131 = load volatile i32, ptr %130, align 4, !tbaa !31
  %132 = zext i32 %131 to i64
  %133 = and i64 %132, 298
  %134 = icmp ne i64 %133, 0
  %135 = xor i1 %134, true
  br i1 %135, label %136, label %213

136:                                              ; preds = %126
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !17
  %140 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %139, i32 0, i32 13
  %141 = load volatile i32, ptr %140, align 4, !tbaa !31
  %142 = zext i32 %141 to i64
  %143 = and i64 %142, 32768
  %144 = icmp ne i64 %143, 0
  br i1 %144, label %145, label %190

145:                                              ; preds = %136
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = icmp uge i32 %146, 32
  br i1 %147, label %148, label %190

148:                                              ; preds = %145
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %149

149:                                              ; preds = %184, %148
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = icmp ult i32 %150, 8
  br i1 %151, label %152, label %187

152:                                              ; preds = %149
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !17
  %156 = call i32 @SDMMC_ReadFIFO(ptr noundef %155)
  store i32 %156, ptr %16, align 4, !tbaa !9
  %157 = load i32, ptr %16, align 4, !tbaa !9
  %158 = and i32 %157, 255
  %159 = trunc i32 %158 to i8
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %159, ptr %160, align 1, !tbaa !32
  %161 = load ptr, ptr %19, align 8, !tbaa !5
  %162 = getelementptr inbounds i8, ptr %161, i32 1
  store ptr %162, ptr %19, align 8, !tbaa !5
  %163 = load i32, ptr %16, align 4, !tbaa !9
  %164 = lshr i32 %163, 8
  %165 = and i32 %164, 255
  %166 = trunc i32 %165 to i8
  %167 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %166, ptr %167, align 1, !tbaa !32
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = getelementptr inbounds i8, ptr %168, i32 1
  store ptr %169, ptr %19, align 8, !tbaa !5
  %170 = load i32, ptr %16, align 4, !tbaa !9
  %171 = lshr i32 %170, 16
  %172 = and i32 %171, 255
  %173 = trunc i32 %172 to i8
  %174 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %173, ptr %174, align 1, !tbaa !32
  %175 = load ptr, ptr %19, align 8, !tbaa !5
  %176 = getelementptr inbounds i8, ptr %175, i32 1
  store ptr %176, ptr %19, align 8, !tbaa !5
  %177 = load i32, ptr %16, align 4, !tbaa !9
  %178 = lshr i32 %177, 24
  %179 = and i32 %178, 255
  %180 = trunc i32 %179 to i8
  %181 = load ptr, ptr %19, align 8, !tbaa !5
  store i8 %180, ptr %181, align 1, !tbaa !32
  %182 = load ptr, ptr %19, align 8, !tbaa !5
  %183 = getelementptr inbounds i8, ptr %182, i32 1
  store ptr %183, ptr %19, align 8, !tbaa !5
  br label %184

184:                                              ; preds = %152
  %185 = load i32, ptr %15, align 4, !tbaa !9
  %186 = add i32 %185, 1
  store i32 %186, ptr %15, align 4, !tbaa !9
  br label %149, !llvm.loop !33

187:                                              ; preds = %149
  %188 = load i32, ptr %17, align 4, !tbaa !9
  %189 = sub i32 %188, 32
  store i32 %189, ptr %17, align 4, !tbaa !9
  br label %190

190:                                              ; preds = %187, %145, %136
  %191 = call i32 @HAL_GetTick()
  %192 = load i32, ptr %14, align 4, !tbaa !9
  %193 = sub i32 %191, %192
  %194 = load i32, ptr %11, align 4, !tbaa !9
  %195 = icmp uge i32 %193, %194
  br i1 %195, label %199, label %196

196:                                              ; preds = %190
  %197 = load i32, ptr %11, align 4, !tbaa !9
  %198 = icmp eq i32 %197, 0
  br i1 %198, label %199, label %212

199:                                              ; preds = %196, %190
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %200, i32 0, i32 0
  %202 = load ptr, ptr %201, align 8, !tbaa !17
  %203 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %202, i32 0, i32 14
  store volatile i32 534777855, ptr %203, align 4, !tbaa !30
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %204, i32 0, i32 9
  %206 = load volatile i32, ptr %205, align 4, !tbaa !11
  %207 = or i32 %206, -2147483648
  store volatile i32 %207, ptr %205, align 4, !tbaa !11
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %208, i32 0, i32 8
  store volatile i32 1, ptr %209, align 8, !tbaa !15
  %210 = load ptr, ptr %7, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %210, i32 0, i32 7
  store volatile i32 0, ptr %211, align 4, !tbaa !29
  store i32 3, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

212:                                              ; preds = %196
  br label %126, !llvm.loop !35

213:                                              ; preds = %126
  %214 = load ptr, ptr %7, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !17
  %217 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %216, i32 0, i32 3
  %218 = load volatile i32, ptr %217, align 4, !tbaa !28
  %219 = zext i32 %218 to i64
  %220 = and i64 %219, -65
  %221 = trunc i64 %220 to i32
  store volatile i32 %221, ptr %217, align 4, !tbaa !28
  %222 = load ptr, ptr %7, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !17
  %225 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %224, i32 0, i32 13
  %226 = load volatile i32, ptr %225, align 4, !tbaa !31
  %227 = zext i32 %226 to i64
  %228 = and i64 %227, 256
  %229 = icmp ne i64 %228, 0
  br i1 %229, label %230, label %262

230:                                              ; preds = %213
  %231 = load i32, ptr %10, align 4, !tbaa !9
  %232 = icmp ugt i32 %231, 1
  br i1 %232, label %233, label %262

233:                                              ; preds = %230
  %234 = load ptr, ptr %7, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %234, i32 0, i32 10
  %236 = getelementptr inbounds %struct.HAL_SD_CardInfoTypeDef, ptr %235, i32 0, i32 0
  %237 = load i32, ptr %236, align 8, !tbaa !20
  %238 = icmp ne i32 %237, 3
  br i1 %238, label %239, label %261

239:                                              ; preds = %233
  %240 = load ptr, ptr %7, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %240, i32 0, i32 0
  %242 = load ptr, ptr %241, align 8, !tbaa !17
  %243 = call i32 @SDMMC_CmdStopTransfer(ptr noundef %242)
  store i32 %243, ptr %13, align 4, !tbaa !9
  %244 = load i32, ptr %13, align 4, !tbaa !9
  %245 = icmp ne i32 %244, 0
  br i1 %245, label %246, label %260

246:                                              ; preds = %239
  %247 = load ptr, ptr %7, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %247, i32 0, i32 0
  %249 = load ptr, ptr %248, align 8, !tbaa !17
  %250 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %249, i32 0, i32 14
  store volatile i32 534777855, ptr %250, align 4, !tbaa !30
  %251 = load i32, ptr %13, align 4, !tbaa !9
  %252 = load ptr, ptr %7, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %252, i32 0, i32 9
  %254 = load volatile i32, ptr %253, align 4, !tbaa !11
  %255 = or i32 %254, %251
  store volatile i32 %255, ptr %253, align 4, !tbaa !11
  %256 = load ptr, ptr %7, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %256, i32 0, i32 8
  store volatile i32 1, ptr %257, align 8, !tbaa !15
  %258 = load ptr, ptr %7, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %258, i32 0, i32 7
  store volatile i32 0, ptr %259, align 4, !tbaa !29
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

260:                                              ; preds = %239
  br label %261

261:                                              ; preds = %260, %233
  br label %262

262:                                              ; preds = %261, %230, %213
  %263 = load ptr, ptr %7, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %263, i32 0, i32 0
  %265 = load ptr, ptr %264, align 8, !tbaa !17
  %266 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %265, i32 0, i32 13
  %267 = load volatile i32, ptr %266, align 4, !tbaa !31
  %268 = zext i32 %267 to i64
  %269 = and i64 %268, 8
  %270 = icmp ne i64 %269, 0
  br i1 %270, label %271, label %284

271:                                              ; preds = %262
  %272 = load ptr, ptr %7, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %272, i32 0, i32 0
  %274 = load ptr, ptr %273, align 8, !tbaa !17
  %275 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %274, i32 0, i32 14
  store volatile i32 534777855, ptr %275, align 4, !tbaa !30
  %276 = load ptr, ptr %7, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %276, i32 0, i32 9
  %278 = load volatile i32, ptr %277, align 4, !tbaa !11
  %279 = or i32 %278, 8
  store volatile i32 %279, ptr %277, align 4, !tbaa !11
  %280 = load ptr, ptr %7, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %280, i32 0, i32 8
  store volatile i32 1, ptr %281, align 8, !tbaa !15
  %282 = load ptr, ptr %7, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %282, i32 0, i32 7
  store volatile i32 0, ptr %283, align 4, !tbaa !29
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

284:                                              ; preds = %262
  %285 = load ptr, ptr %7, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %285, i32 0, i32 0
  %287 = load ptr, ptr %286, align 8, !tbaa !17
  %288 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %287, i32 0, i32 13
  %289 = load volatile i32, ptr %288, align 4, !tbaa !31
  %290 = zext i32 %289 to i64
  %291 = and i64 %290, 2
  %292 = icmp ne i64 %291, 0
  br i1 %292, label %293, label %306

293:                                              ; preds = %284
  %294 = load ptr, ptr %7, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %294, i32 0, i32 0
  %296 = load ptr, ptr %295, align 8, !tbaa !17
  %297 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %296, i32 0, i32 14
  store volatile i32 534777855, ptr %297, align 4, !tbaa !30
  %298 = load ptr, ptr %7, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %298, i32 0, i32 9
  %300 = load volatile i32, ptr %299, align 4, !tbaa !11
  %301 = or i32 %300, 2
  store volatile i32 %301, ptr %299, align 4, !tbaa !11
  %302 = load ptr, ptr %7, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %302, i32 0, i32 8
  store volatile i32 1, ptr %303, align 8, !tbaa !15
  %304 = load ptr, ptr %7, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %304, i32 0, i32 7
  store volatile i32 0, ptr %305, align 4, !tbaa !29
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

306:                                              ; preds = %284
  %307 = load ptr, ptr %7, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %307, i32 0, i32 0
  %309 = load ptr, ptr %308, align 8, !tbaa !17
  %310 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %309, i32 0, i32 13
  %311 = load volatile i32, ptr %310, align 4, !tbaa !31
  %312 = zext i32 %311 to i64
  %313 = and i64 %312, 32
  %314 = icmp ne i64 %313, 0
  br i1 %314, label %315, label %328

315:                                              ; preds = %306
  %316 = load ptr, ptr %7, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %316, i32 0, i32 0
  %318 = load ptr, ptr %317, align 8, !tbaa !17
  %319 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %318, i32 0, i32 14
  store volatile i32 534777855, ptr %319, align 4, !tbaa !30
  %320 = load ptr, ptr %7, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %320, i32 0, i32 9
  %322 = load volatile i32, ptr %321, align 4, !tbaa !11
  %323 = or i32 %322, 32
  store volatile i32 %323, ptr %321, align 4, !tbaa !11
  %324 = load ptr, ptr %7, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %324, i32 0, i32 8
  store volatile i32 1, ptr %325, align 8, !tbaa !15
  %326 = load ptr, ptr %7, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %326, i32 0, i32 7
  store volatile i32 0, ptr %327, align 4, !tbaa !29
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

328:                                              ; preds = %306
  br label %329

329:                                              ; preds = %328
  br label %330

330:                                              ; preds = %329
  br label %331

331:                                              ; preds = %330
  %332 = load ptr, ptr %7, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %332, i32 0, i32 0
  %334 = load ptr, ptr %333, align 8, !tbaa !17
  %335 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %334, i32 0, i32 14
  store volatile i32 402657082, ptr %335, align 4, !tbaa !30
  %336 = load ptr, ptr %7, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %336, i32 0, i32 8
  store volatile i32 1, ptr %337, align 8, !tbaa !15
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

338:                                              ; preds = %31
  %339 = load ptr, ptr %7, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %339, i32 0, i32 9
  %341 = load volatile i32, ptr %340, align 4, !tbaa !11
  %342 = or i32 %341, 536870912
  store volatile i32 %342, ptr %340, align 4, !tbaa !11
  store i32 1, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %343

343:                                              ; preds = %338, %331, %315, %293, %271, %246, %199, %109, %47, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #3
  %344 = load i32, ptr %6, align 4
  ret i32 %344
}

declare i32 @SDMMC_ConfigData(ptr noundef, ptr noundef) #1

declare i32 @SDMMC_CmdReadMultiBlock(ptr noundef, i32 noundef) #1

declare i32 @SDMMC_CmdReadSingleBlock(ptr noundef, i32 noundef) #1

declare i32 @SDMMC_ReadFIFO(ptr noundef) #1

declare i32 @SDMMC_CmdStopTransfer(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 68}
!12 = !{!"", !6, i64 0, !13, i64 8, !10, i64 28, !6, i64 32, !10, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !14, i64 72, !7, i64 108, !7, i64 124}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!15 = !{!12, !10, i64 64}
!16 = !{!12, !10, i64 96}
!17 = !{!12, !6, i64 0}
!18 = !{!19, !10, i64 44}
!19 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !7, i64 68, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !7, i64 96, !10, i64 128, !7, i64 132, !10, i64 1020}
!20 = !{!12, !10, i64 72}
!21 = !{!22, !10, i64 0}
!22 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!23 = !{!22, !10, i64 4}
!24 = !{!22, !10, i64 8}
!25 = !{!22, !10, i64 12}
!26 = !{!22, !10, i64 16}
!27 = !{!22, !10, i64 20}
!28 = !{!19, !10, i64 12}
!29 = !{!12, !10, i64 60}
!30 = !{!19, !10, i64 56}
!31 = !{!19, !10, i64 52}
!32 = !{!7, !7, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


; 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.SDMMC_DataInitTypeDef = type { i32, i32, i32, i32, i32, i32 }

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

declare i32 @HAL_GetTick() local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 4) i32 @HAL_SD_ReadBlocks(ptr noundef %0, ptr noundef writeonly %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %6 = alloca %struct.SDMMC_DataInitTypeDef, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  %7 = tail call i32 @HAL_GetTick() #3
  %8 = icmp eq ptr %1, null
  br i1 %8, label %9, label %13

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 68
  %11 = load volatile i32, ptr %10, align 4, !tbaa !5
  %12 = or i32 %11, 134217728
  store volatile i32 %12, ptr %10, align 4, !tbaa !5
  br label %224

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %0, i64 64
  %15 = load volatile i32, ptr %14, align 8, !tbaa !13
  %16 = icmp eq i32 %15, 1
  %17 = getelementptr inbounds i8, ptr %0, i64 68
  br i1 %16, label %18, label %221

18:                                               ; preds = %13
  store volatile i32 0, ptr %17, align 4, !tbaa !5
  %19 = add i32 %3, %2
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  %21 = getelementptr inbounds i8, ptr %0, i64 96
  %22 = load i32, ptr %21, align 8, !tbaa !14
  %23 = icmp ugt i32 %19, %22
  br i1 %23, label %24, label %27

24:                                               ; preds = %18
  %25 = load volatile i32, ptr %17, align 4, !tbaa !5
  %26 = or i32 %25, 33554432
  store volatile i32 %26, ptr %17, align 4, !tbaa !5
  br label %224

27:                                               ; preds = %18
  store volatile i32 3, ptr %14, align 8, !tbaa !13
  %28 = load ptr, ptr %0, align 8, !tbaa !15
  %29 = getelementptr inbounds i8, ptr %28, i64 44
  store volatile i32 0, ptr %29, align 4, !tbaa !16
  %30 = load i32, ptr %20, align 8, !tbaa !18
  %.not = icmp eq i32 %30, 1
  %31 = shl i32 %2, 9
  %spec.select = select i1 %.not, i32 %2, i32 %31
  store i32 -1, ptr %6, align 4, !tbaa !19
  %32 = shl i32 %3, 9
  %33 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %32, ptr %33, align 4, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %6, i64 8
  store <4 x i32> <i32 144, i32 2, i32 0, i32 0>, ptr %34, align 4, !tbaa !22
  %35 = call i32 @SDMMC_ConfigData(ptr noundef %28, ptr noundef nonnull %6) #3
  %36 = load ptr, ptr %0, align 8, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %36, i64 12
  %38 = load volatile i32, ptr %37, align 4, !tbaa !23
  %39 = or i32 %38, 64
  store volatile i32 %39, ptr %37, align 4, !tbaa !23
  %40 = icmp ugt i32 %3, 1
  %41 = getelementptr inbounds i8, ptr %0, i64 60
  br i1 %40, label %42, label %44

42:                                               ; preds = %27
  store volatile i32 2, ptr %41, align 4, !tbaa !24
  %43 = call i32 @SDMMC_CmdReadMultiBlock(ptr noundef nonnull %36, i32 noundef %spec.select) #3
  br label %46

44:                                               ; preds = %27
  store volatile i32 1, ptr %41, align 4, !tbaa !24
  %45 = call i32 @SDMMC_CmdReadSingleBlock(ptr noundef nonnull %36, i32 noundef %spec.select) #3
  br label %46

46:                                               ; preds = %44, %42
  %.095 = phi i32 [ %43, %42 ], [ %45, %44 ]
  %.not98 = icmp eq i32 %.095, 0
  br i1 %.not98, label %53, label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %0, align 8, !tbaa !15
  %49 = getelementptr inbounds i8, ptr %48, i64 56
  store volatile i32 534777855, ptr %49, align 4, !tbaa !25
  %50 = load volatile i32, ptr %17, align 4, !tbaa !5
  %51 = or i32 %50, %.095
  store volatile i32 %51, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  %52 = getelementptr inbounds i8, ptr %0, i64 60
  store volatile i32 0, ptr %52, align 4, !tbaa !24
  br label %224

53:                                               ; preds = %46
  %54 = load i32, ptr %33, align 4, !tbaa !21
  br label %55

55:                                               ; preds = %169, %53
  %.091 = phi i32 [ %54, %53 ], [ %.192, %169 ]
  %.0 = phi ptr [ %1, %53 ], [ %.2, %169 ]
  %56 = load ptr, ptr %0, align 8, !tbaa !15
  %57 = getelementptr inbounds i8, ptr %56, i64 52
  %58 = load volatile i32, ptr %57, align 4, !tbaa !26
  %59 = and i32 %58, 298
  %.not99 = icmp eq i32 %59, 0
  br i1 %.not99, label %60, label %178

60:                                               ; preds = %55
  %61 = load volatile i32, ptr %57, align 4, !tbaa !26
  %62 = and i32 %61, 32768
  %63 = icmp ne i32 %62, 0
  %64 = icmp ugt i32 %.091, 31
  %or.cond = select i1 %63, i1 %64, i1 false
  br i1 %or.cond, label %.preheader.preheader, label %169

.preheader.preheader:                             ; preds = %60
  %65 = call i32 @SDMMC_ReadFIFO(ptr noundef nonnull %56) #3
  %66 = trunc i32 %65 to i8
  store i8 %66, ptr %.0, align 1, !tbaa !27
  %67 = getelementptr inbounds i8, ptr %.0, i64 1
  %68 = lshr i32 %65, 8
  %69 = trunc i32 %68 to i8
  store i8 %69, ptr %67, align 1, !tbaa !27
  %70 = getelementptr inbounds i8, ptr %.0, i64 2
  %71 = lshr i32 %65, 16
  %72 = trunc i32 %71 to i8
  store i8 %72, ptr %70, align 1, !tbaa !27
  %73 = getelementptr inbounds i8, ptr %.0, i64 3
  %74 = lshr i32 %65, 24
  %75 = trunc nuw i32 %74 to i8
  store i8 %75, ptr %73, align 1, !tbaa !27
  %76 = getelementptr inbounds i8, ptr %.0, i64 4
  %77 = load ptr, ptr %0, align 8, !tbaa !15
  %78 = call i32 @SDMMC_ReadFIFO(ptr noundef %77) #3
  %79 = trunc i32 %78 to i8
  store i8 %79, ptr %76, align 1, !tbaa !27
  %80 = getelementptr inbounds i8, ptr %.0, i64 5
  %81 = lshr i32 %78, 8
  %82 = trunc i32 %81 to i8
  store i8 %82, ptr %80, align 1, !tbaa !27
  %83 = getelementptr inbounds i8, ptr %.0, i64 6
  %84 = lshr i32 %78, 16
  %85 = trunc i32 %84 to i8
  store i8 %85, ptr %83, align 1, !tbaa !27
  %86 = getelementptr inbounds i8, ptr %.0, i64 7
  %87 = lshr i32 %78, 24
  %88 = trunc nuw i32 %87 to i8
  store i8 %88, ptr %86, align 1, !tbaa !27
  %89 = getelementptr inbounds i8, ptr %.0, i64 8
  %90 = load ptr, ptr %0, align 8, !tbaa !15
  %91 = call i32 @SDMMC_ReadFIFO(ptr noundef %90) #3
  %92 = trunc i32 %91 to i8
  store i8 %92, ptr %89, align 1, !tbaa !27
  %93 = getelementptr inbounds i8, ptr %.0, i64 9
  %94 = lshr i32 %91, 8
  %95 = trunc i32 %94 to i8
  store i8 %95, ptr %93, align 1, !tbaa !27
  %96 = getelementptr inbounds i8, ptr %.0, i64 10
  %97 = lshr i32 %91, 16
  %98 = trunc i32 %97 to i8
  store i8 %98, ptr %96, align 1, !tbaa !27
  %99 = getelementptr inbounds i8, ptr %.0, i64 11
  %100 = lshr i32 %91, 24
  %101 = trunc nuw i32 %100 to i8
  store i8 %101, ptr %99, align 1, !tbaa !27
  %102 = getelementptr inbounds i8, ptr %.0, i64 12
  %103 = load ptr, ptr %0, align 8, !tbaa !15
  %104 = call i32 @SDMMC_ReadFIFO(ptr noundef %103) #3
  %105 = trunc i32 %104 to i8
  store i8 %105, ptr %102, align 1, !tbaa !27
  %106 = getelementptr inbounds i8, ptr %.0, i64 13
  %107 = lshr i32 %104, 8
  %108 = trunc i32 %107 to i8
  store i8 %108, ptr %106, align 1, !tbaa !27
  %109 = getelementptr inbounds i8, ptr %.0, i64 14
  %110 = lshr i32 %104, 16
  %111 = trunc i32 %110 to i8
  store i8 %111, ptr %109, align 1, !tbaa !27
  %112 = getelementptr inbounds i8, ptr %.0, i64 15
  %113 = lshr i32 %104, 24
  %114 = trunc nuw i32 %113 to i8
  store i8 %114, ptr %112, align 1, !tbaa !27
  %115 = getelementptr inbounds i8, ptr %.0, i64 16
  %116 = load ptr, ptr %0, align 8, !tbaa !15
  %117 = call i32 @SDMMC_ReadFIFO(ptr noundef %116) #3
  %118 = trunc i32 %117 to i8
  store i8 %118, ptr %115, align 1, !tbaa !27
  %119 = getelementptr inbounds i8, ptr %.0, i64 17
  %120 = lshr i32 %117, 8
  %121 = trunc i32 %120 to i8
  store i8 %121, ptr %119, align 1, !tbaa !27
  %122 = getelementptr inbounds i8, ptr %.0, i64 18
  %123 = lshr i32 %117, 16
  %124 = trunc i32 %123 to i8
  store i8 %124, ptr %122, align 1, !tbaa !27
  %125 = getelementptr inbounds i8, ptr %.0, i64 19
  %126 = lshr i32 %117, 24
  %127 = trunc nuw i32 %126 to i8
  store i8 %127, ptr %125, align 1, !tbaa !27
  %128 = getelementptr inbounds i8, ptr %.0, i64 20
  %129 = load ptr, ptr %0, align 8, !tbaa !15
  %130 = call i32 @SDMMC_ReadFIFO(ptr noundef %129) #3
  %131 = trunc i32 %130 to i8
  store i8 %131, ptr %128, align 1, !tbaa !27
  %132 = getelementptr inbounds i8, ptr %.0, i64 21
  %133 = lshr i32 %130, 8
  %134 = trunc i32 %133 to i8
  store i8 %134, ptr %132, align 1, !tbaa !27
  %135 = getelementptr inbounds i8, ptr %.0, i64 22
  %136 = lshr i32 %130, 16
  %137 = trunc i32 %136 to i8
  store i8 %137, ptr %135, align 1, !tbaa !27
  %138 = getelementptr inbounds i8, ptr %.0, i64 23
  %139 = lshr i32 %130, 24
  %140 = trunc nuw i32 %139 to i8
  store i8 %140, ptr %138, align 1, !tbaa !27
  %141 = getelementptr inbounds i8, ptr %.0, i64 24
  %142 = load ptr, ptr %0, align 8, !tbaa !15
  %143 = call i32 @SDMMC_ReadFIFO(ptr noundef %142) #3
  %144 = trunc i32 %143 to i8
  store i8 %144, ptr %141, align 1, !tbaa !27
  %145 = getelementptr inbounds i8, ptr %.0, i64 25
  %146 = lshr i32 %143, 8
  %147 = trunc i32 %146 to i8
  store i8 %147, ptr %145, align 1, !tbaa !27
  %148 = getelementptr inbounds i8, ptr %.0, i64 26
  %149 = lshr i32 %143, 16
  %150 = trunc i32 %149 to i8
  store i8 %150, ptr %148, align 1, !tbaa !27
  %151 = getelementptr inbounds i8, ptr %.0, i64 27
  %152 = lshr i32 %143, 24
  %153 = trunc nuw i32 %152 to i8
  store i8 %153, ptr %151, align 1, !tbaa !27
  %154 = getelementptr inbounds i8, ptr %.0, i64 28
  %155 = load ptr, ptr %0, align 8, !tbaa !15
  %156 = call i32 @SDMMC_ReadFIFO(ptr noundef %155) #3
  %157 = trunc i32 %156 to i8
  store i8 %157, ptr %154, align 1, !tbaa !27
  %158 = getelementptr inbounds i8, ptr %.0, i64 29
  %159 = lshr i32 %156, 8
  %160 = trunc i32 %159 to i8
  store i8 %160, ptr %158, align 1, !tbaa !27
  %161 = getelementptr inbounds i8, ptr %.0, i64 30
  %162 = lshr i32 %156, 16
  %163 = trunc i32 %162 to i8
  store i8 %163, ptr %161, align 1, !tbaa !27
  %164 = getelementptr inbounds i8, ptr %.0, i64 31
  %165 = lshr i32 %156, 24
  %166 = trunc nuw i32 %165 to i8
  store i8 %166, ptr %164, align 1, !tbaa !27
  %167 = getelementptr inbounds i8, ptr %.0, i64 32
  %168 = add i32 %.091, -32
  br label %169

169:                                              ; preds = %.preheader.preheader, %60
  %.192 = phi i32 [ %168, %.preheader.preheader ], [ %.091, %60 ]
  %.2 = phi ptr [ %167, %.preheader.preheader ], [ %.0, %60 ]
  %170 = call i32 @HAL_GetTick() #3
  %171 = sub i32 %170, %7
  %.not105 = icmp ult i32 %171, %4
  br i1 %.not105, label %55, label %172, !llvm.loop !28

172:                                              ; preds = %169
  %173 = load ptr, ptr %0, align 8, !tbaa !15
  %174 = getelementptr inbounds i8, ptr %173, i64 56
  store volatile i32 534777855, ptr %174, align 4, !tbaa !25
  %175 = load volatile i32, ptr %17, align 4, !tbaa !5
  %176 = or i32 %175, -2147483648
  store volatile i32 %176, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  %177 = getelementptr inbounds i8, ptr %0, i64 60
  store volatile i32 0, ptr %177, align 4, !tbaa !24
  br label %224

178:                                              ; preds = %55
  %179 = getelementptr inbounds i8, ptr %56, i64 12
  %180 = load volatile i32, ptr %179, align 4, !tbaa !23
  %181 = and i32 %180, -65
  store volatile i32 %181, ptr %179, align 4, !tbaa !23
  %182 = load volatile i32, ptr %57, align 4, !tbaa !26
  %183 = and i32 %182, 256
  %184 = icmp ne i32 %183, 0
  %or.cond5 = and i1 %40, %184
  br i1 %or.cond5, label %185, label %194

185:                                              ; preds = %178
  %186 = load i32, ptr %20, align 8, !tbaa !18
  %.not100 = icmp eq i32 %186, 3
  br i1 %.not100, label %194, label %187

187:                                              ; preds = %185
  %188 = call i32 @SDMMC_CmdStopTransfer(ptr noundef nonnull %56) #3
  %.not101 = icmp eq i32 %188, 0
  %.pre = load ptr, ptr %0, align 8, !tbaa !15
  br i1 %.not101, label %194, label %189

189:                                              ; preds = %187
  %190 = getelementptr inbounds i8, ptr %.pre, i64 56
  store volatile i32 534777855, ptr %190, align 4, !tbaa !25
  %191 = load volatile i32, ptr %17, align 4, !tbaa !5
  %192 = or i32 %191, %188
  store volatile i32 %192, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  %193 = getelementptr inbounds i8, ptr %0, i64 60
  store volatile i32 0, ptr %193, align 4, !tbaa !24
  br label %224

194:                                              ; preds = %185, %187, %178
  %195 = phi ptr [ %56, %185 ], [ %.pre, %187 ], [ %56, %178 ]
  %196 = getelementptr inbounds i8, ptr %195, i64 52
  %197 = load volatile i32, ptr %196, align 4, !tbaa !26
  %198 = and i32 %197, 8
  %.not102 = icmp eq i32 %198, 0
  br i1 %.not102, label %204, label %199

199:                                              ; preds = %194
  %200 = getelementptr inbounds i8, ptr %195, i64 56
  store volatile i32 534777855, ptr %200, align 4, !tbaa !25
  %201 = load volatile i32, ptr %17, align 4, !tbaa !5
  %202 = or i32 %201, 8
  store volatile i32 %202, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  %203 = getelementptr inbounds i8, ptr %0, i64 60
  store volatile i32 0, ptr %203, align 4, !tbaa !24
  br label %224

204:                                              ; preds = %194
  %205 = load volatile i32, ptr %196, align 4, !tbaa !26
  %206 = and i32 %205, 2
  %.not103 = icmp eq i32 %206, 0
  br i1 %.not103, label %212, label %207

207:                                              ; preds = %204
  %208 = getelementptr inbounds i8, ptr %195, i64 56
  store volatile i32 534777855, ptr %208, align 4, !tbaa !25
  %209 = load volatile i32, ptr %17, align 4, !tbaa !5
  %210 = or i32 %209, 2
  store volatile i32 %210, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  %211 = getelementptr inbounds i8, ptr %0, i64 60
  store volatile i32 0, ptr %211, align 4, !tbaa !24
  br label %224

212:                                              ; preds = %204
  %213 = load volatile i32, ptr %196, align 4, !tbaa !26
  %214 = and i32 %213, 32
  %.not104 = icmp eq i32 %214, 0
  %215 = getelementptr inbounds i8, ptr %195, i64 56
  br i1 %.not104, label %220, label %216

216:                                              ; preds = %212
  store volatile i32 534777855, ptr %215, align 4, !tbaa !25
  %217 = load volatile i32, ptr %17, align 4, !tbaa !5
  %218 = or i32 %217, 32
  store volatile i32 %218, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  %219 = getelementptr inbounds i8, ptr %0, i64 60
  store volatile i32 0, ptr %219, align 4, !tbaa !24
  br label %224

220:                                              ; preds = %212
  store volatile i32 402657082, ptr %215, align 4, !tbaa !25
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %224

221:                                              ; preds = %13
  %222 = load volatile i32, ptr %17, align 4, !tbaa !5
  %223 = or i32 %222, 536870912
  store volatile i32 %223, ptr %17, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %221, %220, %216, %207, %199, %189, %172, %47, %24, %9
  %.093 = phi i32 [ 1, %9 ], [ 1, %24 ], [ 1, %47 ], [ 3, %172 ], [ 1, %189 ], [ 1, %199 ], [ 1, %207 ], [ 1, %216 ], [ 0, %220 ], [ 1, %221 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  ret i32 %.093
}

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

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

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

declare i32 @SDMMC_ReadFIFO(ptr noundef) local_unnamed_addr #1

declare i32 @SDMMC_CmdStopTransfer(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 68}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 28, !7, i64 32, !11, i64 40, !7, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !12, i64 72, !8, i64 108, !8, i64 124}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!13 = !{!6, !11, i64 64}
!14 = !{!6, !11, i64 96}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !11, i64 44}
!17 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !8, i64 68, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !8, i64 96, !11, i64 128, !8, i64 132, !11, i64 1020}
!18 = !{!6, !11, i64 72}
!19 = !{!20, !11, i64 0}
!20 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!21 = !{!20, !11, i64 4}
!22 = !{!11, !11, i64 0}
!23 = !{!17, !11, i64 12}
!24 = !{!6, !11, i64 60}
!25 = !{!17, !11, i64 56}
!26 = !{!17, !11, i64 52}
!27 = !{!8, !8, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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