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

; 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.__SPI_HandleTypeDef = type { ptr, %struct.SPI_InitTypeDef, ptr, i16, i16, ptr, i16, i16, i32, ptr, ptr, ptr, ptr, i32, i32, i32 }
%struct.SPI_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SPI_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], i32, [3 x i32], i32, i32, i32, i32, i32 }
%struct.__DMA_HandleTypeDef = type { ptr, %struct.DMA_InitTypeDef, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32, ptr, ptr, i32 }
%struct.DMA_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@SystemCoreClock = external global i32, align 4

; 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

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_SPI_Abort(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  br label %7

7:                                                ; preds = %1
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %8, i32 0, i32 13
  %10 = load i32, ptr %9, align 8, !tbaa !9
  %11 = icmp eq i32 %10, 1
  br i1 %11, label %12, label %13

12:                                               ; preds = %7
  store i32 2, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %160

13:                                               ; preds = %7
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %14, i32 0, i32 13
  store i32 1, ptr %15, align 8, !tbaa !9
  br label %16

16:                                               ; preds = %13
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %19, i32 0, i32 14
  store volatile i32 7, ptr %20, align 4, !tbaa !14
  store i32 0, ptr %4, align 4, !tbaa !15
  %21 = load i32, ptr @SystemCoreClock, align 4, !tbaa !15
  %22 = zext i32 %21 to i64
  %23 = udiv i64 %22, 24
  %24 = udiv i64 %23, 1000
  %25 = mul i64 100, %24
  %26 = trunc i64 %25 to i32
  store volatile i32 %26, ptr %5, align 4, !tbaa !15
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds %struct.SPI_TypeDef, ptr %29, i32 0, i32 0
  %31 = load volatile i32, ptr %30, align 4, !tbaa !17
  %32 = zext i32 %31 to i64
  %33 = and i64 %32, 512
  %34 = icmp eq i64 %33, 512
  br i1 %34, label %35, label %68

35:                                               ; preds = %18
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  %39 = getelementptr inbounds %struct.SPI_TypeDef, ptr %38, i32 0, i32 0
  %40 = load volatile i32, ptr %39, align 4, !tbaa !17
  %41 = zext i32 %40 to i64
  %42 = or i64 %41, 1024
  %43 = trunc i64 %42 to i32
  store volatile i32 %43, ptr %39, align 4, !tbaa !17
  br label %44

44:                                               ; preds = %58, %35
  %45 = load volatile i32, ptr %5, align 4, !tbaa !15
  %46 = add i32 %45, -1
  store volatile i32 %46, ptr %5, align 4, !tbaa !15
  %47 = load volatile i32, ptr %5, align 4, !tbaa !15
  %48 = zext i32 %47 to i64
  %49 = icmp eq i64 %48, 0
  br i1 %49, label %50, label %57

50:                                               ; preds = %44
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %51, i32 0, i32 15
  %53 = load volatile i32, ptr %52, align 8, !tbaa !19
  %54 = zext i32 %53 to i64
  %55 = or i64 %54, 64
  %56 = trunc i64 %55 to i32
  store volatile i32 %56, ptr %52, align 8, !tbaa !19
  br label %67

57:                                               ; preds = %44
  br label %58

58:                                               ; preds = %57
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !16
  %62 = getelementptr inbounds %struct.SPI_TypeDef, ptr %61, i32 0, i32 0
  %63 = load volatile i32, ptr %62, align 4, !tbaa !17
  %64 = zext i32 %63 to i64
  %65 = and i64 %64, 512
  %66 = icmp eq i64 %65, 512
  br i1 %66, label %44, label %67, !llvm.loop !20

67:                                               ; preds = %58, %50
  br label %68

68:                                               ; preds = %67, %18
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  %72 = getelementptr inbounds %struct.SPI_TypeDef, ptr %71, i32 0, i32 2
  %73 = load volatile i32, ptr %72, align 4, !tbaa !22
  %74 = zext i32 %73 to i64
  %75 = and i64 %74, 32768
  %76 = icmp eq i64 %75, 32768
  br i1 %76, label %77, label %104

77:                                               ; preds = %68
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %78, i32 0, i32 11
  %80 = load ptr, ptr %79, align 8, !tbaa !23
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %103

82:                                               ; preds = %77
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %83, i32 0, i32 11
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %86 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %85, i32 0, i32 10
  store ptr null, ptr %86, align 8, !tbaa !24
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %87, i32 0, i32 11
  %89 = load ptr, ptr %88, align 8, !tbaa !23
  %90 = call i32 @HAL_DMA_Abort(ptr noundef %89)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %102

92:                                               ; preds = %82
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %93, i32 0, i32 11
  %95 = load ptr, ptr %94, align 8, !tbaa !23
  %96 = call i32 @HAL_DMA_GetError(ptr noundef %95)
  %97 = icmp eq i32 %96, 32
  br i1 %97, label %98, label %101

98:                                               ; preds = %92
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %99, i32 0, i32 15
  store volatile i32 64, ptr %100, align 8, !tbaa !19
  br label %101

101:                                              ; preds = %98, %92
  br label %102

102:                                              ; preds = %101, %82
  br label %103

103:                                              ; preds = %102, %77
  br label %104

104:                                              ; preds = %103, %68
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !16
  %108 = getelementptr inbounds %struct.SPI_TypeDef, ptr %107, i32 0, i32 2
  %109 = load volatile i32, ptr %108, align 4, !tbaa !22
  %110 = zext i32 %109 to i64
  %111 = and i64 %110, 16384
  %112 = icmp eq i64 %111, 16384
  br i1 %112, label %113, label %140

113:                                              ; preds = %104
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %114, i32 0, i32 12
  %116 = load ptr, ptr %115, align 8, !tbaa !27
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %139

118:                                              ; preds = %113
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %119, i32 0, i32 12
  %121 = load ptr, ptr %120, align 8, !tbaa !27
  %122 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %121, i32 0, i32 10
  store ptr null, ptr %122, align 8, !tbaa !24
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %123, i32 0, i32 12
  %125 = load ptr, ptr %124, align 8, !tbaa !27
  %126 = call i32 @HAL_DMA_Abort(ptr noundef %125)
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %138

128:                                              ; preds = %118
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %129, i32 0, i32 12
  %131 = load ptr, ptr %130, align 8, !tbaa !27
  %132 = call i32 @HAL_DMA_GetError(ptr noundef %131)
  %133 = icmp eq i32 %132, 32
  br i1 %133, label %134, label %137

134:                                              ; preds = %128
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %135, i32 0, i32 15
  store volatile i32 64, ptr %136, align 8, !tbaa !19
  br label %137

137:                                              ; preds = %134, %128
  br label %138

138:                                              ; preds = %137, %118
  br label %139

139:                                              ; preds = %138, %113
  br label %140

140:                                              ; preds = %139, %104
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  call void @SPI_AbortTransfer(ptr noundef %141)
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %142, i32 0, i32 15
  %144 = load volatile i32, ptr %143, align 8, !tbaa !19
  %145 = zext i32 %144 to i64
  %146 = icmp eq i64 %145, 64
  br i1 %146, label %147, label %148

147:                                              ; preds = %140
  store i32 1, ptr %4, align 4, !tbaa !15
  br label %151

148:                                              ; preds = %140
  %149 = load ptr, ptr %3, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %149, i32 0, i32 15
  store volatile i32 0, ptr %150, align 8, !tbaa !19
  br label %151

151:                                              ; preds = %148, %147
  br label %152

152:                                              ; preds = %151
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %153, i32 0, i32 13
  store i32 0, ptr %154, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %152
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %157, i32 0, i32 14
  store volatile i32 1, ptr %158, align 4, !tbaa !14
  %159 = load i32, ptr %4, align 4, !tbaa !15
  store i32 %159, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %160

160:                                              ; preds = %156, %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %161 = load i32, ptr %2, align 4
  ret i32 %161
}

declare i32 @HAL_DMA_Abort(ptr noundef) #2

declare i32 @HAL_DMA_GetError(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @SPI_AbortTransfer(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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, !12, i64 160}
!10 = !{!"__SPI_HandleTypeDef", !6, i64 0, !11, i64 8, !6, i64 96, !13, i64 104, !13, i64 106, !6, i64 112, !13, i64 120, !13, i64 122, !12, i64 124, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !12, i64 160, !12, i64 164, !12, i64 168}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !12, i64 164}
!15 = !{!12, !12, i64 0}
!16 = !{!10, !6, i64 0}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !7, i64 36, !12, i64 48, !7, i64 52, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80}
!19 = !{!10, !12, i64 168}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!18, !12, i64 8}
!23 = !{!10, !6, i64 144}
!24 = !{!25, !6, i64 112}
!25 = !{!"__DMA_HandleTypeDef", !6, i64 0, !26, i64 8, !12, i64 56, !12, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !12, i64 124, !12, i64 128, !6, i64 136, !6, i64 144, !12, i64 152, !6, i64 160, !6, i64 168, !12, i64 176}
!26 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44}
!27 = !{!10, !6, i64 152}


; 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"

@SystemCoreClock = external local_unnamed_addr global i32, align 4

; 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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @HAL_SPI_Abort(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2)
  %3 = getelementptr inbounds i8, ptr %0, i64 160
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = icmp eq i32 %4, 1
  br i1 %5, label %64, label %6

6:                                                ; preds = %1
  store i32 1, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 164
  store volatile i32 7, ptr %7, align 4, !tbaa !13
  %8 = load i32, ptr @SystemCoreClock, align 4, !tbaa !14
  %9 = udiv i32 %8, 24000
  %narrow = mul nuw nsw i32 %9, 100
  store volatile i32 %narrow, ptr %2, align 4, !tbaa !14
  %10 = load ptr, ptr %0, align 8, !tbaa !15
  %11 = load volatile i32, ptr %10, align 4, !tbaa !16
  %12 = and i32 %11, 512
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %.loopexit, label %13

13:                                               ; preds = %6
  %14 = load volatile i32, ptr %10, align 4, !tbaa !16
  %15 = or i32 %14, 1024
  store volatile i32 %15, ptr %10, align 4, !tbaa !16
  br label %16

16:                                               ; preds = %23, %13
  %.0..0..0..0. = load volatile i32, ptr %2, align 4, !tbaa !14
  %17 = add i32 %.0..0..0..0., -1
  store volatile i32 %17, ptr %2, align 4, !tbaa !14
  %.0..0..0..0.1 = load volatile i32, ptr %2, align 4, !tbaa !14
  %18 = icmp eq i32 %.0..0..0..0.1, 0
  br i1 %18, label %19, label %23

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %0, i64 168
  %21 = load volatile i32, ptr %20, align 8, !tbaa !18
  %22 = or i32 %21, 64
  store volatile i32 %22, ptr %20, align 8, !tbaa !18
  br label %.loopexit

23:                                               ; preds = %16
  %24 = load volatile i32, ptr %10, align 4, !tbaa !16
  %25 = and i32 %24, 512
  %.not30 = icmp eq i32 %25, 0
  br i1 %.not30, label %.loopexit, label %16, !llvm.loop !19

.loopexit:                                        ; preds = %23, %19, %6
  %26 = getelementptr inbounds i8, ptr %10, i64 8
  %27 = load volatile i32, ptr %26, align 4, !tbaa !21
  %28 = and i32 %27, 32768
  %.not31 = icmp eq i32 %28, 0
  br i1 %.not31, label %41, label %29

29:                                               ; preds = %.loopexit
  %30 = getelementptr inbounds i8, ptr %0, i64 144
  %31 = load ptr, ptr %30, align 8, !tbaa !22
  %.not32 = icmp eq ptr %31, null
  br i1 %.not32, label %41, label %32

32:                                               ; preds = %29
  %33 = getelementptr inbounds i8, ptr %31, i64 112
  store ptr null, ptr %33, align 8, !tbaa !23
  %34 = tail call i32 @HAL_DMA_Abort(ptr noundef nonnull %31) #3
  %.not33 = icmp eq i32 %34, 0
  br i1 %.not33, label %41, label %35

35:                                               ; preds = %32
  %36 = load ptr, ptr %30, align 8, !tbaa !22
  %37 = tail call i32 @HAL_DMA_GetError(ptr noundef %36) #3
  %38 = icmp eq i32 %37, 32
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %0, i64 168
  store volatile i32 64, ptr %40, align 8, !tbaa !18
  br label %41

41:                                               ; preds = %29, %35, %39, %32, %.loopexit
  %42 = load ptr, ptr %0, align 8, !tbaa !15
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load volatile i32, ptr %43, align 4, !tbaa !21
  %45 = and i32 %44, 16384
  %.not34 = icmp eq i32 %45, 0
  br i1 %.not34, label %58, label %46

46:                                               ; preds = %41
  %47 = getelementptr inbounds i8, ptr %0, i64 152
  %48 = load ptr, ptr %47, align 8, !tbaa !26
  %.not35 = icmp eq ptr %48, null
  br i1 %.not35, label %58, label %49

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %48, i64 112
  store ptr null, ptr %50, align 8, !tbaa !23
  %51 = tail call i32 @HAL_DMA_Abort(ptr noundef nonnull %48) #3
  %.not36 = icmp eq i32 %51, 0
  br i1 %.not36, label %58, label %52

52:                                               ; preds = %49
  %53 = load ptr, ptr %47, align 8, !tbaa !26
  %54 = tail call i32 @HAL_DMA_GetError(ptr noundef %53) #3
  %55 = icmp eq i32 %54, 32
  br i1 %55, label %56, label %58

56:                                               ; preds = %52
  %57 = getelementptr inbounds i8, ptr %0, i64 168
  store volatile i32 64, ptr %57, align 8, !tbaa !18
  br label %58

58:                                               ; preds = %46, %52, %56, %49, %41
  tail call void @SPI_AbortTransfer(ptr noundef nonnull %0)
  %59 = getelementptr inbounds i8, ptr %0, i64 168
  %60 = load volatile i32, ptr %59, align 8, !tbaa !18
  %61 = icmp eq i32 %60, 64
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store volatile i32 0, ptr %59, align 8, !tbaa !18
  br label %63

63:                                               ; preds = %58, %62
  %.0 = phi i32 [ 0, %62 ], [ 1, %58 ]
  store i32 0, ptr %3, align 8, !tbaa !5
  store volatile i32 1, ptr %7, align 4, !tbaa !13
  br label %64

64:                                               ; preds = %1, %63
  %.027 = phi i32 [ %.0, %63 ], [ 2, %1 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2)
  ret i32 %.027
}

declare i32 @HAL_DMA_Abort(ptr noundef) local_unnamed_addr #2

declare i32 @HAL_DMA_GetError(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @SPI_AbortTransfer(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 160}
!6 = !{!"__SPI_HandleTypeDef", !7, i64 0, !10, i64 8, !7, i64 96, !12, i64 104, !12, i64 106, !7, i64 112, !12, i64 120, !12, i64 122, !11, i64 124, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !11, i64 160, !11, i64 164, !11, i64 168}
!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, 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, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84}
!11 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !11, i64 164}
!14 = !{!11, !11, i64 0}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !11, i64 0}
!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, !8, i64 36, !11, i64 48, !8, i64 52, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80}
!18 = !{!6, !11, i64 168}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!17, !11, i64 8}
!22 = !{!6, !7, i64 144}
!23 = !{!24, !7, i64 112}
!24 = !{!"__DMA_HandleTypeDef", !7, i64 0, !25, i64 8, !11, i64 56, !11, i64 60, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !11, i64 120, !11, i64 124, !11, i64 128, !7, i64 136, !7, i64 144, !11, i64 152, !7, i64 160, !7, i64 168, !11, i64 176}
!25 = !{!"", !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}
!26 = !{!6, !7, i64 152}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass