; LLVM IR from gem5/gem5 :: src/systemc/tests/systemc/datatypes/int/sc_int/partselect/32bit/signed (main)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.sc_dt::sc_int" = type { %"class.sc_dt::sc_int_base" }
%"class.sc_dt::sc_int_base" = type { %"class.sc_dt::sc_value_base", i64, i32, i32 }
%"class.sc_dt::sc_value_base" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZN7sc_core23SC_ID_ASSERTION_FAILED_E = external constant [0 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [125 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @sc_main(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.sc_dt::sc_int", align 8
  %6 = alloca %"class.sc_dt::sc_int", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  call void @_ZN5sc_dt6sc_intILi32EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  invoke void @_ZN5sc_dt6sc_intILi32EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %12 unwind label %17

12:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %78, %12
  %14 = load i32, ptr %9, align 4, !tbaa !5
  %15 = icmp ult i32 %14, 32
  br i1 %15, label %21, label %16

16:                                               ; preds = %13
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %82

17:                                               ; preds = %2
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = extractvalue { ptr, i32 } %18, 0
  store ptr %19, ptr %7, align 8
  %20 = extractvalue { ptr, i32 } %18, 1
  store i32 %20, ptr %8, align 4
  br label %83

21:                                               ; preds = %13
  %22 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %23 unwind label %33

23:                                               ; preds = %21
  %24 = load i32, ptr %9, align 4, !tbaa !5
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %22, i32 noundef %24)
          to label %26 unwind label %33

26:                                               ; preds = %23
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %28 unwind label %33

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %74, %28
  %30 = load i32, ptr %11, align 4, !tbaa !5
  %31 = icmp ult i32 %30, 10000
  br i1 %31, label %37, label %32

32:                                               ; preds = %29
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %77

33:                                               ; preds = %26, %23, %21
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %7, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %8, align 4
  br label %81

37:                                               ; preds = %29
  %38 = load i32, ptr %11, align 4, !tbaa !5
  %39 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt6sc_intILi32EEaSEj(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %38)
          to label %40 unwind label %62

40:                                               ; preds = %37
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 31, i32 noundef %41)
          to label %43 unwind label %62

43:                                               ; preds = %40
  %44 = load i32, ptr %9, align 4, !tbaa !5
  %45 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef 31, i32 noundef %44)
          to label %46 unwind label %62

46:                                               ; preds = %43
  %47 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt13sc_int_subrefaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28) %45, ptr noundef nonnull align 8 dereferenceable(28) %42)
          to label %48 unwind label %62

48:                                               ; preds = %46
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = icmp uge i32 %49, 1
  br i1 %50, label %51, label %66

51:                                               ; preds = %48
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = sub i32 %52, 1
  %54 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %53, i32 noundef 0)
          to label %55 unwind label %62

55:                                               ; preds = %51
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = sub i32 %56, 1
  %58 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %6, i32 noundef %57, i32 noundef 0)
          to label %59 unwind label %62

59:                                               ; preds = %55
  %60 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt13sc_int_subrefaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28) %58, ptr noundef nonnull align 8 dereferenceable(28) %54)
          to label %61 unwind label %62

61:                                               ; preds = %59
  br label %66

62:                                               ; preds = %70, %66, %59, %55, %51, %46, %43, %40, %37
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %7, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %81

66:                                               ; preds = %61, %48
  %67 = invoke noundef zeroext i1 @_ZN5sc_dteqERKNS_11sc_int_baseES2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %68 unwind label %62

68:                                               ; preds = %66
  br i1 %67, label %69, label %70

69:                                               ; preds = %68
  br label %72

70:                                               ; preds = %68
  invoke void @_ZN7sc_core17sc_report_handler6reportENS_11sc_severityEPKcS3_S3_i(i32 noundef 3, ptr noundef @_ZN7sc_core23SC_ID_ASSERTION_FAILED_E, ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 59)
          to label %71 unwind label %62

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71, %69
  %73 = phi i32 [ 0, %69 ], [ 0, %71 ]
  br label %74

74:                                               ; preds = %72
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = add i32 %75, 1
  store i32 %76, ptr %11, align 4, !tbaa !5
  br label %29, !llvm.loop !11

77:                                               ; preds = %32
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = add i32 %79, 1
  store i32 %80, ptr %9, align 4, !tbaa !5
  br label %13, !llvm.loop !13

81:                                               ; preds = %62, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  br label %83

82:                                               ; preds = %16
  store i32 1, ptr %10, align 4
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  ret i32 0

83:                                               ; preds = %81, %17
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %7, align 8
  %86 = load i32, ptr %8, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5sc_dt6sc_intILi32EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt6sc_intILi32EEaSEj(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt13sc_int_subrefaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(28)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5sc_dteqERKNS_11sc_int_baseES2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #3

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { 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 = { "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 = { 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 #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.sc_dt::sc_int" = type { %"class.sc_dt::sc_int_base" }
%"class.sc_dt::sc_int_base" = type { %"class.sc_dt::sc_value_base", i64, i32, i32 }
%"class.sc_dt::sc_value_base" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZN7sc_core23SC_ID_ASSERTION_FAILED_E = external constant [0 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [125 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @sc_main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.sc_dt::sc_int", align 8
  %4 = alloca %"class.sc_dt::sc_int", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZN5sc_dt6sc_intILi32EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  invoke void @_ZN5sc_dt6sc_intILi32EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %.preheader18 unwind label %6

5:                                                ; preds = %.split21.us
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  ret i32 0

6:                                                ; preds = %2
  %7 = landingpad { ptr, i32 }
          cleanup
  br label %50

.preheader18:                                     ; preds = %2, %.split21.us
  %.01222 = phi i32 [ %27, %.split21.us ], [ 0, %2 ]
  %8 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %9 unwind label %28

9:                                                ; preds = %.preheader18
  %10 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %.01222)
          to label %11 unwind label %28

11:                                               ; preds = %9
  %12 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.preheader unwind label %28

.preheader:                                       ; preds = %11
  %.not = icmp eq i32 %.01222, 0
  %13 = add nsw i32 %.01222, -1
  br i1 %.not, label %.preheader.split.us, label %.preheader.split

.preheader.split.us:                              ; preds = %.preheader, %24
  %.019.us = phi i32 [ %25, %24 ], [ 0, %.preheader ]
  %14 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt6sc_intILi32EEaSEj(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.019.us)
          to label %15 unwind label %.split.us

15:                                               ; preds = %.preheader.split.us
  %16 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef 31, i32 noundef 0)
          to label %17 unwind label %.split.us

17:                                               ; preds = %15
  %18 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef 31, i32 noundef 0)
          to label %19 unwind label %.split.us

19:                                               ; preds = %17
  %20 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt13sc_int_subrefaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28) %18, ptr noundef nonnull align 8 dereferenceable(28) %16)
          to label %21 unwind label %.split.us

21:                                               ; preds = %19
  %22 = call noundef zeroext i1 @_ZN5sc_dteqERKNS_11sc_int_baseES2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  br i1 %22, label %24, label %23

23:                                               ; preds = %21
  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.2, ptr noundef nonnull @.str.3, i32 noundef 59)
          to label %24 unwind label %.split.us

24:                                               ; preds = %23, %21
  %25 = add nuw nsw i32 %.019.us, 1
  %exitcond24.not = icmp eq i32 %25, 10000
  br i1 %exitcond24.not, label %.split21.us, label %.preheader.split.us, !llvm.loop !5

.split.us:                                        ; preds = %23, %19, %17, %15, %.preheader.split.us
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %49

.split21.us:                                      ; preds = %47, %24
  %27 = add nuw nsw i32 %.01222, 1
  %exitcond25.not = icmp eq i32 %27, 32
  br i1 %exitcond25.not, label %5, label %.preheader18, !llvm.loop !7

28:                                               ; preds = %11, %9, %.preheader18
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %49

.preheader.split:                                 ; preds = %.preheader, %47
  %.019 = phi i32 [ %48, %47 ], [ 0, %.preheader ]
  %30 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5sc_dt6sc_intILi32EEaSEj(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.019)
          to label %31 unwind label %.split

31:                                               ; preds = %.preheader.split
  %32 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef 31, i32 noundef %.01222)
          to label %33 unwind label %.split

33:                                               ; preds = %31
  %34 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef 31, i32 noundef %.01222)
          to label %35 unwind label %.split

35:                                               ; preds = %33
  %36 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt13sc_int_subrefaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28) %34, ptr noundef nonnull align 8 dereferenceable(28) %32)
          to label %37 unwind label %.split

37:                                               ; preds = %35
  %38 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %13, i32 noundef 0)
          to label %39 unwind label %.split

39:                                               ; preds = %37
  %40 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %13, i32 noundef 0)
          to label %41 unwind label %.split

41:                                               ; preds = %39
  %42 = invoke noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt13sc_int_subrefaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28) %40, ptr noundef nonnull align 8 dereferenceable(28) %38)
          to label %44 unwind label %.split

.split:                                           ; preds = %46, %41, %39, %37, %35, %33, %31, %.preheader.split
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %49

44:                                               ; preds = %41
  %45 = call noundef zeroext i1 @_ZN5sc_dteqERKNS_11sc_int_baseES2_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
  br i1 %45, label %47, label %46

46:                                               ; preds = %44
  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.2, ptr noundef nonnull @.str.3, i32 noundef 59)
          to label %47 unwind label %.split

47:                                               ; preds = %44, %46
  %48 = add nuw nsw i32 %.019, 1
  %exitcond.not = icmp eq i32 %48, 10000
  br i1 %exitcond.not, label %.split21.us, label %.preheader.split, !llvm.loop !5

49:                                               ; preds = %.split, %.split.us, %28
  %.pn = phi { ptr, i32 } [ %29, %28 ], [ %43, %.split ], [ %26, %.split.us ]
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %50

50:                                               ; preds = %49, %6
  %.pn.pn = phi { ptr, i32 } [ %.pn, %49 ], [ %7, %6 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @_ZN5sc_dt13sc_value_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5sc_dt6sc_intILi32EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt11sc_int_base5rangeEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(28) ptr @_ZN5sc_dt13sc_int_subrefaSERKS0_(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5sc_dteqERKNS_11sc_int_baseES2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { 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 = { "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 = { 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 #6 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


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