; 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.__USART_HandleTypeDef = type { ptr, %struct.USART_InitTypeDef, ptr, i16, i16, ptr, i16, i16, i16, i16, i16, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32 }
%struct.USART_InitTypeDef = type { i32, i32, i32, 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 }
%struct.USART_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, 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

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

declare i32 @HAL_DMA_Start_IT(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_USART_Receive_DMA(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i16 %2, ptr %7, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store ptr %6, ptr %9, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %11, i32 0, i32 18
  %13 = load volatile i32, ptr %12, align 4, !tbaa !13
  %14 = icmp eq i32 %13, 1
  br i1 %14, label %15, label %184

15:                                               ; preds = %3
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %22, label %18

18:                                               ; preds = %15
  %19 = load i16, ptr %7, align 2, !tbaa !9
  %20 = zext i16 %19 to i32
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %18, %15
  store i32 1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %185

23:                                               ; preds = %18
  br label %24

24:                                               ; preds = %23
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %25, i32 0, i32 17
  %27 = load i32, ptr %26, align 8, !tbaa !16
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %29, label %30

29:                                               ; preds = %24
  store i32 2, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %185

30:                                               ; preds = %24
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %31, i32 0, i32 17
  store i32 1, ptr %32, align 8, !tbaa !16
  br label %33

33:                                               ; preds = %30
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %37, i32 0, i32 5
  store ptr %36, ptr %38, align 8, !tbaa !17
  %39 = load i16, ptr %7, align 2, !tbaa !9
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %40, i32 0, i32 6
  store i16 %39, ptr %41, align 8, !tbaa !18
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %43, i32 0, i32 2
  store ptr %42, ptr %44, align 8, !tbaa !19
  %45 = load i16, ptr %7, align 2, !tbaa !9
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %46, i32 0, i32 3
  store i16 %45, ptr %47, align 8, !tbaa !20
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %48, i32 0, i32 19
  store volatile i32 0, ptr %49, align 8, !tbaa !21
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %50, i32 0, i32 18
  store volatile i32 34, ptr %51, align 4, !tbaa !13
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %52, i32 0, i32 16
  %54 = load ptr, ptr %53, align 8, !tbaa !22
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %82

56:                                               ; preds = %35
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %57, i32 0, i32 16
  %59 = load ptr, ptr %58, align 8, !tbaa !22
  %60 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %59, i32 0, i32 5
  store ptr @USART_DMAReceiveCplt, ptr %60, align 8, !tbaa !23
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %61, i32 0, i32 16
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  %64 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %63, i32 0, i32 6
  store ptr @USART_DMARxHalfCplt, ptr %64, align 8, !tbaa !26
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %65, i32 0, i32 16
  %67 = load ptr, ptr %66, align 8, !tbaa !22
  %68 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %67, i32 0, i32 9
  store ptr @USART_DMAError, ptr %68, align 8, !tbaa !27
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %69, i32 0, i32 16
  %71 = load ptr, ptr %70, align 8, !tbaa !22
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !28
  %75 = getelementptr inbounds %struct.USART_TypeDef, ptr %74, i32 0, i32 9
  %76 = ptrtoint ptr %75 to i32
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = load i32, ptr %77, align 4, !tbaa !11
  %79 = load i16, ptr %7, align 2, !tbaa !9
  %80 = zext i16 %79 to i32
  %81 = call i32 @HAL_DMA_Start_IT(ptr noundef %71, i32 noundef %76, i32 noundef %78, i32 noundef %80)
  store i32 %81, ptr %8, align 4, !tbaa !11
  br label %82

82:                                               ; preds = %56, %35
  %83 = load i32, ptr %8, align 4, !tbaa !11
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %122

85:                                               ; preds = %82
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %86, i32 0, i32 11
  %88 = load i32, ptr %87, align 4, !tbaa !29
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %122

90:                                               ; preds = %85
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %91, i32 0, i32 15
  %93 = load ptr, ptr %92, align 8, !tbaa !30
  %94 = icmp ne ptr %93, null
  br i1 %94, label %95, label %121

95:                                               ; preds = %90
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %96, i32 0, i32 15
  %98 = load ptr, ptr %97, align 8, !tbaa !30
  %99 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %98, i32 0, i32 9
  store ptr null, ptr %99, align 8, !tbaa !27
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %100, i32 0, i32 15
  %102 = load ptr, ptr %101, align 8, !tbaa !30
  %103 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %102, i32 0, i32 6
  store ptr null, ptr %103, align 8, !tbaa !26
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %104, i32 0, i32 15
  %106 = load ptr, ptr %105, align 8, !tbaa !30
  %107 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %106, i32 0, i32 5
  store ptr null, ptr %107, align 8, !tbaa !23
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %108, i32 0, i32 15
  %110 = load ptr, ptr %109, align 8, !tbaa !30
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load i32, ptr %111, align 4, !tbaa !11
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !28
  %116 = getelementptr inbounds %struct.USART_TypeDef, ptr %115, i32 0, i32 10
  %117 = ptrtoint ptr %116 to i32
  %118 = load i16, ptr %7, align 2, !tbaa !9
  %119 = zext i16 %118 to i32
  %120 = call i32 @HAL_DMA_Start_IT(ptr noundef %110, i32 noundef %112, i32 noundef %117, i32 noundef %119)
  store i32 %120, ptr %8, align 4, !tbaa !11
  br label %121

121:                                              ; preds = %95, %90
  br label %122

122:                                              ; preds = %121, %85, %82
  %123 = load i32, ptr %8, align 4, !tbaa !11
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %163

125:                                              ; preds = %122
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %127, i32 0, i32 17
  store i32 0, ptr %128, align 8, !tbaa !16
  br label %129

129:                                              ; preds = %126
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !28
  %134 = getelementptr inbounds %struct.USART_TypeDef, ptr %133, i32 0, i32 0
  %135 = load volatile i32, ptr %134, align 4, !tbaa !31
  %136 = zext i32 %135 to i64
  %137 = or i64 %136, 256
  %138 = trunc i64 %137 to i32
  store volatile i32 %138, ptr %134, align 4, !tbaa !31
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !28
  %142 = getelementptr inbounds %struct.USART_TypeDef, ptr %141, i32 0, i32 2
  %143 = load volatile i32, ptr %142, align 4, !tbaa !32
  %144 = zext i32 %143 to i64
  %145 = or i64 %144, 1
  %146 = trunc i64 %145 to i32
  store volatile i32 %146, ptr %142, align 4, !tbaa !32
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !28
  %150 = getelementptr inbounds %struct.USART_TypeDef, ptr %149, i32 0, i32 2
  %151 = load volatile i32, ptr %150, align 4, !tbaa !32
  %152 = zext i32 %151 to i64
  %153 = or i64 %152, 64
  %154 = trunc i64 %153 to i32
  store volatile i32 %154, ptr %150, align 4, !tbaa !32
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %155, i32 0, i32 0
  %157 = load ptr, ptr %156, align 8, !tbaa !28
  %158 = getelementptr inbounds %struct.USART_TypeDef, ptr %157, i32 0, i32 2
  %159 = load volatile i32, ptr %158, align 4, !tbaa !32
  %160 = zext i32 %159 to i64
  %161 = or i64 %160, 128
  %162 = trunc i64 %161 to i32
  store volatile i32 %162, ptr %158, align 4, !tbaa !32
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %185

163:                                              ; preds = %122
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %164, i32 0, i32 16
  %166 = load ptr, ptr %165, align 8, !tbaa !22
  %167 = icmp ne ptr %166, null
  br i1 %167, label %168, label %173

168:                                              ; preds = %163
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %169, i32 0, i32 16
  %171 = load ptr, ptr %170, align 8, !tbaa !22
  %172 = call i32 @HAL_DMA_Abort(ptr noundef %171)
  store i32 %172, ptr %8, align 4, !tbaa !11
  br label %173

173:                                              ; preds = %168, %163
  %174 = load i32, ptr %8, align 4, !tbaa !11
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %175, i32 0, i32 19
  store volatile i32 16, ptr %176, align 8, !tbaa !21
  br label %177

177:                                              ; preds = %173
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %178, i32 0, i32 17
  store i32 0, ptr %179, align 8, !tbaa !16
  br label %180

180:                                              ; preds = %177
  br label %181

181:                                              ; preds = %180
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %182, i32 0, i32 18
  store volatile i32 1, ptr %183, align 4, !tbaa !13
  store i32 1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %185

184:                                              ; preds = %3
  store i32 2, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %185

185:                                              ; preds = %184, %181, %130, %29, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %186 = load i32, ptr %4, align 4
  ret i32 %186
}

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

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

declare i32 @HAL_DMA_Abort(ptr noundef) #2

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, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 132}
!14 = !{!"__USART_HandleTypeDef", !6, i64 0, !15, i64 8, !6, i64 48, !10, i64 56, !10, i64 58, !6, i64 64, !10, i64 72, !10, i64 74, !10, i64 76, !10, i64 78, !10, i64 80, !12, i64 84, !12, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !12, i64 128, !12, i64 132, !12, i64 136}
!15 = !{!"", !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}
!16 = !{!14, !12, i64 128}
!17 = !{!14, !6, i64 64}
!18 = !{!14, !10, i64 72}
!19 = !{!14, !6, i64 48}
!20 = !{!14, !10, i64 56}
!21 = !{!14, !12, i64 136}
!22 = !{!14, !6, i64 120}
!23 = !{!24, !6, i64 72}
!24 = !{!"__DMA_HandleTypeDef", !6, i64 0, !25, 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}
!25 = !{!"", !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}
!26 = !{!24, !6, i64 80}
!27 = !{!24, !6, i64 104}
!28 = !{!14, !6, i64 0}
!29 = !{!14, !12, i64 84}
!30 = !{!14, !6, i64 112}
!31 = !{!25, !12, i64 0}
!32 = !{!25, !12, i64 8}


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

; Function Attrs: nounwind uwtable
declare hidden void @USART_DMAError(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @HAL_USART_Receive_DMA(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 132
  %5 = load volatile i32, ptr %4, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 1
  br i1 %6, label %7, label %64

7:                                                ; preds = %3
  %8 = icmp eq ptr %1, null
  %9 = zext i16 %2 to i32
  %10 = icmp eq i16 %2, 0
  %or.cond = or i1 %8, %10
  br i1 %or.cond, label %64, label %11

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

15:                                               ; preds = %11
  store i32 1, ptr %12, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %1, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %0, i64 72
  store i16 %2, ptr %17, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %1, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  store i16 %2, ptr %19, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %0, i64 136
  store volatile i32 0, ptr %20, align 8, !tbaa !18
  store volatile i32 34, ptr %4, align 4, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %0, i64 120
  %22 = load ptr, ptr %21, align 8, !tbaa !19
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %.critedge, label %23

23:                                               ; preds = %15
  %24 = getelementptr inbounds i8, ptr %22, i64 72
  store ptr @USART_DMAReceiveCplt, ptr %24, align 8, !tbaa !20
  %25 = getelementptr inbounds i8, ptr %22, i64 80
  store ptr @USART_DMARxHalfCplt, ptr %25, align 8, !tbaa !23
  %26 = getelementptr inbounds i8, ptr %22, i64 104
  store ptr @USART_DMAError, ptr %26, align 8, !tbaa !24
  %27 = load ptr, ptr %0, align 8, !tbaa !25
  %28 = getelementptr inbounds i8, ptr %27, i64 36
  %29 = ptrtoint ptr %28 to i64
  %30 = trunc i64 %29 to i32
  %31 = ptrtoint ptr %1 to i64
  %.0.extract.trunc48 = trunc i64 %31 to i32
  %32 = tail call i32 @HAL_DMA_Start_IT(ptr noundef nonnull %22, i32 noundef %30, i32 noundef %.0.extract.trunc48, i32 noundef %9) #3
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %.critedge, label %.critedge59

.critedge:                                        ; preds = %15, %23
  %34 = getelementptr inbounds i8, ptr %0, i64 84
  %35 = load i32, ptr %34, align 4, !tbaa !26
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %.critedge57

37:                                               ; preds = %.critedge
  %38 = getelementptr inbounds i8, ptr %0, i64 112
  %39 = load ptr, ptr %38, align 8, !tbaa !27
  %.not54 = icmp eq ptr %39, null
  br i1 %.not54, label %.critedge57, label %40

40:                                               ; preds = %37
  %41 = getelementptr inbounds i8, ptr %39, i64 104
  store ptr null, ptr %41, align 8, !tbaa !24
  %42 = getelementptr inbounds i8, ptr %39, i64 72
  %43 = ptrtoint ptr %1 to i64
  %.0.extract.trunc = trunc i64 %43 to i32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %42, i8 0, i64 16, i1 false)
  %44 = load ptr, ptr %0, align 8, !tbaa !25
  %45 = getelementptr inbounds i8, ptr %44, i64 40
  %46 = ptrtoint ptr %45 to i64
  %47 = trunc i64 %46 to i32
  %48 = tail call i32 @HAL_DMA_Start_IT(ptr noundef nonnull %39, i32 noundef %.0.extract.trunc, i32 noundef %47, i32 noundef %9) #3
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %.critedge57, label %.critedge59

.critedge57:                                      ; preds = %37, %.critedge, %40
  store i32 0, ptr %12, align 8, !tbaa !13
  %50 = load ptr, ptr %0, align 8, !tbaa !25
  %51 = load volatile i32, ptr %50, align 4, !tbaa !28
  %52 = or i32 %51, 256
  store volatile i32 %52, ptr %50, align 4, !tbaa !28
  %53 = getelementptr inbounds i8, ptr %50, i64 8
  %54 = load volatile i32, ptr %53, align 4, !tbaa !29
  %55 = or i32 %54, 1
  store volatile i32 %55, ptr %53, align 4, !tbaa !29
  %56 = load volatile i32, ptr %53, align 4, !tbaa !29
  %57 = or i32 %56, 64
  store volatile i32 %57, ptr %53, align 4, !tbaa !29
  %58 = load volatile i32, ptr %53, align 4, !tbaa !29
  %59 = or i32 %58, 128
  store volatile i32 %59, ptr %53, align 4, !tbaa !29
  br label %64

.critedge59:                                      ; preds = %23, %40
  %60 = load ptr, ptr %21, align 8, !tbaa !19
  %.not55 = icmp eq ptr %60, null
  br i1 %.not55, label %63, label %61

61:                                               ; preds = %.critedge59
  %62 = tail call i32 @HAL_DMA_Abort(ptr noundef nonnull %60) #3
  br label %63

63:                                               ; preds = %61, %.critedge59
  store volatile i32 16, ptr %20, align 8, !tbaa !18
  store i32 0, ptr %12, align 8, !tbaa !13
  store volatile i32 1, ptr %4, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %3, %11, %7, %63, %.critedge57
  %.0 = phi i32 [ 0, %.critedge57 ], [ 1, %63 ], [ 1, %7 ], [ 2, %11 ], [ 2, %3 ]
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden void @USART_DMAReceiveCplt(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @USART_DMARxHalfCplt(ptr noundef) #0

declare i32 @HAL_DMA_Abort(ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 132}
!6 = !{!"__USART_HandleTypeDef", !7, i64 0, !10, i64 8, !7, i64 48, !12, i64 56, !12, i64 58, !7, i64 64, !12, i64 72, !12, i64 74, !12, i64 76, !12, i64 78, !12, i64 80, !11, i64 84, !11, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !11, i64 128, !11, i64 132, !11, i64 136}
!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 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !11, i64 128}
!14 = !{!6, !7, i64 64}
!15 = !{!6, !12, i64 72}
!16 = !{!6, !7, i64 48}
!17 = !{!6, !12, i64 56}
!18 = !{!6, !11, i64 136}
!19 = !{!6, !7, i64 120}
!20 = !{!21, !7, i64 72}
!21 = !{!"__DMA_HandleTypeDef", !7, i64 0, !22, 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}
!22 = !{!"", !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}
!23 = !{!21, !7, i64 80}
!24 = !{!21, !7, i64 104}
!25 = !{!6, !7, i64 0}
!26 = !{!6, !11, i64 84}
!27 = !{!6, !7, i64 112}
!28 = !{!22, !11, i64 0}
!29 = !{!22, !11, i64 8}


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