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

; 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 @SDMMC_CmdBlockLength(ptr noundef, i32 noundef) #1

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

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

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

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

17:                                               ; preds = %4
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %18, i32 0, i32 9
  %20 = load volatile i32, ptr %19, align 4, !tbaa !11
  %21 = or i32 %20, 134217728
  store volatile i32 %21, ptr %19, align 4, !tbaa !11
  store i32 1, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %166

22:                                               ; preds = %4
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %23, i32 0, i32 8
  %25 = load volatile i32, ptr %24, align 8, !tbaa !15
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %27, label %165

27:                                               ; preds = %22
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %28, i32 0, i32 9
  store volatile i32 0, ptr %29, align 4, !tbaa !11
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = add i32 %30, %31
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %33, i32 0, i32 10
  %35 = getelementptr inbounds %struct.HAL_MMC_CardInfoTypeDef, ptr %34, i32 0, i32 5
  %36 = load i32, ptr %35, align 4, !tbaa !16
  %37 = icmp ugt i32 %32, %36
  br i1 %37, label %38, label %43

38:                                               ; preds = %27
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %39, i32 0, i32 9
  %41 = load volatile i32, ptr %40, align 4, !tbaa !11
  %42 = or i32 %41, 33554432
  store volatile i32 %42, ptr %40, align 4, !tbaa !11
  store i32 1, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %166

43:                                               ; preds = %27
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %44, i32 0, i32 8
  store volatile i32 3, ptr %45, align 8, !tbaa !15
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !17
  %49 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %48, i32 0, i32 11
  store volatile i32 0, ptr %49, align 4, !tbaa !18
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %51, i32 0, i32 3
  store ptr %50, ptr %52, align 8, !tbaa !20
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = mul i32 512, %53
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %55, i32 0, i32 4
  store i32 %54, ptr %56, align 8, !tbaa !21
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %57, i32 0, i32 10
  %59 = getelementptr inbounds %struct.HAL_MMC_CardInfoTypeDef, ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 8, !tbaa !22
  %61 = icmp ne i32 %60, 1
  br i1 %61, label %62, label %65

62:                                               ; preds = %43
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = mul i32 %63, 512
  store i32 %64, ptr %12, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %62, %43
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = call i32 @SDMMC_CmdBlockLength(ptr noundef %68, i32 noundef 512)
  store i32 %69, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %84

72:                                               ; preds = %65
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !17
  %76 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %75, i32 0, i32 14
  store volatile i32 534777855, ptr %76, align 4, !tbaa !23
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %78, i32 0, i32 9
  %80 = load volatile i32, ptr %79, align 4, !tbaa !11
  %81 = or i32 %80, %77
  store volatile i32 %81, ptr %79, align 4, !tbaa !11
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %82, i32 0, i32 8
  store volatile i32 1, ptr %83, align 8, !tbaa !15
  store i32 1, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %166

84:                                               ; preds = %65
  %85 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %10, i32 0, i32 0
  store i32 -1, ptr %85, align 4, !tbaa !24
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = mul i32 512, %86
  %88 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %10, i32 0, i32 1
  store i32 %87, ptr %88, align 4, !tbaa !26
  %89 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %10, i32 0, i32 2
  store i32 144, ptr %89, align 4, !tbaa !27
  %90 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %10, i32 0, i32 3
  store i32 0, ptr %90, align 4, !tbaa !28
  %91 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %10, i32 0, i32 4
  store i32 0, ptr %91, align 4, !tbaa !29
  %92 = getelementptr inbounds %struct.SDMMC_DataInitTypeDef, ptr %10, i32 0, i32 5
  store i32 0, ptr %92, align 4, !tbaa !30
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !17
  %96 = call i32 @SDMMC_ConfigData(ptr noundef %95, ptr noundef %10)
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !17
  %100 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %99, i32 0, i32 15
  %101 = load volatile i32, ptr %100, align 4, !tbaa !31
  %102 = zext i32 %101 to i64
  %103 = or i64 %102, 282
  %104 = trunc i64 %103 to i32
  store volatile i32 %104, ptr %100, align 4, !tbaa !31
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !17
  %108 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %107, i32 0, i32 3
  %109 = load volatile i32, ptr %108, align 4, !tbaa !32
  %110 = zext i32 %109 to i64
  %111 = or i64 %110, 64
  %112 = trunc i64 %111 to i32
  store volatile i32 %112, ptr %108, align 4, !tbaa !32
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = ptrtoint ptr %113 to i32
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !17
  %118 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %117, i32 0, i32 20
  store volatile i32 %114, ptr %118, align 4, !tbaa !33
  %119 = load ptr, ptr %6, 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 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %121, i32 0, i32 18
  store volatile i32 1, ptr %122, align 4, !tbaa !34
  %123 = load i32, ptr %9, align 4, !tbaa !9
  %124 = icmp ugt i32 %123, 1
  br i1 %124, label %125, label %133

125:                                              ; preds = %84
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %126, i32 0, i32 7
  store volatile i32 160, ptr %127, align 4, !tbaa !35
  %128 = load ptr, ptr %6, 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 = load i32, ptr %12, align 4, !tbaa !9
  %132 = call i32 @SDMMC_CmdWriteMultiBlock(ptr noundef %130, i32 noundef %131)
  store i32 %132, ptr %11, align 4, !tbaa !9
  br label %141

133:                                              ; preds = %84
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %134, i32 0, i32 7
  store volatile i32 144, ptr %135, align 4, !tbaa !35
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !17
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = call i32 @SDMMC_CmdWriteSingleBlock(ptr noundef %138, i32 noundef %139)
  store i32 %140, ptr %11, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %133, %125
  %142 = load i32, ptr %11, align 4, !tbaa !9
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %164

144:                                              ; preds = %141
  %145 = load ptr, ptr %6, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !17
  %148 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %147, i32 0, i32 14
  store volatile i32 534777855, ptr %148, align 4, !tbaa !23
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %149, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !17
  %152 = getelementptr inbounds %struct.SDMMC_TypeDef, ptr %151, i32 0, i32 15
  %153 = load volatile i32, ptr %152, align 4, !tbaa !31
  %154 = zext i32 %153 to i64
  %155 = and i64 %154, -283
  %156 = trunc i64 %155 to i32
  store volatile i32 %156, ptr %152, align 4, !tbaa !31
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %158, i32 0, i32 9
  %160 = load volatile i32, ptr %159, align 4, !tbaa !11
  %161 = or i32 %160, %157
  store volatile i32 %161, ptr %159, align 4, !tbaa !11
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.MMC_HandleTypeDef, ptr %162, i32 0, i32 8
  store volatile i32 1, ptr %163, align 8, !tbaa !15
  store i32 1, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %166

164:                                              ; preds = %141
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %166

165:                                              ; preds = %22
  store i32 2, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %166

166:                                              ; preds = %165, %164, %144, %72, %38, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #3
  %167 = load i32, ptr %5, align 4
  ret i32 %167
}

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, !6, i64 32}
!21 = !{!12, !10, i64 40}
!22 = !{!12, !10, i64 72}
!23 = !{!19, !10, i64 56}
!24 = !{!25, !10, i64 0}
!25 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!26 = !{!25, !10, i64 4}
!27 = !{!25, !10, i64 8}
!28 = !{!25, !10, i64 12}
!29 = !{!25, !10, i64 16}
!30 = !{!25, !10, i64 20}
!31 = !{!19, !10, i64 60}
!32 = !{!19, !10, i64 12}
!33 = !{!19, !10, i64 88}
!34 = !{!19, !10, i64 80}
!35 = !{!12, !10, i64 60}


; 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 @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_CmdWriteMultiBlock(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

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

11:                                               ; preds = %4
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = load volatile i32, ptr %12, align 8, !tbaa !13
  %14 = icmp eq i32 %13, 1
  br i1 %14, label %15, label %70

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

21:                                               ; preds = %15
  %22 = load volatile i32, ptr %16, align 4, !tbaa !5
  %23 = or i32 %22, 33554432
  store volatile i32 %23, ptr %16, align 4, !tbaa !5
  br label %70

24:                                               ; preds = %15
  %25 = getelementptr inbounds i8, ptr %0, i64 72
  store volatile i32 3, ptr %12, align 8, !tbaa !13
  %26 = load ptr, ptr %0, align 8, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %26, i64 44
  store volatile i32 0, ptr %27, align 4, !tbaa !16
  %28 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %1, ptr %28, align 8, !tbaa !18
  %29 = shl i32 %3, 9
  %30 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %29, ptr %30, align 8, !tbaa !19
  %31 = load i32, ptr %25, align 8, !tbaa !20
  %.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 %26, i32 noundef 512) #3
  %.not47 = icmp eq i32 %33, 0
  br i1 %.not47, label %39, label %34

34:                                               ; preds = %24
  %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 !21
  %37 = load volatile i32, ptr %16, align 4, !tbaa !5
  %38 = or i32 %37, %33
  store volatile i32 %38, ptr %16, align 4, !tbaa !5
  store volatile i32 1, ptr %12, align 8, !tbaa !13
  br label %70

39:                                               ; preds = %24
  store i32 -1, ptr %5, align 4, !tbaa !22
  %40 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %29, ptr %40, align 4, !tbaa !24
  %41 = getelementptr inbounds i8, ptr %5, i64 8
  store <4 x i32> <i32 144, i32 0, i32 0, i32 0>, ptr %41, align 4, !tbaa !25
  %42 = load ptr, ptr %0, align 8, !tbaa !15
  %43 = call i32 @SDMMC_ConfigData(ptr noundef %42, ptr noundef nonnull %5) #3
  %44 = load ptr, ptr %0, align 8, !tbaa !15
  %45 = getelementptr inbounds i8, ptr %44, i64 60
  %46 = load volatile i32, ptr %45, align 4, !tbaa !26
  %47 = or i32 %46, 282
  store volatile i32 %47, ptr %45, align 4, !tbaa !26
  %48 = getelementptr inbounds i8, ptr %44, i64 12
  %49 = load volatile i32, ptr %48, align 4, !tbaa !27
  %50 = or i32 %49, 64
  store volatile i32 %50, ptr %48, align 4, !tbaa !27
  %51 = ptrtoint ptr %1 to i64
  %52 = trunc i64 %51 to i32
  %53 = getelementptr inbounds i8, ptr %44, i64 88
  store volatile i32 %52, ptr %53, align 4, !tbaa !28
  %54 = getelementptr inbounds i8, ptr %44, i64 80
  store volatile i32 1, ptr %54, align 4, !tbaa !29
  %55 = icmp ugt i32 %3, 1
  %56 = getelementptr inbounds i8, ptr %0, i64 60
  br i1 %55, label %57, label %59

57:                                               ; preds = %39
  store volatile i32 160, ptr %56, align 4, !tbaa !30
  %58 = call i32 @SDMMC_CmdWriteMultiBlock(ptr noundef nonnull %44, i32 noundef %spec.select) #3
  br label %61

59:                                               ; preds = %39
  store volatile i32 144, ptr %56, align 4, !tbaa !30
  %60 = call i32 @SDMMC_CmdWriteSingleBlock(ptr noundef nonnull %44, i32 noundef %spec.select) #3
  br label %61

61:                                               ; preds = %59, %57
  %.043 = phi i32 [ %58, %57 ], [ %60, %59 ]
  %.not48 = icmp eq i32 %.043, 0
  br i1 %.not48, label %70, label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %0, align 8, !tbaa !15
  %64 = getelementptr inbounds i8, ptr %63, i64 56
  store volatile i32 534777855, ptr %64, align 4, !tbaa !21
  %65 = getelementptr inbounds i8, ptr %63, i64 60
  %66 = load volatile i32, ptr %65, align 4, !tbaa !26
  %67 = and i32 %66, -283
  store volatile i32 %67, ptr %65, align 4, !tbaa !26
  %68 = load volatile i32, ptr %16, align 4, !tbaa !5
  %69 = or i32 %68, %.043
  store volatile i32 %69, ptr %16, align 4, !tbaa !5
  store volatile i32 1, ptr %12, align 8, !tbaa !13
  br label %70

70:                                               ; preds = %11, %61, %62, %34, %21, %7
  %.044 = phi i32 [ 1, %7 ], [ 1, %21 ], [ 1, %34 ], [ 1, %62 ], [ 0, %61 ], [ 2, %11 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  ret i32 %.044
}

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, !7, i64 32}
!19 = !{!6, !11, i64 40}
!20 = !{!6, !11, i64 72}
!21 = !{!17, !11, i64 56}
!22 = !{!23, !11, i64 0}
!23 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!24 = !{!23, !11, i64 4}
!25 = !{!11, !11, i64 0}
!26 = !{!17, !11, i64 60}
!27 = !{!17, !11, i64 12}
!28 = !{!17, !11, i64 88}
!29 = !{!17, !11, i64 80}
!30 = !{!6, !11, i64 60}


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