; LLVM IR from lfarcaro/ARINC653_ARMV7A_Z7000 :: ARINC653_ARMV7A_Z7000.sw/ARINC653_ARMV7A_Z7000/src/ARINC653 (MESSAGE)

; 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._MODULE_INFORMATION_TYPE = type { ptr, %struct._heapRECORD, i32, i32, i32, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i64, i64, i64, %struct._priorityqueueRECORD }
%struct._heapRECORD = type { ptr, i32, i32, i32 }
%struct._CONTEXT_TYPE = type { i32, ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32 }
%struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32, i32 }
%struct._priorityqueueRECORD = type { ptr, i32, i8, i8 }
%struct._PARTITION_INFORMATION_TYPE = type { i8, ptr, ptr, i32, i32, i32, i32, i8, %struct._heapRECORD, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._ERRORHANDLER_INFORMATION_TYPE, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i32, %struct._priorityqueueENTRY, %struct._priorityqueueRECORD, %struct._priorityqueueRECORD, %struct._priorityqueueRECORD, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr }
%struct._ERRORHANDLER_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32 }
%struct._priorityqueueENTRY = type { i64, i64, ptr, ptr, ptr }
%struct._SAMPLINGPORT_INFORMATION_TYPE = type { i32, ptr, i32, i32, i64, i64, i64, i32, i32, ptr, i32 }

@CORE_MODULE_INFORMATION = external global [2 x %struct._MODULE_INFORMATION_TYPE], align 16

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare void @ENTER_CORE() #1

declare i32 @PORT_GETCORE() #1

declare void @EXIT_CORE() #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local void @READ_SAMPLING_MESSAGE(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @ENTER_CORE()
  %15 = call i32 @PORT_GETCORE()
  %16 = zext i32 %15 to i64
  %17 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %16
  store ptr %17, ptr %11, align 8, !tbaa !9
  %18 = load ptr, ptr %11, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %18, i32 0, i32 8
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %24

22:                                               ; preds = %5
  %23 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 6, ptr %23, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %14, align 4
  br label %132

24:                                               ; preds = %5
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = load ptr, ptr %11, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %26, i32 0, i32 8
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %28, i32 0, i32 23
  %30 = load i32, ptr %29, align 8, !tbaa !18
  %31 = icmp uge i32 %25, %30
  br i1 %31, label %32, label %34

32:                                               ; preds = %24
  %33 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 4, ptr %33, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %14, align 4
  br label %132

34:                                               ; preds = %24
  %35 = load ptr, ptr %11, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %35, i32 0, i32 8
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %37, i32 0, i32 24
  %39 = load ptr, ptr %38, align 8, !tbaa !22
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %39, i64 %41
  store ptr %42, ptr %12, align 8, !tbaa !9
  %43 = load ptr, ptr %12, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %43, i32 0, i32 3
  %45 = load i32, ptr %44, align 4, !tbaa !23
  %46 = icmp ne i32 %45, 2
  br i1 %46, label %47, label %49

47:                                               ; preds = %34
  %48 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 6, ptr %48, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %14, align 4
  br label %132

49:                                               ; preds = %34
  %50 = load ptr, ptr %12, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %50, i32 0, i32 8
  %52 = load i32, ptr %51, align 4, !tbaa !25
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 1, ptr %55, align 4, !tbaa !5
  %56 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 2, ptr %56, align 4, !tbaa !5
  br label %127

57:                                               ; preds = %49
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %76, %57
  %59 = load i32, ptr %13, align 4, !tbaa !5
  %60 = load ptr, ptr %12, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %60, i32 0, i32 10
  %62 = load i32, ptr %61, align 8, !tbaa !26
  %63 = icmp ult i32 %59, %62
  br i1 %63, label %64, label %79

64:                                               ; preds = %58
  %65 = load ptr, ptr %12, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %65, i32 0, i32 9
  %67 = load ptr, ptr %66, align 8, !tbaa !27
  %68 = load i32, ptr %13, align 4, !tbaa !5
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %67, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !28
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %72, i64 %74
  store i8 %71, ptr %75, align 1, !tbaa !28
  br label %76

76:                                               ; preds = %64
  %77 = load i32, ptr %13, align 4, !tbaa !5
  %78 = add i32 %77, 1
  store i32 %78, ptr %13, align 4, !tbaa !5
  br label %58, !llvm.loop !29

79:                                               ; preds = %58
  %80 = load ptr, ptr %12, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %80, i32 0, i32 10
  %82 = load i32, ptr %81, align 8, !tbaa !26
  %83 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 %82, ptr %83, align 4, !tbaa !5
  %84 = load ptr, ptr %11, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %84, i32 0, i32 10
  %86 = load i64, ptr %85, align 8, !tbaa !31
  %87 = load ptr, ptr %11, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %87, i32 0, i32 11
  %89 = load i64, ptr %88, align 8, !tbaa !32
  %90 = add nsw i64 %86, %89
  %91 = load ptr, ptr %12, align 8, !tbaa !9
  %92 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %91, i32 0, i32 5
  store i64 %90, ptr %92, align 8, !tbaa !33
  %93 = load ptr, ptr %12, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %93, i32 0, i32 4
  %95 = load i64, ptr %94, align 8, !tbaa !34
  %96 = icmp ne i64 %95, -1
  br i1 %96, label %97, label %123

97:                                               ; preds = %79
  %98 = load ptr, ptr %12, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %98, i32 0, i32 6
  %100 = load i64, ptr %99, align 8, !tbaa !35
  %101 = icmp ne i64 %100, -1
  br i1 %101, label %102, label %123

102:                                              ; preds = %97
  %103 = load ptr, ptr %11, align 8, !tbaa !9
  %104 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %103, i32 0, i32 10
  %105 = load i64, ptr %104, align 8, !tbaa !31
  %106 = load ptr, ptr %11, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %106, i32 0, i32 11
  %108 = load i64, ptr %107, align 8, !tbaa !32
  %109 = add nsw i64 %105, %108
  %110 = load ptr, ptr %12, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %110, i32 0, i32 6
  %112 = load i64, ptr %111, align 8, !tbaa !35
  %113 = sub nsw i64 %109, %112
  %114 = load ptr, ptr %12, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %114, i32 0, i32 4
  %116 = load i64, ptr %115, align 8, !tbaa !34
  %117 = icmp sgt i64 %113, %116
  br i1 %117, label %118, label %120

118:                                              ; preds = %102
  %119 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 1, ptr %119, align 4, !tbaa !5
  br label %122

120:                                              ; preds = %102
  %121 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 2, ptr %121, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %120, %118
  br label %125

123:                                              ; preds = %97, %79
  %124 = load ptr, ptr %9, align 8, !tbaa !9
  store i32 2, ptr %124, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %123, %122
  %126 = load ptr, ptr %10, align 8, !tbaa !9
  store i32 1, ptr %126, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %125, %54
  %128 = load ptr, ptr %9, align 8, !tbaa !9
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = load ptr, ptr %12, align 8, !tbaa !9
  %131 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %130, i32 0, i32 7
  store i32 %129, ptr %131, align 8, !tbaa !36
  call void @EXIT_CORE()
  store i32 0, ptr %14, align 4
  br label %132

132:                                              ; preds = %127, %47, %32, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %133 = load i32, ptr %14, align 4
  switch i32 %133, label %135 [
    i32 0, label %134
    i32 1, label %134
  ]

134:                                              ; preds = %132, %132
  ret void

135:                                              ; preds = %132
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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" }
attributes #2 = { 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" }
attributes #3 = { nounwind }

!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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 136}
!12 = !{!"_MODULE_INFORMATION_TYPE", !10, i64 0, !13, i64 8, !6, i64 32, !6, i64 36, !6, i64 40, !14, i64 48, !6, i64 120, !10, i64 128, !10, i64 136, !15, i64 144, !16, i64 256, !16, i64 264, !16, i64 272, !17, i64 280}
!13 = !{!"_heapRECORD", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}
!14 = !{!"_CONTEXT_TYPE", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !7, i64 36, !10, i64 40, !10, i64 48, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68}
!15 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !6, i64 16, !14, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !6, i64 100, !6, i64 104}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"_priorityqueueRECORD", !10, i64 0, !6, i64 8, !7, i64 12, !7, i64 13}
!18 = !{!19, !6, i64 496}
!19 = !{!"_PARTITION_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !7, i64 40, !13, i64 48, !14, i64 72, !6, i64 144, !10, i64 152, !10, i64 160, !20, i64 168, !15, i64 272, !6, i64 384, !21, i64 392, !17, i64 432, !17, i64 448, !17, i64 464, !6, i64 480, !6, i64 484, !10, i64 488, !6, i64 496, !10, i64 504, !6, i64 512, !10, i64 520, !6, i64 528, !10, i64 536, !6, i64 544, !10, i64 552, !6, i64 560, !10, i64 568, !6, i64 576, !10, i64 584}
!20 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !6, i64 16, !14, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !6, i64 100}
!21 = !{!"_priorityqueueENTRY", !16, i64 0, !16, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!22 = !{!19, !10, i64 504}
!23 = !{!24, !6, i64 20}
!24 = !{!"_SAMPLINGPORT_INFORMATION_TYPE", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !16, i64 24, !16, i64 32, !16, i64 40, !6, i64 48, !6, i64 52, !10, i64 56, !6, i64 64}
!25 = !{!24, !6, i64 52}
!26 = !{!24, !6, i64 64}
!27 = !{!24, !10, i64 56}
!28 = !{!7, !7, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!12, !16, i64 256}
!32 = !{!12, !16, i64 264}
!33 = !{!24, !16, i64 32}
!34 = !{!24, !16, i64 24}
!35 = !{!24, !16, i64 40}
!36 = !{!24, !6, i64 48}


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

%struct._MODULE_INFORMATION_TYPE = type { ptr, %struct._heapRECORD, i32, i32, i32, %struct._CONTEXT_TYPE, i32, ptr, ptr, %struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE, i64, i64, i64, %struct._priorityqueueRECORD }
%struct._heapRECORD = type { ptr, i32, i32, i32 }
%struct._CONTEXT_TYPE = type { i32, ptr, ptr, ptr, i32, i8, ptr, ptr, i32, i32, i32, i32 }
%struct._HEALTHMONITORINGCALLBACK_INFORMATION_TYPE = type { i8, ptr, i32, %struct._CONTEXT_TYPE, i8, i8, i8, i8, i32, i32 }
%struct._priorityqueueRECORD = type { ptr, i32, i8, i8 }
%struct._SAMPLINGPORT_INFORMATION_TYPE = type { i32, ptr, i32, i32, i64, i64, i64, i32, i32, ptr, i32 }

@CORE_MODULE_INFORMATION = external local_unnamed_addr global [2 x %struct._MODULE_INFORMATION_TYPE], align 16

declare void @ENTER_CORE() local_unnamed_addr #0

declare i32 @PORT_GETCORE() local_unnamed_addr #0

declare void @EXIT_CORE() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @READ_SAMPLING_MESSAGE(i32 noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #1 {
  tail call void @ENTER_CORE() #2
  %6 = tail call i32 @PORT_GETCORE() #2
  %7 = zext i32 %6 to i64
  %8 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %7
  %9 = getelementptr inbounds i8, ptr %8, i64 136
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %5
  store i32 6, ptr %4, align 4, !tbaa !16
  br label %57

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %10, i64 496
  %15 = load i32, ptr %14, align 8, !tbaa !17
  %.not = icmp ugt i32 %15, %0
  br i1 %.not, label %17, label %16

16:                                               ; preds = %13
  store i32 4, ptr %4, align 4, !tbaa !16
  br label %57

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %10, i64 504
  %19 = load ptr, ptr %18, align 8, !tbaa !21
  %20 = zext i32 %0 to i64
  %21 = getelementptr inbounds %struct._SAMPLINGPORT_INFORMATION_TYPE, ptr %19, i64 %20
  %22 = getelementptr inbounds i8, ptr %21, i64 20
  %23 = load i32, ptr %22, align 4, !tbaa !22
  %.not40 = icmp eq i32 %23, 2
  br i1 %.not40, label %25, label %24

24:                                               ; preds = %17
  store i32 6, ptr %4, align 4, !tbaa !16
  br label %57

25:                                               ; preds = %17
  %26 = getelementptr inbounds i8, ptr %21, i64 52
  %27 = load i32, ptr %26, align 4, !tbaa !24
  %28 = icmp eq i32 %27, 1
  br i1 %28, label %54, label %.preheader

.preheader:                                       ; preds = %25
  %29 = getelementptr inbounds i8, ptr %21, i64 64
  %30 = load i32, ptr %29, align 8, !tbaa !25
  %.not44 = icmp eq i32 %30, 0
  br i1 %.not44, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %31 = getelementptr inbounds i8, ptr %21, i64 56
  br label %32

32:                                               ; preds = %.lr.ph, %32
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %32 ]
  %33 = load ptr, ptr %31, align 8, !tbaa !26
  %34 = getelementptr inbounds i8, ptr %33, i64 %indvars.iv
  %35 = load i8, ptr %34, align 1, !tbaa !27
  %36 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  store i8 %35, ptr %36, align 1, !tbaa !27
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i32, ptr %29, align 8, !tbaa !25
  %38 = zext i32 %37 to i64
  %39 = icmp ult i64 %indvars.iv.next, %38
  br i1 %39, label %32, label %._crit_edge, !llvm.loop !28

._crit_edge:                                      ; preds = %32, %.preheader
  %.lcssa = phi i32 [ 0, %.preheader ], [ %37, %32 ]
  store i32 %.lcssa, ptr %2, align 4, !tbaa !16
  %40 = getelementptr inbounds i8, ptr %8, i64 256
  %41 = load i64, ptr %40, align 8, !tbaa !30
  %42 = getelementptr inbounds i8, ptr %8, i64 264
  %43 = load i64, ptr %42, align 8, !tbaa !31
  %44 = add nsw i64 %43, %41
  %45 = getelementptr inbounds i8, ptr %21, i64 32
  store i64 %44, ptr %45, align 8, !tbaa !32
  %46 = getelementptr inbounds i8, ptr %21, i64 24
  %47 = load i64, ptr %46, align 8, !tbaa !33
  %.not41 = icmp eq i64 %47, -1
  br i1 %.not41, label %54, label %48

48:                                               ; preds = %._crit_edge
  %49 = getelementptr inbounds i8, ptr %21, i64 40
  %50 = load i64, ptr %49, align 8, !tbaa !34
  %.not42 = icmp eq i64 %50, -1
  br i1 %.not42, label %54, label %51

51:                                               ; preds = %48
  %52 = sub nsw i64 %44, %50
  %53 = icmp sgt i64 %52, %47
  %. = select i1 %53, i32 1, i32 2
  br label %54

54:                                               ; preds = %._crit_edge, %48, %51, %25
  %.sink = phi i32 [ 1, %25 ], [ %., %51 ], [ 2, %48 ], [ 2, %._crit_edge ]
  %storemerge = phi i32 [ 2, %25 ], [ 1, %51 ], [ 1, %48 ], [ 1, %._crit_edge ]
  store i32 %.sink, ptr %3, align 4, !tbaa !16
  store i32 %storemerge, ptr %4, align 4, !tbaa !16
  %55 = load i32, ptr %3, align 4, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %21, i64 48
  store i32 %55, ptr %56, align 8, !tbaa !35
  br label %57

57:                                               ; preds = %54, %24, %16, %12
  tail call void @EXIT_CORE() #2
  ret void
}

attributes #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" }
attributes #1 = { 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" }
attributes #2 = { nounwind }

!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 136}
!6 = !{!"_MODULE_INFORMATION_TYPE", !7, i64 0, !10, i64 8, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 48, !11, i64 120, !7, i64 128, !7, i64 136, !13, i64 144, !14, i64 256, !14, i64 264, !14, i64 272, !15, i64 280}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_heapRECORD", !7, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_CONTEXT_TYPE", !11, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !8, i64 36, !7, i64 40, !7, i64 48, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68}
!13 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !11, i64 100, !11, i64 104}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"_priorityqueueRECORD", !7, i64 0, !11, i64 8, !8, i64 12, !8, i64 13}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !11, i64 496}
!18 = !{!"_PARTITION_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !8, i64 40, !10, i64 48, !12, i64 72, !11, i64 144, !7, i64 152, !7, i64 160, !19, i64 168, !13, i64 272, !11, i64 384, !20, i64 392, !15, i64 432, !15, i64 448, !15, i64 464, !11, i64 480, !11, i64 484, !7, i64 488, !11, i64 496, !7, i64 504, !11, i64 512, !7, i64 520, !11, i64 528, !7, i64 536, !11, i64 544, !7, i64 552, !11, i64 560, !7, i64 568, !11, i64 576, !7, i64 584}
!19 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !8, i64 0, !7, i64 8, !11, i64 16, !12, i64 24, !8, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !11, i64 100}
!20 = !{!"_priorityqueueENTRY", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!21 = !{!18, !7, i64 504}
!22 = !{!23, !11, i64 20}
!23 = !{!"_SAMPLINGPORT_INFORMATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !14, i64 24, !14, i64 32, !14, i64 40, !11, i64 48, !11, i64 52, !7, i64 56, !11, i64 64}
!24 = !{!23, !11, i64 52}
!25 = !{!23, !11, i64 64}
!26 = !{!23, !7, i64 56}
!27 = !{!8, !8, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!6, !14, i64 256}
!31 = !{!6, !14, i64 264}
!32 = !{!23, !14, i64 32}
!33 = !{!23, !14, i64 24}
!34 = !{!23, !14, i64 40}
!35 = !{!23, !11, i64 48}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass