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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core12sc_process_b21remove_dynamic_eventsEb(ptr noundef nonnull align 8 dereferenceable(357) %0, i1 noundef zeroext %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %7 = zext i1 %1 to i8
  store i8 %7, ptr %4, align 1, !tbaa !9
  %8 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %9 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 40
  store i32 0, ptr %9, align 8, !tbaa !11
  %10 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 21
  %11 = load i32, ptr %10, align 8, !tbaa !37
  switch i32 %11, label %88 [
    i32 2, label %12
    i32 3, label %12
    i32 1, label %50
  ]

12:                                               ; preds = %2, %2
  store ptr %8, ptr %6, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %13, i32 0, i32 39
  %15 = load ptr, ptr %14, align 8, !tbaa !38
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %29

17:                                               ; preds = %12
  %18 = load i8, ptr %4, align 1, !tbaa !9, !range !39, !noundef !40
  %19 = trunc i8 %18 to i1
  br i1 %19, label %29, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %21, i32 0, i32 39
  %23 = load ptr, ptr %22, align 8, !tbaa !38
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160) %23, ptr noundef %24)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %26, i32 0, i32 39
  %28 = load ptr, ptr %27, align 8, !tbaa !38
  call void @_ZN7sc_core8sc_event6cancelEv(ptr noundef nonnull align 8 dereferenceable(160) %28)
  br label %29

29:                                               ; preds = %20, %17, %12
  %30 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 9
  %31 = load ptr, ptr %30, align 8, !tbaa !41
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %38

33:                                               ; preds = %29
  %34 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 9
  %35 = load ptr, ptr %34, align 8, !tbaa !41
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160) %35, ptr noundef %36)
  br label %38

38:                                               ; preds = %33, %29
  %39 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  %40 = load ptr, ptr %39, align 8, !tbaa !42
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %49

42:                                               ; preds = %38
  %43 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  %44 = load ptr, ptr %43, align 8, !tbaa !42
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_thread_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32) %44, ptr noundef %45, ptr noundef null)
  %46 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  %47 = load ptr, ptr %46, align 8, !tbaa !42
  call void @_ZNK7sc_core13sc_event_list11auto_deleteEv(ptr noundef nonnull align 8 dereferenceable(32) %47)
  %48 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  store ptr null, ptr %48, align 8, !tbaa !42
  br label %49

49:                                               ; preds = %42, %38
  br label %89

50:                                               ; preds = %2
  store ptr %8, ptr %5, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %51, i32 0, i32 39
  %53 = load ptr, ptr %52, align 8, !tbaa !38
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %67

55:                                               ; preds = %50
  %56 = load i8, ptr %4, align 1, !tbaa !9, !range !39, !noundef !40
  %57 = trunc i8 %56 to i1
  br i1 %57, label %67, label %58

58:                                               ; preds = %55
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %59, i32 0, i32 39
  %61 = load ptr, ptr %60, align 8, !tbaa !38
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160) %61, ptr noundef %62)
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %64, i32 0, i32 39
  %66 = load ptr, ptr %65, align 8, !tbaa !38
  call void @_ZN7sc_core8sc_event6cancelEv(ptr noundef nonnull align 8 dereferenceable(160) %66)
  br label %67

67:                                               ; preds = %58, %55, %50
  %68 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 9
  %69 = load ptr, ptr %68, align 8, !tbaa !41
  %70 = icmp ne ptr %69, null
  br i1 %70, label %71, label %76

71:                                               ; preds = %67
  %72 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 9
  %73 = load ptr, ptr %72, align 8, !tbaa !41
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160) %73, ptr noundef %74)
  br label %76

76:                                               ; preds = %71, %67
  %77 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  %78 = load ptr, ptr %77, align 8, !tbaa !42
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %87

80:                                               ; preds = %76
  %81 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  %82 = load ptr, ptr %81, align 8, !tbaa !42
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_method_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32) %82, ptr noundef %83, ptr noundef null)
  %84 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  %85 = load ptr, ptr %84, align 8, !tbaa !42
  call void @_ZNK7sc_core13sc_event_list11auto_deleteEv(ptr noundef nonnull align 8 dereferenceable(32) %85)
  %86 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %8, i32 0, i32 12
  store ptr null, ptr %86, align 8, !tbaa !42
  br label %87

87:                                               ; preds = %80, %76
  br label %89

88:                                               ; preds = %2
  br label %89

89:                                               ; preds = %88, %87, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

declare noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef) #2

declare void @_ZN7sc_core8sc_event6cancelEv(ptr noundef nonnull align 8 dereferenceable(160)) #2

declare void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_thread_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef) #2

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

declare noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160), ptr noundef) #2

declare void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_method_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef) #2

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


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7sc_core12sc_process_b21remove_dynamic_eventsEb(ptr noundef nonnull align 8 dereferenceable(357) %0, i1 noundef zeroext %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 352
  store i32 0, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 200
  %5 = load i32, ptr %4, align 8, !tbaa !35
  switch i32 %5, label %37 [
    i32 2, label %6
    i32 3, label %6
    i32 1, label %21
  ]

6:                                                ; preds = %2, %2
  %7 = getelementptr inbounds i8, ptr %0, i64 344
  %8 = load ptr, ptr %7, align 8, !tbaa !36
  %.not21 = icmp eq ptr %8, null
  %brmerge = or i1 %.not21, %1
  br i1 %brmerge, label %12, label %9

9:                                                ; preds = %6
  %10 = tail call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160) %8, ptr noundef nonnull %0)
  %11 = load ptr, ptr %7, align 8, !tbaa !36
  tail call void @_ZN7sc_core8sc_event6cancelEv(ptr noundef nonnull align 8 dereferenceable(160) %11)
  br label %12

12:                                               ; preds = %6, %9
  %13 = getelementptr inbounds i8, ptr %0, i64 144
  %14 = load ptr, ptr %13, align 8, !tbaa !37
  %.not22 = icmp eq ptr %14, null
  br i1 %.not22, label %17, label %15

15:                                               ; preds = %12
  %16 = tail call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_thread_processE(ptr noundef nonnull align 8 dereferenceable(160) %14, ptr noundef nonnull %0)
  br label %17

17:                                               ; preds = %15, %12
  %18 = getelementptr inbounds i8, ptr %0, i64 160
  %19 = load ptr, ptr %18, align 8, !tbaa !38
  %.not23 = icmp eq ptr %19, null
  br i1 %.not23, label %37, label %20

20:                                               ; preds = %17
  tail call void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_thread_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull %0, ptr noundef null)
  br label %.sink.split

21:                                               ; preds = %2
  %22 = getelementptr inbounds i8, ptr %0, i64 344
  %23 = load ptr, ptr %22, align 8, !tbaa !36
  %.not = icmp eq ptr %23, null
  %brmerge24 = or i1 %.not, %1
  br i1 %brmerge24, label %27, label %24

24:                                               ; preds = %21
  %25 = tail call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160) %23, ptr noundef nonnull %0)
  %26 = load ptr, ptr %22, align 8, !tbaa !36
  tail call void @_ZN7sc_core8sc_event6cancelEv(ptr noundef nonnull align 8 dereferenceable(160) %26)
  br label %27

27:                                               ; preds = %21, %24
  %28 = getelementptr inbounds i8, ptr %0, i64 144
  %29 = load ptr, ptr %28, align 8, !tbaa !37
  %.not19 = icmp eq ptr %29, null
  br i1 %.not19, label %32, label %30

30:                                               ; preds = %27
  %31 = tail call noundef zeroext i1 @_ZNK7sc_core8sc_event14remove_dynamicEPNS_17sc_method_processE(ptr noundef nonnull align 8 dereferenceable(160) %29, ptr noundef nonnull %0)
  br label %32

32:                                               ; preds = %30, %27
  %33 = getelementptr inbounds i8, ptr %0, i64 160
  %34 = load ptr, ptr %33, align 8, !tbaa !38
  %.not20 = icmp eq ptr %34, null
  br i1 %.not20, label %37, label %35

35:                                               ; preds = %32
  tail call void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_method_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32) %34, ptr noundef nonnull %0, ptr noundef null)
  br label %.sink.split

.sink.split:                                      ; preds = %20, %35
  %.sink26 = phi ptr [ %33, %35 ], [ %18, %20 ]
  %36 = load ptr, ptr %.sink26, align 8, !tbaa !38
  tail call void @_ZNK7sc_core13sc_event_list11auto_deleteEv(ptr noundef nonnull align 8 dereferenceable(32) %36)
  store ptr null, ptr %.sink26, align 8, !tbaa !38
  br label %37

37:                                               ; preds = %.sink.split, %2, %32, %17
  ret void
}

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

declare void @_ZN7sc_core8sc_event6cancelEv(ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #1

declare void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_thread_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare void @_ZNK7sc_core13sc_event_list14remove_dynamicEPNS_17sc_method_processEPKNS_8sc_eventE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #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 = { 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" }

!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, !34, i64 352}
!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 = !{!6, !24, i64 200}
!36 = !{!6, !8, i64 344}
!37 = !{!6, !8, i64 144}
!38 = !{!6, !8, i64 160}


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