; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/Drivers/STM32H7xx_HAL_Driver/Src (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 ptr, align 8
  %19 = 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
  %20 = call i32 @HAL_GetTick()
  store i32 %20, 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
  %21 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %21, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %22, ptr %18, align 8, !tbaa !5
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = icmp eq ptr null, %23
  br i1 %24, label %25, label %30

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

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

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

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

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

63:                                               ; preds = %51
  %64 = load i32, ptr %17, align 4, !tbaa !9
  %65 = mul i32 %64, 512
  store i32 %65, ptr %17, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %63, %51
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !17
  %70 = call i32 @SDMMC_CmdBlockLength(ptr noundef %69, i32 noundef 512)
  store i32 %70, ptr %13, align 4, !tbaa !9
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %85

73:                                               ; preds = %66
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !17
  %77 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %76, i32 0, i32 14
  store volatile i32 534777855, ptr %77, align 4, !tbaa !21
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %79, i32 0, i32 9
  %81 = load volatile i32, ptr %80, align 4, !tbaa !11
  %82 = or i32 %81, %78
  store volatile i32 %82, ptr %80, align 4, !tbaa !11
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %83, i32 0, i32 8
  store volatile i32 1, ptr %84, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %342

85:                                               ; preds = %66
  %86 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 0
  store i32 -1, ptr %86, align 4, !tbaa !22
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = mul i32 %87, 512
  %89 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 1
  store i32 %88, ptr %89, align 4, !tbaa !24
  %90 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 2
  store i32 144, ptr %90, align 4, !tbaa !25
  %91 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 3
  store i32 2, ptr %91, align 4, !tbaa !26
  %92 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 4
  store i32 0, ptr %92, align 4, !tbaa !27
  %93 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %12, i32 0, i32 5
  store i32 0, ptr %93, align 4, !tbaa !28
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !17
  %97 = call i32 @SDMMC_ConfigData(ptr noundef %96, ptr noundef %12)
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !17
  %101 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %100, i32 0, i32 3
  %102 = load volatile i32, ptr %101, align 4, !tbaa !29
  %103 = zext i32 %102 to i64
  %104 = or i64 %103, 64
  %105 = trunc i64 %104 to i32
  store volatile i32 %105, ptr %101, align 4, !tbaa !29
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = icmp ugt i32 %106, 1
  br i1 %107, label %108, label %116

108:                                              ; preds = %85
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %109, i32 0, i32 7
  store volatile i32 2, ptr %110, align 4, !tbaa !30
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !17
  %114 = load i32, ptr %17, align 4, !tbaa !9
  %115 = call i32 @SDMMC_CmdReadMultiBlock(ptr noundef %113, i32 noundef %114)
  store i32 %115, ptr %13, align 4, !tbaa !9
  br label %124

116:                                              ; preds = %85
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %117, i32 0, i32 7
  store volatile i32 1, ptr %118, align 4, !tbaa !30
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %119, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !17
  %122 = load i32, ptr %17, align 4, !tbaa !9
  %123 = call i32 @SDMMC_CmdReadSingleBlock(ptr noundef %121, i32 noundef %122)
  store i32 %123, ptr %13, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %116, %108
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %139

127:                                              ; preds = %124
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !17
  %131 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %130, i32 0, i32 14
  store volatile i32 534777855, ptr %131, align 4, !tbaa !21
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %133, i32 0, i32 9
  %135 = load volatile i32, ptr %134, align 4, !tbaa !11
  %136 = or i32 %135, %132
  store volatile i32 %136, ptr %134, align 4, !tbaa !11
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %137, i32 0, i32 8
  store volatile i32 1, ptr %138, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %342

139:                                              ; preds = %124
  br label %140

140:                                              ; preds = %219, %139
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !17
  %144 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %143, i32 0, i32 13
  %145 = load volatile i32, ptr %144, align 4, !tbaa !31
  %146 = zext i32 %145 to i64
  %147 = and i64 %146, 298
  %148 = icmp ne i64 %147, 0
  %149 = xor i1 %148, true
  br i1 %149, label %150, label %220

150:                                              ; preds = %140
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !17
  %154 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %153, i32 0, i32 13
  %155 = load volatile i32, ptr %154, align 4, !tbaa !31
  %156 = zext i32 %155 to i64
  %157 = and i64 %156, 32768
  %158 = icmp ne i64 %157, 0
  br i1 %158, label %159, label %199

159:                                              ; preds = %150
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %195, %159
  %161 = load i32, ptr %15, align 4, !tbaa !9
  %162 = icmp ult i32 %161, 8
  br i1 %162, label %163, label %198

163:                                              ; preds = %160
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !17
  %167 = call i32 @SDMMC_ReadFIFO(ptr noundef %166)
  store i32 %167, ptr %16, align 4, !tbaa !9
  %168 = load i32, ptr %16, align 4, !tbaa !9
  %169 = and i32 %168, 255
  %170 = trunc i32 %169 to i8
  %171 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %170, ptr %171, align 1, !tbaa !32
  %172 = load ptr, ptr %18, align 8, !tbaa !5
  %173 = getelementptr inbounds i8, ptr %172, i32 1
  store ptr %173, ptr %18, align 8, !tbaa !5
  %174 = load i32, ptr %16, align 4, !tbaa !9
  %175 = lshr i32 %174, 8
  %176 = and i32 %175, 255
  %177 = trunc i32 %176 to i8
  %178 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %177, ptr %178, align 1, !tbaa !32
  %179 = load ptr, ptr %18, align 8, !tbaa !5
  %180 = getelementptr inbounds i8, ptr %179, i32 1
  store ptr %180, ptr %18, align 8, !tbaa !5
  %181 = load i32, ptr %16, align 4, !tbaa !9
  %182 = lshr i32 %181, 16
  %183 = and i32 %182, 255
  %184 = trunc i32 %183 to i8
  %185 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %184, ptr %185, align 1, !tbaa !32
  %186 = load ptr, ptr %18, align 8, !tbaa !5
  %187 = getelementptr inbounds i8, ptr %186, i32 1
  store ptr %187, ptr %18, align 8, !tbaa !5
  %188 = load i32, ptr %16, align 4, !tbaa !9
  %189 = lshr i32 %188, 24
  %190 = and i32 %189, 255
  %191 = trunc i32 %190 to i8
  %192 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %191, ptr %192, align 1, !tbaa !32
  %193 = load ptr, ptr %18, align 8, !tbaa !5
  %194 = getelementptr inbounds i8, ptr %193, i32 1
  store ptr %194, ptr %18, align 8, !tbaa !5
  br label %195

195:                                              ; preds = %163
  %196 = load i32, ptr %15, align 4, !tbaa !9
  %197 = add i32 %196, 1
  store i32 %197, ptr %15, align 4, !tbaa !9
  br label %160, !llvm.loop !33

198:                                              ; preds = %160
  br label %199

199:                                              ; preds = %198, %150
  %200 = call i32 @HAL_GetTick()
  %201 = load i32, ptr %14, align 4, !tbaa !9
  %202 = sub i32 %200, %201
  %203 = load i32, ptr %11, align 4, !tbaa !9
  %204 = icmp uge i32 %202, %203
  br i1 %204, label %208, label %205

205:                                              ; preds = %199
  %206 = load i32, ptr %11, align 4, !tbaa !9
  %207 = icmp eq i32 %206, 0
  br i1 %207, label %208, label %219

208:                                              ; preds = %205, %199
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %209, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !17
  %212 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %211, i32 0, i32 14
  store volatile i32 534777855, ptr %212, align 4, !tbaa !21
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %213, i32 0, i32 9
  %215 = load volatile i32, ptr %214, align 4, !tbaa !11
  %216 = or i32 %215, -2147483648
  store volatile i32 %216, ptr %214, align 4, !tbaa !11
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %217, i32 0, i32 8
  store volatile i32 1, ptr %218, align 8, !tbaa !15
  store i32 3, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %342

219:                                              ; preds = %205
  br label %140, !llvm.loop !35

220:                                              ; preds = %140
  %221 = load ptr, ptr %7, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !17
  %224 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %223, i32 0, i32 3
  %225 = load volatile i32, ptr %224, align 4, !tbaa !29
  %226 = zext i32 %225 to i64
  %227 = and i64 %226, -65
  %228 = trunc i64 %227 to i32
  store volatile i32 %228, ptr %224, align 4, !tbaa !29
  %229 = load ptr, ptr %7, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %229, i32 0, i32 0
  %231 = load ptr, ptr %230, align 8, !tbaa !17
  %232 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %231, i32 0, i32 13
  %233 = load volatile i32, ptr %232, align 4, !tbaa !31
  %234 = zext i32 %233 to i64
  %235 = and i64 %234, 256
  %236 = icmp ne i64 %235, 0
  br i1 %236, label %237, label %267

237:                                              ; preds = %220
  %238 = load i32, ptr %10, align 4, !tbaa !9
  %239 = icmp ugt i32 %238, 1
  br i1 %239, label %240, label %267

240:                                              ; preds = %237
  %241 = load ptr, ptr %7, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %241, i32 0, i32 10
  %243 = getelementptr inbounds %struct.HAL_SD_CardInfoTypeDef, ptr %242, i32 0, i32 0
  %244 = load i32, ptr %243, align 8, !tbaa !20
  %245 = icmp ne i32 %244, 3
  br i1 %245, label %246, label %266

246:                                              ; preds = %240
  %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 = call i32 @SDMMC_CmdStopTransfer(ptr noundef %249)
  store i32 %250, ptr %13, align 4, !tbaa !9
  %251 = load i32, ptr %13, align 4, !tbaa !9
  %252 = icmp ne i32 %251, 0
  br i1 %252, label %253, label %265

253:                                              ; preds = %246
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %254, i32 0, i32 0
  %256 = load ptr, ptr %255, align 8, !tbaa !17
  %257 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %256, i32 0, i32 14
  store volatile i32 534777855, ptr %257, align 4, !tbaa !21
  %258 = load i32, ptr %13, align 4, !tbaa !9
  %259 = load ptr, ptr %7, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %259, i32 0, i32 9
  %261 = load volatile i32, ptr %260, align 4, !tbaa !11
  %262 = or i32 %261, %258
  store volatile i32 %262, ptr %260, align 4, !tbaa !11
  %263 = load ptr, ptr %7, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %263, i32 0, i32 8
  store volatile i32 1, ptr %264, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %342

265:                                              ; preds = %246
  br label %266

266:                                              ; preds = %265, %240
  br label %267

267:                                              ; preds = %266, %237, %220
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %268, i32 0, i32 0
  %270 = load ptr, ptr %269, align 8, !tbaa !17
  %271 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %270, i32 0, i32 13
  %272 = load volatile i32, ptr %271, align 4, !tbaa !31
  %273 = zext i32 %272 to i64
  %274 = and i64 %273, 8
  %275 = icmp ne i64 %274, 0
  br i1 %275, label %276, label %287

276:                                              ; preds = %267
  %277 = load ptr, ptr %7, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %277, i32 0, i32 0
  %279 = load ptr, ptr %278, align 8, !tbaa !17
  %280 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %279, i32 0, i32 14
  store volatile i32 534777855, ptr %280, align 4, !tbaa !21
  %281 = load ptr, ptr %7, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %281, i32 0, i32 9
  %283 = load volatile i32, ptr %282, align 4, !tbaa !11
  %284 = or i32 %283, 8
  store volatile i32 %284, ptr %282, align 4, !tbaa !11
  %285 = load ptr, ptr %7, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %285, i32 0, i32 8
  store volatile i32 1, ptr %286, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %342

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

296:                                              ; preds = %287
  %297 = load ptr, ptr %7, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %297, i32 0, i32 0
  %299 = load ptr, ptr %298, align 8, !tbaa !17
  %300 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %299, i32 0, i32 14
  store volatile i32 534777855, ptr %300, align 4, !tbaa !21
  %301 = load ptr, ptr %7, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %301, i32 0, i32 9
  %303 = load volatile i32, ptr %302, align 4, !tbaa !11
  %304 = or i32 %303, 2
  store volatile i32 %304, ptr %302, align 4, !tbaa !11
  %305 = load ptr, ptr %7, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.SD_HandleTypeDef, ptr %305, i32 0, i32 8
  store volatile i32 1, ptr %306, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %342

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

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

327:                                              ; preds = %307
  br label %328

328:                                              ; preds = %327
  br label %329

329:                                              ; preds = %328
  br label %330

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

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

342:                                              ; preds = %337, %330, %316, %296, %276, %253, %208, %127, %73, %46, %25
  call void @llvm.lifetime.end.p0(i64 8, 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
  %343 = load i32, ptr %6, align 4
  ret i32 %343
}

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

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 = !{!19, !10, i64 56}
!22 = !{!23, !10, i64 0}
!23 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!24 = !{!23, !10, i64 4}
!25 = !{!23, !10, i64 8}
!26 = !{!23, !10, i64 12}
!27 = !{!23, !10, i64 16}
!28 = !{!23, !10, i64 20}
!29 = !{!19, !10, i64 12}
!30 = !{!12, !10, i64 60}
!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 %219

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 %216

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 %219

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
  %32 = tail call i32 @SDMMC_CmdBlockLength(ptr noundef %28, i32 noundef 512) #3
  %.not93 = icmp eq i32 %32, 0
  br i1 %.not93, label %38, label %33

33:                                               ; preds = %27
  %34 = load ptr, ptr %0, align 8, !tbaa !15
  %35 = getelementptr inbounds i8, ptr %34, i64 56
  store volatile i32 534777855, ptr %35, align 4, !tbaa !19
  %36 = load volatile i32, ptr %17, align 4, !tbaa !5
  %37 = or i32 %36, %32
  store volatile i32 %37, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %219

38:                                               ; preds = %27
  store i32 -1, ptr %6, align 4, !tbaa !20
  %39 = shl i32 %3, 9
  %40 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %39, ptr %40, align 4, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %6, i64 8
  store <4 x i32> <i32 144, i32 2, i32 0, i32 0>, ptr %41, align 4, !tbaa !23
  %42 = load ptr, ptr %0, align 8, !tbaa !15
  %43 = call i32 @SDMMC_ConfigData(ptr noundef %42, ptr noundef nonnull %6) #3
  %44 = load ptr, ptr %0, align 8, !tbaa !15
  %45 = getelementptr inbounds i8, ptr %44, i64 12
  %46 = load volatile i32, ptr %45, align 4, !tbaa !24
  %47 = or i32 %46, 64
  store volatile i32 %47, ptr %45, align 4, !tbaa !24
  %48 = icmp ugt i32 %3, 1
  %49 = getelementptr inbounds i8, ptr %0, i64 60
  br i1 %48, label %50, label %52

50:                                               ; preds = %38
  store volatile i32 2, ptr %49, align 4, !tbaa !25
  %51 = call i32 @SDMMC_CmdReadMultiBlock(ptr noundef nonnull %44, i32 noundef %spec.select) #3
  br label %54

52:                                               ; preds = %38
  store volatile i32 1, ptr %49, align 4, !tbaa !25
  %53 = call i32 @SDMMC_CmdReadSingleBlock(ptr noundef nonnull %44, i32 noundef %spec.select) #3
  br label %54

54:                                               ; preds = %52, %50
  %.089 = phi i32 [ %51, %50 ], [ %53, %52 ]
  %.not94 = icmp eq i32 %.089, 0
  br i1 %.not94, label %.preheader103, label %55

55:                                               ; preds = %54
  %56 = load ptr, ptr %0, align 8, !tbaa !15
  %57 = getelementptr inbounds i8, ptr %56, i64 56
  store volatile i32 534777855, ptr %57, align 4, !tbaa !19
  %58 = load volatile i32, ptr %17, align 4, !tbaa !5
  %59 = or i32 %58, %.089
  store volatile i32 %59, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %219

.preheader103:                                    ; preds = %54, %.loopexit
  %.0 = phi ptr [ %.2, %.loopexit ], [ %1, %54 ]
  %60 = load ptr, ptr %0, align 8, !tbaa !15
  %61 = getelementptr inbounds i8, ptr %60, i64 52
  %62 = load volatile i32, ptr %61, align 4, !tbaa !26
  %63 = and i32 %62, 298
  %.not95 = icmp eq i32 %63, 0
  br i1 %.not95, label %64, label %177

64:                                               ; preds = %.preheader103
  %65 = load volatile i32, ptr %61, align 4, !tbaa !26
  %66 = and i32 %65, 32768
  %.not101 = icmp eq i32 %66, 0
  br i1 %.not101, label %.loopexit, label %.preheader.preheader

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

.loopexit:                                        ; preds = %.preheader.preheader, %64
  %.2 = phi ptr [ %.0, %64 ], [ %169, %.preheader.preheader ]
  %170 = call i32 @HAL_GetTick() #3
  %171 = sub i32 %170, %7
  %.not102 = icmp ult i32 %171, %4
  br i1 %.not102, label %.preheader103, label %172, !llvm.loop !28

172:                                              ; preds = %.loopexit
  %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 !19
  %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
  br label %219

177:                                              ; preds = %.preheader103
  %178 = getelementptr inbounds i8, ptr %60, i64 12
  %179 = load volatile i32, ptr %178, align 4, !tbaa !24
  %180 = and i32 %179, -65
  store volatile i32 %180, ptr %178, align 4, !tbaa !24
  %181 = load volatile i32, ptr %61, align 4, !tbaa !26
  %182 = and i32 %181, 256
  %183 = icmp ne i32 %182, 0
  %or.cond3 = and i1 %48, %183
  br i1 %or.cond3, label %184, label %192

184:                                              ; preds = %177
  %185 = load i32, ptr %20, align 8, !tbaa !18
  %.not96 = icmp eq i32 %185, 3
  br i1 %.not96, label %192, label %186

186:                                              ; preds = %184
  %187 = call i32 @SDMMC_CmdStopTransfer(ptr noundef nonnull %60) #3
  %.not97 = icmp eq i32 %187, 0
  %.pre = load ptr, ptr %0, align 8, !tbaa !15
  br i1 %.not97, label %192, label %188

188:                                              ; preds = %186
  %189 = getelementptr inbounds i8, ptr %.pre, i64 56
  store volatile i32 534777855, ptr %189, align 4, !tbaa !19
  %190 = load volatile i32, ptr %17, align 4, !tbaa !5
  %191 = or i32 %190, %187
  store volatile i32 %191, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %219

192:                                              ; preds = %184, %186, %177
  %193 = phi ptr [ %60, %184 ], [ %.pre, %186 ], [ %60, %177 ]
  %194 = getelementptr inbounds i8, ptr %193, i64 52
  %195 = load volatile i32, ptr %194, align 4, !tbaa !26
  %196 = and i32 %195, 8
  %.not98 = icmp eq i32 %196, 0
  br i1 %.not98, label %201, label %197

197:                                              ; preds = %192
  %198 = getelementptr inbounds i8, ptr %193, i64 56
  store volatile i32 534777855, ptr %198, align 4, !tbaa !19
  %199 = load volatile i32, ptr %17, align 4, !tbaa !5
  %200 = or i32 %199, 8
  store volatile i32 %200, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %219

201:                                              ; preds = %192
  %202 = load volatile i32, ptr %194, align 4, !tbaa !26
  %203 = and i32 %202, 2
  %.not99 = icmp eq i32 %203, 0
  br i1 %.not99, label %208, label %204

204:                                              ; preds = %201
  %205 = getelementptr inbounds i8, ptr %193, i64 56
  store volatile i32 534777855, ptr %205, align 4, !tbaa !19
  %206 = load volatile i32, ptr %17, align 4, !tbaa !5
  %207 = or i32 %206, 2
  store volatile i32 %207, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %219

208:                                              ; preds = %201
  %209 = load volatile i32, ptr %194, align 4, !tbaa !26
  %210 = and i32 %209, 32
  %.not100 = icmp eq i32 %210, 0
  %211 = getelementptr inbounds i8, ptr %193, i64 56
  br i1 %.not100, label %215, label %212

212:                                              ; preds = %208
  store volatile i32 534777855, ptr %211, align 4, !tbaa !19
  %213 = load volatile i32, ptr %17, align 4, !tbaa !5
  %214 = or i32 %213, 32
  store volatile i32 %214, ptr %17, align 4, !tbaa !5
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %219

215:                                              ; preds = %208
  store volatile i32 402657082, ptr %211, align 4, !tbaa !19
  store volatile i32 1, ptr %14, align 8, !tbaa !13
  br label %219

216:                                              ; preds = %13
  %217 = load volatile i32, ptr %17, align 4, !tbaa !5
  %218 = or i32 %217, 536870912
  store volatile i32 %218, ptr %17, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %216, %215, %212, %204, %197, %188, %172, %55, %33, %24, %9
  %.087 = phi i32 [ 1, %9 ], [ 1, %24 ], [ 1, %33 ], [ 1, %55 ], [ 3, %172 ], [ 1, %188 ], [ 1, %197 ], [ 1, %204 ], [ 1, %212 ], [ 0, %215 ], [ 1, %216 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  ret i32 %.087
}

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

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 = !{!17, !11, i64 56}
!20 = !{!21, !11, i64 0}
!21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!22 = !{!21, !11, i64 4}
!23 = !{!11, !11, i64 0}
!24 = !{!17, !11, i64 12}
!25 = !{!6, !11, i64 60}
!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