; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/datatypes/fx/scfx_rep.ll (ZN5sc_dt8scfx_repC2ERKNS_11sc_unsignedE)

; 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_dt::scfx_index" = type { i32, i32 }
%"class.sc_dt::scfx_rep" = type <{ %"class.sc_dt::scfx_mant", i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"class.sc_dt::scfx_mant" = type <{ ptr, i32, [4 x i8] }>

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37)) #0 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef, i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt8scfx_repC2ERKNS_11sc_unsignedE(ptr noundef nonnull align 8 dereferenceable(37) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.sc_dt::scfx_index", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  %11 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 0
  call void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12) %11, i64 noundef 4)
  %12 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 1
  store i32 0, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 2
  store i32 0, ptr %13, align 4, !tbaa !15
  %14 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 3
  store i32 0, ptr %14, align 8, !tbaa !16
  %15 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 4
  store i32 0, ptr %15, align 4, !tbaa !17
  %16 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 5
  store i32 0, ptr %16, align 8, !tbaa !18
  %17 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 6
  store i8 0, ptr %17, align 4, !tbaa !19
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = invoke noundef zeroext i1 @_ZNK5sc_dt11sc_unsigned6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %20 unwind label %23

20:                                               ; preds = %2
  br i1 %19, label %21, label %27

21:                                               ; preds = %20
  invoke void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37) %10, i32 noundef 1)
          to label %22 unwind label %23

22:                                               ; preds = %21
  br label %95

23:                                               ; preds = %21, %2
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %5, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %6, align 4
  br label %96

27:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = invoke noundef i32 @_ZNK5sc_dt11sc_unsigned6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %28)
          to label %30 unwind label %40

30:                                               ; preds = %27
  %31 = invoke noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef %29)
          to label %32 unwind label %40

32:                                               ; preds = %30
  store i32 %31, ptr %7, align 4, !tbaa !20
  %33 = load i32, ptr %7, align 4, !tbaa !20
  %34 = invoke noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37) %10)
          to label %35 unwind label %40

35:                                               ; preds = %32
  %36 = icmp sgt i32 %33, %34
  br i1 %36, label %37, label %44

37:                                               ; preds = %35
  %38 = load i32, ptr %7, align 4, !tbaa !20
  invoke void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37) %10, i32 noundef %38, i32 noundef 0)
          to label %39 unwind label %40

39:                                               ; preds = %37
  br label %44

40:                                               ; preds = %91, %44, %37, %32, %30, %27
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %5, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %6, align 4
  br label %94

44:                                               ; preds = %39, %35
  %45 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 0
  invoke void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12) %45)
          to label %46 unwind label %40

46:                                               ; preds = %44
  %47 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 1
  store i32 0, ptr %47, align 8, !tbaa !9
  %48 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 3
  store i32 0, ptr %48, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !20
  br label %49

49:                                               ; preds = %87, %46
  %50 = load i32, ptr %8, align 4, !tbaa !20
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = invoke noundef i32 @_ZNK5sc_dt11sc_unsigned6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %51)
          to label %53 unwind label %56

53:                                               ; preds = %49
  %54 = icmp slt i32 %50, %52
  br i1 %54, label %60, label %55

55:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %91

56:                                               ; preds = %64, %60, %49
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %5, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %6, align 4
  br label %90

60:                                               ; preds = %53
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load i32, ptr %8, align 4, !tbaa !20
  %63 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5sc_dt11sc_unsignedixEi(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef %62)
          to label %64 unwind label %56

64:                                               ; preds = %60
  %65 = invoke noundef i64 @_ZNK5sc_dt20sc_unsigned_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24) %63)
          to label %66 unwind label %56

66:                                               ; preds = %64
  %67 = icmp ne i64 %65, 0
  br i1 %67, label %68, label %86

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %69 = load i32, ptr %8, align 4, !tbaa !20
  %70 = invoke i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37) %10, i32 noundef %69)
          to label %71 unwind label %82

71:                                               ; preds = %68
  store i64 %70, ptr %9, align 4
  %72 = invoke noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %73 unwind label %82

73:                                               ; preds = %71
  %74 = shl i32 1, %72
  %75 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 0
  %76 = invoke noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %77 unwind label %82

77:                                               ; preds = %73
  %78 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12) %75, i32 noundef %76)
          to label %79 unwind label %82

79:                                               ; preds = %77
  %80 = load i32, ptr %78, align 4, !tbaa !20
  %81 = or i32 %80, %74
  store i32 %81, ptr %78, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %86

82:                                               ; preds = %77, %73, %71, %68
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %5, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %90

86:                                               ; preds = %79, %66
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %8, align 4, !tbaa !20
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %8, align 4, !tbaa !20
  br label %49, !llvm.loop !21

90:                                               ; preds = %82, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %94

91:                                               ; preds = %55
  %92 = getelementptr inbounds %"class.sc_dt::scfx_rep", ptr %10, i32 0, i32 2
  store i32 1, ptr %92, align 4, !tbaa !15
  invoke void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37) %10)
          to label %93 unwind label %40

93:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %95

94:                                               ; preds = %90, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %96

95:                                               ; preds = %93, %22
  ret void

96:                                               ; preds = %94, %23
  call void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %11) #6
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %5, align 8
  %99 = load i32, ptr %6, align 4
  %100 = insertvalue { ptr, i32 } poison, ptr %98, 0
  %101 = insertvalue { ptr, i32 } %100, i32 %99, 1
  resume { ptr, i32 } %101
}

declare noundef zeroext i1 @_ZNK5sc_dt11sc_unsigned6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32)) #5

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

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

declare noundef i64 @_ZNK5sc_dt20sc_unsigned_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24)) #5

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 #5 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 16}
!10 = !{!"_ZTSN5sc_dt8scfx_repE", !11, i64 0, !12, i64 16, !12, i64 20, !13, i64 24, !12, i64 28, !12, i64 32, !14, i64 36}
!11 = !{!"_ZTSN5sc_dt9scfx_mantE", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSN5sc_dt8scfx_rep5stateE", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!10, !12, i64 20}
!16 = !{!10, !13, i64 24}
!17 = !{!10, !12, i64 28}
!18 = !{!10, !12, i64 32}
!19 = !{!10, !14, i64 36}
!20 = !{!12, !12, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"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_dt::scfx_index" = type { i32, i32 }

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12), i64 noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt8scfx_repC2ERKNS_11sc_unsignedE(ptr noundef nonnull align 8 dereferenceable(37) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.sc_dt::scfx_index", align 8
  tail call void @_ZN5sc_dt9scfx_mantC2Em(ptr noundef nonnull align 8 dereferenceable(12) %0, i64 noundef 4)
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = getelementptr inbounds i8, ptr %0, i64 20
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(21) %4, i8 0, i64 21, i1 false)
  %7 = invoke noundef zeroext i1 @_ZNK5sc_dt11sc_unsigned6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %8 unwind label %10

8:                                                ; preds = %2
  br i1 %7, label %9, label %12

9:                                                ; preds = %8
  invoke void @_ZN5sc_dt8scfx_rep8set_zeroEi(ptr noundef nonnull align 8 dereferenceable(37) %0, i32 noundef 1)
          to label %46 unwind label %10

10:                                               ; preds = %9, %2
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %47

12:                                               ; preds = %8
  %13 = tail call noundef i32 @_ZNK5sc_dt11sc_unsigned6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %14 = tail call noundef i32 @_ZN5sc_dtL6n_wordEi(i32 noundef %13)
  %15 = invoke noundef i32 @_ZNK5sc_dt8scfx_rep4sizeEv(ptr noundef nonnull align 8 dereferenceable(37) %0)
          to label %16 unwind label %19

16:                                               ; preds = %12
  %17 = icmp sgt i32 %14, %15
  br i1 %17, label %18, label %21

18:                                               ; preds = %16
  invoke void @_ZN5sc_dt8scfx_rep9resize_toEii(ptr noundef nonnull align 8 dereferenceable(37) %0, i32 noundef %14, i32 noundef 0)
          to label %21 unwind label %19

19:                                               ; preds = %._crit_edge, %21, %18, %12
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %47

21:                                               ; preds = %18, %16
  invoke void @_ZN5sc_dt9scfx_mant5clearEv(ptr noundef nonnull align 8 dereferenceable(12) %0)
          to label %22 unwind label %19

22:                                               ; preds = %21
  store i32 0, ptr %4, align 8, !tbaa !5
  store i32 0, ptr %6, align 8, !tbaa !14
  %23 = tail call noundef i32 @_ZNK5sc_dt11sc_unsigned6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %42, %22
  store i32 1, ptr %5, align 4, !tbaa !15
  invoke void @_ZN5sc_dt8scfx_rep7find_swEv(ptr noundef nonnull align 8 dereferenceable(37) %0)
          to label %46 unwind label %19

25:                                               ; preds = %28, %.lr.ph
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %47

.lr.ph:                                           ; preds = %22, %42
  %.021 = phi i32 [ %43, %42 ], [ 0, %22 ]
  %27 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNK5sc_dt11sc_unsignedixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %.021)
          to label %28 unwind label %25

28:                                               ; preds = %.lr.ph
  %29 = invoke noundef i64 @_ZNK5sc_dt20sc_unsigned_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24) %27)
          to label %30 unwind label %25

30:                                               ; preds = %28
  %.not = icmp eq i64 %29, 0
  br i1 %.not, label %42, label %31

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %32 = invoke i64 @_ZNK5sc_dt8scfx_rep12calc_indicesEi(ptr noundef nonnull align 8 dereferenceable(37) %0, i32 noundef %.021)
          to label %33 unwind label %40

33:                                               ; preds = %31
  store i64 %32, ptr %3, align 8
  %34 = call noundef i32 @_ZNK5sc_dt10scfx_index2biEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %35 = shl nuw i32 1, %34
  %36 = call noundef i32 @_ZNK5sc_dt10scfx_index2wiEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5sc_dt9scfx_mantixEi(ptr noundef nonnull align 8 dereferenceable(12) %0, i32 noundef %36)
  %38 = load i32, ptr %37, align 4, !tbaa !16
  %39 = or i32 %38, %35
  store i32 %39, ptr %37, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %42

40:                                               ; preds = %31
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %47

42:                                               ; preds = %30, %33
  %43 = add nuw nsw i32 %.021, 1
  %44 = call noundef i32 @_ZNK5sc_dt11sc_unsigned6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %.lr.ph, label %._crit_edge, !llvm.loop !17

46:                                               ; preds = %._crit_edge, %9
  ret void

47:                                               ; preds = %19, %40, %25, %10
  %.pn19 = phi { ptr, i32 } [ %11, %10 ], [ %20, %19 ], [ %41, %40 ], [ %26, %25 ]
  call void @_ZN5sc_dt9scfx_mantD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %0) #7
  resume { ptr, i32 } %.pn19
}

declare noundef zeroext i1 @_ZNK5sc_dt11sc_unsigned6iszeroEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt11sc_unsigned6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

declare noundef i64 @_ZNK5sc_dt20sc_unsigned_bitref_rcvyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 #5 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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, !11, i64 16}
!6 = !{!"_ZTSN5sc_dt8scfx_repE", !7, i64 0, !11, i64 16, !11, i64 20, !12, i64 24, !11, i64 28, !11, i64 32, !13, i64 36}
!7 = !{!"_ZTSN5sc_dt9scfx_mantE", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_ZTSN5sc_dt8scfx_rep5stateE", !9, i64 0}
!13 = !{!"bool", !9, i64 0}
!14 = !{!6, !12, i64 24}
!15 = !{!6, !11, i64 20}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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