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

; 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._MODULE_CONFIGURATION_TYPE = type { i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, i64, ptr, ptr, i32, ptr, ptr }
%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._PARTITION_CONFIGURATION_SCHEDULE_TYPE = type { i64, i64, i32, ptr }
%struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE = type { i64, i64, i8 }

@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 i32 @PORT_GETCORE() #1

declare void @PRIORITYQUEUE_ENQUEUE(ptr noundef, ptr noundef) #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
declare dso_local void @SCHEDULER() #2

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

20:                                               ; preds = %0
  %21 = load ptr, ptr %1, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %24 = getelementptr inbounds %struct._MODULE_CONFIGURATION_TYPE, ptr %23, i32 0, i32 11
  %25 = load i64, ptr %24, align 8, !tbaa !18
  %26 = load ptr, ptr %1, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %26, i32 0, i32 10
  %28 = load i64, ptr %27, align 8, !tbaa !20
  %29 = add nsw i64 %28, %25
  store i64 %29, ptr %27, align 8, !tbaa !20
  %30 = load ptr, ptr %1, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %30, i32 0, i32 11
  store i64 0, ptr %31, align 8, !tbaa !9
  %32 = load ptr, ptr %1, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %32, i32 0, i32 10
  %34 = load i64, ptr %33, align 8, !tbaa !20
  %35 = load ptr, ptr %1, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = getelementptr inbounds %struct._MODULE_CONFIGURATION_TYPE, ptr %37, i32 0, i32 11
  %39 = load i64, ptr %38, align 8, !tbaa !18
  %40 = add nsw i64 %34, %39
  %41 = load ptr, ptr %1, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %41, i32 0, i32 12
  store i64 %40, ptr %42, align 8, !tbaa !21
  store i32 0, ptr %2, align 4, !tbaa !22
  br label %43

43:                                               ; preds = %94, %20
  %44 = load i32, ptr %2, align 4, !tbaa !22
  %45 = load ptr, ptr %1, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %45, i32 0, i32 6
  %47 = load i32, ptr %46, align 8, !tbaa !23
  %48 = icmp ult i32 %44, %47
  br i1 %48, label %49, label %97

49:                                               ; preds = %43
  %50 = load ptr, ptr %1, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %50, i32 0, i32 7
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  %53 = load i32, ptr %2, align 4, !tbaa !22
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %52, i64 %54
  store ptr %55, ptr %3, align 8, !tbaa !5
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %56, i32 0, i32 16
  call void @PRIORITYQUEUE_REMOVE(ptr noundef %57)
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %58, i32 0, i32 15
  store i32 0, ptr %59, align 8, !tbaa !25
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %60, i32 0, i32 4
  %62 = load i32, ptr %61, align 4, !tbaa !29
  %63 = icmp ne i32 %62, 1
  br i1 %63, label %64, label %93

64:                                               ; preds = %49
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !30
  %68 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %67, i32 0, i32 24
  %69 = load ptr, ptr %68, align 8, !tbaa !31
  %70 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE, ptr %69, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !33
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %72, i32 0, i32 15
  %74 = load i32, ptr %73, align 8, !tbaa !25
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %71, i64 %75
  %77 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %76, i32 0, i32 0
  %78 = load i64, ptr %77, align 8, !tbaa !35
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %79, i32 0, i32 16
  %81 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %80, i32 0, i32 0
  store i64 %78, ptr %81, align 8, !tbaa !37
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %82, i32 0, i32 3
  %84 = load i32, ptr %83, align 8, !tbaa !38
  %85 = zext i32 %84 to i64
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %86, i32 0, i32 16
  %88 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %87, i32 0, i32 1
  store i64 %85, ptr %88, align 8, !tbaa !39
  %89 = load ptr, ptr %1, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %89, i32 0, i32 13
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %91, i32 0, i32 16
  call void @PRIORITYQUEUE_ENQUEUE(ptr noundef %90, ptr noundef %92)
  br label %93

93:                                               ; preds = %64, %49
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %2, align 4, !tbaa !22
  %96 = add i32 %95, 1
  store i32 %96, ptr %2, align 4, !tbaa !22
  br label %43, !llvm.loop !40

97:                                               ; preds = %43
  br label %98

98:                                               ; preds = %97, %0
  call void @SCHEDULER()
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

declare void @PRIORITYQUEUE_REMOVE(ptr noundef) #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !15, i64 264}
!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 = !{!10, !6, i64 0}
!18 = !{!19, !15, i64 88}
!19 = !{!"_MODULE_CONFIGURATION_TYPE", !12, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !6, i64 40, !12, i64 48, !6, i64 56, !12, i64 64, !6, i64 72, !12, i64 80, !15, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !6, i64 120, !6, i64 128}
!20 = !{!10, !15, i64 256}
!21 = !{!10, !15, i64 272}
!22 = !{!12, !12, i64 0}
!23 = !{!10, !12, i64 120}
!24 = !{!10, !6, i64 128}
!25 = !{!26, !12, i64 384}
!26 = !{!"_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, !27, i64 168, !14, i64 272, !12, i64 384, !28, 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}
!27 = !{!"_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}
!28 = !{!"_priorityqueueENTRY", !15, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!29 = !{!26, !12, i64 28}
!30 = !{!26, !6, i64 16}
!31 = !{!32, !6, i64 160}
!32 = !{!"_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}
!33 = !{!34, !6, i64 24}
!34 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_TYPE", !15, i64 0, !15, i64 8, !12, i64 16, !6, i64 24}
!35 = !{!36, !15, i64 0}
!36 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE", !15, i64 0, !15, i64 8, !7, i64 16}
!37 = !{!26, !15, i64 392}
!38 = !{!26, !12, i64 24}
!39 = !{!26, !15, i64 400}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}


; 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._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 }

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

declare i32 @PORT_GETCORE() local_unnamed_addr #0

declare void @PRIORITYQUEUE_ENQUEUE(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @SCHEDULER() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @TICK() local_unnamed_addr #1 {
  %1 = tail call i32 @PORT_GETCORE() #2
  %2 = zext i32 %1 to i64
  %3 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %2
  %4 = getelementptr inbounds i8, ptr %3, i64 264
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = add nsw i64 %5, 1000000
  store i64 %6, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8, !tbaa !16
  %8 = getelementptr inbounds i8, ptr %7, i64 88
  %9 = load i64, ptr %8, align 8, !tbaa !17
  %.not = icmp slt i64 %6, %9
  br i1 %.not, label %.loopexit, label %10

10:                                               ; preds = %0
  %11 = getelementptr inbounds i8, ptr %3, i64 256
  %12 = load i64, ptr %11, align 8, !tbaa !19
  %13 = add nsw i64 %12, %9
  store i64 %13, ptr %11, align 8, !tbaa !19
  store i64 0, ptr %4, align 8, !tbaa !5
  %14 = add nsw i64 %13, %9
  %15 = getelementptr inbounds i8, ptr %3, i64 272
  store i64 %14, ptr %15, align 8, !tbaa !20
  %16 = getelementptr inbounds i8, ptr %3, i64 120
  %17 = load i32, ptr %16, align 8, !tbaa !21
  %.not26 = icmp eq i32 %17, 0
  br i1 %.not26, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %10
  %18 = getelementptr inbounds i8, ptr %3, i64 128
  %19 = getelementptr inbounds i8, ptr %3, i64 280
  br label %20

20:                                               ; preds = %.lr.ph, %39
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %39 ]
  %21 = load ptr, ptr %18, align 8, !tbaa !22
  %22 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %21, i64 %indvars.iv
  %23 = getelementptr inbounds i8, ptr %22, i64 392
  tail call void @PRIORITYQUEUE_REMOVE(ptr noundef nonnull %23) #2
  %24 = getelementptr inbounds i8, ptr %22, i64 384
  store i32 0, ptr %24, align 8, !tbaa !23
  %25 = getelementptr inbounds i8, ptr %22, i64 28
  %26 = load i32, ptr %25, align 4, !tbaa !27
  %.not24 = icmp eq i32 %26, 1
  br i1 %.not24, label %39, label %27

27:                                               ; preds = %20
  %28 = getelementptr inbounds i8, ptr %22, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !28
  %30 = getelementptr inbounds i8, ptr %29, i64 160
  %31 = load ptr, ptr %30, align 8, !tbaa !29
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  %33 = load ptr, ptr %32, align 8, !tbaa !31
  %34 = load i64, ptr %33, align 8, !tbaa !33
  store i64 %34, ptr %23, align 8, !tbaa !35
  %35 = getelementptr inbounds i8, ptr %22, i64 24
  %36 = load i32, ptr %35, align 8, !tbaa !36
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds i8, ptr %22, i64 400
  store i64 %37, ptr %38, align 8, !tbaa !37
  tail call void @PRIORITYQUEUE_ENQUEUE(ptr noundef nonnull %19, ptr noundef nonnull %23) #2
  br label %39

39:                                               ; preds = %20, %27
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr %16, align 8, !tbaa !21
  %41 = zext i32 %40 to i64
  %42 = icmp ult i64 %indvars.iv.next, %41
  br i1 %42, label %20, label %.loopexit, !llvm.loop !38

.loopexit:                                        ; preds = %39, %10, %0
  tail call void @SCHEDULER()
  ret void
}

declare void @PRIORITYQUEUE_REMOVE(ptr noundef) 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, !14, i64 264}
!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 = !{!6, !7, i64 0}
!17 = !{!18, !14, i64 88}
!18 = !{!"_MODULE_CONFIGURATION_TYPE", !11, i64 0, !7, i64 8, !11, i64 16, !7, i64 24, !11, i64 32, !7, i64 40, !11, i64 48, !7, i64 56, !11, i64 64, !7, i64 72, !11, i64 80, !14, i64 88, !7, i64 96, !7, i64 104, !11, i64 112, !7, i64 120, !7, i64 128}
!19 = !{!6, !14, i64 256}
!20 = !{!6, !14, i64 272}
!21 = !{!6, !11, i64 120}
!22 = !{!6, !7, i64 128}
!23 = !{!24, !11, i64 384}
!24 = !{!"_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, !25, i64 168, !13, i64 272, !11, i64 384, !26, 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}
!25 = !{!"_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}
!26 = !{!"_priorityqueueENTRY", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!27 = !{!24, !11, i64 28}
!28 = !{!24, !7, i64 16}
!29 = !{!30, !7, i64 160}
!30 = !{!"_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}
!31 = !{!32, !7, i64 24}
!32 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_TYPE", !14, i64 0, !14, i64 8, !11, i64 16, !7, i64 24}
!33 = !{!34, !14, i64 0}
!34 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE", !14, i64 0, !14, i64 8, !8, i64 16}
!35 = !{!24, !14, i64 392}
!36 = !{!24, !11, i64 24}
!37 = !{!24, !14, i64 400}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


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