; 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.HRTIM_HandleTypeDef = type { ptr, %struct.HRTIM_InitTypeDef, [6 x %struct.HRTIM_TimerParamTypeDef], i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.HRTIM_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.HRTIM_TimerParamTypeDef = type { 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.HRTIM_TypeDef = type { %struct.HRTIM_Master_TypeDef, [5 x %struct.HRTIM_Timerx_TypeDef], [32 x i32], %struct.HRTIM_Common_TypeDef }
%struct.HRTIM_Master_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [20 x i32] }
%struct.HRTIM_Timerx_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [5 x i32] }
%struct.HRTIM_Common_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@TimerIdxToTimerId = external hidden global [6 x i32], align 16

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

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

; Function Attrs: nounwind uwtable
declare hidden void @HRTIM_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_HRTIM_SimpleCaptureStart_DMA(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #1 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  br label %16

16:                                               ; preds = %6
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %17, i32 0, i32 3
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %22

21:                                               ; preds = %16
  store i32 2, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %153

22:                                               ; preds = %16
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %23, i32 0, i32 3
  store i32 1, ptr %24, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %22
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %28, i32 0, i32 4
  store volatile i32 2, ptr %29, align 8, !tbaa !14
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = call ptr @HRTIM_GetDMAHandleFromTimerIdx(ptr noundef %30, i32 noundef %31)
  store ptr %32, ptr %14, align 8, !tbaa !5
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %43

35:                                               ; preds = %27
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %36, i32 0, i32 4
  store volatile i32 7, ptr %37, align 8, !tbaa !14
  br label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %39, i32 0, i32 3
  store i32 0, ptr %40, align 4, !tbaa !11
  br label %41

41:                                               ; preds = %38
  br label %42

42:                                               ; preds = %41
  store i32 1, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %153

43:                                               ; preds = %27
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %44, i32 0, i32 9
  store ptr @HRTIM_DMAError, ptr %45, align 8, !tbaa !15
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %46, i32 0, i32 5
  store ptr @HRTIM_DMATimerxCplt, ptr %47, align 8, !tbaa !18
  %48 = load ptr, ptr %14, align 8, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = load i32, ptr %13, align 4, !tbaa !9
  %52 = call i32 @HAL_DMA_Start_IT(ptr noundef %48, i32 noundef %49, i32 noundef %50, i32 noundef %51)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %62

54:                                               ; preds = %43
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %55, i32 0, i32 4
  store volatile i32 7, ptr %56, align 8, !tbaa !14
  br label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %58, i32 0, i32 3
  store i32 0, ptr %59, align 4, !tbaa !11
  br label %60

60:                                               ; preds = %57
  br label %61

61:                                               ; preds = %60
  store i32 1, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %153

62:                                               ; preds = %43
  %63 = load i32, ptr %10, align 4, !tbaa !9
  switch i32 %63, label %120 [
    i32 1, label %64
    i32 2, label %92
  ]

64:                                               ; preds = %62
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds [6 x %struct.HRTIM_TimerParamTypeDef], ptr %66, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.HRTIM_TimerParamTypeDef, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 4, !tbaa !19
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !21
  %75 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %74, i32 0, i32 1
  %76 = load i32, ptr %9, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %75, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %78, i32 0, i32 23
  store volatile i32 %71, ptr %79, align 4, !tbaa !22
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !21
  %83 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %83, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %86, i32 0, i32 3
  %88 = load volatile i32, ptr %87, align 4, !tbaa !24
  %89 = zext i32 %88 to i64
  %90 = or i64 %89, 8388608
  %91 = trunc i64 %90 to i32
  store volatile i32 %91, ptr %87, align 4, !tbaa !24
  br label %128

92:                                               ; preds = %62
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %93, i32 0, i32 2
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds [6 x %struct.HRTIM_TimerParamTypeDef], ptr %94, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.HRTIM_TimerParamTypeDef, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !25
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !21
  %103 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %102, i32 0, i32 1
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %103, i64 0, i64 %105
  %107 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %106, i32 0, i32 24
  store volatile i32 %99, ptr %107, align 4, !tbaa !26
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !21
  %111 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %9, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %111, i64 0, i64 %113
  %115 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %114, i32 0, i32 3
  %116 = load volatile i32, ptr %115, align 4, !tbaa !24
  %117 = zext i32 %116 to i64
  %118 = or i64 %117, 16777216
  %119 = trunc i64 %118 to i32
  store volatile i32 %119, ptr %115, align 4, !tbaa !24
  br label %128

120:                                              ; preds = %62
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %121, i32 0, i32 4
  store volatile i32 7, ptr %122, align 8, !tbaa !14
  br label %123

123:                                              ; preds = %120
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %124, i32 0, i32 3
  store i32 0, ptr %125, align 4, !tbaa !11
  br label %126

126:                                              ; preds = %123
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127, %92, %64
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %129, i32 0, i32 4
  %131 = load volatile i32, ptr %130, align 8, !tbaa !14
  %132 = icmp eq i32 %131, 7
  br i1 %132, label %133, label %134

133:                                              ; preds = %128
  store i32 1, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %153

134:                                              ; preds = %128
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !21
  %142 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %141, i32 0, i32 0
  %143 = getelementptr inbounds %struct.HRTIM_Master_TypeDef, ptr %142, i32 0, i32 0
  %144 = load volatile i32, ptr %143, align 4, !tbaa !27
  %145 = or i32 %144, %138
  store volatile i32 %145, ptr %143, align 4, !tbaa !27
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %146, i32 0, i32 4
  store volatile i32 1, ptr %147, align 8, !tbaa !14
  br label %148

148:                                              ; preds = %134
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %149, i32 0, i32 3
  store i32 0, ptr %150, align 4, !tbaa !11
  br label %151

151:                                              ; preds = %148
  br label %152

152:                                              ; preds = %151
  store i32 0, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %153

153:                                              ; preds = %152, %133, %61, %42, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %154 = load i32, ptr %7, align 4
  ret i32 %154
}

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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 196}
!12 = !{!"", !6, i64 0, !13, i64 8, !7, i64 28, !10, i64 196, !10, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!14 = !{!12, !10, i64 200}
!15 = !{!16, !6, i64 104}
!16 = !{!"__DMA_HandleTypeDef", !6, i64 0, !17, i64 8, !10, i64 56, !10, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !10, i64 120, !10, i64 124, !10, i64 128, !6, i64 136, !6, i64 144, !10, i64 152, !6, i64 160, !6, i64 168, !10, i64 176}
!17 = !{!"", !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}
!18 = !{!16, !6, i64 72}
!19 = !{!20, !10, i64 0}
!20 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!21 = !{!12, !6, i64 0}
!22 = !{!23, !10, i64 92}
!23 = !{!"", !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, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !7, i64 108}
!24 = !{!23, !10, i64 12}
!25 = !{!20, !10, i64 4}
!26 = !{!23, !10, i64 96}
!27 = !{!28, !10, i64 0}
!28 = !{!"", !29, i64 0, !7, i64 128, !7, i64 768, !30, i64 896}
!29 = !{!"", !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, !7, i64 48}
!30 = !{!"", !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, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112}


; 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.HRTIM_TimerParamTypeDef = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.HRTIM_Timerx_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [5 x i32] }

@TimerIdxToTimerId = external hidden local_unnamed_addr global [6 x i32], align 16

; Function Attrs: nounwind uwtable
declare hidden ptr @HRTIM_GetDMAHandleFromTimerIdx(ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden void @HRTIM_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_HRTIM_SimpleCaptureStart_DMA(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = getelementptr inbounds i8, ptr %0, i64 196
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = icmp eq i32 %8, 1
  br i1 %9, label %52, label %10

10:                                               ; preds = %6
  store i32 1, ptr %7, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 200
  store volatile i32 2, ptr %11, align 8, !tbaa !12
  %12 = tail call ptr @HRTIM_GetDMAHandleFromTimerIdx(ptr noundef nonnull %0, i32 noundef %1)
  %13 = icmp eq ptr %12, null
  br i1 %13, label %.sink.split, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %12, i64 104
  store ptr @HRTIM_DMAError, ptr %15, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %12, i64 72
  store ptr @HRTIM_DMATimerxCplt, ptr %16, align 8, !tbaa !16
  %17 = tail call i32 @HAL_DMA_Start_IT(ptr noundef nonnull %12, i32 noundef %3, i32 noundef %4, i32 noundef %5) #2
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %18, label %.sink.split

18:                                               ; preds = %14
  switch i32 %2, label %41 [
    i32 1, label %19
    i32 2, label %30
  ]

19:                                               ; preds = %18
  %20 = getelementptr inbounds i8, ptr %0, i64 28
  %21 = zext i32 %1 to i64
  %22 = getelementptr inbounds [6 x %struct.HRTIM_TimerParamTypeDef], ptr %20, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !17
  %24 = load ptr, ptr %0, align 8, !tbaa !19
  %25 = getelementptr inbounds i8, ptr %24, i64 128
  %26 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %25, i64 0, i64 %21, i32 23
  store volatile i32 %23, ptr %26, align 4, !tbaa !20
  %27 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %25, i64 0, i64 %21, i32 3
  %28 = load volatile i32, ptr %27, align 4, !tbaa !22
  %29 = or i32 %28, 8388608
  store volatile i32 %29, ptr %27, align 4, !tbaa !22
  br label %42

30:                                               ; preds = %18
  %31 = getelementptr inbounds i8, ptr %0, i64 28
  %32 = zext i32 %1 to i64
  %33 = getelementptr inbounds [6 x %struct.HRTIM_TimerParamTypeDef], ptr %31, i64 0, i64 %32, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !23
  %35 = load ptr, ptr %0, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %35, i64 128
  %37 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %36, i64 0, i64 %32, i32 24
  store volatile i32 %34, ptr %37, align 4, !tbaa !24
  %38 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %36, i64 0, i64 %32, i32 3
  %39 = load volatile i32, ptr %38, align 4, !tbaa !22
  %40 = or i32 %39, 16777216
  store volatile i32 %40, ptr %38, align 4, !tbaa !22
  br label %42

41:                                               ; preds = %18
  store volatile i32 7, ptr %11, align 8, !tbaa !12
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %41, %30, %19
  %43 = load volatile i32, ptr %11, align 8, !tbaa !12
  %44 = icmp eq i32 %43, 7
  br i1 %44, label %52, label %45

45:                                               ; preds = %42
  %46 = zext i32 %1 to i64
  %47 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !25
  %49 = load ptr, ptr %0, align 8, !tbaa !19
  %50 = load volatile i32, ptr %49, align 4, !tbaa !26
  %51 = or i32 %50, %48
  store volatile i32 %51, ptr %49, align 4, !tbaa !26
  br label %.sink.split

.sink.split:                                      ; preds = %14, %10, %45
  %.sink = phi i32 [ 1, %45 ], [ 7, %10 ], [ 7, %14 ]
  %.0.ph = phi i32 [ 0, %45 ], [ 1, %10 ], [ 1, %14 ]
  store volatile i32 %.sink, ptr %11, align 8, !tbaa !12
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %.sink.split, %42, %6
  %.0 = phi i32 [ 2, %6 ], [ 1, %42 ], [ %.0.ph, %.sink.split ]
  ret i32 %.0
}

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 = { 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 196}
!6 = !{!"", !7, i64 0, !10, i64 8, !8, i64 28, !11, i64 196, !11, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248}
!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 = !{!6, !11, i64 200}
!13 = !{!14, !7, i64 104}
!14 = !{!"__DMA_HandleTypeDef", !7, i64 0, !15, 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}
!15 = !{!"", !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}
!16 = !{!14, !7, i64 72}
!17 = !{!18, !11, i64 0}
!18 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!19 = !{!6, !7, i64 0}
!20 = !{!21, !11, i64 92}
!21 = !{!"", !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, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !8, i64 108}
!22 = !{!21, !11, i64 12}
!23 = !{!18, !11, i64 4}
!24 = !{!21, !11, i64 96}
!25 = !{!11, !11, i64 0}
!26 = !{!27, !11, i64 0}
!27 = !{!"", !28, i64 0, !8, i64 128, !8, i64 768, !29, i64 896}
!28 = !{!"", !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, !8, i64 48}
!29 = !{!"", !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, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112}


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