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

; 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._BLACKBOARD_INFORMATION_TYPE = type { i32, ptr, i32, i32, ptr, i32, %struct._priorityqueueRECORD }

@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 @DISPLAY_BLACKBOARD(i32 noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @ENTER_CORE()
  %13 = call i32 @PORT_GETCORE()
  %14 = zext i32 %13 to i64
  %15 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %14
  store ptr %15, ptr %9, align 8, !tbaa !9
  %16 = load ptr, ptr %9, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %16, i32 0, i32 8
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %22

20:                                               ; preds = %4
  %21 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 6, ptr %21, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %107

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

30:                                               ; preds = %22
  %31 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 4, ptr %31, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %107

32:                                               ; preds = %22
  %33 = load ptr, ptr %9, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %33, i32 0, i32 8
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %35, i32 0, i32 30
  %37 = load ptr, ptr %36, align 8, !tbaa !22
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %37, i64 %39
  store ptr %40, ptr %10, align 8, !tbaa !9
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = load ptr, ptr %10, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 4, !tbaa !23
  %45 = icmp ugt i32 %41, %44
  br i1 %45, label %46, label %48

46:                                               ; preds = %32
  %47 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 4, ptr %47, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %107

48:                                               ; preds = %32
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %49, i32 0, i32 2
  store i32 2, ptr %50, align 8, !tbaa !25
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %67, %48
  %52 = load i32, ptr %11, align 4, !tbaa !5
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = icmp ult i32 %52, %53
  br i1 %54, label %55, label %70

55:                                               ; preds = %51
  %56 = load ptr, ptr %6, align 8, !tbaa !9
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds i8, ptr %56, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !26
  %61 = load ptr, ptr %10, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %61, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !27
  %64 = load i32, ptr %11, align 4, !tbaa !5
  %65 = zext i32 %64 to i64
  %66 = getelementptr inbounds i8, ptr %63, i64 %65
  store i8 %60, ptr %66, align 1, !tbaa !26
  br label %67

67:                                               ; preds = %55
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = add i32 %68, 1
  store i32 %69, ptr %11, align 4, !tbaa !5
  br label %51, !llvm.loop !28

70:                                               ; preds = %51
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = load ptr, ptr %10, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %72, i32 0, i32 5
  store i32 %71, ptr %73, align 8, !tbaa !30
  %74 = load ptr, ptr %10, align 8, !tbaa !9
  %75 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %74, i32 0, i32 6
  %76 = getelementptr inbounds %struct._priorityqueueRECORD, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !31
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %105, label %79

79:                                               ; preds = %70
  br label %80

80:                                               ; preds = %87, %79
  %81 = load ptr, ptr %10, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %81, i32 0, i32 6
  %83 = getelementptr inbounds %struct._priorityqueueRECORD, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 8, !tbaa !31
  %85 = icmp eq i32 %84, 0
  %86 = xor i1 %85, true
  br i1 %86, label %87, label %96

87:                                               ; preds = %80
  %88 = load ptr, ptr %9, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %88, i32 0, i32 8
  %90 = load ptr, ptr %89, align 8, !tbaa !11
  %91 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %90, i32 0, i32 3
  %92 = load i32, ptr %91, align 8, !tbaa !32
  %93 = load ptr, ptr %10, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %93, i32 0, i32 6
  %95 = load ptr, ptr %8, align 8, !tbaa !9
  call void @SIGNAL_RESOURCE(i32 noundef %92, ptr noundef %94, i8 noundef zeroext 0, ptr noundef %95)
  br label %80, !llvm.loop !33

96:                                               ; preds = %80
  %97 = load ptr, ptr %9, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %97, i32 0, i32 8
  %99 = load ptr, ptr %98, align 8, !tbaa !11
  %100 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %99, i32 0, i32 6
  %101 = load i32, ptr %100, align 4, !tbaa !34
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %96
  call void @PORT_YIELD()
  br label %104

104:                                              ; preds = %103, %96
  br label %105

105:                                              ; preds = %104, %70
  %106 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 1, ptr %106, align 4, !tbaa !5
  call void @EXIT_CORE()
  store i32 0, ptr %12, align 4
  br label %107

107:                                              ; preds = %105, %46, %30, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %108 = load i32, ptr %12, align 4
  switch i32 %108, label %110 [
    i32 0, label %109
    i32 1, label %109
  ]

109:                                              ; preds = %107, %107
  ret void

110:                                              ; preds = %107
  unreachable
}

declare void @SIGNAL_RESOURCE(i32 noundef, ptr noundef, i8 noundef zeroext, ptr noundef) #1

declare void @PORT_YIELD() #1

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 544}
!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 552}
!23 = !{!24, !6, i64 20}
!24 = !{!"_BLACKBOARD_INFORMATION_TYPE", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !10, i64 24, !6, i64 32, !17, i64 40}
!25 = !{!24, !6, i64 16}
!26 = !{!7, !7, i64 0}
!27 = !{!24, !10, i64 24}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!24, !6, i64 32}
!31 = !{!24, !6, i64 48}
!32 = !{!19, !6, i64 24}
!33 = distinct !{!33, !29}
!34 = !{!19, !6, i64 36}


; 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._BLACKBOARD_INFORMATION_TYPE = type { i32, ptr, i32, i32, ptr, i32, %struct._priorityqueueRECORD }

@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 @DISPLAY_BLACKBOARD(i32 noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  tail call void @ENTER_CORE() #2
  %5 = tail call i32 @PORT_GETCORE() #2
  %6 = zext i32 %5 to i64
  %7 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %6, i32 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %60, label %10

10:                                               ; preds = %4
  %11 = getelementptr inbounds i8, ptr %8, i64 544
  %12 = load i32, ptr %11, align 8, !tbaa !16
  %.not = icmp ugt i32 %12, %0
  br i1 %.not, label %13, label %60

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %8, i64 552
  %15 = load ptr, ptr %14, align 8, !tbaa !20
  %16 = zext i32 %0 to i64
  %17 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %15, i64 %16
  %18 = getelementptr inbounds i8, ptr %17, i64 20
  %19 = load i32, ptr %18, align 4, !tbaa !21
  %20 = icmp ult i32 %19, %2
  br i1 %20, label %60, label %21

21:                                               ; preds = %13
  %22 = getelementptr inbounds i8, ptr %17, i64 16
  store i32 2, ptr %22, align 8, !tbaa !23
  %.not31 = icmp eq i32 %2, 0
  br i1 %.not31, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %21
  %23 = getelementptr inbounds i8, ptr %17, i64 24
  %wide.trip.count = zext i32 %2 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %24 = icmp ult i32 %2, 4
  br i1 %24, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 4294967292
  br label %25

25:                                               ; preds = %25, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.3, %25 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %25 ]
  %26 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  %27 = load i8, ptr %26, align 1, !tbaa !24
  %28 = load ptr, ptr %23, align 8, !tbaa !25
  %29 = getelementptr inbounds i8, ptr %28, i64 %indvars.iv
  store i8 %27, ptr %29, align 1, !tbaa !24
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %30 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.next
  %31 = load i8, ptr %30, align 1, !tbaa !24
  %32 = load ptr, ptr %23, align 8, !tbaa !25
  %33 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv.next
  store i8 %31, ptr %33, align 1, !tbaa !24
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %34 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.next.1
  %35 = load i8, ptr %34, align 1, !tbaa !24
  %36 = load ptr, ptr %23, align 8, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %36, i64 %indvars.iv.next.1
  store i8 %35, ptr %37, align 1, !tbaa !24
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %38 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.next.2
  %39 = load i8, ptr %38, align 1, !tbaa !24
  %40 = load ptr, ptr %23, align 8, !tbaa !25
  %41 = getelementptr inbounds i8, ptr %40, i64 %indvars.iv.next.2
  store i8 %39, ptr %41, align 1, !tbaa !24
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %25, !llvm.loop !26

._crit_edge.loopexit.unr-lcssa:                   ; preds = %25, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.3, %25 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %42 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.epil
  %43 = load i8, ptr %42, align 1, !tbaa !24
  %44 = load ptr, ptr %23, align 8, !tbaa !25
  %45 = getelementptr inbounds i8, ptr %44, i64 %indvars.iv.epil
  store i8 %43, ptr %45, align 1, !tbaa !24
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !28

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %21
  %46 = getelementptr inbounds i8, ptr %17, i64 32
  store i32 %2, ptr %46, align 8, !tbaa !30
  %47 = getelementptr inbounds i8, ptr %17, i64 40
  %48 = getelementptr inbounds i8, ptr %17, i64 48
  %49 = load i32, ptr %48, align 8, !tbaa !31
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %60, label %.preheader

.preheader:                                       ; preds = %._crit_edge, %.preheader
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i64 24
  %53 = load i32, ptr %52, align 8, !tbaa !32
  tail call void @SIGNAL_RESOURCE(i32 noundef %53, ptr noundef nonnull %47, i8 noundef zeroext 0, ptr noundef %3) #2
  %.pr = load i32, ptr %48, align 8, !tbaa !31
  %.not29 = icmp eq i32 %.pr, 0
  br i1 %.not29, label %54, label %.preheader, !llvm.loop !33

54:                                               ; preds = %.preheader
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 36
  %57 = load i32, ptr %56, align 4, !tbaa !34
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %54
  tail call void @PORT_YIELD() #2
  br label %60

60:                                               ; preds = %._crit_edge, %59, %54, %13, %10, %4
  %.sink = phi i32 [ 6, %4 ], [ 4, %10 ], [ 4, %13 ], [ 1, %54 ], [ 1, %59 ], [ 1, %._crit_edge ]
  store i32 %.sink, ptr %3, align 4, !tbaa !35
  tail call void @EXIT_CORE() #2
  ret void
}

declare void @SIGNAL_RESOURCE(i32 noundef, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #0

declare void @PORT_YIELD() local_unnamed_addr #0

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 = !{!17, !11, i64 544}
!17 = !{!"_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, !18, i64 168, !13, i64 272, !11, i64 384, !19, 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}
!18 = !{!"_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}
!19 = !{!"_priorityqueueENTRY", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{!17, !7, i64 552}
!21 = !{!22, !11, i64 20}
!22 = !{!"_BLACKBOARD_INFORMATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !7, i64 24, !11, i64 32, !15, i64 40}
!23 = !{!22, !11, i64 16}
!24 = !{!8, !8, i64 0}
!25 = !{!22, !7, i64 24}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.unroll.disable"}
!30 = !{!22, !11, i64 32}
!31 = !{!22, !11, i64 48}
!32 = !{!17, !11, i64 24}
!33 = distinct !{!33, !27}
!34 = !{!17, !11, i64 36}
!35 = !{!11, !11, i64 0}


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