; LLVM IR from lfarcaro/ARINC653_ARMV7A_AM335X :: Hardware (hsi2c_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 @I2C1ModuleClkConfig() #0 {
  %1 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %2 = or i32 %1, 2
  store volatile i32 %2, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  br label %3

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

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

8:                                                ; preds = %3
  %9 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %10 = or i32 %9, 2
  store volatile i32 %10, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  br label %11

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

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

16:                                               ; preds = %11
  %17 = load volatile i32, ptr inttoptr (i64 1155530972 to ptr), align 4, !tbaa !5
  %18 = or i32 %17, 2
  store volatile i32 %18, ptr inttoptr (i64 1155530972 to ptr), align 4, !tbaa !5
  br label %19

19:                                               ; preds = %23, %16
  %20 = load volatile i32, ptr inttoptr (i64 1155530972 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 !12

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

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

31:                                               ; preds = %27
  br label %27, !llvm.loop !13

32:                                               ; preds = %27
  %33 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %34 = or i32 %33, 2
  store volatile i32 %34, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  br label %35

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

39:                                               ; preds = %35
  br label %35, !llvm.loop !14

40:                                               ; preds = %35
  %41 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 4, !tbaa !5
  %42 = or i32 %41, 2
  store volatile i32 %42, ptr inttoptr (i64 1155530752 to ptr), align 4, !tbaa !5
  br label %43

43:                                               ; preds = %47, %40
  %44 = load volatile i32, ptr inttoptr (i64 1155530752 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 !15

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

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

55:                                               ; preds = %51
  br label %51, !llvm.loop !16

56:                                               ; preds = %51
  %57 = load volatile i32, ptr inttoptr (i64 1155530824 to ptr), align 4, !tbaa !5
  %58 = or i32 %57, 2
  store volatile i32 %58, ptr inttoptr (i64 1155530824 to ptr), align 4, !tbaa !5
  br label %59

59:                                               ; preds = %63, %56
  %60 = load volatile i32, ptr inttoptr (i64 1155530824 to ptr), align 4, !tbaa !5
  %61 = and i32 %60, 3
  %62 = icmp ne i32 %61, 2
  br i1 %62, label %63, label %64

63:                                               ; preds = %59
  br label %59, !llvm.loop !17

64:                                               ; preds = %59
  br label %65

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

70:                                               ; preds = %65
  br label %65, !llvm.loop !18

71:                                               ; preds = %65
  br label %72

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

77:                                               ; preds = %72
  br label %72, !llvm.loop !19

78:                                               ; preds = %72
  br label %79

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

84:                                               ; preds = %79
  br label %79, !llvm.loop !20

85:                                               ; preds = %79
  br label %86

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

91:                                               ; preds = %86
  br label %86, !llvm.loop !21

92:                                               ; preds = %86
  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}


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

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

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

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

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

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

18:                                               ; preds = %15
  %19 = load volatile i32, ptr inttoptr (i64 1155530976 to ptr), align 32, !tbaa !5
  %20 = or i32 %19, 2
  store volatile i32 %20, ptr inttoptr (i64 1155530976 to ptr), align 32, !tbaa !5
  br label %21

21:                                               ; preds = %21, %18
  %22 = load volatile i32, ptr inttoptr (i64 1155530976 to ptr), align 32, !tbaa !5
  %23 = and i32 %22, 3
  %.not3 = icmp eq i32 %23, 2
  br i1 %.not3, label %24, label %21, !llvm.loop !13

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

27:                                               ; preds = %27, %24
  %28 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %29 = and i32 %28, 3
  %.not4 = icmp eq i32 %29, 2
  br i1 %.not4, label %30, label %27, !llvm.loop !14

30:                                               ; preds = %27
  %31 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  %32 = or i32 %31, 2
  store volatile i32 %32, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  br label %33

33:                                               ; preds = %33, %30
  %34 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  %35 = and i32 %34, 3
  %.not5 = icmp eq i32 %35, 2
  br i1 %.not5, label %36, label %33, !llvm.loop !15

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

39:                                               ; preds = %39, %36
  %40 = load volatile i32, ptr inttoptr (i64 1155530848 to ptr), align 32, !tbaa !5
  %41 = and i32 %40, 3
  %.not6 = icmp eq i32 %41, 2
  br i1 %.not6, label %42, label %39, !llvm.loop !16

42:                                               ; preds = %39
  %43 = load volatile i32, ptr inttoptr (i64 1155530824 to ptr), align 8, !tbaa !5
  %44 = or i32 %43, 2
  store volatile i32 %44, ptr inttoptr (i64 1155530824 to ptr), align 8, !tbaa !5
  br label %45

45:                                               ; preds = %45, %42
  %46 = load volatile i32, ptr inttoptr (i64 1155530824 to ptr), align 8, !tbaa !5
  %47 = and i32 %46, 3
  %.not7 = icmp eq i32 %47, 2
  br i1 %.not7, label %.preheader14, label %45, !llvm.loop !17

.preheader14:                                     ; preds = %45, %.preheader14
  %48 = load volatile i32, ptr inttoptr (i64 1155530756 to ptr), align 4, !tbaa !5
  %49 = and i32 %48, 8
  %.not8 = icmp eq i32 %49, 0
  br i1 %.not8, label %.preheader14, label %.preheader13, !llvm.loop !18

.preheader13:                                     ; preds = %.preheader14, %.preheader13
  %50 = load volatile i32, ptr inttoptr (i64 1155530764 to ptr), align 4, !tbaa !5
  %51 = and i32 %50, 16
  %.not9 = icmp eq i32 %51, 0
  br i1 %.not9, label %.preheader13, label %.preheader12, !llvm.loop !19

.preheader12:                                     ; preds = %.preheader13, %.preheader12
  %52 = load volatile i32, ptr inttoptr (i64 1155531052 to ptr), align 4, !tbaa !5
  %53 = and i32 %52, 48
  %.not10 = icmp eq i32 %53, 0
  br i1 %.not10, label %.preheader12, label %.preheader, !llvm.loop !20

.preheader:                                       ; preds = %.preheader12, %.preheader
  %54 = load volatile i32, ptr inttoptr (i64 1155530752 to ptr), align 2097152, !tbaa !5
  %55 = and i32 %54, 16777472
  %.not11 = icmp eq i32 %55, 0
  br i1 %.not11, label %.preheader, label %56, !llvm.loop !21

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


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