; LLVM IR from kmilo17pet/QuarkTS-cpp :: src/kernel.ll (ZN3qOS4core8dispatchEPNS_4listE)

; 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"

%"class.qOS::listIterator" = type { ptr, ptr, ptr, ptr }
%"class.qOS::core" = type { %"class.qOS::taskEvent", %"class.qOS::task", ptr, ptr, [10 x %"struct.qOS::pq::queueStack_t"], %"class.qOS::prioQueue", i32, %"struct.qOS::notificationSpreader_t", i64, [5 x %"class.qOS::list"], ptr, ptr, %"class.qOS::list" }
%"class.qOS::taskEvent" = type { ptr, i8, i8, i8, i8, i64, ptr, ptr, ptr }
%"class.qOS::task" = type <{ %"class.qOS::node", ptr, ptr, ptr, ptr, ptr, i64, [11 x i8], [5 x i8], %"class.qOS::timer", i32, [4 x i8], i64, i32, i32, i32, i8, i8, [2 x i8] }>
%"class.qOS::node" = type { ptr, ptr, ptr, ptr }
%"class.qOS::timer" = type { ptr, i64, i64 }
%"struct.qOS::pq::queueStack_t" = type { ptr, ptr }
%"class.qOS::prioQueue" = type { ptr, i32, ptr, ptr, i64 }
%"struct.qOS::notificationSpreader_t" = type { i8, ptr }
%"class.qOS::list" = type { %"class.qOS::node", ptr, ptr, i64 }

@_ZN3qOS4task8BIT_INITE = external constant i32, align 4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #0

; Function Attrs: nounwind
declare void @_ZN3qOS4task8setFlagsEjb(ptr noundef nonnull align 8 dereferenceable(150), i32 noundef, i1 noundef zeroext) #1

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qOS4list6insertEPvNS_12listPositionE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i32 noundef) #1

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

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

; Function Attrs: nounwind
declare void @_ZN3qOS4list5beginEv(ptr dead_on_unwind writable sret(%"class.qOS::listIterator") align 8, ptr noundef nonnull align 8 dereferenceable(56)) #1

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qOS12listIterator8untilEndEv(ptr noundef nonnull align 8 dereferenceable(32)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3qOS12listIterator3getIPNS_4taskEEET_v(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: nounwind
declare noundef ptr @_ZN3qOS4list6removeENS_12listPositionEPv(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, ptr noundef) #1

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN3qOS12listIteratorppEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qOS12listIteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qOS4core25dispatchTaskFillEventInfoEPNS_4taskE(ptr noundef nonnull align 8 dereferenceable(800), ptr noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3qOS4core8dispatchEPNS_4listE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.qOS::listIterator", align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qOS4list5beginEv(ptr dead_on_unwind writable sret(%"class.qOS::listIterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(56) %9) #5
  br label %10

10:                                               ; preds = %69, %2
  %11 = call noundef zeroext i1 @_ZNK3qOS12listIterator8untilEndEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  br i1 %11, label %13, label %12

12:                                               ; preds = %10
  call void @_ZN3qOS12listIteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  br label %71

13:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %14 = call noundef ptr @_ZN3qOS12listIterator3getIPNS_4taskEEET_v(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  store ptr %14, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr %8, ptr %7, align 8, !tbaa !5
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN3qOS4core25dispatchTaskFillEventInfoEPNS_4taskE(ptr noundef nonnull align 8 dereferenceable(800) %8, ptr noundef %15) #5
  %16 = getelementptr inbounds %"class.qOS::core", ptr %8, i32 0, i32 3
  store ptr null, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %17, align 8, !tbaa !23
  %20 = getelementptr inbounds ptr, ptr %19, i64 2
  %21 = load ptr, ptr %20, align 8
  invoke void %21(ptr noundef nonnull align 8 dereferenceable(150) %17, ptr noundef nonnull align 8 dereferenceable(48) %18)
          to label %22 unwind label %72

22:                                               ; preds = %13
  br label %23

23:                                               ; preds = %38, %22
  %24 = getelementptr inbounds %"class.qOS::core", ptr %8, i32 0, i32 3
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = icmp ne ptr null, %25
  br i1 %26, label %27, label %39

27:                                               ; preds = %23
  %28 = getelementptr inbounds %"class.qOS::core", ptr %8, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds %"class.qOS::taskEvent", ptr %8, i32 0, i32 6
  store ptr %29, ptr %30, align 8, !tbaa !25
  %31 = getelementptr inbounds %"class.qOS::core", ptr %8, i32 0, i32 3
  store ptr null, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds %"class.qOS::taskEvent", ptr %8, i32 0, i32 6
  %33 = load ptr, ptr %32, align 8, !tbaa !25
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %33, align 8, !tbaa !23
  %36 = getelementptr inbounds ptr, ptr %35, i64 2
  %37 = load ptr, ptr %36, align 8
  invoke void %37(ptr noundef nonnull align 8 dereferenceable(150) %33, ptr noundef nonnull align 8 dereferenceable(48) %34)
          to label %38 unwind label %72

38:                                               ; preds = %27
  br label %23, !llvm.loop !26

39:                                               ; preds = %23
  %40 = getelementptr inbounds %"class.qOS::taskEvent", ptr %8, i32 0, i32 6
  store ptr null, ptr %40, align 8, !tbaa !25
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call noundef ptr @_ZN3qOS4list6removeENS_12listPositionEPv(ptr noundef nonnull align 8 dereferenceable(56) %41, i32 noundef -1, ptr noundef null) #5
  %43 = getelementptr inbounds %"class.qOS::core", ptr %8, i32 0, i32 10
  %44 = load ptr, ptr %43, align 8, !tbaa !28
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = call noundef zeroext i1 @_ZN3qOS4list6insertEPvNS_12listPositionE(ptr noundef nonnull align 8 dereferenceable(56) %44, ptr noundef %45, i32 noundef -2) #5
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.qOS::task", ptr %47, i32 0, i32 17
  %49 = load i8, ptr %48, align 1, !tbaa !29
  %50 = icmp eq i8 4, %49
  br i1 %50, label %51, label %56

51:                                               ; preds = %39
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.qOS::task", ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !30
  %55 = call noundef zeroext i1 @_ZN3qOS5queue11removeFrontEv(ptr noundef nonnull align 8 dereferenceable(64) %54) #5
  br label %56

56:                                               ; preds = %51, %39
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load i32, ptr @_ZN3qOS4task8BIT_INITE, align 4, !tbaa !31
  call void @_ZN3qOS4task8setFlagsEjb(ptr noundef nonnull align 8 dereferenceable(150) %57, i32 noundef %58, i1 noundef zeroext true) #5
  %59 = getelementptr inbounds %"class.qOS::taskEvent", ptr %8, i32 0, i32 3
  store i8 0, ptr %59, align 2, !tbaa !32
  %60 = getelementptr inbounds %"class.qOS::taskEvent", ptr %8, i32 0, i32 4
  store i8 0, ptr %60, align 1, !tbaa !33
  %61 = getelementptr inbounds %"class.qOS::taskEvent", ptr %8, i32 0, i32 5
  store i64 0, ptr %61, align 8, !tbaa !34
  %62 = getelementptr inbounds %"class.qOS::taskEvent", ptr %8, i32 0, i32 8
  store ptr null, ptr %62, align 8, !tbaa !35
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.qOS::task", ptr %63, i32 0, i32 10
  %65 = load i32, ptr %64, align 8, !tbaa !36
  %66 = add i32 %65, 1
  store i32 %66, ptr %64, align 8, !tbaa !36
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %"class.qOS::task", ptr %67, i32 0, i32 17
  store i8 0, ptr %68, align 1, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %69

69:                                               ; preds = %56
  %70 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3qOS12listIteratorppEi(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 0) #5
  br label %10, !llvm.loop !37

71:                                               ; preds = %12
  ret void

72:                                               ; preds = %27, %13
  %73 = landingpad { ptr, i32 }
          catch ptr null
  %74 = extractvalue { ptr, i32 } %73, 0
  call void @__clang_call_terminate(ptr %74) #6
  unreachable
}

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qOS5queue11removeFrontEv(ptr noundef nonnull align 8 dereferenceable(64)) #1

attributes #0 = { noinline noreturn nounwind uwtable "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 "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress 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 #4 = { mustprogress 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 #5 = { nounwind }
attributes #6 = { noreturn 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++ TBAA"}
!9 = !{!10, !6, i64 208}
!10 = !{!"_ZTSN3qOS4coreE", !11, i64 0, !15, i64 48, !6, i64 200, !6, i64 208, !7, i64 216, !19, i64 376, !18, i64 416, !20, i64 424, !14, i64 440, !7, i64 448, !6, i64 728, !6, i64 736, !22, i64 744}
!11 = !{!"_ZTSN3qOS9taskEventE", !12, i64 8, !13, i64 9, !13, i64 10, !13, i64 11, !14, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!12 = !{!"_ZTSN3qOS7triggerE", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSN3qOS4taskE", !16, i64 0, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !14, i64 72, !7, i64 80, !17, i64 96, !18, i64 120, !14, i64 128, !18, i64 136, !18, i64 140, !18, i64 144, !7, i64 148, !12, i64 149}
!16 = !{!"_ZTSN3qOS4nodeE", !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"_ZTSN3qOS5timerE", !14, i64 8, !14, i64 16}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN3qOS9prioQueueE", !18, i64 8, !6, i64 16, !6, i64 24, !14, i64 32}
!20 = !{!"_ZTSN3qOS22notificationSpreader_tE", !21, i64 0, !6, i64 8}
!21 = !{!"_ZTSN3qOS10notifyModeE", !7, i64 0}
!22 = !{!"_ZTSN3qOS4listE", !16, i64 0, !6, i64 32, !6, i64 40, !14, i64 48}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{!11, !6, i64 24}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!10, !6, i64 728}
!29 = !{!15, !12, i64 149}
!30 = !{!15, !6, i64 64}
!31 = !{!18, !18, i64 0}
!32 = !{!11, !13, i64 10}
!33 = !{!11, !13, i64 11}
!34 = !{!11, !14, i64 16}
!35 = !{!11, !6, i64 40}
!36 = !{!15, !18, i64 120}
!37 = distinct !{!37, !27}


; 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"

%"class.qOS::listIterator" = type { ptr, ptr, ptr, ptr }

@_ZN3qOS4task8BIT_INITE = external local_unnamed_addr constant i32, align 4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN3qOS4task8setFlagsEjb(ptr noundef nonnull align 8 dereferenceable(150), i32 noundef, i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qOS4list6insertEPvNS_12listPositionE(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind
declare void @_ZN3qOS4list5beginEv(ptr dead_on_unwind writable sret(%"class.qOS::listIterator") align 8, ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qOS12listIterator8untilEndEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3qOS12listIterator3getIPNS_4taskEEET_v(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: nounwind
declare noundef ptr @_ZN3qOS4list6removeENS_12listPositionEPv(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZN3qOS12listIteratorppEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qOS12listIteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qOS4core25dispatchTaskFillEventInfoEPNS_4taskE(ptr noundef nonnull align 8 dereferenceable(800), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3qOS4core8dispatchEPNS_4listE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef nonnull %1) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.qOS::listIterator", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZN3qOS4list5beginEv(ptr dead_on_unwind nonnull writable sret(%"class.qOS::listIterator") align 8 %3, ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  %4 = call noundef zeroext i1 @_ZNK3qOS12listIterator8untilEndEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 208
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = getelementptr inbounds i8, ptr %0, i64 728
  %8 = load i32, ptr @_ZN3qOS4task8BIT_INITE, align 4
  %9 = getelementptr inbounds i8, ptr %0, i64 10
  %10 = getelementptr inbounds i8, ptr %0, i64 11
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  br label %13

._crit_edge:                                      ; preds = %34, %2
  call void @_ZN3qOS12listIteratorD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  ret void

13:                                               ; preds = %.lr.ph, %34
  %14 = call noundef ptr @_ZN3qOS12listIterator3getIPNS_4taskEEET_v(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @_ZN3qOS4core25dispatchTaskFillEventInfoEPNS_4taskE(ptr noundef nonnull align 8 dereferenceable(800) %0, ptr noundef %14) #5
  store ptr null, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %14, align 8, !tbaa !22
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = load ptr, ptr %16, align 8
  invoke void %17(ptr noundef nonnull align 8 dereferenceable(150) %14, ptr noundef nonnull align 8 dereferenceable(48) %0)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %13, %19
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %18, null
  br i1 %.not, label %23, label %19

19:                                               ; preds = %.preheader
  store ptr %18, ptr %6, align 8, !tbaa !24
  store ptr null, ptr %5, align 8, !tbaa !5
  %20 = load ptr, ptr %18, align 8, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %22 = load ptr, ptr %21, align 8
  invoke void %22(ptr noundef nonnull align 8 dereferenceable(150) %18, ptr noundef nonnull align 8 dereferenceable(48) %0)
          to label %.preheader unwind label %.loopexit, !llvm.loop !25

23:                                               ; preds = %.preheader
  store ptr null, ptr %6, align 8, !tbaa !24
  %24 = call noundef ptr @_ZN3qOS4list6removeENS_12listPositionEPv(ptr noundef nonnull align 8 dereferenceable(56) %1, i32 noundef -1, ptr noundef null) #5
  %25 = load ptr, ptr %7, align 8, !tbaa !27
  %26 = call noundef zeroext i1 @_ZN3qOS4list6insertEPvNS_12listPositionE(ptr noundef nonnull align 8 dereferenceable(56) %25, ptr noundef nonnull %14, i32 noundef -2) #5
  %27 = getelementptr inbounds i8, ptr %14, i64 149
  %28 = load i8, ptr %27, align 1, !tbaa !28
  %29 = icmp eq i8 %28, 4
  br i1 %29, label %30, label %34

30:                                               ; preds = %23
  %31 = getelementptr inbounds i8, ptr %14, i64 64
  %32 = load ptr, ptr %31, align 8, !tbaa !29
  %33 = call noundef zeroext i1 @_ZN3qOS5queue11removeFrontEv(ptr noundef nonnull align 8 dereferenceable(64) %32) #5
  br label %34

34:                                               ; preds = %30, %23
  call void @_ZN3qOS4task8setFlagsEjb(ptr noundef nonnull align 8 dereferenceable(150) %14, i32 noundef %8, i1 noundef zeroext true) #5
  store i8 0, ptr %9, align 2, !tbaa !30
  store i8 0, ptr %10, align 1, !tbaa !31
  store i64 0, ptr %11, align 8, !tbaa !32
  store ptr null, ptr %12, align 8, !tbaa !33
  %35 = getelementptr inbounds i8, ptr %14, i64 120
  %36 = load i32, ptr %35, align 8, !tbaa !34
  %37 = add i32 %36, 1
  store i32 %37, ptr %35, align 8, !tbaa !34
  store i8 0, ptr %27, align 1, !tbaa !28
  %38 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3qOS12listIteratorppEi(ptr noundef nonnull align 8 dereferenceable(32) %3, i32 noundef 0) #5
  %39 = call noundef zeroext i1 @_ZNK3qOS12listIterator8untilEndEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  br i1 %39, label %13, label %._crit_edge, !llvm.loop !35

.loopexit:                                        ; preds = %19
  %lpad.loopexit = landingpad { ptr, i32 }
          catch ptr null
  br label %40

.loopexit.split-lp:                               ; preds = %13
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          catch ptr null
  br label %40

40:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  %41 = extractvalue { ptr, i32 } %lpad.phi, 0
  call void @__clang_call_terminate(ptr %41) #6
  unreachable
}

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qOS5queue11removeFrontEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1

attributes #0 = { noinline noreturn nounwind uwtable "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 "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress 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 #4 = { mustprogress 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 #5 = { nounwind }
attributes #6 = { noreturn 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, !13, i64 208}
!6 = !{!"_ZTSN3qOS4coreE", !7, i64 0, !14, i64 48, !13, i64 200, !13, i64 208, !9, i64 216, !18, i64 376, !17, i64 416, !19, i64 424, !12, i64 440, !9, i64 448, !13, i64 728, !13, i64 736, !21, i64 744}
!7 = !{!"_ZTSN3qOS9taskEventE", !8, i64 8, !11, i64 9, !11, i64 10, !11, i64 11, !12, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!8 = !{!"_ZTSN3qOS7triggerE", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"long", !9, i64 0}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!"_ZTSN3qOS4taskE", !15, i64 0, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !12, i64 72, !9, i64 80, !16, i64 96, !17, i64 120, !12, i64 128, !17, i64 136, !17, i64 140, !17, i64 144, !9, i64 148, !8, i64 149}
!15 = !{!"_ZTSN3qOS4nodeE", !13, i64 8, !13, i64 16, !13, i64 24}
!16 = !{!"_ZTSN3qOS5timerE", !12, i64 8, !12, i64 16}
!17 = !{!"int", !9, i64 0}
!18 = !{!"_ZTSN3qOS9prioQueueE", !17, i64 8, !13, i64 16, !13, i64 24, !12, i64 32}
!19 = !{!"_ZTSN3qOS22notificationSpreader_tE", !20, i64 0, !13, i64 8}
!20 = !{!"_ZTSN3qOS10notifyModeE", !9, i64 0}
!21 = !{!"_ZTSN3qOS4listE", !15, i64 0, !13, i64 32, !13, i64 40, !12, i64 48}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !10, i64 0}
!24 = !{!7, !13, i64 24}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!6, !13, i64 728}
!28 = !{!14, !8, i64 149}
!29 = !{!14, !13, i64 64}
!30 = !{!7, !11, i64 10}
!31 = !{!7, !11, i64 11}
!32 = !{!7, !12, i64 16}
!33 = !{!7, !13, i64 40}
!34 = !{!14, !17, i64 120}
!35 = distinct !{!35, !26}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass