; LLVM IR from lfarcaro/ARINC653_ARMV7A_AM335X :: Hardware (dmtimer_bb)

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

; Function Attrs: nounwind uwtable
define dso_local void @DMTimer2ModuleClkConfig() #0 {
  store volatile i32 2, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  br label %1

1:                                                ; preds = %5, %0
  %2 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %3 = and i32 %2, 3
  %4 = icmp ne i32 %3, 2
  br i1 %4, label %5, label %6

5:                                                ; preds = %1
  br label %1, !llvm.loop !9

6:                                                ; preds = %1
  store volatile i32 2, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  br label %7

7:                                                ; preds = %11, %6
  %8 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %9 = and i32 %8, 3
  %10 = icmp ne i32 %9, 2
  br i1 %10, label %11, label %12

11:                                               ; preds = %7
  br label %7, !llvm.loop !11

12:                                               ; preds = %7
  store volatile i32 2, ptr inttoptr (i64 1155530972 to ptr), align 4, !tbaa !5
  br label %13

13:                                               ; preds = %17, %12
  %14 = load volatile i32, ptr inttoptr (i64 1155530972 to ptr), align 4, !tbaa !5
  %15 = and i32 %14, 3
  %16 = icmp ne i32 %15, 2
  br i1 %16, label %17, label %18

17:                                               ; preds = %13
  br label %13, !llvm.loop !12

18:                                               ; preds = %13
  store volatile i32 2, ptr inttoptr (i64 1155530976 to ptr), align 4, !tbaa !5
  br label %19

19:                                               ; preds = %23, %18
  %20 = load volatile i32, ptr inttoptr (i64 1155530976 to ptr), align 4, !tbaa !5
  %21 = and i32 %20, 3
  %22 = icmp ne i32 %21, 2
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  br label %19, !llvm.loop !13

24:                                               ; preds = %19
  store volatile i32 2, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  br label %25

25:                                               ; preds = %29, %24
  %26 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %27 = and i32 %26, 3
  %28 = icmp ne i32 %27, 2
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  br label %25, !llvm.loop !14

30:                                               ; preds = %25
  store volatile i32 2, ptr inttoptr (i64 1155530752 to ptr), align 4, !tbaa !5
  br label %31

31:                                               ; preds = %35, %30
  %32 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 4, !tbaa !5
  %33 = and i32 %32, 3
  %34 = icmp ne i32 %33, 2
  br i1 %34, label %35, label %36

35:                                               ; preds = %31
  br label %31, !llvm.loop !15

36:                                               ; preds = %31
  store volatile i32 2, ptr inttoptr (i64 1155530848 to ptr), align 4, !tbaa !5
  br label %37

37:                                               ; preds = %41, %36
  %38 = load volatile i32, ptr inttoptr (i64 1155530848 to ptr), align 4, !tbaa !5
  %39 = and i32 %38, 3
  %40 = icmp ne i32 %39, 2
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  br label %37, !llvm.loop !16

42:                                               ; preds = %37
  %43 = load volatile i32, ptr inttoptr (i64 1155532040 to ptr), align 4, !tbaa !5
  %44 = and i32 %43, -4
  store volatile i32 %44, ptr inttoptr (i64 1155532040 to ptr), align 4, !tbaa !5
  %45 = load volatile i32, ptr inttoptr (i64 1155532040 to ptr), align 4, !tbaa !5
  %46 = or i32 %45, 1
  store volatile i32 %46, ptr inttoptr (i64 1155532040 to ptr), align 4, !tbaa !5
  br label %47

47:                                               ; preds = %51, %42
  %48 = load volatile i32, ptr inttoptr (i64 1155532040 to ptr), align 4, !tbaa !5
  %49 = and i32 %48, 3
  %50 = icmp ne i32 %49, 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  br label %47, !llvm.loop !17

52:                                               ; preds = %47
  %53 = load volatile i32, ptr inttoptr (i64 1155530880 to ptr), align 4, !tbaa !5
  %54 = or i32 %53, 2
  store volatile i32 %54, ptr inttoptr (i64 1155530880 to ptr), align 4, !tbaa !5
  br label %55

55:                                               ; preds = %59, %52
  %56 = load volatile i32, ptr inttoptr (i64 1155530880 to ptr), align 4, !tbaa !5
  %57 = and i32 %56, 3
  %58 = icmp ne i32 %57, 2
  br i1 %58, label %59, label %60

59:                                               ; preds = %55
  br label %55, !llvm.loop !18

60:                                               ; preds = %55
  br label %61

61:                                               ; preds = %65, %60
  %62 = load volatile i32, ptr inttoptr (i64 1155530880 to ptr), align 4, !tbaa !5
  %63 = and i32 %62, 196608
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %61
  br label %61, !llvm.loop !19

66:                                               ; preds = %61
  br label %67

67:                                               ; preds = %72, %66
  %68 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %69 = and i32 %68, 8
  %70 = icmp ne i32 %69, 0
  %71 = xor i1 %70, true
  br i1 %71, label %72, label %73

72:                                               ; preds = %67
  br label %67, !llvm.loop !20

73:                                               ; preds = %67
  br label %74

74:                                               ; preds = %79, %73
  %75 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %76 = and i32 %75, 16
  %77 = icmp ne i32 %76, 0
  %78 = xor i1 %77, true
  br i1 %78, label %79, label %80

79:                                               ; preds = %74
  br label %74, !llvm.loop !21

80:                                               ; preds = %74
  br label %81

81:                                               ; preds = %86, %80
  %82 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %83 = and i32 %82, 48
  %84 = icmp ne i32 %83, 0
  %85 = xor i1 %84, true
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  br label %81, !llvm.loop !22

87:                                               ; preds = %81
  br label %88

88:                                               ; preds = %93, %87
  %89 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 4, !tbaa !5
  %90 = and i32 %89, 16640
  %91 = icmp ne i32 %90, 0
  %92 = xor i1 %91, true
  br i1 %92, label %93, label %94

93:                                               ; preds = %88
  br label %88, !llvm.loop !23

94:                                               ; preds = %88
  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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


; 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 @DMTimer2ModuleClkConfig() local_unnamed_addr #0 {
  store volatile i32 2, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  br label %1

1:                                                ; preds = %1, %0
  %2 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %3 = and i32 %2, 3
  %.not = icmp eq i32 %3, 2
  br i1 %.not, label %4, label %1, !llvm.loop !9

4:                                                ; preds = %1
  store volatile i32 2, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  br label %5

5:                                                ; preds = %5, %4
  %6 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %7 = and i32 %6, 3
  %.not1 = icmp eq i32 %7, 2
  br i1 %.not1, label %8, label %5, !llvm.loop !11

8:                                                ; preds = %5
  store volatile i32 2, ptr inttoptr (i64 1155530972 to ptr), align 4, !tbaa !5
  br label %9

9:                                                ; preds = %9, %8
  %10 = load volatile i32, ptr inttoptr (i64 1155530972 to ptr), align 4, !tbaa !5
  %11 = and i32 %10, 3
  %.not2 = icmp eq i32 %11, 2
  br i1 %.not2, label %12, label %9, !llvm.loop !12

12:                                               ; preds = %9
  store volatile i32 2, ptr inttoptr (i64 1155530976 to ptr), align 32, !tbaa !5
  br label %13

13:                                               ; preds = %13, %12
  %14 = load volatile i32, ptr inttoptr (i64 1155530976 to ptr), align 32, !tbaa !5
  %15 = and i32 %14, 3
  %.not3 = icmp eq i32 %15, 2
  br i1 %.not3, label %16, label %13, !llvm.loop !13

16:                                               ; preds = %13
  store volatile i32 2, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  br label %17

17:                                               ; preds = %17, %16
  %18 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %19 = and i32 %18, 3
  %.not4 = icmp eq i32 %19, 2
  br i1 %.not4, label %20, label %17, !llvm.loop !14

20:                                               ; preds = %17
  store volatile i32 2, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  br label %21

21:                                               ; preds = %21, %20
  %22 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  %23 = and i32 %22, 3
  %.not5 = icmp eq i32 %23, 2
  br i1 %.not5, label %24, label %21, !llvm.loop !15

24:                                               ; preds = %21
  store volatile i32 2, ptr inttoptr (i64 1155530848 to ptr), align 32, !tbaa !5
  br label %25

25:                                               ; preds = %25, %24
  %26 = load volatile i32, ptr inttoptr (i64 1155530848 to ptr), align 32, !tbaa !5
  %27 = and i32 %26, 3
  %.not6 = icmp eq i32 %27, 2
  br i1 %.not6, label %28, label %25, !llvm.loop !16

28:                                               ; preds = %25
  %29 = load volatile i32, ptr inttoptr (i64 1155532040 to ptr), align 8, !tbaa !5
  %30 = and i32 %29, -4
  store volatile i32 %30, ptr inttoptr (i64 1155532040 to ptr), align 8, !tbaa !5
  %31 = load volatile i32, ptr inttoptr (i64 1155532040 to ptr), align 8, !tbaa !5
  %32 = or i32 %31, 1
  store volatile i32 %32, ptr inttoptr (i64 1155532040 to ptr), align 8, !tbaa !5
  br label %33

33:                                               ; preds = %33, %28
  %34 = load volatile i32, ptr inttoptr (i64 1155532040 to ptr), align 8, !tbaa !5
  %35 = and i32 %34, 3
  %.not7 = icmp eq i32 %35, 1
  br i1 %.not7, label %36, label %33, !llvm.loop !17

36:                                               ; preds = %33
  %37 = load volatile i32, ptr inttoptr (i64 1155530880 to ptr), align 128, !tbaa !5
  %38 = or i32 %37, 2
  store volatile i32 %38, ptr inttoptr (i64 1155530880 to ptr), align 128, !tbaa !5
  br label %39

39:                                               ; preds = %39, %36
  %40 = load volatile i32, ptr inttoptr (i64 1155530880 to ptr), align 128, !tbaa !5
  %41 = and i32 %40, 3
  %.not8 = icmp eq i32 %41, 2
  br i1 %.not8, label %.preheader17, label %39, !llvm.loop !18

.preheader17:                                     ; preds = %39, %.preheader17
  %42 = load volatile i32, ptr inttoptr (i64 1155530880 to ptr), align 128, !tbaa !5
  %43 = and i32 %42, 196608
  %.not9 = icmp eq i32 %43, 0
  br i1 %.not9, label %.preheader16, label %.preheader17, !llvm.loop !19

.preheader16:                                     ; preds = %.preheader17, %.preheader16
  %44 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %45 = and i32 %44, 8
  %.not10 = icmp eq i32 %45, 0
  br i1 %.not10, label %.preheader16, label %.preheader15, !llvm.loop !20

.preheader15:                                     ; preds = %.preheader16, %.preheader15
  %46 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %47 = and i32 %46, 16
  %.not11 = icmp eq i32 %47, 0
  br i1 %.not11, label %.preheader15, label %.preheader14, !llvm.loop !21

.preheader14:                                     ; preds = %.preheader15, %.preheader14
  %48 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %49 = and i32 %48, 48
  %.not12 = icmp eq i32 %49, 0
  br i1 %.not12, label %.preheader14, label %.preheader, !llvm.loop !22

.preheader:                                       ; preds = %.preheader14, %.preheader
  %50 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  %51 = and i32 %50, 16640
  %.not13 = icmp eq i32 %51, 0
  br i1 %.not13, label %.preheader, label %52, !llvm.loop !23

52:                                               ; preds = %.preheader
  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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


; Effective O3 passes: GlobalOptPass,InferAlignmentPass,InstCombinePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SimplifyCFGPass