; LLVM IR from lfarcaro/ARINC653_ARMV7A_AM335X :: Hardware (dcan_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 @DCANModuleClkConfig() #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
  store volatile i32 2, ptr inttoptr (i64 1155530948 to ptr), align 4, !tbaa !5
  br label %43

43:                                               ; preds = %47, %42
  %44 = load volatile i32, ptr inttoptr (i64 1155530948 to ptr), align 4, !tbaa !5
  %45 = and i32 %44, 3
  %46 = icmp ne i32 %45, 2
  br i1 %46, label %47, label %48

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

48:                                               ; preds = %43
  store volatile i32 2, ptr inttoptr (i64 1155530944 to ptr), align 4, !tbaa !5
  br label %49

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

53:                                               ; preds = %49
  br label %49, !llvm.loop !18

54:                                               ; preds = %49
  br label %55

55:                                               ; preds = %60, %54
  %56 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %57 = and i32 %56, 8
  %58 = icmp ne i32 %57, 0
  %59 = xor i1 %58, true
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  br label %55, !llvm.loop !19

61:                                               ; preds = %55
  br label %62

62:                                               ; preds = %67, %61
  %63 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %64 = and i32 %63, 16
  %65 = icmp ne i32 %64, 0
  %66 = xor i1 %65, true
  br i1 %66, label %67, label %68

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

68:                                               ; preds = %62
  br label %69

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

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

75:                                               ; preds = %69
  br label %76

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

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

82:                                               ; preds = %76
  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}


; 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 @DCANModuleClkConfig() 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
  store volatile i32 2, ptr inttoptr (i64 1155530948 to ptr), align 4, !tbaa !5
  br label %29

29:                                               ; preds = %29, %28
  %30 = load volatile i32, ptr inttoptr (i64 1155530948 to ptr), align 4, !tbaa !5
  %31 = and i32 %30, 3
  %.not7 = icmp eq i32 %31, 2
  br i1 %.not7, label %32, label %29, !llvm.loop !17

32:                                               ; preds = %29
  store volatile i32 2, ptr inttoptr (i64 1155530944 to ptr), align 64, !tbaa !5
  br label %33

33:                                               ; preds = %33, %32
  %34 = load volatile i32, ptr inttoptr (i64 1155530944 to ptr), align 64, !tbaa !5
  %35 = and i32 %34, 3
  %.not8 = icmp eq i32 %35, 2
  br i1 %.not8, label %.preheader15, label %33, !llvm.loop !18

.preheader15:                                     ; preds = %33, %.preheader15
  %36 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %37 = and i32 %36, 8
  %.not9 = icmp eq i32 %37, 0
  br i1 %.not9, label %.preheader15, label %.preheader14, !llvm.loop !19

.preheader14:                                     ; preds = %.preheader15, %.preheader14
  %38 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %39 = and i32 %38, 16
  %.not10 = icmp eq i32 %39, 0
  br i1 %.not10, label %.preheader14, label %.preheader13, !llvm.loop !20

.preheader13:                                     ; preds = %.preheader14, %.preheader13
  %40 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %41 = and i32 %40, 48
  %.not11 = icmp eq i32 %41, 0
  br i1 %.not11, label %.preheader13, label %.preheader, !llvm.loop !21

.preheader:                                       ; preds = %.preheader13, %.preheader
  %42 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  %43 = and i32 %42, 2304
  %.not12 = icmp eq i32 %43, 0
  br i1 %.not12, label %.preheader, label %44, !llvm.loop !22

44:                                               ; 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}


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