; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/Drivers/STM32H7xx_HAL_Driver/Src (WriteBlocks)

; 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.MMC_HandleTypeDef = type { ptr, %struct.SDMMC_InitTypeDef, i32, ptr, i32, ptr, i32, i32, i32, i32, %struct.HAL_MMC_CardInfoTypeDef, [4 x i32], [4 x i32], [128 x i32] }
%struct.SDMMC_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.HAL_MMC_CardInfoTypeDef = type { 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

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

declare i32 @HAL_GetTick() #1

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

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

declare i32 @SDMMC_CmdStopTransfer(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_MMC_WriteBlocks(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.MMC_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 %338

30:                                               ; preds = %5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.MMC_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 %333

35:                                               ; preds = %30
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %36, i32 0, i32 9
  store volatile i32 0, ptr %37, align 4, !tbaa !11
  %38 = load i32, ptr %9, 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.MMC_HandleTypeDef, ptr %41, i32 0, i32 10
  %43 = getelementptr inbounds %struct.HAL_MMC_CardInfoTypeDef, ptr %42, i32 0, i32 5
  %44 = load i32, ptr %43, align 4, !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.MMC_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 %338

51:                                               ; preds = %35
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.MMC_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.MMC_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.MMC_HandleTypeDef, ptr %58, i32 0, i32 10
  %60 = getelementptr inbounds %struct.HAL_MMC_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.MMC_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.MMC_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.MMC_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.MMC_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 %338

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 0, 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.MMC_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.MMC_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.MMC_HandleTypeDef, ptr %109, i32 0, i32 7
  store volatile i32 32, ptr %110, align 4, !tbaa !30
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.MMC_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_CmdWriteMultiBlock(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.MMC_HandleTypeDef, ptr %117, i32 0, i32 7
  store volatile i32 16, ptr %118, align 4, !tbaa !30
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MMC_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_CmdWriteSingleBlock(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.MMC_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.MMC_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.MMC_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 %338

139:                                              ; preds = %124
  br label %140

140:                                              ; preds = %222, %139
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.MMC_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, 282
  %148 = icmp ne i64 %147, 0
  %149 = xor i1 %148, true
  br i1 %149, label %150, label %223

150:                                              ; preds = %140
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.MMC_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, 16384
  %158 = icmp ne i64 %157, 0
  br i1 %158, label %159, label %201

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

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

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

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

200:                                              ; preds = %160
  br label %201

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

207:                                              ; preds = %201
  %208 = load i32, ptr %11, align 4, !tbaa !9
  %209 = icmp eq i32 %208, 0
  br i1 %209, label %210, label %222

210:                                              ; preds = %207, %201
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !17
  %214 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %213, i32 0, i32 14
  store volatile i32 534777855, ptr %214, align 4, !tbaa !21
  %215 = load i32, ptr %13, align 4, !tbaa !9
  %216 = load ptr, ptr %7, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %216, i32 0, i32 9
  %218 = load volatile i32, ptr %217, align 4, !tbaa !11
  %219 = or i32 %218, %215
  store volatile i32 %219, ptr %217, align 4, !tbaa !11
  %220 = load ptr, ptr %7, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %220, i32 0, i32 8
  store volatile i32 1, ptr %221, align 8, !tbaa !15
  store i32 3, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %338

222:                                              ; preds = %207
  br label %140, !llvm.loop !35

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

240:                                              ; preds = %223
  %241 = load i32, ptr %10, align 4, !tbaa !9
  %242 = icmp ugt i32 %241, 1
  br i1 %242, label %243, label %263

243:                                              ; preds = %240
  %244 = load ptr, ptr %7, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %244, i32 0, i32 0
  %246 = load ptr, ptr %245, align 8, !tbaa !17
  %247 = call i32 @SDMMC_CmdStopTransfer(ptr noundef %246)
  store i32 %247, ptr %13, align 4, !tbaa !9
  %248 = load i32, ptr %13, align 4, !tbaa !9
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %250, label %262

250:                                              ; preds = %243
  %251 = load ptr, ptr %7, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %251, i32 0, i32 0
  %253 = load ptr, ptr %252, align 8, !tbaa !17
  %254 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %253, i32 0, i32 14
  store volatile i32 534777855, ptr %254, align 4, !tbaa !21
  %255 = load i32, ptr %13, align 4, !tbaa !9
  %256 = load ptr, ptr %7, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %256, i32 0, i32 9
  %258 = load volatile i32, ptr %257, align 4, !tbaa !11
  %259 = or i32 %258, %255
  store volatile i32 %259, ptr %257, align 4, !tbaa !11
  %260 = load ptr, ptr %7, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %260, i32 0, i32 8
  store volatile i32 1, ptr %261, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %338

262:                                              ; preds = %243
  br label %263

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

272:                                              ; preds = %263
  %273 = load ptr, ptr %7, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %273, i32 0, i32 0
  %275 = load ptr, ptr %274, align 8, !tbaa !17
  %276 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %275, i32 0, i32 14
  store volatile i32 534777855, ptr %276, align 4, !tbaa !21
  %277 = load ptr, ptr %7, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %277, i32 0, i32 9
  %279 = load volatile i32, ptr %278, align 4, !tbaa !11
  %280 = or i32 %279, 8
  store volatile i32 %280, ptr %278, align 4, !tbaa !11
  %281 = load ptr, ptr %7, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %281, i32 0, i32 8
  store volatile i32 1, ptr %282, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %338

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

292:                                              ; preds = %283
  %293 = load ptr, ptr %7, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %293, i32 0, i32 0
  %295 = load ptr, ptr %294, align 8, !tbaa !17
  %296 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %295, i32 0, i32 14
  store volatile i32 534777855, ptr %296, align 4, !tbaa !21
  %297 = load ptr, ptr %7, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %297, i32 0, i32 9
  %299 = load volatile i32, ptr %298, align 4, !tbaa !11
  %300 = or i32 %299, 2
  store volatile i32 %300, ptr %298, align 4, !tbaa !11
  %301 = load ptr, ptr %7, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %301, i32 0, i32 8
  store volatile i32 1, ptr %302, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %338

303:                                              ; preds = %283
  %304 = load ptr, ptr %7, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %304, i32 0, i32 0
  %306 = load ptr, ptr %305, align 8, !tbaa !17
  %307 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %306, i32 0, i32 13
  %308 = load volatile i32, ptr %307, align 4, !tbaa !31
  %309 = zext i32 %308 to i64
  %310 = and i64 %309, 16
  %311 = icmp ne i64 %310, 0
  br i1 %311, label %312, label %323

312:                                              ; preds = %303
  %313 = load ptr, ptr %7, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %313, i32 0, i32 0
  %315 = load ptr, ptr %314, align 8, !tbaa !17
  %316 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %315, i32 0, i32 14
  store volatile i32 534777855, ptr %316, align 4, !tbaa !21
  %317 = load ptr, ptr %7, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %317, i32 0, i32 9
  %319 = load volatile i32, ptr %318, align 4, !tbaa !11
  %320 = or i32 %319, 16
  store volatile i32 %320, ptr %318, align 4, !tbaa !11
  %321 = load ptr, ptr %7, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %321, i32 0, i32 8
  store volatile i32 1, ptr %322, align 8, !tbaa !15
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %338

323:                                              ; preds = %303
  br label %324

324:                                              ; preds = %323
  br label %325

325:                                              ; preds = %324
  br label %326

326:                                              ; preds = %325
  %327 = load ptr, ptr %7, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %327, i32 0, i32 0
  %329 = load ptr, ptr %328, align 8, !tbaa !17
  %330 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %329, i32 0, i32 14
  store volatile i32 402657082, ptr %330, align 4, !tbaa !21
  %331 = load ptr, ptr %7, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %331, i32 0, i32 8
  store volatile i32 1, ptr %332, align 8, !tbaa !15
  store i32 0, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %338

333:                                              ; preds = %30
  %334 = load ptr, ptr %7, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %334, i32 0, i32 9
  %336 = load volatile i32, ptr %335, align 4, !tbaa !11
  %337 = or i32 %336, 536870912
  store volatile i32 %337, ptr %335, align 4, !tbaa !11
  store i32 1, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %338

338:                                              ; preds = %333, %326, %312, %292, %272, %250, %210, %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
  %339 = load i32, ptr %6, align 4
  ret i32 %339
}

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

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

declare i32 @SDMMC_WriteFIFO(ptr noundef, 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 100, !7, i64 116, !7, i64 132}
!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}
!15 = !{!12, !10, i64 64}
!16 = !{!12, !10, i64 92}
!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

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

declare i32 @HAL_GetTick() local_unnamed_addr #1

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_CmdStopTransfer(ptr noundef) local_unnamed_addr #1

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

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

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

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

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

27:                                               ; preds = %19
  %28 = getelementptr inbounds i8, ptr %0, i64 72
  store volatile i32 3, ptr %15, align 8, !tbaa !13
  %29 = load ptr, ptr %0, align 8, !tbaa !15
  %30 = getelementptr inbounds i8, ptr %29, i64 44
  store volatile i32 0, ptr %30, align 4, !tbaa !16
  %31 = load i32, ptr %28, align 8, !tbaa !18
  %.not = icmp eq i32 %31, 1
  %32 = shl i32 %2, 9
  %spec.select = select i1 %.not, i32 %2, i32 %32
  %33 = tail call i32 @SDMMC_CmdBlockLength(ptr noundef %29, i32 noundef 512) #3
  %.not89 = icmp eq i32 %33, 0
  br i1 %.not89, label %39, label %34

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

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

51:                                               ; preds = %39
  store volatile i32 32, ptr %50, align 4, !tbaa !25
  %52 = call i32 @SDMMC_CmdWriteMultiBlock(ptr noundef nonnull %45, i32 noundef %spec.select) #3
  br label %55

53:                                               ; preds = %39
  store volatile i32 16, ptr %50, align 4, !tbaa !25
  %54 = call i32 @SDMMC_CmdWriteSingleBlock(ptr noundef nonnull %45, i32 noundef %spec.select) #3
  br label %55

55:                                               ; preds = %53, %51
  %.085 = phi i32 [ %52, %51 ], [ %54, %53 ]
  %.not90 = icmp eq i32 %.085, 0
  br i1 %.not90, label %.preheader98, label %56

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

.preheader98:                                     ; preds = %55, %.loopexit
  %.0 = phi ptr [ %.2, %.loopexit ], [ %1, %55 ]
  %61 = load ptr, ptr %0, align 8, !tbaa !15
  %62 = getelementptr inbounds i8, ptr %61, i64 52
  %63 = load volatile i32, ptr %62, align 4, !tbaa !26
  %64 = and i32 %63, 282
  %.not91 = icmp eq i32 %64, 0
  br i1 %.not91, label %65, label %233

65:                                               ; preds = %.preheader98
  %66 = load volatile i32, ptr %62, align 4, !tbaa !26
  %67 = and i32 %66, 16384
  %.not96 = icmp eq i32 %67, 0
  br i1 %.not96, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %65
  %68 = load i8, ptr %.0, align 1, !tbaa !27
  %69 = zext i8 %68 to i32
  store i32 %69, ptr %7, align 4, !tbaa !23
  %70 = getelementptr inbounds i8, ptr %.0, i64 1
  %71 = load i8, ptr %70, align 1, !tbaa !27
  %72 = zext i8 %71 to i32
  %73 = shl nuw nsw i32 %72, 8
  %74 = or disjoint i32 %73, %69
  store i32 %74, ptr %7, align 4, !tbaa !23
  %75 = getelementptr inbounds i8, ptr %.0, i64 2
  %76 = load i8, ptr %75, align 1, !tbaa !27
  %77 = zext i8 %76 to i32
  %78 = shl nuw nsw i32 %77, 16
  %79 = or disjoint i32 %78, %74
  store i32 %79, ptr %7, align 4, !tbaa !23
  %80 = getelementptr inbounds i8, ptr %.0, i64 3
  %81 = load i8, ptr %80, align 1, !tbaa !27
  %82 = zext i8 %81 to i32
  %83 = shl nuw i32 %82, 24
  %84 = or disjoint i32 %83, %79
  store i32 %84, ptr %7, align 4, !tbaa !23
  %85 = getelementptr inbounds i8, ptr %.0, i64 4
  %86 = call i32 @SDMMC_WriteFIFO(ptr noundef nonnull %61, ptr noundef nonnull %7) #3
  %87 = load i8, ptr %85, align 1, !tbaa !27
  %88 = zext i8 %87 to i32
  %89 = getelementptr inbounds i8, ptr %.0, i64 5
  %90 = load i8, ptr %89, align 1, !tbaa !27
  %91 = zext i8 %90 to i32
  %92 = shl nuw nsw i32 %91, 8
  %93 = or disjoint i32 %92, %88
  %94 = getelementptr inbounds i8, ptr %.0, i64 6
  %95 = load i8, ptr %94, align 1, !tbaa !27
  %96 = zext i8 %95 to i32
  %97 = shl nuw nsw i32 %96, 16
  %98 = or disjoint i32 %97, %93
  %99 = getelementptr inbounds i8, ptr %.0, i64 7
  %100 = load i8, ptr %99, align 1, !tbaa !27
  %101 = zext i8 %100 to i32
  %102 = shl nuw i32 %101, 24
  %103 = or disjoint i32 %102, %98
  store i32 %103, ptr %7, align 4, !tbaa !23
  %104 = getelementptr inbounds i8, ptr %.0, i64 8
  %105 = load ptr, ptr %0, align 8, !tbaa !15
  %106 = call i32 @SDMMC_WriteFIFO(ptr noundef %105, ptr noundef nonnull %7) #3
  %107 = load i8, ptr %104, align 1, !tbaa !27
  %108 = zext i8 %107 to i32
  %109 = getelementptr inbounds i8, ptr %.0, i64 9
  %110 = load i8, ptr %109, align 1, !tbaa !27
  %111 = zext i8 %110 to i32
  %112 = shl nuw nsw i32 %111, 8
  %113 = or disjoint i32 %112, %108
  %114 = getelementptr inbounds i8, ptr %.0, i64 10
  %115 = load i8, ptr %114, align 1, !tbaa !27
  %116 = zext i8 %115 to i32
  %117 = shl nuw nsw i32 %116, 16
  %118 = or disjoint i32 %117, %113
  %119 = getelementptr inbounds i8, ptr %.0, i64 11
  %120 = load i8, ptr %119, align 1, !tbaa !27
  %121 = zext i8 %120 to i32
  %122 = shl nuw i32 %121, 24
  %123 = or disjoint i32 %122, %118
  store i32 %123, ptr %7, align 4, !tbaa !23
  %124 = getelementptr inbounds i8, ptr %.0, i64 12
  %125 = load ptr, ptr %0, align 8, !tbaa !15
  %126 = call i32 @SDMMC_WriteFIFO(ptr noundef %125, ptr noundef nonnull %7) #3
  %127 = load i8, ptr %124, align 1, !tbaa !27
  %128 = zext i8 %127 to i32
  %129 = getelementptr inbounds i8, ptr %.0, i64 13
  %130 = load i8, ptr %129, align 1, !tbaa !27
  %131 = zext i8 %130 to i32
  %132 = shl nuw nsw i32 %131, 8
  %133 = or disjoint i32 %132, %128
  %134 = getelementptr inbounds i8, ptr %.0, i64 14
  %135 = load i8, ptr %134, align 1, !tbaa !27
  %136 = zext i8 %135 to i32
  %137 = shl nuw nsw i32 %136, 16
  %138 = or disjoint i32 %137, %133
  %139 = getelementptr inbounds i8, ptr %.0, i64 15
  %140 = load i8, ptr %139, align 1, !tbaa !27
  %141 = zext i8 %140 to i32
  %142 = shl nuw i32 %141, 24
  %143 = or disjoint i32 %142, %138
  store i32 %143, ptr %7, align 4, !tbaa !23
  %144 = getelementptr inbounds i8, ptr %.0, i64 16
  %145 = load ptr, ptr %0, align 8, !tbaa !15
  %146 = call i32 @SDMMC_WriteFIFO(ptr noundef %145, ptr noundef nonnull %7) #3
  %147 = load i8, ptr %144, align 1, !tbaa !27
  %148 = zext i8 %147 to i32
  %149 = getelementptr inbounds i8, ptr %.0, i64 17
  %150 = load i8, ptr %149, align 1, !tbaa !27
  %151 = zext i8 %150 to i32
  %152 = shl nuw nsw i32 %151, 8
  %153 = or disjoint i32 %152, %148
  %154 = getelementptr inbounds i8, ptr %.0, i64 18
  %155 = load i8, ptr %154, align 1, !tbaa !27
  %156 = zext i8 %155 to i32
  %157 = shl nuw nsw i32 %156, 16
  %158 = or disjoint i32 %157, %153
  %159 = getelementptr inbounds i8, ptr %.0, i64 19
  %160 = load i8, ptr %159, align 1, !tbaa !27
  %161 = zext i8 %160 to i32
  %162 = shl nuw i32 %161, 24
  %163 = or disjoint i32 %162, %158
  store i32 %163, ptr %7, align 4, !tbaa !23
  %164 = getelementptr inbounds i8, ptr %.0, i64 20
  %165 = load ptr, ptr %0, align 8, !tbaa !15
  %166 = call i32 @SDMMC_WriteFIFO(ptr noundef %165, ptr noundef nonnull %7) #3
  %167 = load i8, ptr %164, align 1, !tbaa !27
  %168 = zext i8 %167 to i32
  %169 = getelementptr inbounds i8, ptr %.0, i64 21
  %170 = load i8, ptr %169, align 1, !tbaa !27
  %171 = zext i8 %170 to i32
  %172 = shl nuw nsw i32 %171, 8
  %173 = or disjoint i32 %172, %168
  %174 = getelementptr inbounds i8, ptr %.0, i64 22
  %175 = load i8, ptr %174, align 1, !tbaa !27
  %176 = zext i8 %175 to i32
  %177 = shl nuw nsw i32 %176, 16
  %178 = or disjoint i32 %177, %173
  %179 = getelementptr inbounds i8, ptr %.0, i64 23
  %180 = load i8, ptr %179, align 1, !tbaa !27
  %181 = zext i8 %180 to i32
  %182 = shl nuw i32 %181, 24
  %183 = or disjoint i32 %182, %178
  store i32 %183, ptr %7, align 4, !tbaa !23
  %184 = getelementptr inbounds i8, ptr %.0, i64 24
  %185 = load ptr, ptr %0, align 8, !tbaa !15
  %186 = call i32 @SDMMC_WriteFIFO(ptr noundef %185, ptr noundef nonnull %7) #3
  %187 = load i8, ptr %184, align 1, !tbaa !27
  %188 = zext i8 %187 to i32
  %189 = getelementptr inbounds i8, ptr %.0, i64 25
  %190 = load i8, ptr %189, align 1, !tbaa !27
  %191 = zext i8 %190 to i32
  %192 = shl nuw nsw i32 %191, 8
  %193 = or disjoint i32 %192, %188
  %194 = getelementptr inbounds i8, ptr %.0, i64 26
  %195 = load i8, ptr %194, align 1, !tbaa !27
  %196 = zext i8 %195 to i32
  %197 = shl nuw nsw i32 %196, 16
  %198 = or disjoint i32 %197, %193
  %199 = getelementptr inbounds i8, ptr %.0, i64 27
  %200 = load i8, ptr %199, align 1, !tbaa !27
  %201 = zext i8 %200 to i32
  %202 = shl nuw i32 %201, 24
  %203 = or disjoint i32 %202, %198
  store i32 %203, ptr %7, align 4, !tbaa !23
  %204 = getelementptr inbounds i8, ptr %.0, i64 28
  %205 = load ptr, ptr %0, align 8, !tbaa !15
  %206 = call i32 @SDMMC_WriteFIFO(ptr noundef %205, ptr noundef nonnull %7) #3
  %207 = load i8, ptr %204, align 1, !tbaa !27
  %208 = zext i8 %207 to i32
  %209 = getelementptr inbounds i8, ptr %.0, i64 29
  %210 = load i8, ptr %209, align 1, !tbaa !27
  %211 = zext i8 %210 to i32
  %212 = shl nuw nsw i32 %211, 8
  %213 = or disjoint i32 %212, %208
  %214 = getelementptr inbounds i8, ptr %.0, i64 30
  %215 = load i8, ptr %214, align 1, !tbaa !27
  %216 = zext i8 %215 to i32
  %217 = shl nuw nsw i32 %216, 16
  %218 = or disjoint i32 %217, %213
  %219 = getelementptr inbounds i8, ptr %.0, i64 31
  %220 = load i8, ptr %219, align 1, !tbaa !27
  %221 = zext i8 %220 to i32
  %222 = shl nuw i32 %221, 24
  %223 = or disjoint i32 %222, %218
  store i32 %223, ptr %7, align 4, !tbaa !23
  %224 = getelementptr inbounds i8, ptr %.0, i64 32
  %225 = load ptr, ptr %0, align 8, !tbaa !15
  %226 = call i32 @SDMMC_WriteFIFO(ptr noundef %225, ptr noundef nonnull %7) #3
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader.preheader, %65
  %.2 = phi ptr [ %.0, %65 ], [ %224, %.preheader.preheader ]
  %227 = call i32 @HAL_GetTick() #3
  %228 = sub i32 %227, %8
  %.not97 = icmp ult i32 %228, %4
  br i1 %.not97, label %.preheader98, label %229, !llvm.loop !28

229:                                              ; preds = %.loopexit
  %230 = load ptr, ptr %0, align 8, !tbaa !15
  %231 = getelementptr inbounds i8, ptr %230, i64 56
  store volatile i32 534777855, ptr %231, align 4, !tbaa !19
  %232 = load volatile i32, ptr %18, align 4, !tbaa !5
  store volatile i32 %232, ptr %18, align 4, !tbaa !5
  store volatile i32 1, ptr %15, align 8, !tbaa !13
  br label %273

233:                                              ; preds = %.preheader98
  %234 = getelementptr inbounds i8, ptr %61, i64 12
  %235 = load volatile i32, ptr %234, align 4, !tbaa !24
  %236 = and i32 %235, -65
  store volatile i32 %236, ptr %234, align 4, !tbaa !24
  %237 = load volatile i32, ptr %62, align 4, !tbaa !26
  %238 = and i32 %237, 256
  %239 = icmp ne i32 %238, 0
  %or.cond3 = and i1 %49, %239
  br i1 %or.cond3, label %240, label %246

240:                                              ; preds = %233
  %241 = call i32 @SDMMC_CmdStopTransfer(ptr noundef nonnull %61) #3
  %.not92 = icmp eq i32 %241, 0
  %.pre = load ptr, ptr %0, align 8, !tbaa !15
  br i1 %.not92, label %246, label %242

242:                                              ; preds = %240
  %243 = getelementptr inbounds i8, ptr %.pre, i64 56
  store volatile i32 534777855, ptr %243, align 4, !tbaa !19
  %244 = load volatile i32, ptr %18, align 4, !tbaa !5
  %245 = or i32 %244, %241
  store volatile i32 %245, ptr %18, align 4, !tbaa !5
  store volatile i32 1, ptr %15, align 8, !tbaa !13
  br label %273

246:                                              ; preds = %240, %233
  %247 = phi ptr [ %.pre, %240 ], [ %61, %233 ]
  %248 = getelementptr inbounds i8, ptr %247, i64 52
  %249 = load volatile i32, ptr %248, align 4, !tbaa !26
  %250 = and i32 %249, 8
  %.not93 = icmp eq i32 %250, 0
  br i1 %.not93, label %255, label %251

251:                                              ; preds = %246
  %252 = getelementptr inbounds i8, ptr %247, i64 56
  store volatile i32 534777855, ptr %252, align 4, !tbaa !19
  %253 = load volatile i32, ptr %18, align 4, !tbaa !5
  %254 = or i32 %253, 8
  store volatile i32 %254, ptr %18, align 4, !tbaa !5
  store volatile i32 1, ptr %15, align 8, !tbaa !13
  br label %273

255:                                              ; preds = %246
  %256 = load volatile i32, ptr %248, align 4, !tbaa !26
  %257 = and i32 %256, 2
  %.not94 = icmp eq i32 %257, 0
  br i1 %.not94, label %262, label %258

258:                                              ; preds = %255
  %259 = getelementptr inbounds i8, ptr %247, i64 56
  store volatile i32 534777855, ptr %259, align 4, !tbaa !19
  %260 = load volatile i32, ptr %18, align 4, !tbaa !5
  %261 = or i32 %260, 2
  store volatile i32 %261, ptr %18, align 4, !tbaa !5
  store volatile i32 1, ptr %15, align 8, !tbaa !13
  br label %273

262:                                              ; preds = %255
  %263 = load volatile i32, ptr %248, align 4, !tbaa !26
  %264 = and i32 %263, 16
  %.not95 = icmp eq i32 %264, 0
  %265 = getelementptr inbounds i8, ptr %247, i64 56
  br i1 %.not95, label %269, label %266

266:                                              ; preds = %262
  store volatile i32 534777855, ptr %265, align 4, !tbaa !19
  %267 = load volatile i32, ptr %18, align 4, !tbaa !5
  %268 = or i32 %267, 16
  store volatile i32 %268, ptr %18, align 4, !tbaa !5
  store volatile i32 1, ptr %15, align 8, !tbaa !13
  br label %273

269:                                              ; preds = %262
  store volatile i32 402657082, ptr %265, align 4, !tbaa !19
  store volatile i32 1, ptr %15, align 8, !tbaa !13
  br label %273

270:                                              ; preds = %14
  %271 = load volatile i32, ptr %18, align 4, !tbaa !5
  %272 = or i32 %271, 536870912
  store volatile i32 %272, ptr %18, align 4, !tbaa !5
  br label %273

273:                                              ; preds = %270, %269, %266, %258, %251, %242, %229, %56, %34, %24, %10
  %.084 = phi i32 [ 1, %10 ], [ 1, %24 ], [ 1, %34 ], [ 1, %56 ], [ 3, %229 ], [ 1, %242 ], [ 1, %251 ], [ 1, %258 ], [ 1, %266 ], [ 0, %269 ], [ 1, %270 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  ret i32 %.084
}

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

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

declare i32 @SDMMC_WriteFIFO(ptr noundef, 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 100, !8, i64 116, !8, i64 132}
!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}
!13 = !{!6, !11, i64 64}
!14 = !{!6, !11, i64 92}
!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,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass