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

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

@_ZN7sc_core23SC_ID_ASSERTION_FAILED_E = external constant [0 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@_ZTIN7sc_core9sc_reportE = external constant ptr
@_ZTISt9exception = external constant ptr
@_ZTIN7sc_core19sc_unwind_exceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIPKc = external constant ptr
@_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E = external constant [0 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [53 x i8], align 1

declare void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #0

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_begin_catch(ptr)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7sc_core19sc_handle_exceptionEv() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  invoke void @__cxa_rethrow() #7
          to label %129 unwind label %10

10:                                               ; preds = %0
  %11 = landingpad { ptr, i32 }
          catch ptr @_ZTIN7sc_core9sc_reportE
          catch ptr @_ZTIN7sc_core19sc_unwind_exceptionE
          catch ptr @_ZTISt9exception
          catch ptr @_ZTIPKc
          catch ptr null
  %12 = extractvalue { ptr, i32 } %11, 0
  store ptr %12, ptr %2, align 8
  %13 = extractvalue { ptr, i32 } %11, 1
  store i32 %13, ptr %3, align 4
  br label %14

14:                                               ; preds = %10
  %15 = load i32, ptr %3, align 4
  %16 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN7sc_core9sc_reportE) #8
  %17 = icmp eq i32 %15, %16
  br i1 %17, label %18, label %21

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %19 = load ptr, ptr %2, align 8
  %20 = call ptr @__cxa_begin_catch(ptr %19) #8
  store ptr %20, ptr %7, align 8
  invoke void @__cxa_rethrow() #7
          to label %129 unwind label %88

21:                                               ; preds = %14
  %22 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN7sc_core19sc_unwind_exceptionE) #8
  %23 = icmp eq i32 %15, %22
  br i1 %23, label %24, label %29

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %25 = load ptr, ptr %2, align 8
  %26 = call ptr @__cxa_begin_catch(ptr %25) #8
  store ptr %26, ptr %6, align 8
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 96)
          to label %27 unwind label %78

27:                                               ; preds = %24
  invoke void @__cxa_end_catch()
          to label %28 unwind label %82

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %107

29:                                               ; preds = %21
  %30 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #8
  %31 = icmp eq i32 %15, %30
  br i1 %31, label %32, label %42

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %33 = load ptr, ptr %2, align 8
  %34 = call ptr @__cxa_begin_catch(ptr %33) #8
  store ptr %34, ptr %5, align 8
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 2
  %38 = load ptr, ptr %37, align 8
  %39 = call noundef ptr %38(ptr noundef nonnull align 8 dereferenceable(8) %35) #8
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef @_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E, ptr noundef %39, ptr noundef @.str.1, i32 noundef 100)
          to label %40 unwind label %68

40:                                               ; preds = %32
  invoke void @__cxa_end_catch()
          to label %41 unwind label %72

41:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %107

42:                                               ; preds = %29
  %43 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIPKc) #8
  %44 = icmp eq i32 %15, %43
  br i1 %44, label %45, label %50

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %46 = load ptr, ptr %2, align 8
  %47 = call ptr @__cxa_begin_catch(ptr %46) #8
  store ptr %47, ptr %4, align 8
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef @_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E, ptr noundef %48, ptr noundef @.str.1, i32 noundef 104)
          to label %49 unwind label %64

49:                                               ; preds = %45
  call void @__cxa_end_catch() #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %107

50:                                               ; preds = %42
  %51 = load ptr, ptr %2, align 8
  %52 = call ptr @__cxa_begin_catch(ptr %51) #8
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef @_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E, ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 109)
          to label %53 unwind label %55

53:                                               ; preds = %50
  invoke void @__cxa_end_catch()
          to label %54 unwind label %59

54:                                               ; preds = %53
  br label %107

55:                                               ; preds = %50
  %56 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %2, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %3, align 4
  invoke void @__cxa_end_catch()
          to label %63 unwind label %126

59:                                               ; preds = %53
  %60 = landingpad { ptr, i32 }
          catch ptr @_ZTIN7sc_core9sc_reportE
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %2, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %3, align 4
  br label %93

63:                                               ; preds = %55
  br label %93

64:                                               ; preds = %45
  %65 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %2, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %3, align 4
  call void @__cxa_end_catch() #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %93

68:                                               ; preds = %32
  %69 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %2, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %3, align 4
  invoke void @__cxa_end_catch()
          to label %76 unwind label %126

72:                                               ; preds = %40
  %73 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %2, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %3, align 4
  br label %77

76:                                               ; preds = %68
  br label %77

77:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %93

78:                                               ; preds = %24
  %79 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %2, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %3, align 4
  invoke void @__cxa_end_catch()
          to label %86 unwind label %126

82:                                               ; preds = %27
  %83 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %2, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %3, align 4
  br label %87

86:                                               ; preds = %78
  br label %87

87:                                               ; preds = %86, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %93

88:                                               ; preds = %18
  %89 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %2, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %3, align 4
  invoke void @__cxa_end_catch()
          to label %92 unwind label %126

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %93

93:                                               ; preds = %92, %87, %77, %64, %63, %59
  %94 = load i32, ptr %3, align 4
  %95 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIN7sc_core9sc_reportE) #8
  %96 = icmp eq i32 %94, %95
  br i1 %96, label %97, label %121

97:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %98 = load ptr, ptr %2, align 8
  %99 = call ptr @__cxa_begin_catch(ptr %98) #8
  store ptr %99, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %100 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 80) #9
          to label %101 unwind label %108

101:                                              ; preds = %97
  invoke void @_ZN7sc_core9sc_reportC1Ev(ptr noundef nonnull align 8 dereferenceable(80) %100)
          to label %102 unwind label %112

102:                                              ; preds = %101
  store ptr %100, ptr %9, align 8, !tbaa !5
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @_ZN7sc_core9sc_report4swapERS0_(ptr noundef nonnull align 8 dereferenceable(80) %103, ptr noundef nonnull align 8 dereferenceable(80) %104)
          to label %105 unwind label %108

105:                                              ; preds = %102
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %106, ptr %1, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %119

107:                                              ; preds = %54, %49, %41, %28
  br label %118

108:                                              ; preds = %102, %97
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %2, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %3, align 4
  br label %116

112:                                              ; preds = %101
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %2, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %3, align 4
  call void @_ZdlPvm(ptr noundef %100, i64 noundef 80) #10
  br label %116

116:                                              ; preds = %112, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  invoke void @__cxa_end_catch()
          to label %117 unwind label %126

117:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %121

118:                                              ; preds = %107
  store ptr null, ptr %1, align 8
  br label %119

119:                                              ; preds = %118, %105
  %120 = load ptr, ptr %1, align 8
  ret ptr %120

121:                                              ; preds = %117, %93
  %122 = load ptr, ptr %2, align 8
  %123 = load i32, ptr %3, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125

126:                                              ; preds = %116, %88, %78, %68, %55
  %127 = landingpad { ptr, i32 }
          catch ptr null
  %128 = extractvalue { ptr, i32 } %127, 0
  call void @__clang_call_terminate(ptr %128) #11
  unreachable

129:                                              ; preds = %18, %0
  unreachable
}

declare void @__cxa_rethrow()

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #4

declare void @__cxa_end_catch()

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

declare void @_ZN7sc_core9sc_reportC1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0

declare void @_ZN7sc_core9sc_report4swapERS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) #0

attributes #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 = { 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 #2 = { 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 #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 = { nounwind memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nobuiltin allocsize(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 #7 = { noreturn }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }
attributes #11 = { 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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}


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

@_ZN7sc_core23SC_ID_ASSERTION_FAILED_E = external constant [0 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@_ZTIN7sc_core9sc_reportE = external constant ptr
@_ZTISt9exception = external constant ptr
@_ZTIN7sc_core19sc_unwind_exceptionE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIPKc = external constant ptr
@_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E = external constant [0 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [53 x i8], align 1

declare void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7sc_core19sc_handle_exceptionEv() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  invoke void @__cxa_rethrow() #6
          to label %67 unwind label %1

1:                                                ; preds = %0
  %2 = landingpad { ptr, i32 }
          catch ptr @_ZTIN7sc_core9sc_reportE
          catch ptr @_ZTIN7sc_core19sc_unwind_exceptionE
          catch ptr @_ZTISt9exception
          catch ptr @_ZTIPKc
          catch ptr null
  %3 = extractvalue { ptr, i32 } %2, 0
  %4 = extractvalue { ptr, i32 } %2, 1
  %5 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN7sc_core9sc_reportE) #7
  %6 = icmp eq i32 %4, %5
  br i1 %6, label %7, label %9

7:                                                ; preds = %1
  %8 = tail call ptr @__cxa_begin_catch(ptr %3) #7
  invoke void @__cxa_rethrow() #6
          to label %67 unwind label %47

9:                                                ; preds = %1
  %10 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIN7sc_core19sc_unwind_exceptionE) #7
  %11 = icmp eq i32 %4, %10
  br i1 %11, label %12, label %15

12:                                               ; preds = %9
  %13 = tail call ptr @__cxa_begin_catch(ptr %3) #7
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef nonnull @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 96)
          to label %14 unwind label %43

14:                                               ; preds = %12
  invoke void @__cxa_end_catch()
          to label %62 unwind label %45

15:                                               ; preds = %9
  %16 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #7
  %17 = icmp eq i32 %4, %16
  br i1 %17, label %18, label %25

18:                                               ; preds = %15
  %19 = tail call ptr @__cxa_begin_catch(ptr %3) #7
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %22 = load ptr, ptr %21, align 8
  %23 = tail call noundef ptr %22(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef nonnull @_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E, ptr noundef %23, ptr noundef nonnull @.str.1, i32 noundef 100)
          to label %24 unwind label %39

24:                                               ; preds = %18
  invoke void @__cxa_end_catch()
          to label %62 unwind label %41

25:                                               ; preds = %15
  %26 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTIPKc) #7
  %27 = icmp eq i32 %4, %26
  %28 = tail call ptr @__cxa_begin_catch(ptr %3) #7
  br i1 %27, label %29, label %31

29:                                               ; preds = %25
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef nonnull @_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E, ptr noundef %28, ptr noundef nonnull @.str.1, i32 noundef 104)
          to label %30 unwind label %37

30:                                               ; preds = %29
  tail call void @__cxa_end_catch() #7
  br label %62

31:                                               ; preds = %25
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 2, ptr noundef nonnull @_ZN7sc_core36SC_ID_SIMULATION_UNCAUGHT_EXCEPTION_E, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 109)
          to label %32 unwind label %33

32:                                               ; preds = %31
  invoke void @__cxa_end_catch()
          to label %62 unwind label %35

33:                                               ; preds = %31
  %34 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  invoke void @__cxa_end_catch()
          to label %49 unwind label %64

35:                                               ; preds = %32
  %36 = landingpad { ptr, i32 }
          catch ptr @_ZTIN7sc_core9sc_reportE
  br label %49

37:                                               ; preds = %29
  %38 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  tail call void @__cxa_end_catch() #7
  br label %49

39:                                               ; preds = %18
  %40 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  invoke void @__cxa_end_catch()
          to label %49 unwind label %64

41:                                               ; preds = %24
  %42 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  br label %49

43:                                               ; preds = %12
  %44 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  invoke void @__cxa_end_catch()
          to label %49 unwind label %64

45:                                               ; preds = %14
  %46 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  br label %49

47:                                               ; preds = %7
  %48 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTIN7sc_core9sc_reportE
  invoke void @__cxa_end_catch()
          to label %49 unwind label %64

49:                                               ; preds = %47, %45, %43, %41, %39, %33, %37, %35
  %.pn25 = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ], [ %34, %33 ], [ %42, %41 ], [ %40, %39 ], [ %46, %45 ], [ %44, %43 ], [ %48, %47 ]
  %.218 = extractvalue { ptr, i32 } %.pn25, 1
  %50 = icmp eq i32 %.218, %5
  br i1 %50, label %51, label %63

51:                                               ; preds = %49
  %.2 = extractvalue { ptr, i32 } %.pn25, 0
  %52 = tail call ptr @__cxa_begin_catch(ptr %.2) #7
  %53 = invoke noalias noundef nonnull dereferenceable(80) ptr @_Znwm(i64 noundef 80) #8
          to label %54 unwind label %57

54:                                               ; preds = %51
  invoke void @_ZN7sc_core9sc_reportC1Ev(ptr noundef nonnull align 8 dereferenceable(80) %53)
          to label %55 unwind label %59

55:                                               ; preds = %54
  invoke void @_ZN7sc_core9sc_report4swapERS0_(ptr noundef nonnull align 8 dereferenceable(80) %53, ptr noundef nonnull align 8 dereferenceable(80) %52)
          to label %56 unwind label %57

56:                                               ; preds = %55
  tail call void @__cxa_end_catch()
  br label %62

57:                                               ; preds = %55, %51
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %61

59:                                               ; preds = %54
  %60 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %53, i64 noundef 80) #9
  br label %61

61:                                               ; preds = %59, %57
  %.pn27 = phi { ptr, i32 } [ %58, %57 ], [ %60, %59 ]
  invoke void @__cxa_end_catch()
          to label %63 unwind label %64

62:                                               ; preds = %32, %30, %14, %24, %56
  %.0 = phi ptr [ %53, %56 ], [ null, %24 ], [ null, %14 ], [ null, %30 ], [ null, %32 ]
  ret ptr %.0

63:                                               ; preds = %61, %49
  %.merged = phi { ptr, i32 } [ %.pn25, %49 ], [ %.pn27, %61 ]
  resume { ptr, i32 } %.merged

64:                                               ; preds = %61, %47, %43, %39, %33
  %65 = landingpad { ptr, i32 }
          catch ptr null
  %66 = extractvalue { ptr, i32 } %65, 0
  tail call void @__clang_call_terminate(ptr %66) #10
  unreachable

67:                                               ; preds = %7, %0
  unreachable
}

declare void @__cxa_rethrow() local_unnamed_addr

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #4

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #5

declare void @_ZN7sc_core9sc_reportC1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0

declare void @_ZN7sc_core9sc_report4swapERS0_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0

attributes #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 = { 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 #2 = { 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 #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 = { nofree nosync nounwind memory(none) }
attributes #5 = { nobuiltin allocsize(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 #6 = { noreturn }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin nounwind }
attributes #10 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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