; LLVM IR from lfarcaro/ARINC653_ARMV7A_AM335X :: Hardware (watchdog_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 @WatchdogTimer1ModuleClkConfig() #0 {
  store volatile i32 1, ptr inttoptr (i64 1155532088 to ptr), align 4, !tbaa !5
  br label %1

1:                                                ; preds = %5, %0
  %2 = load volatile i32, ptr inttoptr (i64 1155532088 to ptr), align 4, !tbaa !5
  %3 = and i32 %2, 1
  %4 = icmp ne i32 %3, 1
  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 1155530756 to ptr), align 4, !tbaa !5
  br label %7

7:                                                ; preds = %11, %6
  %8 = load volatile i32, ptr inttoptr (i64 1155530756 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 1155530764 to ptr), align 4, !tbaa !5
  br label %13

13:                                               ; preds = %17, %12
  %14 = load volatile i32, ptr inttoptr (i64 1155530764 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 1155530972 to ptr), align 4, !tbaa !5
  br label %19

19:                                               ; preds = %23, %18
  %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 !13

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

25:                                               ; preds = %29, %24
  %26 = load volatile i32, ptr inttoptr (i64 1155530976 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 1155531052 to ptr), align 4, !tbaa !5
  br label %31

31:                                               ; preds = %35, %30
  %32 = load volatile i32, ptr inttoptr (i64 1155531052 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 1155531776 to ptr), align 4, !tbaa !5
  br label %37

37:                                               ; preds = %41, %36
  %38 = load volatile i32, ptr inttoptr (i64 1155531776 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 1155531780 to ptr), align 4, !tbaa !5
  br label %43

43:                                               ; preds = %47, %42
  %44 = load volatile i32, ptr inttoptr (i64 1155531780 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
  %49 = load volatile i32, ptr inttoptr (i64 1155531796 to ptr), align 4, !tbaa !5
  %50 = or i32 %49, 2
  store volatile i32 %50, ptr inttoptr (i64 1155531796 to ptr), align 4, !tbaa !5
  br label %51

51:                                               ; preds = %55, %48
  %52 = load volatile i32, ptr inttoptr (i64 1155531796 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 !18

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

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

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

62:                                               ; preds = %57
  br label %63

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

68:                                               ; preds = %63
  br label %63, !llvm.loop !20

69:                                               ; preds = %63
  br label %70

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

75:                                               ; preds = %70
  br label %70, !llvm.loop !21

76:                                               ; preds = %70
  br label %77

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

82:                                               ; preds = %77
  br label %77, !llvm.loop !22

83:                                               ; preds = %77
  br label %84

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

89:                                               ; preds = %84
  br label %84, !llvm.loop !23

90:                                               ; preds = %84
  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 @WatchdogTimer1ModuleClkConfig() local_unnamed_addr #0 {
  store volatile i32 1, ptr inttoptr (i64 1155532088 to ptr), align 8, !tbaa !5
  br label %1

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

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

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

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

9:                                                ; preds = %9, %8
  %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 !12

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

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

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

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

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

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

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

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

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

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

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

35:                                               ; preds = %35, %32
  %36 = load volatile i32, ptr inttoptr (i64 1155531796 to ptr), align 4, !tbaa !5
  %37 = and i32 %36, 3
  %.not7 = icmp eq i32 %37, 2
  br i1 %.not7, label %38, label %35, !llvm.loop !18

38:                                               ; preds = %35
  store volatile i32 2, ptr inttoptr (i64 1155531988 to ptr), align 4, !tbaa !5
  br label %39

39:                                               ; preds = %39, %38
  %40 = load volatile i32, ptr inttoptr (i64 1155531988 to ptr), align 4, !tbaa !5
  %41 = and i32 %40, 3
  %.not8 = icmp eq i32 %41, 2
  br i1 %.not8, label %.preheader15, label %39, !llvm.loop !19

.preheader15:                                     ; preds = %39, %.preheader15
  %42 = load volatile i32, ptr inttoptr (i64 1155531776 to ptr), align 1024, !tbaa !5
  %43 = and i32 %42, 20
  %.not9 = icmp eq i32 %43, 0
  br i1 %.not9, label %.preheader15, label %.preheader14, !llvm.loop !20

.preheader14:                                     ; preds = %.preheader15, %.preheader14
  %44 = load volatile i32, ptr inttoptr (i64 1155531788 to ptr), align 4, !tbaa !5
  %45 = and i32 %44, 2
  %.not10 = icmp eq i32 %45, 0
  br i1 %.not10, label %.preheader14, label %.preheader13, !llvm.loop !21

.preheader13:                                     ; preds = %.preheader14, %.preheader13
  %46 = load volatile i32, ptr inttoptr (i64 1155531952 to ptr), align 16, !tbaa !5
  %47 = and i32 %46, 2
  %.not11 = icmp eq i32 %47, 0
  br i1 %.not11, label %.preheader13, label %.preheader, !llvm.loop !22

.preheader:                                       ; preds = %.preheader13, %.preheader
  %48 = load volatile i32, ptr inttoptr (i64 1155531980 to ptr), align 4, !tbaa !5
  %49 = and i32 %48, 2
  %.not12 = icmp eq i32 %49, 0
  br i1 %.not12, label %.preheader, label %50, !llvm.loop !23

50:                                               ; 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