; LLVM IR from bqi343/cp-notebook :: Implementations/content/data-structures/STL (5) (rope_test)

; 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.__gnu_cxx::_Rope_iterator" = type { %"class.__gnu_cxx::_Rope_iterator_base.base", ptr }
%"class.__gnu_cxx::_Rope_iterator_base.base" = type <{ i64, ptr, i64, ptr, ptr, ptr, [4 x ptr], i32, i8, [3 x i8], [15 x i32] }>
%"class.std::allocator.3" = type { i8 }

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

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 @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; 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 void @_ZNK9__gnu_cxx4ropeIiSaIiEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.__gnu_cxx::rope") align 8, ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9__gnu_cxx4ropeIiSaIiEE13mutable_beginEv(ptr dead_on_unwind noalias writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9__gnu_cxx4ropeIiSaIiEE6insertERKNS_14_Rope_iteratorIiS1_EERKS2_(ptr dead_on_unwind noalias writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; 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: 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 i64, align 8
  %3 = alloca %"class.__gnu_cxx::rope", align 8
  %4 = alloca %"class.std::allocator.3", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::rope", align 8
  %12 = alloca %"class.__gnu_cxx::_Rope_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::_Rope_iterator", align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %17 = call i64 @clock() #7
  store i64 %17, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %18 unwind label %23

18:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %30, %18
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = icmp slt i32 %20, 200005
  br i1 %21, label %27, label %22

22:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %37

23:                                               ; preds = %0
  %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
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  br label %136

27:                                               ; preds = %19
  %28 = load i32, ptr %7, align 4, !tbaa !9
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %28)
          to label %29 unwind label %33

29:                                               ; preds = %27
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %7, align 4, !tbaa !9
  br label %19, !llvm.loop !11

33:                                               ; preds = %27
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %5, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %135

37:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %70, %37
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = icmp slt i32 %39, 200005
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %43 = call i32 @rand() #7
  %44 = srem i32 %43, 200005
  store i32 %44, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %45 = call i32 @rand() #7
  %46 = srem i32 %45, 200005
  store i32 %46, ptr %10, align 4, !tbaa !9
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = icmp sgt i32 %47, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %42
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #7
  br label %51

51:                                               ; preds = %50, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = sub nsw i32 %54, %55
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  invoke void @_ZNK9__gnu_cxx4ropeIiSaIiEE6substrEmm(ptr dead_on_unwind writable sret(%"class.__gnu_cxx::rope") align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %53, i64 noundef %58)
          to label %59 unwind label %73

59:                                               ; preds = %51
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = sub nsw i32 %62, %63
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE5eraseEmm(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %61, i64 noundef %66)
          to label %67 unwind label %77

67:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 160, ptr %13) #7
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE13mutable_beginEv(ptr dead_on_unwind writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8 %13, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %68 unwind label %81

68:                                               ; preds = %67
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE6insertERKNS_14_Rope_iteratorIiS1_EERKS2_(ptr dead_on_unwind writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(160) %13, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %69 unwind label %85

69:                                               ; preds = %68
  call void @_ZN9__gnu_cxx14_Rope_iteratorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %12) #7
  call void @_ZN9__gnu_cxx14_Rope_iteratorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %13) #7
  call void @llvm.lifetime.end.p0(i64 160, ptr %13) #7
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %8, align 4, !tbaa !9
  br label %38, !llvm.loop !13

73:                                               ; preds = %51
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %5, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %6, align 4
  br label %91

77:                                               ; preds = %59
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %5, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %6, align 4
  br label %90

81:                                               ; preds = %67
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %5, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %6, align 4
  br label %89

85:                                               ; preds = %68
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %5, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %6, align 4
  call void @_ZN9__gnu_cxx14_Rope_iteratorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %13) #7
  br label %89

89:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 160, ptr %13) #7
  br label %90

90:                                               ; preds = %89, %77
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  br label %91

91:                                               ; preds = %90, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %135

92:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %115, %92
  %94 = load i32, ptr %15, align 4, !tbaa !9
  %95 = invoke noundef i64 @_ZNK9__gnu_cxx4ropeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %96 unwind label %100

96:                                               ; preds = %93
  %97 = trunc i64 %95 to i32
  %98 = icmp slt i32 %94, %97
  br i1 %98, label %104, label %99

99:                                               ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %118

100:                                              ; preds = %104, %93
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %5, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %134

104:                                              ; preds = %96
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = load i32, ptr %15, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = invoke noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %108)
          to label %110 unwind label %100

110:                                              ; preds = %104
  %111 = sext i32 %109 to i64
  %112 = mul nsw i64 %106, %111
  %113 = load i64, ptr %14, align 8, !tbaa !14
  %114 = add nsw i64 %113, %112
  store i64 %114, ptr %14, align 8, !tbaa !14
  br label %115

115:                                              ; preds = %110
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %15, align 4, !tbaa !9
  br label %93, !llvm.loop !16

118:                                              ; preds = %99
  invoke void @_Z2psIxJEEvRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %119 unwind label %126

119:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %120 = call i64 @clock() #7
  %121 = load i64, ptr %2, align 8, !tbaa !5
  %122 = sub nsw i64 %120, %121
  %123 = sitofp i64 %122 to double
  %124 = fdiv double %123, 1.000000e+06
  store double %124, ptr %16, align 8, !tbaa !17
  invoke void @_Z2psIdJEEvRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %125 unwind label %130

125:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @exit(i32 noundef 0) #8
  unreachable

126:                                              ; preds = %118
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %5, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %6, align 4
  br label %134

130:                                              ; preds = %119
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %5, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %134

134:                                              ; preds = %130, %126, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %135

135:                                              ; preds = %134, %91, %33
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  br label %136

136:                                              ; preds = %135, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %137

137:                                              ; preds = %136
  %138 = load ptr, ptr %5, align 8
  %139 = load i32, ptr %6, align 4
  %140 = insertvalue { ptr, i32 } poison, ptr %138, 0
  %141 = insertvalue { ptr, i32 } %140, i32 %139, 1
  resume { ptr, i32 } %141
}

; Function Attrs: nounwind
declare i64 @clock() #4

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

; Function Attrs: nounwind
declare i32 @rand() #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

; 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 = { 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 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}


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

%"class.__gnu_cxx::rope" = type { %"struct.__gnu_cxx::_Rope_base" }
%"struct.__gnu_cxx::_Rope_base" = type { ptr }
%"class.__gnu_cxx::_Rope_iterator" = type { %"class.__gnu_cxx::_Rope_iterator_base.base", ptr }
%"class.__gnu_cxx::_Rope_iterator_base.base" = type <{ i64, ptr, i64, ptr, ptr, ptr, [4 x ptr], i32, i8, [3 x i8], [15 x i32] }>
%"class.std::allocator.3" = type { i8 }

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

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 @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK9__gnu_cxx4ropeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; 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 void @_ZNK9__gnu_cxx4ropeIiSaIiEE6substrEmm(ptr dead_on_unwind noalias writable sret(%"class.__gnu_cxx::rope") align 8, ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9__gnu_cxx4ropeIiSaIiEE13mutable_beginEv(ptr dead_on_unwind noalias writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9__gnu_cxx4ropeIiSaIiEE6insertERKNS_14_Rope_iteratorIiS1_EERKS2_(ptr dead_on_unwind noalias writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(160), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; 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: 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 noreturn 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.3", align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::rope", align 8
  %6 = alloca %"class.__gnu_cxx::_Rope_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::_Rope_iterator", align 8
  %8 = alloca i64, align 8
  %9 = alloca double, align 8
  %10 = tail call i64 @clock() #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @_ZN9__gnu_cxx4ropeIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  br label %11

11:                                               ; preds = %0, %12
  %.01227 = phi i32 [ 0, %0 ], [ %13, %12 ]
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE9push_backEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %.01227)
          to label %12 unwind label %14

12:                                               ; preds = %11
  %13 = add nuw nsw i32 %.01227, 1
  %exitcond.not = icmp eq i32 %13, 200005
  br i1 %exitcond.not, label %.preheader, label %11, !llvm.loop !5

14:                                               ; preds = %11
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %76

16:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store i64 0, ptr %8, align 8, !tbaa !7
  %17 = call noundef i64 @_ZNK9__gnu_cxx4ropeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %18 = trunc i64 %17 to i32
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %12, %41
  %.01128 = phi i32 [ %42, %41 ], [ 0, %12 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %20 = call i32 @rand() #7
  %21 = srem i32 %20, 200005
  store i32 %21, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %22 = call i32 @rand() #7
  %23 = srem i32 %22, 200005
  store i32 %23, ptr %4, align 4, !tbaa !11
  %24 = load i32, ptr %3, align 4, !tbaa !11
  %25 = icmp sgt i32 %24, %23
  br i1 %25, label %26, label %27

26:                                               ; preds = %.preheader
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %.pre = load i32, ptr %3, align 4, !tbaa !11
  %.pre33 = load i32, ptr %4, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %26, %.preheader
  %28 = phi i32 [ %.pre33, %26 ], [ %23, %.preheader ]
  %29 = phi i32 [ %.pre, %26 ], [ %24, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %30 = sext i32 %29 to i64
  %reass.sub = sub i32 %28, %29
  %31 = add i32 %reass.sub, 1
  %32 = sext i32 %31 to i64
  invoke void @_ZNK9__gnu_cxx4ropeIiSaIiEE6substrEmm(ptr dead_on_unwind nonnull writable sret(%"class.__gnu_cxx::rope") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %30, i64 noundef %32)
          to label %33 unwind label %43

33:                                               ; preds = %27
  %34 = load i32, ptr %3, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = load i32, ptr %4, align 4, !tbaa !11
  %reass.sub30 = sub i32 %36, %34
  %37 = add i32 %reass.sub30, 1
  %38 = sext i32 %37 to i64
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE5eraseEmm(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %35, i64 noundef %38)
          to label %39 unwind label %45

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %7) #7
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE13mutable_beginEv(ptr dead_on_unwind nonnull writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %40 unwind label %47

40:                                               ; preds = %39
  invoke void @_ZN9__gnu_cxx4ropeIiSaIiEE6insertERKNS_14_Rope_iteratorIiS1_EERKS2_(ptr dead_on_unwind nonnull writable sret(%"class.__gnu_cxx::_Rope_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(160) %7, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %41 unwind label %49

41:                                               ; preds = %40
  call void @_ZN9__gnu_cxx14_Rope_iteratorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %6) #7
  call void @_ZN9__gnu_cxx14_Rope_iteratorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7) #7
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %7) #7
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %42 = add nuw nsw i32 %.01128, 1
  %exitcond31.not = icmp eq i32 %42, 200005
  br i1 %exitcond31.not, label %16, label %.preheader, !llvm.loop !13

43:                                               ; preds = %27
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %53

45:                                               ; preds = %33
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %52

47:                                               ; preds = %39
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %51

49:                                               ; preds = %40
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN9__gnu_cxx14_Rope_iteratorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(160) %7) #7
  br label %51

51:                                               ; preds = %49, %47
  %.pn20 = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %7) #7
  br label %52

52:                                               ; preds = %51, %45
  %.pn20.pn = phi { ptr, i32 } [ %.pn20, %51 ], [ %46, %45 ]
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br label %53

53:                                               ; preds = %52, %43
  %.pn20.pn.pn = phi { ptr, i32 } [ %.pn20.pn, %52 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %76

._crit_edge:                                      ; preds = %58, %16
  invoke void @_Z2psIxJEEvRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %65 unwind label %71

54:                                               ; preds = %.lr.ph
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %75

.lr.ph:                                           ; preds = %16, %58
  %56 = phi i64 [ %61, %58 ], [ 0, %16 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %58 ], [ 0, %16 ]
  %57 = invoke noundef i32 @_ZNK9__gnu_cxx4ropeIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %indvars.iv)
          to label %58 unwind label %54

58:                                               ; preds = %.lr.ph
  %59 = sext i32 %57 to i64
  %60 = mul nsw i64 %indvars.iv, %59
  %61 = add nsw i64 %56, %60
  store i64 %61, ptr %8, align 8, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %62 = call noundef i64 @_ZNK9__gnu_cxx4ropeIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %sext = shl i64 %62, 32
  %63 = ashr exact i64 %sext, 32
  %64 = icmp slt i64 %indvars.iv.next, %63
  br i1 %64, label %.lr.ph, label %._crit_edge, !llvm.loop !14

65:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %66 = call i64 @clock() #7
  %67 = sub nsw i64 %66, %10
  %68 = sitofp i64 %67 to double
  %69 = fdiv double %68, 1.000000e+06
  store double %69, ptr %9, align 8, !tbaa !15
  invoke void @_Z2psIdJEEvRKT_DpRKT0_(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %70 unwind label %73

70:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @exit(i32 noundef 0) #8
  unreachable

71:                                               ; preds = %._crit_edge
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %75

73:                                               ; preds = %65
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %75

75:                                               ; preds = %73, %71, %54
  %.pn = phi { ptr, i32 } [ %55, %54 ], [ %74, %73 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %76

76:                                               ; preds = %75, %53, %14
  %.pn24 = phi { ptr, i32 } [ %15, %14 ], [ %.pn20.pn.pn, %53 ], [ %.pn, %75 ]
  call void @_ZN9__gnu_cxx4ropeIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn24
}

; Function Attrs: nounwind
declare i64 @clock() local_unnamed_addr #4

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

; 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 noreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !9, i64 0}


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