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

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

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

14:                                               ; preds = %1
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  store i32 1, ptr %15, align 4, !tbaa !17
  store i32 1, ptr %6, align 4
  br label %89

16:                                               ; preds = %1
  store i32 0, ptr %4, align 4, !tbaa !17
  br label %17

17:                                               ; preds = %71, %16
  %18 = load i32, ptr %4, align 4, !tbaa !17
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %19, i32 0, i32 6
  %21 = load i32, ptr %20, align 8, !tbaa !9
  %22 = icmp ult i32 %18, %21
  br i1 %22, label %23, label %74

23:                                               ; preds = %17
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %24, i32 0, i32 7
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = load i32, ptr %4, align 4, !tbaa !17
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %26, i64 %28
  store ptr %29, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %30, i32 0, i32 4
  store i32 2, ptr %31, align 4, !tbaa !19
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %32, i32 0, i32 9
  call void @PORT_PREPARECONTEXT(ptr noundef %33)
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %34, i32 0, i32 9
  %36 = getelementptr inbounds %struct._CONTEXT_TYPE, ptr %35, i32 0, i32 10
  %37 = load i32, ptr %36, align 8, !tbaa !23
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %38, i32 0, i32 9
  %40 = getelementptr inbounds %struct._CONTEXT_TYPE, ptr %39, i32 0, i32 11
  store i32 %37, ptr %40, align 4, !tbaa !24
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %41, i32 0, i32 15
  store i32 0, ptr %42, align 8, !tbaa !25
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %43, i32 0, i32 2
  %45 = load ptr, ptr %44, align 8, !tbaa !26
  %46 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_TYPE, ptr %45, i32 0, i32 24
  %47 = load ptr, ptr %46, align 8, !tbaa !27
  %48 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_TYPE, ptr %47, i32 0, i32 3
  %49 = load ptr, ptr %48, align 8, !tbaa !29
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %50, i32 0, i32 15
  %52 = load i32, ptr %51, align 8, !tbaa !25
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %49, i64 %53
  %55 = getelementptr inbounds %struct._PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE, ptr %54, i32 0, i32 0
  %56 = load i64, ptr %55, align 8, !tbaa !31
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %57, i32 0, i32 16
  %59 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %58, i32 0, i32 0
  store i64 %56, ptr %59, align 8, !tbaa !33
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %60, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !34
  %63 = zext i32 %62 to i64
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %64, i32 0, i32 16
  %66 = getelementptr inbounds %struct._priorityqueueENTRY, ptr %65, i32 0, i32 1
  store i64 %63, ptr %66, align 8, !tbaa !35
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %67, i32 0, i32 13
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %69, i32 0, i32 16
  call void @PRIORITYQUEUE_ENQUEUE(ptr noundef %68, ptr noundef %70)
  br label %71

71:                                               ; preds = %23
  %72 = load i32, ptr %4, align 4, !tbaa !17
  %73 = add i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !17
  br label %17, !llvm.loop !36

74:                                               ; preds = %17
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %75, i32 0, i32 8
  store ptr null, ptr %76, align 8, !tbaa !38
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %77, i32 0, i32 10
  store i64 0, ptr %78, align 8, !tbaa !39
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %79, i32 0, i32 11
  store i64 0, ptr %80, align 8, !tbaa !40
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !41
  %84 = getelementptr inbounds %struct._MODULE_CONFIGURATION_TYPE, ptr %83, i32 0, i32 11
  %85 = load i64, ptr %84, align 8, !tbaa !42
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._MODULE_INFORMATION_TYPE, ptr %86, i32 0, i32 12
  store i64 %85, ptr %87, align 8, !tbaa !44
  call void @PORT_INITIALIZETICK()
  call void @PORT_STARTSCHEDULER()
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  store i32 1, ptr %88, align 4, !tbaa !17
  store i32 0, ptr %6, align 4
  br label %89

89:                                               ; preds = %74, %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %90 = load i32, ptr %6, align 4
  switch i32 %90, label %92 [
    i32 0, label %91
    i32 1, label %91
  ]

91:                                               ; preds = %89, %89
  ret void

92:                                               ; preds = %89
  unreachable
}

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

declare i32 @PORT_GETCORE() #2

declare void @PORT_PREPARECONTEXT(ptr noundef) #2

declare void @PRIORITYQUEUE_ENQUEUE(ptr noundef, ptr noundef) #2

declare void @PORT_INITIALIZETICK() #2

declare void @PORT_STARTSCHEDULER() #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, !12, i64 120}
!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 = !{!10, !6, i64 128}
!19 = !{!20, !12, i64 28}
!20 = !{!"_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, !21, i64 168, !14, i64 272, !12, i64 384, !22, 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}
!21 = !{!"_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}
!22 = !{!"_priorityqueueENTRY", !15, i64 0, !15, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!20, !12, i64 136}
!24 = !{!20, !12, i64 140}
!25 = !{!20, !12, i64 384}
!26 = !{!20, !6, i64 16}
!27 = !{!28, !6, i64 160}
!28 = !{!"_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}
!29 = !{!30, !6, i64 24}
!30 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_TYPE", !15, i64 0, !15, i64 8, !12, i64 16, !6, i64 24}
!31 = !{!32, !15, i64 0}
!32 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE", !15, i64 0, !15, i64 8, !7, i64 16}
!33 = !{!20, !15, i64 392}
!34 = !{!20, !12, i64 24}
!35 = !{!20, !15, i64 400}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!10, !6, i64 136}
!39 = !{!10, !15, i64 256}
!40 = !{!10, !15, i64 264}
!41 = !{!10, !6, i64 0}
!42 = !{!43, !15, i64 88}
!43 = !{!"_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}
!44 = !{!10, !15, i64 272}


; 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

; Function Attrs: nounwind uwtable
define dso_local void @SCHEDULER_STARTPARTITIONSCHEDULER(ptr nocapture noundef writeonly %0) local_unnamed_addr #0 {
  %2 = tail call i32 @PORT_GETCORE() #3
  %3 = zext i32 %2 to i64
  %4 = getelementptr inbounds [2 x %struct._MODULE_INFORMATION_TYPE], ptr @CORE_MODULE_INFORMATION, i64 0, i64 %3
  %5 = getelementptr inbounds i8, ptr %4, i64 120
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %40, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %8 = getelementptr inbounds i8, ptr %4, i64 128
  %9 = getelementptr inbounds i8, ptr %4, i64 280
  br label %10

10:                                               ; preds = %.lr.ph, %10
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %10 ]
  %11 = load ptr, ptr %8, align 8, !tbaa !16
  %12 = getelementptr inbounds %struct._PARTITION_INFORMATION_TYPE, ptr %11, i64 %indvars.iv
  %13 = getelementptr inbounds i8, ptr %12, i64 28
  store i32 2, ptr %13, align 4, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %12, i64 72
  tail call void @PORT_PREPARECONTEXT(ptr noundef nonnull %14) #3
  %15 = getelementptr inbounds i8, ptr %12, i64 136
  %16 = load i32, ptr %15, align 8, !tbaa !21
  %17 = getelementptr inbounds i8, ptr %12, i64 140
  store i32 %16, ptr %17, align 4, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %12, i64 384
  store i32 0, ptr %18, align 8, !tbaa !23
  %19 = getelementptr inbounds i8, ptr %12, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !24
  %21 = getelementptr inbounds i8, ptr %20, i64 160
  %22 = load ptr, ptr %21, align 8, !tbaa !25
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  %24 = load ptr, ptr %23, align 8, !tbaa !27
  %25 = load i64, ptr %24, align 8, !tbaa !29
  %26 = getelementptr inbounds i8, ptr %12, i64 392
  store i64 %25, ptr %26, align 8, !tbaa !31
  %27 = getelementptr inbounds i8, ptr %12, i64 24
  %28 = load i32, ptr %27, align 8, !tbaa !32
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %12, i64 400
  store i64 %29, ptr %30, align 8, !tbaa !33
  tail call void @PRIORITYQUEUE_ENQUEUE(ptr noundef nonnull %9, ptr noundef nonnull %26) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %5, align 8, !tbaa !5
  %32 = zext i32 %31 to i64
  %33 = icmp ult i64 %indvars.iv.next, %32
  br i1 %33, label %10, label %._crit_edge, !llvm.loop !34

._crit_edge:                                      ; preds = %10
  %34 = getelementptr inbounds i8, ptr %4, i64 136
  store ptr null, ptr %34, align 8, !tbaa !36
  %35 = getelementptr inbounds i8, ptr %4, i64 256
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %35, i8 0, i64 16, i1 false)
  %36 = load ptr, ptr %4, align 8, !tbaa !37
  %37 = getelementptr inbounds i8, ptr %36, i64 88
  %38 = load i64, ptr %37, align 8, !tbaa !38
  %39 = getelementptr inbounds i8, ptr %4, i64 272
  store i64 %38, ptr %39, align 8, !tbaa !40
  tail call void @PORT_INITIALIZETICK() #3
  tail call void @PORT_STARTSCHEDULER() #3
  br label %40

40:                                               ; preds = %1, %._crit_edge
  store i32 1, ptr %0, align 4, !tbaa !41
  ret void
}

declare i32 @PORT_GETCORE() local_unnamed_addr #1

declare void @PORT_PREPARECONTEXT(ptr noundef) local_unnamed_addr #1

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

declare void @PORT_INITIALIZETICK() local_unnamed_addr #1

declare void @PORT_STARTSCHEDULER() local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 120}
!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 128}
!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 136}
!22 = !{!18, !11, i64 140}
!23 = !{!18, !11, i64 384}
!24 = !{!18, !7, i64 16}
!25 = !{!26, !7, i64 160}
!26 = !{!"_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}
!27 = !{!28, !7, i64 24}
!28 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_TYPE", !14, i64 0, !14, i64 8, !11, i64 16, !7, i64 24}
!29 = !{!30, !14, i64 0}
!30 = !{!"_PARTITION_CONFIGURATION_SCHEDULE_WINDOW_TYPE", !14, i64 0, !14, i64 8, !8, i64 16}
!31 = !{!18, !14, i64 392}
!32 = !{!18, !11, i64 24}
!33 = !{!18, !14, i64 400}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!6, !7, i64 136}
!37 = !{!6, !7, i64 0}
!38 = !{!39, !14, i64 88}
!39 = !{!"_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}
!40 = !{!6, !14, i64 272}
!41 = !{!11, !11, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass