; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/kernel (sc_process)

; 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.sc_core::sc_process_b" = type <{ %"class.sc_core::sc_object", ptr, i32, i32, i32, i32, i8, i8, [6 x i8], ptr, i32, [4 x i8], ptr, ptr, i8, i8, i8, i8, [4 x i8], ptr, ptr, i32, i32, %"class.std::vector.18", ptr, ptr, ptr, ptr, { i64, i64 }, i32, [4 x i8], %"class.std::vector.23", i8, [7 x i8], ptr, ptr, i32, i8, [3 x i8], ptr, i32, i8, [3 x i8] }>
%"class.sc_core::sc_object" = type { ptr, ptr, %"class.std::vector", %"class.std::vector.0", %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_event *, std::allocator<sc_core::sc_event *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_object *, std::allocator<sc_core::sc_object *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<sc_core::sc_reset *, std::allocator<sc_core::sc_reset *>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_reset *, std::allocator<sc_core::sc_reset *>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_reset *, std::allocator<sc_core::sc_reset *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_reset *, std::allocator<sc_core::sc_reset *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.23" = type { %"struct.std::_Vector_base.24" }
%"struct.std::_Vector_base.24" = type { %"struct.std::_Vector_base<const sc_core::sc_event *, std::allocator<const sc_core::sc_event *>>::_Vector_impl" }
%"struct.std::_Vector_base<const sc_core::sc_event *, std::allocator<const sc_core::sc_event *>>::_Vector_impl" = type { %"struct.std::_Vector_base<const sc_core::sc_event *, std::allocator<const sc_core::sc_event *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<const sc_core::sc_event *, std::allocator<const sc_core::sc_event *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [86 x i8], align 1
@_ZTIN7sc_core12sc_process_bE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN7sc_core17sc_method_processE = external constant ptr
@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZN7sc_core12sc_process_b20remove_static_eventsEv = external hidden unnamed_addr constant [51 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPKN7sc_core8sc_eventESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core12sc_process_b20remove_static_eventsEv(ptr noundef nonnull align 8 dereferenceable(357) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %8 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %7, i32 0, i32 21
  %9 = load i32, ptr %8, align 8, !tbaa !9
  switch i32 %9, label %66 [
    i32 2, label %10
    i32 3, label %10
    i32 1, label %32
  ]

10:                                               ; preds = %1, %1
  store ptr %7, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %11 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %7, i32 0, i32 31
  %12 = call noundef i64 @_ZNKSt6vectorIPKN7sc_core8sc_eventESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %13 = sub i64 %12, 1
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr %5, align 4, !tbaa !36
  br label %15

15:                                               ; preds = %27, %10
  %16 = load i32, ptr %5, align 4, !tbaa !36
  %17 = icmp sge i32 %16, 0
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %30

19:                                               ; preds = %15
  %20 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %7, i32 0, i32 31
  %21 = load i32, ptr %5, align 4, !tbaa !36
  %22 = sext i32 %21 to i64
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %22) #6
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160) %24, ptr noundef %25)
  br label %27

27:                                               ; preds = %19
  %28 = load i32, ptr %5, align 4, !tbaa !36
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %5, align 4, !tbaa !36
  br label %15, !llvm.loop !37

30:                                               ; preds = %18
  %31 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %7, i32 0, i32 31
  call void @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef 0)
  br label %67

32:                                               ; preds = %1
  %33 = icmp eq ptr %7, null
  br i1 %33, label %36, label %34

34:                                               ; preds = %32
  %35 = call ptr @__dynamic_cast(ptr %7, ptr @_ZTIN7sc_core12sc_process_bE, ptr @_ZTIN7sc_core17sc_method_processE, i64 0) #6
  br label %37

36:                                               ; preds = %32
  br label %37

37:                                               ; preds = %36, %34
  %38 = phi ptr [ %35, %34 ], [ null, %36 ]
  store ptr %38, ptr %3, align 8, !tbaa !5
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  br label %44

42:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.5, i32 noundef 321, ptr noundef @__PRETTY_FUNCTION__._ZN7sc_core12sc_process_b20remove_static_eventsEv) #7
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %45 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %7, i32 0, i32 31
  %46 = call noundef i64 @_ZNKSt6vectorIPKN7sc_core8sc_eventESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %45) #6
  %47 = sub i64 %46, 1
  %48 = trunc i64 %47 to i32
  store i32 %48, ptr %6, align 4, !tbaa !36
  br label %49

49:                                               ; preds = %61, %44
  %50 = load i32, ptr %6, align 4, !tbaa !36
  %51 = icmp sge i32 %50, 0
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %64

53:                                               ; preds = %49
  %54 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %7, i32 0, i32 31
  %55 = load i32, ptr %6, align 4, !tbaa !36
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %56) #6
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = call noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160) %58, ptr noundef %59)
  br label %61

61:                                               ; preds = %53
  %62 = load i32, ptr %6, align 4, !tbaa !36
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %6, align 4, !tbaa !36
  br label %49, !llvm.loop !39

64:                                               ; preds = %52
  %65 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %7, i32 0, i32 31
  call void @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %65, i64 noundef 0)
  br label %67

66:                                               ; preds = %1
  br label %67

67:                                               ; preds = %66, %64, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void
}

declare noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #5

declare noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn 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 #3 = { mustprogress 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 = { "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 willreturn memory(read) }
attributes #6 = { nounwind }
attributes #7 = { 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, !25, i64 200}
!10 = !{!"_ZTSN7sc_core12sc_process_bE", !11, i64 0, !6, i64 112, !23, i64 120, !23, i64 124, !23, i64 128, !23, i64 132, !24, i64 136, !24, i64 137, !6, i64 144, !23, i64 152, !6, i64 160, !6, i64 168, !24, i64 176, !24, i64 177, !24, i64 178, !24, i64 179, !6, i64 184, !6, i64 192, !25, i64 200, !23, i64 204, !26, i64 208, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !7, i64 264, !23, i64 280, !30, i64 288, !24, i64 312, !6, i64 320, !6, i64 328, !34, i64 336, !24, i64 340, !6, i64 344, !35, i64 352, !24, i64 356}
!11 = !{!"_ZTSN7sc_core9sc_objectE", !6, i64 8, !12, i64 16, !16, i64 40, !20, i64 64, !6, i64 96, !6, i64 104}
!12 = !{!"_ZTSSt6vectorIPN7sc_core8sc_eventESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIPN7sc_core8sc_eventESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_eventESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_eventESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"_ZTSSt6vectorIPN7sc_core9sc_objectESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIPN7sc_core9sc_objectESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9sc_objectESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9sc_objectESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !22, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"int", !7, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSN7sc_core17sc_curr_proc_kindE", !7, i64 0}
!26 = !{!"_ZTSSt6vectorIPN7sc_core8sc_resetESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIPN7sc_core8sc_resetESaIS2_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_resetESaIS2_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_resetESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"_ZTSSt6vectorIPKN7sc_core8sc_eventESaIS3_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIPKN7sc_core8sc_eventESaIS3_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIPKN7sc_core8sc_eventESaIS3_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPKN7sc_core8sc_eventESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTSN7sc_core12sc_process_b18process_throw_typeE", !7, i64 0}
!35 = !{!"_ZTSN7sc_core12sc_process_b9trigger_tE", !7, i64 0}
!36 = !{!23, !23, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


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

@.str.5 = external hidden unnamed_addr constant [86 x i8], align 1
@_ZTIN7sc_core12sc_process_bE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN7sc_core17sc_method_processE = external constant ptr
@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._ZN7sc_core12sc_process_b20remove_static_eventsEv = external hidden unnamed_addr constant [51 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPKN7sc_core8sc_eventESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core12sc_process_b20remove_static_eventsEv(ptr noundef nonnull align 8 dereferenceable(357) %0) local_unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 200
  %3 = load i32, ptr %2, align 8, !tbaa !5
  switch i32 %3, label %25 [
    i32 2, label %4
    i32 3, label %4
    i32 1, label %13
  ]

4:                                                ; preds = %1, %1
  %5 = getelementptr inbounds i8, ptr %0, i64 288
  %6 = tail call noundef i64 @_ZNKSt6vectorIPKN7sc_core8sc_eventESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  %7 = trunc i64 %6 to i32
  %.0913 = add i32 %7, -1
  %8 = icmp sgt i32 %.0913, -1
  br i1 %8, label %.lr.ph16.preheader, label %.sink.split

.lr.ph16.preheader:                               ; preds = %4
  %9 = zext nneg i32 %.0913 to i64
  br label %.lr.ph16

.lr.ph16:                                         ; preds = %.lr.ph16.preheader, %.lr.ph16
  %indvars.iv19 = phi i64 [ %9, %.lr.ph16.preheader ], [ %indvars.iv.next20, %.lr.ph16 ]
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv19) #5
  %11 = load ptr, ptr %10, align 8, !tbaa !35
  %12 = tail call noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160) %11, ptr noundef nonnull %0)
  %indvars.iv.next20 = add nsw i64 %indvars.iv19, -1
  %.not23 = icmp eq i64 %indvars.iv19, 0
  br i1 %.not23, label %.sink.split, label %.lr.ph16, !llvm.loop !36

13:                                               ; preds = %1
  %14 = tail call ptr @__dynamic_cast(ptr nonnull %0, ptr nonnull @_ZTIN7sc_core12sc_process_bE, ptr nonnull @_ZTIN7sc_core17sc_method_processE, i64 0) #5
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %15, label %16

15:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.5, i32 noundef 321, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7sc_core12sc_process_b20remove_static_eventsEv) #6
  unreachable

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %0, i64 288
  %18 = tail call noundef i64 @_ZNKSt6vectorIPKN7sc_core8sc_eventESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  %19 = trunc i64 %18 to i32
  %.011 = add i32 %19, -1
  %20 = icmp sgt i32 %.011, -1
  br i1 %20, label %.lr.ph.preheader, label %.sink.split

.lr.ph.preheader:                                 ; preds = %16
  %21 = zext nneg i32 %.011 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %21, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %indvars.iv) #5
  %23 = load ptr, ptr %22, align 8, !tbaa !35
  %24 = tail call noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160) %23, ptr noundef nonnull %14)
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not22 = icmp eq i64 %indvars.iv, 0
  br i1 %.not22, label %.sink.split, label %.lr.ph, !llvm.loop !38

.sink.split:                                      ; preds = %.lr.ph, %.lr.ph16, %16, %4
  %.sink = phi ptr [ %5, %4 ], [ %17, %16 ], [ %5, %.lr.ph16 ], [ %17, %.lr.ph ]
  tail call void @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %.sink, i64 noundef 0)
  br label %25

25:                                               ; preds = %.sink.split, %1
  ret void
}

declare noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPKN7sc_core8sc_eventESaIS3_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #4

declare noundef zeroext i1 @_ZNK7sc_core8sc_event13remove_staticEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { noreturn 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 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 = { "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 nofree nounwind willreturn memory(read) }
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, !24, i64 200}
!6 = !{!"_ZTSN7sc_core12sc_process_bE", !7, i64 0, !8, i64 112, !22, i64 120, !22, i64 124, !22, i64 128, !22, i64 132, !23, i64 136, !23, i64 137, !8, i64 144, !22, i64 152, !8, i64 160, !8, i64 168, !23, i64 176, !23, i64 177, !23, i64 178, !23, i64 179, !8, i64 184, !8, i64 192, !24, i64 200, !22, i64 204, !25, i64 208, !8, i64 232, !8, i64 240, !8, i64 248, !8, i64 256, !9, i64 264, !22, i64 280, !29, i64 288, !23, i64 312, !8, i64 320, !8, i64 328, !33, i64 336, !23, i64 340, !8, i64 344, !34, i64 352, !23, i64 356}
!7 = !{!"_ZTSN7sc_core9sc_objectE", !8, i64 8, !11, i64 16, !15, i64 40, !19, i64 64, !8, i64 96, !8, i64 104}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt6vectorIPN7sc_core8sc_eventESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIPN7sc_core8sc_eventESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_eventESaIS2_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_eventESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!15 = !{!"_ZTSSt6vectorIPN7sc_core9sc_objectESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIPN7sc_core9sc_objectESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9sc_objectESaIS2_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core9sc_objectESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !21, i64 8, !9, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !8, i64 0}
!21 = !{!"long", !9, i64 0}
!22 = !{!"int", !9, i64 0}
!23 = !{!"bool", !9, i64 0}
!24 = !{!"_ZTSN7sc_core17sc_curr_proc_kindE", !9, i64 0}
!25 = !{!"_ZTSSt6vectorIPN7sc_core8sc_resetESaIS2_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIPN7sc_core8sc_resetESaIS2_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_resetESaIS2_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIPN7sc_core8sc_resetESaIS2_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!29 = !{!"_ZTSSt6vectorIPKN7sc_core8sc_eventESaIS3_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIPKN7sc_core8sc_eventESaIS3_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIPKN7sc_core8sc_eventESaIS3_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIPKN7sc_core8sc_eventESaIS3_EE17_Vector_impl_dataE", !8, i64 0, !8, i64 8, !8, i64 16}
!33 = !{!"_ZTSN7sc_core12sc_process_b18process_throw_typeE", !9, i64 0}
!34 = !{!"_ZTSN7sc_core12sc_process_b9trigger_tE", !9, i64 0}
!35 = !{!8, !8, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}


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