; 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._PARTITION_CONFIGURATION_TYPE = type { i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, i32, 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: nounwind uwtable
define dso_local void @CREATE_BLACKBOARD(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, 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 !5
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %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 !5
  store i32 6, ptr %21, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %128

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

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

31:                                               ; preds = %22
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %32, i32 0, i32 8
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %34, i32 0, i32 29
  %36 = load i32, ptr %35, align 8, !tbaa !22
  store i32 %36, ptr %10, align 4, !tbaa !9
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %38, i32 0, i32 8
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !23
  %43 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %42, i32 0, i32 7
  %44 = load i32, ptr %43, align 4, !tbaa !24
  %45 = icmp uge i32 %37, %44
  br i1 %45, label %46, label %48

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

48:                                               ; preds = %31
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  call void @GET_BLACKBOARD_ID(ptr noundef %49, ptr noundef %10, ptr noundef %50)
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %54, label %56

54:                                               ; preds = %48
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 2, ptr %55, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %128

56:                                               ; preds = %48
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = icmp ult i32 %57, 1
  br i1 %58, label %62, label %59

59:                                               ; preds = %56
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = icmp ugt i32 %60, 512
  br i1 %61, label %62, label %64

62:                                               ; preds = %59, %56
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 4, ptr %63, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %128

64:                                               ; preds = %59
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %65, i32 0, i32 8
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %67, i32 0, i32 30
  %69 = load ptr, ptr %68, align 8, !tbaa !26
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %69, i64 %71
  store ptr %72, ptr %11, align 8, !tbaa !5
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %73, i32 0, i32 8
  %75 = load ptr, ptr %74, align 8, !tbaa !11
  %76 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %75, i32 0, i32 8
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %77, i32 0, i32 4
  %79 = load i32, ptr %6, align 4, !tbaa !9
  call void @HEAP_ALLOCATE(ptr noundef %76, ptr noundef %78, i32 noundef %79, i8 noundef zeroext 0)
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %80, i32 0, i32 4
  %82 = load ptr, ptr %81, align 8, !tbaa !27
  %83 = icmp eq ptr %82, null
  br i1 %83, label %84, label %86

84:                                               ; preds = %64
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 5, ptr %85, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %128

86:                                               ; preds = %64
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %87, i32 0, i32 8
  %89 = load ptr, ptr %88, align 8, !tbaa !11
  %90 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %89, i32 0, i32 8
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %91, i32 0, i32 1
  call void @HEAP_ALLOCATE(ptr noundef %90, ptr noundef %92, i32 noundef 30, i8 noundef zeroext 0)
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !29
  %96 = icmp eq ptr %95, null
  br i1 %96, label %97, label %99

97:                                               ; preds = %86
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 5, ptr %98, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 1, ptr %12, align 4
  br label %128

99:                                               ; preds = %86
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !29
  %104 = call zeroext i8 @COMMON_COPYSTRING(ptr noundef %100, ptr noundef %103, i32 noundef 30)
  %105 = icmp ne i8 %104, 0
  br i1 %105, label %108, label %106

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

108:                                              ; preds = %99
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %110, i32 0, i32 0
  store i32 %109, ptr %111, align 8, !tbaa !30
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %112, i32 0, i32 2
  store i32 1, ptr %113, align 8, !tbaa !31
  %114 = load i32, ptr %6, align 4, !tbaa !9
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %115, i32 0, i32 3
  store i32 %114, ptr %116, align 4, !tbaa !32
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %117, i32 0, i32 6
  call void @PRIORITYQUEUE_CLEAR(ptr noundef %118, i8 noundef zeroext 1, i8 noundef zeroext 0)
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %119, i32 0, i32 8
  %121 = load ptr, ptr %120, align 8, !tbaa !11
  %122 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %121, i32 0, i32 29
  %123 = load i32, ptr %122, align 8, !tbaa !22
  %124 = add i32 %123, 1
  store i32 %124, ptr %122, align 8, !tbaa !22
  %125 = load i32, ptr %10, align 4, !tbaa !9
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %125, ptr %126, align 4, !tbaa !9
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 1, ptr %127, align 4, !tbaa !9
  call void @EXIT_CORE()
  store i32 0, ptr %12, align 4
  br label %128

128:                                              ; preds = %108, %106, %97, %84, %62, %54, %46, %29, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %129 = load i32, ptr %12, align 4
  switch i32 %129, label %131 [
    i32 0, label %130
    i32 1, label %130
  ]

130:                                              ; preds = %128, %128
  ret void

131:                                              ; preds = %128
  unreachable
}

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

declare void @ENTER_CORE() #2

declare i32 @PORT_GETCORE() #2

declare void @EXIT_CORE() #2

; Function Attrs: nounwind uwtable
declare dso_local void @GET_BLACKBOARD_ID(ptr noundef, ptr noundef, ptr noundef) #0

declare void @HEAP_ALLOCATE(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) #2

declare zeroext i8 @COMMON_COPYSTRING(ptr noundef, ptr noundef, i32 noundef) #2

declare void @PRIORITYQUEUE_CLEAR(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) #2

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

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 136}
!12 = !{!"_MODULE_INFORMATION_TYPE", !6, i64 0, !13, i64 8, !10, i64 32, !10, i64 36, !10, i64 40, !14, i64 48, !10, i64 120, !6, i64 128, !6, i64 136, !15, i64 144, !16, i64 256, !16, i64 264, !16, i64 272, !17, i64 280}
!13 = !{!"_heapRECORD", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!14 = !{!"_CONTEXT_TYPE", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !7, i64 36, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!15 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !10, i64 16, !14, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !10, i64 100, !10, i64 104}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"_priorityqueueRECORD", !6, i64 0, !10, i64 8, !7, i64 12, !7, i64 13}
!18 = !{!19, !10, i64 28}
!19 = !{!"_PARTITION_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !7, i64 40, !13, i64 48, !14, i64 72, !10, i64 144, !6, i64 152, !6, i64 160, !20, i64 168, !15, i64 272, !10, i64 384, !21, i64 392, !17, i64 432, !17, i64 448, !17, i64 464, !10, i64 480, !10, i64 484, !6, i64 488, !10, i64 496, !6, i64 504, !10, i64 512, !6, i64 520, !10, i64 528, !6, i64 536, !10, i64 544, !6, i64 552, !10, i64 560, !6, i64 568, !10, i64 576, !6, i64 584}
!20 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !10, i64 16, !14, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !10, i64 100}
!21 = !{!"_priorityqueueENTRY", !16, i64 0, !16, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!22 = !{!19, !10, i64 544}
!23 = !{!19, !6, i64 16}
!24 = !{!25, !10, i64 36}
!25 = !{!"_PARTITION_CONFIGURATION_TYPE", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !6, i64 48, !10, i64 56, !6, i64 64, !10, i64 72, !6, i64 80, !10, i64 88, !6, i64 96, !10, i64 104, !6, i64 112, !10, i64 120, !6, i64 128, !10, i64 136, !6, i64 144, !10, i64 152, !6, i64 160, !6, i64 168, !10, i64 176, !6, i64 184, !6, i64 192}
!26 = !{!19, !6, i64 552}
!27 = !{!28, !6, i64 24}
!28 = !{!"_BLACKBOARD_INFORMATION_TYPE", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !10, i64 32, !17, i64 40}
!29 = !{!28, !6, i64 8}
!30 = !{!28, !10, i64 0}
!31 = !{!28, !10, i64 16}
!32 = !{!28, !10, i64 20}


; 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

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

11:                                               ; preds = %4
  store i32 6, ptr %3, align 4, !tbaa !16
  tail call void @EXIT_CORE() #3
  br label %64

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %9, i64 28
  %14 = load i32, ptr %13, align 4, !tbaa !17
  %15 = icmp eq i32 %14, 4
  br i1 %15, label %16, label %17

16:                                               ; preds = %12
  store i32 6, ptr %3, align 4, !tbaa !16
  tail call void @EXIT_CORE() #3
  br label %64

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %9, i64 544
  %19 = load i32, ptr %18, align 8, !tbaa !21
  store i32 %19, ptr %5, align 4, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %9, i64 16
  %21 = load ptr, ptr %20, align 8, !tbaa !22
  %22 = getelementptr inbounds i8, ptr %21, i64 36
  %23 = load i32, ptr %22, align 4, !tbaa !23
  %.not = icmp ult i32 %19, %23
  br i1 %.not, label %25, label %24

24:                                               ; preds = %17
  store i32 5, ptr %3, align 4, !tbaa !16
  tail call void @EXIT_CORE() #3
  br label %64

25:                                               ; preds = %17
  call void @GET_BLACKBOARD_ID(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %3)
  %26 = load i32, ptr %3, align 4, !tbaa !16
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  store i32 2, ptr %3, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %64

29:                                               ; preds = %25
  %30 = add i32 %1, -513
  %or.cond = icmp ult i32 %30, -512
  br i1 %or.cond, label %31, label %32

31:                                               ; preds = %29
  store i32 4, ptr %3, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %64

32:                                               ; preds = %29
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 552
  %35 = load ptr, ptr %34, align 8, !tbaa !25
  %36 = load i32, ptr %5, align 4, !tbaa !16
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds %struct._BLACKBOARD_INFORMATION_TYPE, ptr %35, i64 %37
  %39 = getelementptr inbounds i8, ptr %33, i64 48
  %40 = getelementptr inbounds i8, ptr %38, i64 24
  call void @HEAP_ALLOCATE(ptr noundef nonnull %39, ptr noundef nonnull %40, i32 noundef %1, i8 noundef zeroext 0) #3
  %41 = load ptr, ptr %40, align 8, !tbaa !26
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %32
  store i32 5, ptr %3, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %64

44:                                               ; preds = %32
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 48
  %47 = getelementptr inbounds i8, ptr %38, i64 8
  call void @HEAP_ALLOCATE(ptr noundef nonnull %46, ptr noundef nonnull %47, i32 noundef 30, i8 noundef zeroext 0) #3
  %48 = load ptr, ptr %47, align 8, !tbaa !28
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %51

50:                                               ; preds = %44
  store i32 5, ptr %3, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %64

51:                                               ; preds = %44
  %52 = call zeroext i8 @COMMON_COPYSTRING(ptr noundef %0, ptr noundef nonnull %48, i32 noundef 30) #3
  %.not37 = icmp eq i8 %52, 0
  br i1 %.not37, label %53, label %54

53:                                               ; preds = %51
  store i32 5, ptr %3, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %64

54:                                               ; preds = %51
  %55 = load i32, ptr %5, align 4, !tbaa !16
  store i32 %55, ptr %38, align 8, !tbaa !29
  %56 = getelementptr inbounds i8, ptr %38, i64 16
  store i32 1, ptr %56, align 8, !tbaa !30
  %57 = getelementptr inbounds i8, ptr %38, i64 20
  store i32 %1, ptr %57, align 4, !tbaa !31
  %58 = getelementptr inbounds i8, ptr %38, i64 40
  call void @PRIORITYQUEUE_CLEAR(ptr noundef nonnull %58, i8 noundef zeroext 1, i8 noundef zeroext 0) #3
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 544
  %61 = load i32, ptr %60, align 8, !tbaa !21
  %62 = add i32 %61, 1
  store i32 %62, ptr %60, align 8, !tbaa !21
  %63 = load i32, ptr %5, align 4, !tbaa !16
  store i32 %63, ptr %2, align 4, !tbaa !16
  store i32 1, ptr %3, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %64

64:                                               ; preds = %54, %53, %50, %43, %31, %28, %24, %16, %11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  ret void
}

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

declare void @ENTER_CORE() local_unnamed_addr #2

declare i32 @PORT_GETCORE() local_unnamed_addr #2

declare void @EXIT_CORE() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @GET_BLACKBOARD_ID(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @HEAP_ALLOCATE(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #2

declare zeroext i8 @COMMON_COPYSTRING(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @PRIORITYQUEUE_CLEAR(ptr noundef, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2

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

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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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, !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 28}
!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, !11, i64 544}
!22 = !{!18, !7, i64 16}
!23 = !{!24, !11, i64 36}
!24 = !{!"_PARTITION_CONFIGURATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !7, i64 48, !11, i64 56, !7, i64 64, !11, i64 72, !7, i64 80, !11, i64 88, !7, i64 96, !11, i64 104, !7, i64 112, !11, i64 120, !7, i64 128, !11, i64 136, !7, i64 144, !11, i64 152, !7, i64 160, !7, i64 168, !11, i64 176, !7, i64 184, !7, i64 192}
!25 = !{!18, !7, i64 552}
!26 = !{!27, !7, i64 24}
!27 = !{!"_BLACKBOARD_INFORMATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !11, i64 20, !7, i64 24, !11, i64 32, !15, i64 40}
!28 = !{!27, !7, i64 8}
!29 = !{!27, !11, i64 0}
!30 = !{!27, !11, i64 16}
!31 = !{!27, !11, i64 20}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass