; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/kernel/sc_reset.ll (ZN7sc_core8sc_reset16reconcile_resetsEv)

; 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_reset_target" = type { i8, i8, ptr }
%"class.sc_core::sc_reset_finder" = type { i8, i8, ptr, ptr, ptr, ptr, ptr }
%"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.13", ptr, ptr, ptr, ptr, { i64, i64 }, i32, [4 x i8], %"class.std::vector.18", 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.0", %"class.std::vector.5", %"class.std::__cxx11::basic_string", 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_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.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = 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.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = 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 }
%"class.sc_core::sc_reset" = type { ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sc_core::sc_reset_target, std::allocator<sc_core::sc_reset_target>>::_Vector_impl" }
%"struct.std::_Vector_base<sc_core::sc_reset_target, std::allocator<sc_core::sc_reset_target>>::_Vector_impl" = type { %"struct.std::_Vector_base<sc_core::sc_reset_target, std::allocator<sc_core::sc_reset_target>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sc_core::sc_reset_target, std::allocator<sc_core::sc_reset_target>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN7sc_coreL14reset_finder_qE = external hidden global ptr, align 8
@_ZTIN7sc_core12sc_interfaceE = external constant ptr
@_ZTIN7sc_core15sc_signal_in_ifIbEE = external dso_local constant { ptr, ptr, i32, i32, ptr, i64 }, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__._ZN7sc_core8sc_reset16reconcile_resetsEv = external hidden unnamed_addr constant [50 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: 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_core8sc_reset16reconcile_resetsEv() #1 align 2 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.sc_core::sc_reset_target", align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %6 = load ptr, ptr @_ZN7sc_coreL14reset_finder_qE, align 8, !tbaa !5
  store ptr %6, ptr %3, align 8, !tbaa !5
  br label %7

7:                                                ; preds = %127, %0
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = icmp ne ptr %8, null
  br i1 %9, label %10, label %129

10:                                               ; preds = %7
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %11, i32 0, i32 2
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %13, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %14, i32 0, i32 3
  %16 = load ptr, ptr %15, align 8, !tbaa !12
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %32

18:                                               ; preds = %10
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = getelementptr inbounds ptr, ptr %22, i64 16
  %24 = load ptr, ptr %23, align 8
  %25 = call noundef ptr %24(ptr noundef nonnull align 8 dereferenceable(152) %21)
  %26 = icmp eq ptr %25, null
  br i1 %26, label %29, label %27

27:                                               ; preds = %18
  %28 = call ptr @__dynamic_cast(ptr %25, ptr @_ZTIN7sc_core12sc_interfaceE, ptr @_ZTIN7sc_core15sc_signal_in_ifIbEE, i64 -1) #6
  br label %30

29:                                               ; preds = %18
  br label %30

30:                                               ; preds = %29, %27
  %31 = phi ptr [ %28, %27 ], [ null, %29 ]
  store ptr %31, ptr %1, align 8, !tbaa !5
  br label %66

32:                                               ; preds = %10
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %51

37:                                               ; preds = %32
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %38, i32 0, i32 4
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = getelementptr inbounds ptr, ptr %41, i64 16
  %43 = load ptr, ptr %42, align 8
  %44 = call noundef ptr %43(ptr noundef nonnull align 8 dereferenceable(152) %40)
  %45 = icmp eq ptr %44, null
  br i1 %45, label %48, label %46

46:                                               ; preds = %37
  %47 = call ptr @__dynamic_cast(ptr %44, ptr @_ZTIN7sc_core12sc_interfaceE, ptr @_ZTIN7sc_core15sc_signal_in_ifIbEE, i64 -1) #6
  br label %49

48:                                               ; preds = %37
  br label %49

49:                                               ; preds = %48, %46
  %50 = phi ptr [ %47, %46 ], [ null, %48 ]
  store ptr %50, ptr %1, align 8, !tbaa !5
  br label %65

51:                                               ; preds = %32
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %52, i32 0, i32 5
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = getelementptr inbounds ptr, ptr %55, i64 16
  %57 = load ptr, ptr %56, align 8
  %58 = call noundef ptr %57(ptr noundef nonnull align 8 dereferenceable(152) %54)
  %59 = icmp eq ptr %58, null
  br i1 %59, label %62, label %60

60:                                               ; preds = %51
  %61 = call ptr @__dynamic_cast(ptr %58, ptr @_ZTIN7sc_core12sc_interfaceE, ptr @_ZTIN7sc_core15sc_signal_in_ifIbEE, i64 -1) #6
  br label %63

62:                                               ; preds = %51
  br label %63

63:                                               ; preds = %62, %60
  %64 = phi ptr [ %61, %60 ], [ null, %62 ]
  store ptr %64, ptr %1, align 8, !tbaa !5
  br label %65

65:                                               ; preds = %63, %49
  br label %66

66:                                               ; preds = %65, %30
  %67 = load ptr, ptr %1, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  br label %72

70:                                               ; preds = %66
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 188, ptr noundef @__PRETTY_FUNCTION__._ZN7sc_core8sc_reset16reconcile_resetsEv) #7
  unreachable

71:                                               ; No predecessors!
  br label %72

72:                                               ; preds = %71, %69
  %73 = load ptr, ptr %1, align 8, !tbaa !5
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  %75 = getelementptr inbounds ptr, ptr %74, i64 12
  %76 = load ptr, ptr %75, align 8
  %77 = call noundef ptr %76(ptr noundef nonnull align 8 dereferenceable(8) %73)
  store ptr %77, ptr %5, align 8, !tbaa !5
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %78, i32 0, i32 6
  %80 = load ptr, ptr %79, align 8, !tbaa !17
  %81 = getelementptr inbounds %"class.sc_core::sc_process_b", ptr %80, i32 0, i32 23
  call void @_ZNSt6vectorIPN7sc_core8sc_resetESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %82, i32 0, i32 0
  %84 = load i8, ptr %83, align 8, !tbaa !18, !range !19, !noundef !20
  %85 = trunc i8 %84 to i1
  %86 = getelementptr inbounds %"class.sc_core::sc_reset_target", ptr %4, i32 0, i32 0
  %87 = zext i1 %85 to i8
  store i8 %87, ptr %86, align 8, !tbaa !21
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %88, i32 0, i32 1
  %90 = load i8, ptr %89, align 1, !tbaa !23, !range !19, !noundef !20
  %91 = trunc i8 %90 to i1
  %92 = getelementptr inbounds %"class.sc_core::sc_reset_target", ptr %4, i32 0, i32 1
  %93 = zext i1 %91 to i8
  store i8 %93, ptr %92, align 1, !tbaa !24
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %94, i32 0, i32 6
  %96 = load ptr, ptr %95, align 8, !tbaa !17
  %97 = getelementptr inbounds %"class.sc_core::sc_reset_target", ptr %4, i32 0, i32 2
  store ptr %96, ptr %97, align 8, !tbaa !25
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.sc_core::sc_reset", ptr %98, i32 0, i32 1
  call void @_ZNSt6vectorIN7sc_core15sc_reset_targetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %99, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %100 = load ptr, ptr %1, align 8, !tbaa !5
  %101 = load ptr, ptr %100, align 8, !tbaa !13
  %102 = getelementptr inbounds ptr, ptr %101, i64 7
  %103 = load ptr, ptr %102, align 8
  %104 = call noundef nonnull align 1 dereferenceable(1) ptr %103(ptr noundef nonnull align 8 dereferenceable(8) %100)
  %105 = load i8, ptr %104, align 1, !tbaa !26, !range !19, !noundef !20
  %106 = trunc i8 %105 to i1
  %107 = zext i1 %106 to i32
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %108, i32 0, i32 1
  %110 = load i8, ptr %109, align 1, !tbaa !23, !range !19, !noundef !20
  %111 = trunc i8 %110 to i1
  %112 = zext i1 %111 to i32
  %113 = icmp eq i32 %107, %112
  br i1 %113, label %114, label %122

114:                                              ; preds = %72
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %115, i32 0, i32 6
  %117 = load ptr, ptr %116, align 8, !tbaa !17
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %"class.sc_core::sc_reset_finder", ptr %118, i32 0, i32 0
  %120 = load i8, ptr %119, align 8, !tbaa !18, !range !19, !noundef !20
  %121 = trunc i8 %120 to i1
  call void @_ZN7sc_core12sc_process_b18initially_in_resetEb(ptr noundef nonnull align 8 dereferenceable(357) %117, i1 noundef zeroext %121)
  br label %122

122:                                              ; preds = %114, %72
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  call void @_ZdlPvm(ptr noundef %123, i64 noundef 48) #8
  br label %126

126:                                              ; preds = %125, %122
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %128, ptr %3, align 8, !tbaa !5
  br label %7, !llvm.loop !27

129:                                              ; preds = %7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7sc_core15sc_reset_targetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7sc_core12sc_process_b18initially_in_resetEb(ptr noundef nonnull align 8 dereferenceable(357), i1 noundef zeroext) #4 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #5

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 = { nounwind willreturn memory(read) }
attributes #3 = { 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 #4 = { 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 #5 = { nobuiltin 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { builtin 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 8}
!10 = !{!"_ZTSN7sc_core15sc_reset_finderE", !11, i64 0, !11, i64 1, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"bool", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!10, !6, i64 24}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 40}
!18 = !{!10, !11, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !11, i64 0}
!22 = !{!"_ZTSN7sc_core15sc_reset_targetE", !11, i64 0, !11, i64 1, !6, i64 8}
!23 = !{!10, !11, i64 1}
!24 = !{!22, !11, i64 1}
!25 = !{!22, !6, i64 8}
!26 = !{!11, !11, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.sc_core::sc_reset_target" = type { i8, i8, ptr }

@_ZN7sc_coreL14reset_finder_qE = external hidden local_unnamed_addr global ptr, align 8
@_ZTIN7sc_core12sc_interfaceE = external constant ptr
@_ZTIN7sc_core15sc_signal_in_ifIbEE = external dso_local constant { ptr, ptr, i32, i32, ptr, i64 }, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__._ZN7sc_core8sc_reset16reconcile_resetsEv = external hidden unnamed_addr constant [50 x i8], align 1

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

; Function Attrs: mustprogress 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_core8sc_reset16reconcile_resetsEv() local_unnamed_addr #1 align 2 {
  %1 = alloca %"class.sc_core::sc_reset_target", align 8
  %2 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %3 = load ptr, ptr @_ZN7sc_coreL14reset_finder_qE, align 8, !tbaa !5
  %.not30 = icmp eq ptr %3, null
  br i1 %.not30, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %4 = getelementptr inbounds i8, ptr %1, i64 1
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  br label %6

6:                                                ; preds = %.lr.ph, %61
  %.031 = phi ptr [ %3, %.lr.ph ], [ %8, %61 ]
  %7 = getelementptr inbounds i8, ptr %.031, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %.031, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %.not25 = icmp eq ptr %10, null
  br i1 %.not25, label %17, label %11

11:                                               ; preds = %6
  %12 = load ptr, ptr %10, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %12, i64 128
  %14 = load ptr, ptr %13, align 8
  %15 = call noundef ptr %14(ptr noundef nonnull align 8 dereferenceable(152) %10)
  %16 = icmp eq ptr %15, null
  br i1 %16, label %.thread, label %34

17:                                               ; preds = %6
  %18 = getelementptr inbounds i8, ptr %.031, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %.not26 = icmp eq ptr %19, null
  br i1 %.not26, label %26, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr %19, align 8, !tbaa !13
  %22 = getelementptr inbounds i8, ptr %21, i64 128
  %23 = load ptr, ptr %22, align 8
  %24 = call noundef ptr %23(ptr noundef nonnull align 8 dereferenceable(152) %19)
  %25 = icmp eq ptr %24, null
  br i1 %25, label %.thread, label %34

26:                                               ; preds = %17
  %27 = getelementptr inbounds i8, ptr %.031, i64 32
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %29, i64 128
  %31 = load ptr, ptr %30, align 8
  %32 = call noundef ptr %31(ptr noundef nonnull align 8 dereferenceable(152) %28)
  %33 = icmp eq ptr %32, null
  br i1 %33, label %.thread, label %34

34:                                               ; preds = %26, %20, %11
  %.sink = phi ptr [ %15, %11 ], [ %24, %20 ], [ %32, %26 ]
  %35 = call ptr @__dynamic_cast(ptr nonnull %.sink, ptr nonnull @_ZTIN7sc_core12sc_interfaceE, ptr nonnull @_ZTIN7sc_core15sc_signal_in_ifIbEE, i64 -1) #6
  %.not27 = icmp eq ptr %35, null
  br i1 %.not27, label %.thread, label %36

.thread:                                          ; preds = %26, %20, %11, %34
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 188, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7sc_core8sc_reset16reconcile_resetsEv) #7
  unreachable

36:                                               ; preds = %34
  %37 = load ptr, ptr %35, align 8, !tbaa !13
  %38 = getelementptr inbounds i8, ptr %37, i64 96
  %39 = load ptr, ptr %38, align 8
  %40 = call noundef ptr %39(ptr noundef nonnull align 8 dereferenceable(8) %35)
  store ptr %40, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %.031, i64 40
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  %43 = getelementptr inbounds i8, ptr %42, i64 208
  call void @_ZNSt6vectorIPN7sc_core8sc_resetESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %44 = load i8, ptr %.031, align 8, !tbaa !18, !range !19, !noundef !20
  store i8 %44, ptr %1, align 8, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %.031, i64 1
  %46 = load i8, ptr %45, align 1, !tbaa !23, !range !19, !noundef !20
  store i8 %46, ptr %4, align 1, !tbaa !24
  %47 = load ptr, ptr %41, align 8, !tbaa !17
  store ptr %47, ptr %5, align 8, !tbaa !25
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  call void @_ZNSt6vectorIN7sc_core15sc_reset_targetESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %49, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %50 = load ptr, ptr %35, align 8, !tbaa !13
  %51 = getelementptr inbounds i8, ptr %50, i64 56
  %52 = load ptr, ptr %51, align 8
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr %52(ptr noundef nonnull align 8 dereferenceable(8) %35)
  %54 = load i8, ptr %53, align 1, !tbaa !26, !range !19, !noundef !20
  %55 = load i8, ptr %45, align 1, !tbaa !23, !range !19, !noundef !20
  %56 = icmp eq i8 %54, %55
  br i1 %56, label %57, label %61

57:                                               ; preds = %36
  %58 = load ptr, ptr %41, align 8, !tbaa !17
  %59 = load i8, ptr %.031, align 8, !tbaa !18, !range !19, !noundef !20
  %60 = trunc nuw i8 %59 to i1
  call void @_ZN7sc_core12sc_process_b18initially_in_resetEb(ptr noundef nonnull align 8 dereferenceable(357) %58, i1 noundef zeroext %60)
  br label %61

61:                                               ; preds = %36, %57
  call void @_ZdlPvm(ptr noundef nonnull %.031, i64 noundef 48) #8
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %._crit_edge, label %6, !llvm.loop !27

._crit_edge:                                      ; preds = %61, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #6
  ret void
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7sc_core12sc_process_b18initially_in_resetEb(ptr noundef nonnull align 8 dereferenceable(357), i1 noundef zeroext) local_unnamed_addr #4 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #5

attributes #0 = { mustprogress 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 = { mustprogress nofree nounwind willreturn memory(read) }
attributes #3 = { 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 #4 = { 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 #5 = { nobuiltin 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { builtin 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 8}
!10 = !{!"_ZTSN7sc_core15sc_reset_finderE", !11, i64 0, !11, i64 1, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"bool", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!10, !6, i64 24}
!16 = !{!10, !6, i64 32}
!17 = !{!10, !6, i64 40}
!18 = !{!10, !11, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !11, i64 0}
!22 = !{!"_ZTSN7sc_core15sc_reset_targetE", !11, i64 0, !11, i64 1, !6, i64 8}
!23 = !{!10, !11, i64 1}
!24 = !{!22, !11, i64 1}
!25 = !{!22, !6, i64 8}
!26 = !{!11, !11, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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