; LLVM IR from ctlst-tech/catpilot :: bsp/mcu/core/stm32/h753/common (system_stm32h7xx)

; 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.RCC_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, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [9 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x i32] }

; Function Attrs: nounwind uwtable
define dso_local void @SystemInit() #0 {
  %1 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 4, !tbaa !5
  %2 = zext i32 %1 to i64
  %3 = and i64 %2, 15
  %4 = icmp ugt i64 7, %3
  br i1 %4, label %5, label %11

5:                                                ; preds = %0
  %6 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 4, !tbaa !5
  %7 = zext i32 %6 to i64
  %8 = and i64 %7, -16
  %9 = or i64 %8, 7
  %10 = trunc i64 %9 to i32
  store volatile i32 %10, ptr inttoptr (i64 1375739904 to ptr), align 4, !tbaa !5
  br label %11

11:                                               ; preds = %5, %0
  %12 = load volatile i32, ptr inttoptr (i64 1476543488 to ptr), align 4, !tbaa !10
  %13 = zext i32 %12 to i64
  %14 = or i64 %13, 1
  %15 = trunc i64 %14 to i32
  store volatile i32 %15, ptr inttoptr (i64 1476543488 to ptr), align 4, !tbaa !10
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 4), align 4, !tbaa !12
  %16 = load volatile i32, ptr inttoptr (i64 1476543488 to ptr), align 4, !tbaa !10
  %17 = and i32 %16, -352916097
  store volatile i32 %17, ptr inttoptr (i64 1476543488 to ptr), align 4, !tbaa !10
  %18 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 4, !tbaa !5
  %19 = zext i32 %18 to i64
  %20 = and i64 %19, 15
  %21 = icmp ult i64 7, %20
  br i1 %21, label %22, label %28

22:                                               ; preds = %11
  %23 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 4, !tbaa !5
  %24 = zext i32 %23 to i64
  %25 = and i64 %24, -16
  %26 = or i64 %25, 7
  %27 = trunc i64 %26 to i32
  store volatile i32 %27, ptr inttoptr (i64 1375739904 to ptr), align 4, !tbaa !5
  br label %28

28:                                               ; preds = %22, %11
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 6), align 4, !tbaa !13
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 7), align 4, !tbaa !14
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 8), align 4, !tbaa !15
  store volatile i32 33686016, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 10), align 4, !tbaa !16
  store volatile i32 33488896, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 11), align 4, !tbaa !17
  store volatile i32 16843392, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 12), align 4, !tbaa !18
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 13), align 4, !tbaa !19
  store volatile i32 16843392, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 14), align 4, !tbaa !20
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 15), align 4, !tbaa !21
  store volatile i32 16843392, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 16), align 4, !tbaa !22
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 17), align 4, !tbaa !23
  %29 = load volatile i32, ptr inttoptr (i64 1476543488 to ptr), align 4, !tbaa !10
  %30 = and i32 %29, -262145
  store volatile i32 %30, ptr inttoptr (i64 1476543488 to ptr), align 4, !tbaa !10
  store volatile i32 0, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 24), align 4, !tbaa !24
  %31 = load volatile i32, ptr inttoptr (i64 1543507968 to ptr), align 4, !tbaa !25
  %32 = and i32 %31, -65536
  %33 = icmp ult i32 %32, 536870912
  br i1 %33, label %34, label %35

34:                                               ; preds = %28
  store volatile i32 1, ptr inttoptr (i64 1358987528 to ptr), align 4, !tbaa !27
  br label %35

35:                                               ; preds = %34, %28
  store volatile i32 12498, ptr inttoptr (i64 1375748096 to ptr), align 4, !tbaa !27
  ret void
}

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

!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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !8, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !8, i64 100, !7, i64 260, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !8, i64 280, !7, i64 296, !7, i64 300, !7, i64 304, !7, i64 308, !7, i64 312, !7, i64 316, !8, i64 320, !7, i64 336, !7, i64 340, !7, i64 344, !7, i64 348, !7, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !7, i64 160, !7, i64 164, !7, i64 168, !8, i64 172, !7, i64 208, !7, i64 212, !7, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !7, i64 240, !7, i64 244, !7, i64 248, !7, i64 252, !7, i64 256, !7, i64 260, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !7, i64 280, !7, i64 284, !8, i64 288}
!12 = !{!11, !7, i64 16}
!13 = !{!11, !7, i64 24}
!14 = !{!11, !7, i64 28}
!15 = !{!11, !7, i64 32}
!16 = !{!11, !7, i64 40}
!17 = !{!11, !7, i64 44}
!18 = !{!11, !7, i64 48}
!19 = !{!11, !7, i64 52}
!20 = !{!11, !7, i64 56}
!21 = !{!11, !7, i64 60}
!22 = !{!11, !7, i64 64}
!23 = !{!11, !7, i64 68}
!24 = !{!11, !7, i64 96}
!25 = !{!26, !7, i64 0}
!26 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84}
!27 = !{!7, !7, i64 0}


; 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: nofree norecurse nounwind uwtable
define dso_local void @SystemInit() local_unnamed_addr #0 {
  %1 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 8192, !tbaa !5
  %2 = and i32 %1, 15
  %3 = icmp ult i32 %2, 7
  br i1 %3, label %4, label %8

4:                                                ; preds = %0
  %5 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 8192, !tbaa !5
  %6 = and i32 %5, -16
  %7 = or disjoint i32 %6, 7
  store volatile i32 %7, ptr inttoptr (i64 1375739904 to ptr), align 8192, !tbaa !5
  br label %8

8:                                                ; preds = %4, %0
  %9 = load volatile i32, ptr inttoptr (i64 1476543488 to ptr), align 1024, !tbaa !10
  %10 = or i32 %9, 1
  store volatile i32 %10, ptr inttoptr (i64 1476543488 to ptr), align 1024, !tbaa !10
  store volatile i32 0, ptr inttoptr (i64 1476543504 to ptr), align 16, !tbaa !12
  %11 = load volatile i32, ptr inttoptr (i64 1476543488 to ptr), align 1024, !tbaa !10
  %12 = and i32 %11, -352916097
  store volatile i32 %12, ptr inttoptr (i64 1476543488 to ptr), align 1024, !tbaa !10
  %13 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 8192, !tbaa !5
  %14 = and i32 %13, 8
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %19, label %15

15:                                               ; preds = %8
  %16 = load volatile i32, ptr inttoptr (i64 1375739904 to ptr), align 8192, !tbaa !5
  %17 = and i32 %16, -16
  %18 = or disjoint i32 %17, 7
  store volatile i32 %18, ptr inttoptr (i64 1375739904 to ptr), align 8192, !tbaa !5
  br label %19

19:                                               ; preds = %15, %8
  store volatile i32 0, ptr inttoptr (i64 1476543512 to ptr), align 8, !tbaa !13
  store volatile i32 0, ptr inttoptr (i64 1476543516 to ptr), align 4, !tbaa !14
  store volatile i32 0, ptr inttoptr (i64 1476543520 to ptr), align 32, !tbaa !15
  store volatile i32 33686016, ptr inttoptr (i64 1476543528 to ptr), align 8, !tbaa !16
  store volatile i32 33488896, ptr inttoptr (i64 1476543532 to ptr), align 4, !tbaa !17
  store volatile i32 16843392, ptr inttoptr (i64 1476543536 to ptr), align 16, !tbaa !18
  store volatile i32 0, ptr inttoptr (i64 1476543540 to ptr), align 4, !tbaa !19
  store volatile i32 16843392, ptr inttoptr (i64 1476543544 to ptr), align 8, !tbaa !20
  store volatile i32 0, ptr inttoptr (i64 1476543548 to ptr), align 4, !tbaa !21
  store volatile i32 16843392, ptr inttoptr (i64 1476543552 to ptr), align 64, !tbaa !22
  store volatile i32 0, ptr inttoptr (i64 1476543556 to ptr), align 4, !tbaa !23
  %20 = load volatile i32, ptr inttoptr (i64 1476543488 to ptr), align 1024, !tbaa !10
  %21 = and i32 %20, -262145
  store volatile i32 %21, ptr inttoptr (i64 1476543488 to ptr), align 1024, !tbaa !10
  store volatile i32 0, ptr inttoptr (i64 1476543584 to ptr), align 32, !tbaa !24
  %22 = load volatile i32, ptr inttoptr (i64 1543507968 to ptr), align 4096, !tbaa !25
  %23 = icmp ult i32 %22, 536870912
  br i1 %23, label %24, label %25

24:                                               ; preds = %19
  store volatile i32 1, ptr inttoptr (i64 1358987528 to ptr), align 8, !tbaa !27
  br label %25

25:                                               ; preds = %24, %19
  store volatile i32 12498, ptr inttoptr (i64 1375748096 to ptr), align 16384, !tbaa !27
  ret void
}

attributes #0 = { nofree norecurse 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" }

!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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !8, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !8, i64 100, !7, i64 260, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !8, i64 280, !7, i64 296, !7, i64 300, !7, i64 304, !7, i64 308, !7, i64 312, !7, i64 316, !8, i64 320, !7, i64 336, !7, i64 340, !7, i64 344, !7, i64 348, !7, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152, !7, i64 156, !7, i64 160, !7, i64 164, !7, i64 168, !8, i64 172, !7, i64 208, !7, i64 212, !7, i64 216, !7, i64 220, !7, i64 224, !7, i64 228, !7, i64 232, !7, i64 236, !7, i64 240, !7, i64 244, !7, i64 248, !7, i64 252, !7, i64 256, !7, i64 260, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !7, i64 280, !7, i64 284, !8, i64 288}
!12 = !{!11, !7, i64 16}
!13 = !{!11, !7, i64 24}
!14 = !{!11, !7, i64 28}
!15 = !{!11, !7, i64 32}
!16 = !{!11, !7, i64 40}
!17 = !{!11, !7, i64 44}
!18 = !{!11, !7, i64 48}
!19 = !{!11, !7, i64 52}
!20 = !{!11, !7, i64 56}
!21 = !{!11, !7, i64 60}
!22 = !{!11, !7, i64 64}
!23 = !{!11, !7, i64 68}
!24 = !{!11, !7, i64 96}
!25 = !{!26, !7, i64 0}
!26 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84}
!27 = !{!7, !7, i64 0}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferAlignmentPass,InstCombinePass,PostOrderFunctionAttrsPass