; LLVM IR from sunkafei/xcpc-algorithm-templates :: 算法/数据结构 (rope)

; 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.__gnu_cxx::rope" = type { %"struct.__gnu_cxx::_Rope_base" }
%"struct.__gnu_cxx::_Rope_base" = type { ptr }
%"class.std::allocator" = type { i8 }

@version = external dso_local global [110000 x %"class.__gnu_cxx::rope"], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.__gnu_cxx::rope", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 100000, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %19, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 100000
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %22

17:                                               ; preds = %13
  %18 = load i32, ptr %3, align 4, !tbaa !5
  call void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) @version, i32 noundef %18)
  br label %19

19:                                               ; preds = %17
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !9

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %43, %22
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp slt i32 %24, 100000
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %46

27:                                               ; preds = %23
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sub nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 %30
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx4ropeIiSaIiEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 %37
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = mul nsw i32 %41, 10
  call void @_ZN9__gnu_cxx4ropeIiSaIiEE7replaceEmi(ptr noundef nonnull align 8 dereferenceable(8) %38, i64 noundef %40, i32 noundef %42)
  br label %43

43:                                               ; preds = %27
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %4, align 4, !tbaa !5
  br label %23, !llvm.loop !11

46:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 88888, ptr %5, align 4, !tbaa !5
  %47 = call noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds ([110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 88888), i64 noundef 88888)
  %48 = call noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds ([110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 88888), i64 noundef 88889)
  %49 = call noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds ([110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 88889), i64 noundef 88889)
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %47, i32 noundef %48, i32 noundef %49)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %51 unwind label %58

51:                                               ; preds = %46
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0)
          to label %52 unwind label %62

52:                                               ; preds = %51
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 1)
          to label %53 unwind label %62

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %69, %53
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 32
  br i1 %56, label %66, label %57

57:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %76

58:                                               ; preds = %46
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %8, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  br label %107

62:                                               ; preds = %52, %51
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %8, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %9, align 4
  br label %106

66:                                               ; preds = %54
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %68 unwind label %72

68:                                               ; preds = %66
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %10, align 4, !tbaa !5
  br label %54, !llvm.loop !12

72:                                               ; preds = %66
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %8, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %106

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

77:                                               ; preds = %89, %76
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = icmp slt i32 %78, 100000
  br i1 %79, label %81, label %80

80:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %96

81:                                               ; preds = %77
  %82 = load i32, ptr %12, align 4, !tbaa !5
  %83 = add nsw i32 998244353, %82
  %84 = sext i32 %83 to i64
  %85 = invoke noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef %84)
          to label %86 unwind label %92

86:                                               ; preds = %81
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = add nsw i32 %87, %85
  store i32 %88, ptr %11, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %86
  %90 = load i32, ptr %12, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %12, align 4, !tbaa !5
  br label %77, !llvm.loop !13

92:                                               ; preds = %81
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %8, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %105

96:                                               ; preds = %80
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %97)
          to label %99 unwind label %101

99:                                               ; preds = %96
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %100 = load i32, ptr %1, align 4
  ret i32 %100

101:                                              ; preds = %96
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %8, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %9, align 4
  br label %105

105:                                              ; preds = %101, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %106

106:                                              ; preds = %105, %72, %62
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %107

107:                                              ; preds = %106, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %8, align 8
  %110 = load i32, ptr %9, align 4
  %111 = insertvalue { ptr, i32 } poison, ptr %109, 0
  %112 = insertvalue { ptr, i32 } %111, i32 %110, 1
  resume { ptr, i32 } %112
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9__gnu_cxx4ropeIiSaIiEE7replaceEmi(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) #2 align 2

declare i32 @printf(ptr noundef, ...) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 = { mustprogress norecurse 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 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; 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.__gnu_cxx::rope" = type { %"struct.__gnu_cxx::_Rope_base" }
%"struct.__gnu_cxx::_Rope_base" = type { ptr }
%"class.std::allocator" = type { i8 }

@version = external dso_local global [110000 x %"class.__gnu_cxx::rope"], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 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 nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.__gnu_cxx::rope", align 8
  %2 = alloca %"class.std::allocator", align 1
  br label %3

3:                                                ; preds = %0, %3
  %.02531 = phi i32 [ 0, %0 ], [ %4, %3 ]
  tail call void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) @version, i32 noundef %.02531)
  %4 = add nuw nsw i32 %.02531, 1
  %exitcond.not = icmp eq i32 %4, 100000
  br i1 %exitcond.not, label %.preheader29, label %3, !llvm.loop !5

5:                                                ; preds = %.preheader29
  %6 = tail call noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @version, i64 711104), i64 noundef 88888)
  %7 = tail call noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @version, i64 711104), i64 noundef 88889)
  %8 = tail call noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @version, i64 711112), i64 noundef 88889)
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6, i32 noundef %7, i32 noundef %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %16 unwind label %19

.preheader29:                                     ; preds = %3, %.preheader29
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader29 ], [ 1, %3 ]
  %10 = add nsw i64 %indvars.iv, -1
  %11 = getelementptr inbounds [110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 %10
  %12 = getelementptr inbounds [110000 x %"class.__gnu_cxx::rope"], ptr @version, i64 0, i64 %indvars.iv
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx4ropeIiSaIiEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %14 = trunc i64 %indvars.iv to i32
  %15 = mul i32 %14, 10
  tail call void @_ZN9__gnu_cxx4ropeIiSaIiEE7replaceEmi(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef %indvars.iv, i32 noundef %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond37.not = icmp eq i64 %indvars.iv.next, 100000
  br i1 %exitcond37.not, label %5, label %.preheader29, !llvm.loop !7

16:                                               ; preds = %5
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 0)
          to label %17 unwind label %21

17:                                               ; preds = %16
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 1)
          to label %.preheader28.preheader unwind label %21

.preheader28.preheader:                           ; preds = %17
  %18 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.1 unwind label %54

19:                                               ; preds = %5
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  br label %65

21:                                               ; preds = %17, %16
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %64

.preheader28.1:                                   ; preds = %.preheader28.preheader
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.2 unwind label %54

.preheader28.2:                                   ; preds = %.preheader28.1
  %24 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.3 unwind label %54

.preheader28.3:                                   ; preds = %.preheader28.2
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.4 unwind label %54

.preheader28.4:                                   ; preds = %.preheader28.3
  %26 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.5 unwind label %54

.preheader28.5:                                   ; preds = %.preheader28.4
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.6 unwind label %54

.preheader28.6:                                   ; preds = %.preheader28.5
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.7 unwind label %54

.preheader28.7:                                   ; preds = %.preheader28.6
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.8 unwind label %54

.preheader28.8:                                   ; preds = %.preheader28.7
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.9 unwind label %54

.preheader28.9:                                   ; preds = %.preheader28.8
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.10 unwind label %54

.preheader28.10:                                  ; preds = %.preheader28.9
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.11 unwind label %54

.preheader28.11:                                  ; preds = %.preheader28.10
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.12 unwind label %54

.preheader28.12:                                  ; preds = %.preheader28.11
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.13 unwind label %54

.preheader28.13:                                  ; preds = %.preheader28.12
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.14 unwind label %54

.preheader28.14:                                  ; preds = %.preheader28.13
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.15 unwind label %54

.preheader28.15:                                  ; preds = %.preheader28.14
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.16 unwind label %54

.preheader28.16:                                  ; preds = %.preheader28.15
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.17 unwind label %54

.preheader28.17:                                  ; preds = %.preheader28.16
  %39 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.18 unwind label %54

.preheader28.18:                                  ; preds = %.preheader28.17
  %40 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.19 unwind label %54

.preheader28.19:                                  ; preds = %.preheader28.18
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.20 unwind label %54

.preheader28.20:                                  ; preds = %.preheader28.19
  %42 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.21 unwind label %54

.preheader28.21:                                  ; preds = %.preheader28.20
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.22 unwind label %54

.preheader28.22:                                  ; preds = %.preheader28.21
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.23 unwind label %54

.preheader28.23:                                  ; preds = %.preheader28.22
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.24 unwind label %54

.preheader28.24:                                  ; preds = %.preheader28.23
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.25 unwind label %54

.preheader28.25:                                  ; preds = %.preheader28.24
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.26 unwind label %54

.preheader28.26:                                  ; preds = %.preheader28.25
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.27 unwind label %54

.preheader28.27:                                  ; preds = %.preheader28.26
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.28 unwind label %54

.preheader28.28:                                  ; preds = %.preheader28.27
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.29 unwind label %54

.preheader28.29:                                  ; preds = %.preheader28.28
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.30 unwind label %54

.preheader28.30:                                  ; preds = %.preheader28.29
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader28.31 unwind label %54

.preheader28.31:                                  ; preds = %.preheader28.30
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxxpLIiSaIiEEERNS_4ropeIT_T0_EES6_RKS5_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader unwind label %54

54:                                               ; preds = %.preheader28.31, %.preheader28.30, %.preheader28.29, %.preheader28.28, %.preheader28.27, %.preheader28.26, %.preheader28.25, %.preheader28.24, %.preheader28.23, %.preheader28.22, %.preheader28.21, %.preheader28.20, %.preheader28.19, %.preheader28.18, %.preheader28.17, %.preheader28.16, %.preheader28.15, %.preheader28.14, %.preheader28.13, %.preheader28.12, %.preheader28.11, %.preheader28.10, %.preheader28.9, %.preheader28.8, %.preheader28.7, %.preheader28.6, %.preheader28.5, %.preheader28.4, %.preheader28.3, %.preheader28.2, %.preheader28.1, %.preheader28.preheader
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %64

56:                                               ; preds = %60
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %61)
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.preheader:                                       ; preds = %.preheader28.31, %60
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %60 ], [ 0, %.preheader28.31 ]
  %.01934 = phi i32 [ %61, %60 ], [ 0, %.preheader28.31 ]
  %58 = add nuw nsw i64 %indvars.iv39, 998244353
  %59 = invoke noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %58)
          to label %60 unwind label %62

60:                                               ; preds = %.preheader
  %61 = add nsw i32 %59, %.01934
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %exitcond42.not = icmp eq i64 %indvars.iv.next40, 100000
  br i1 %exitcond42.not, label %56, label %.preheader, !llvm.loop !8

62:                                               ; preds = %.preheader
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %64

64:                                               ; preds = %62, %54, %21
  %.pn = phi { ptr, i32 } [ %55, %54 ], [ %63, %62 ], [ %22, %21 ]
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  br label %65

65:                                               ; preds = %64, %19
  %.pn.pn = phi { ptr, i32 } [ %.pn, %64 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9__gnu_cxx4ropeIiSaIiEE7replaceEmi(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 = { mustprogress norecurse 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 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 #5 = { 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 #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}
!8 = distinct !{!8, !6}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass