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

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

18:                                               ; preds = %3
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 6, ptr %19, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %10, align 4
  br label %105

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

27:                                               ; preds = %20
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 6, ptr %28, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %10, align 4
  br label %105

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

44:                                               ; preds = %29
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 5, ptr %45, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %10, align 4
  br label %105

46:                                               ; preds = %29
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  call void @GET_EVENT_ID(ptr noundef %47, ptr noundef %8, ptr noundef %48)
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load i32, ptr %49, align 4, !tbaa !17
  %51 = icmp eq i32 %50, 1
  br i1 %51, label %52, label %54

52:                                               ; preds = %46
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 2, ptr %53, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %10, align 4
  br label %105

54:                                               ; preds = %46
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %55, i32 0, i32 8
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %57, i32 0, i32 34
  %59 = load ptr, ptr %58, align 8, !tbaa !26
  %60 = load i32, ptr %8, align 4, !tbaa !17
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds %struct._EVENT_INFORMATION_TYPE, ptr %59, i64 %61
  store ptr %62, ptr %9, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %63, i32 0, i32 8
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %65, i32 0, i32 8
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._EVENT_INFORMATION_TYPE, ptr %67, i32 0, i32 1
  call void @HEAP_ALLOCATE(ptr noundef %66, ptr noundef %68, i32 noundef 30, i8 noundef zeroext 0)
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._EVENT_INFORMATION_TYPE, ptr %69, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !27
  %72 = icmp eq ptr %71, null
  br i1 %72, label %73, label %75

73:                                               ; preds = %54
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 5, ptr %74, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %10, align 4
  br label %105

75:                                               ; preds = %54
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._EVENT_INFORMATION_TYPE, ptr %77, i32 0, i32 1
  %79 = load ptr, ptr %78, align 8, !tbaa !27
  %80 = call zeroext i8 @COMMON_COPYSTRING(ptr noundef %76, ptr noundef %79, i32 noundef 30)
  %81 = icmp ne i8 %80, 0
  br i1 %81, label %84, label %82

82:                                               ; preds = %75
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 5, ptr %83, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 1, ptr %10, align 4
  br label %105

84:                                               ; preds = %75
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %85, i32 0, i32 8
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %87, i32 0, i32 33
  %89 = load i32, ptr %88, align 8, !tbaa !22
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._EVENT_INFORMATION_TYPE, ptr %90, i32 0, i32 0
  store i32 %89, ptr %91, align 8, !tbaa !29
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._EVENT_INFORMATION_TYPE, ptr %92, i32 0, i32 2
  store i32 1, ptr %93, align 8, !tbaa !30
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._EVENT_INFORMATION_TYPE, ptr %94, i32 0, i32 3
  call void @PRIORITYQUEUE_CLEAR(ptr noundef %95, i8 noundef zeroext 1, i8 noundef zeroext 0)
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %96, i32 0, i32 8
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %98, i32 0, i32 33
  %100 = load i32, ptr %99, align 8, !tbaa !22
  %101 = add i32 %100, 1
  store i32 %101, ptr %99, align 8, !tbaa !22
  %102 = load i32, ptr %8, align 4, !tbaa !17
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 %102, ptr %103, align 4, !tbaa !17
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 1, ptr %104, align 4, !tbaa !17
  call void @EXIT_CORE()
  store i32 0, ptr %10, align 4
  br label %105

105:                                              ; preds = %84, %82, %73, %52, %44, %27, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %106 = load i32, ptr %10, align 4
  switch i32 %106, label %108 [
    i32 0, label %107
    i32 1, label %107
  ]

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

108:                                              ; preds = %105
  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_EVENT_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, !6, i64 136}
!10 = !{!"_MODULE_INFORMATION_TYPE", !6, i64 0, !11, i64 8, !12, i64 32, !12, i64 36, !12, i64 40, !13, i64 48, !12, i64 120, !6, i64 128, !6, i64 136, !14, i64 144, !15, i64 256, !15, i64 264, !15, i64 272, !16, i64 280}
!11 = !{!"_heapRECORD", !6, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_CONTEXT_TYPE", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !7, i64 36, !6, i64 40, !6, i64 48, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68}
!14 = !{!"_HEALTHMONITORINGCALLBACK_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !12, i64 100, !12, i64 104}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_priorityqueueRECORD", !6, i64 0, !12, i64 8, !7, i64 12, !7, i64 13}
!17 = !{!12, !12, i64 0}
!18 = !{!19, !12, i64 28}
!19 = !{!"_PARTITION_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !7, i64 40, !11, i64 48, !13, i64 72, !12, i64 144, !6, i64 152, !6, i64 160, !20, i64 168, !14, i64 272, !12, i64 384, !21, i64 392, !16, i64 432, !16, i64 448, !16, i64 464, !12, i64 480, !12, i64 484, !6, i64 488, !12, i64 496, !6, i64 504, !12, i64 512, !6, i64 520, !12, i64 528, !6, i64 536, !12, i64 544, !6, i64 552, !12, i64 560, !6, i64 568, !12, i64 576, !6, i64 584}
!20 = !{!"_ERRORHANDLER_INFORMATION_TYPE", !7, i64 0, !6, i64 8, !12, i64 16, !13, i64 24, !7, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !12, i64 100}
!21 = !{!"_priorityqueueENTRY", !15, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!22 = !{!19, !12, i64 576}
!23 = !{!19, !6, i64 16}
!24 = !{!25, !12, i64 44}
!25 = !{!"_PARTITION_CONFIGURATION_TYPE", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !6, i64 48, !12, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !12, i64 88, !6, i64 96, !12, i64 104, !6, i64 112, !12, i64 120, !6, i64 128, !12, i64 136, !6, i64 144, !12, i64 152, !6, i64 160, !6, i64 168, !12, i64 176, !6, i64 184, !6, i64 192}
!26 = !{!19, !6, i64 584}
!27 = !{!28, !6, i64 8}
!28 = !{!"_EVENT_INFORMATION_TYPE", !12, i64 0, !6, i64 8, !12, i64 16, !16, i64 24}
!29 = !{!28, !12, i64 0}
!30 = !{!28, !12, i64 16}


; 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._EVENT_INFORMATION_TYPE = type { 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_EVENT(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  tail call void @ENTER_CORE() #3
  %5 = tail call i32 @PORT_GETCORE() #3
  %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 %10, label %11

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

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

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

16:                                               ; preds = %11
  %17 = getelementptr inbounds i8, ptr %8, i64 576
  %18 = load i32, ptr %17, align 8, !tbaa !21
  store i32 %18, ptr %4, align 4, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %8, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %20, i64 44
  %22 = load i32, ptr %21, align 4, !tbaa !23
  %.not = icmp ult i32 %18, %22
  br i1 %.not, label %24, label %23

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

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

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

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

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

40:                                               ; preds = %28
  %41 = call zeroext i8 @COMMON_COPYSTRING(ptr noundef %0, ptr noundef nonnull %37, i32 noundef 30) #3
  %.not27 = icmp eq i8 %41, 0
  br i1 %.not27, label %42, label %43

42:                                               ; preds = %40
  store i32 5, ptr %2, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %54

43:                                               ; preds = %40
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 576
  %46 = load i32, ptr %45, align 8, !tbaa !21
  store i32 %46, ptr %34, align 8, !tbaa !28
  %47 = getelementptr inbounds i8, ptr %34, i64 16
  store i32 1, ptr %47, align 8, !tbaa !29
  %48 = getelementptr inbounds i8, ptr %34, i64 24
  call void @PRIORITYQUEUE_CLEAR(ptr noundef nonnull %48, i8 noundef zeroext 1, i8 noundef zeroext 0) #3
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 576
  %51 = load i32, ptr %50, align 8, !tbaa !21
  %52 = add i32 %51, 1
  store i32 %52, ptr %50, align 8, !tbaa !21
  %53 = load i32, ptr %4, align 4, !tbaa !16
  store i32 %53, ptr %1, align 4, !tbaa !16
  store i32 1, ptr %2, align 4, !tbaa !16
  call void @EXIT_CORE() #3
  br label %54

54:                                               ; preds = %43, %42, %39, %27, %23, %15, %10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #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_EVENT_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 576}
!22 = !{!18, !7, i64 16}
!23 = !{!24, !11, i64 44}
!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 584}
!26 = !{!27, !7, i64 8}
!27 = !{!"_EVENT_INFORMATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !15, i64 24}
!28 = !{!27, !11, i64 0}
!29 = !{!27, !11, i64 16}


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