; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/utils/sc_string.ll (ZN5sc_dtrsERSiRNS_13sc_string_oldE)

; 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::sc_string_old" = type { ptr }
%"class.sc_dt::sc_string_rep" = type { i32, i32, ptr }

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5sc_dtrsERSiRNS_13sc_string_oldE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #0 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 ptr, align 8
  %9 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %10, i32 0, i32 0
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = getelementptr inbounds %"class.sc_dt::sc_string_rep", ptr %12, i32 0, i32 0
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = icmp sgt i32 %14, 1
  br i1 %15, label %16, label %31

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.sc_dt::sc_string_rep", ptr %19, i32 0, i32 0
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr %20, align 8, !tbaa !11
  %23 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #7
  invoke void @_ZN5sc_dt13sc_string_repC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %23, i32 noundef 16)
          to label %24 unwind label %27

24:                                               ; preds = %16
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %25, i32 0, i32 0
  store ptr %23, ptr %26, align 8, !tbaa !9
  br label %31

27:                                               ; preds = %16
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %5, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %23, i64 noundef 16) #8
  br label %118

31:                                               ; preds = %24, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds %"class.sc_dt::sc_string_rep", ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !15
  store ptr %36, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #9
  br label %37

37:                                               ; preds = %52, %31
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi3getERc(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 1 dereferenceable(1) %9)
  %40 = load ptr, ptr %39, align 8, !tbaa !16
  %41 = getelementptr i8, ptr %40, i64 -24
  %42 = load i64, ptr %41, align 8
  %43 = getelementptr inbounds i8, ptr %39, i64 %42
  %44 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %43)
  br i1 %44, label %45, label %50

45:                                               ; preds = %37
  %46 = load i8, ptr %9, align 1, !tbaa !18
  %47 = sext i8 %46 to i32
  %48 = call i32 @isspace(i32 noundef %47) #10
  %49 = icmp ne i32 %48, 0
  br label %50

50:                                               ; preds = %45, %37
  %51 = phi i1 [ false, %37 ], [ %49, %45 ]
  br i1 %51, label %52, label %53

52:                                               ; preds = %50
  br label %37, !llvm.loop !19

53:                                               ; preds = %50
  br label %54

54:                                               ; preds = %112, %53
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %57 = getelementptr i8, ptr %56, i64 -24
  %58 = load i64, ptr %57, align 8
  %59 = getelementptr inbounds i8, ptr %55, i64 %58
  %60 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264) %59)
  br i1 %60, label %61, label %67

61:                                               ; preds = %54
  %62 = load i8, ptr %9, align 1, !tbaa !18
  %63 = sext i8 %62 to i32
  %64 = call i32 @isspace(i32 noundef %63) #10
  %65 = icmp ne i32 %64, 0
  %66 = xor i1 %65, true
  br label %67

67:                                               ; preds = %61, %54
  %68 = phi i1 [ false, %54 ], [ %66, %61 ]
  br i1 %68, label %69, label %115

69:                                               ; preds = %67
  %70 = load i32, ptr %7, align 4, !tbaa !14
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = getelementptr inbounds %"class.sc_dt::sc_string_rep", ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !21
  %76 = sub nsw i32 %75, 2
  %77 = icmp sgt i32 %70, %76
  br i1 %77, label %78, label %106

78:                                               ; preds = %69
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds %"class.sc_dt::sc_string_rep", ptr %81, i32 0, i32 2
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  %84 = load i32, ptr %7, align 4, !tbaa !14
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %83, i64 %85
  store i8 0, ptr %86, align 1, !tbaa !18
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds %"class.sc_dt::sc_string_rep", ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !21
  %95 = sitofp i32 %94 to double
  %96 = fmul double %95, 1.500000e+00
  %97 = fptosi double %96 to i32
  call void @_ZN5sc_dt13sc_string_rep6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %89, i32 noundef %97)
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.sc_dt::sc_string_old", ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds %"class.sc_dt::sc_string_rep", ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !15
  %103 = load i32, ptr %7, align 4, !tbaa !14
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i8, ptr %102, i64 %104
  store ptr %105, ptr %8, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %78, %69
  %107 = load i8, ptr %9, align 1, !tbaa !18
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i32 1
  store ptr %109, ptr %8, align 8, !tbaa !5
  store i8 %107, ptr %108, align 1, !tbaa !18
  %110 = load i32, ptr %7, align 4, !tbaa !14
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %7, align 4, !tbaa !14
  br label %112

112:                                              ; preds = %106
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi3getERc(ptr noundef nonnull align 8 dereferenceable(16) %113, ptr noundef nonnull align 1 dereferenceable(1) %9)
  br label %54, !llvm.loop !22

115:                                              ; preds = %67
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  store i8 0, ptr %116, align 1, !tbaa !18
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  ret ptr %117

118:                                              ; preds = %27
  %119 = load ptr, ptr %5, align 8
  %120 = load i32, ptr %6, align 4
  %121 = insertvalue { ptr, i32 } poison, ptr %119, 0
  %122 = insertvalue { ptr, i32 } %121, i32 %120, 1
  resume { ptr, i32 } %122
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi3getERc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #4

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @isspace(i32 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264)) #6 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 nounwind willreturn memory(read) 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 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }

!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, !6, i64 0}
!10 = !{!"_ZTSN5sc_dt13sc_string_oldE", !6, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN5sc_dt13sc_string_repE", !13, i64 0, !13, i64 4, !6, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !6, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !8, i64 0}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !13, i64 4}
!22 = distinct !{!22, !20}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5sc_dt13sc_string_rep6resizeEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) 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) #1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN5sc_dtrsERSiRNS_13sc_string_oldE(ptr noundef nonnull returned align 8 dereferenceable(16) %0, ptr nocapture noundef nonnull align 8 dereferenceable(8) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i8, align 1
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = load i32, ptr %4, align 8, !tbaa !10
  %6 = icmp sgt i32 %5, 1
  br i1 %6, label %7, label %13

7:                                                ; preds = %2
  %8 = add nsw i32 %5, -1
  store i32 %8, ptr %4, align 8, !tbaa !10
  %9 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #7
  invoke void @_ZN5sc_dt13sc_string_repC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %9, i32 noundef 16)
          to label %10 unwind label %11

10:                                               ; preds = %7
  store ptr %9, ptr %1, align 8, !tbaa !5
  br label %13

11:                                               ; preds = %7
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %9, i64 noundef 16) #8
  resume { ptr, i32 } %12

13:                                               ; preds = %10, %2
  %14 = phi ptr [ %9, %10 ], [ %4, %2 ]
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #9
  br label %17

17:                                               ; preds = %24, %13
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi3getERc(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = getelementptr i8, ptr %19, i64 -24
  %21 = load i64, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr %18, i64 %21
  %23 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %22)
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %17
  %25 = load i8, ptr %3, align 1, !tbaa !16
  %26 = sext i8 %25 to i32
  %27 = call i32 @isspace(i32 noundef %26) #10
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %.critedge, label %17, !llvm.loop !17

.critedge:                                        ; preds = %17, %24
  %28 = load ptr, ptr %0, align 8, !tbaa !14
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr %0, i64 %30
  %32 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264) %31)
  br i1 %32, label %.lr.ph, label %.critedge2

.lr.ph:                                           ; preds = %.critedge, %57
  %indvars.iv = phi i64 [ %indvars.iv.next, %57 ], [ 0, %.critedge ]
  %.026 = phi ptr [ %59, %57 ], [ %16, %.critedge ]
  %33 = load i8, ptr %3, align 1, !tbaa !16
  %34 = sext i8 %33 to i32
  %35 = call i32 @isspace(i32 noundef %34) #10
  %.not24 = icmp eq i32 %35, 0
  br i1 %.not24, label %36, label %.critedge2

36:                                               ; preds = %.lr.ph
  %37 = load ptr, ptr %1, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !19
  %40 = add nsw i32 %39, -2
  %41 = sext i32 %40 to i64
  %42 = icmp sgt i64 %indvars.iv, %41
  br i1 %42, label %43, label %57

43:                                               ; preds = %36
  %44 = getelementptr inbounds i8, ptr %37, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = getelementptr inbounds i8, ptr %45, i64 %indvars.iv
  store i8 0, ptr %46, align 1, !tbaa !16
  %47 = load ptr, ptr %1, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !19
  %50 = sitofp i32 %49 to double
  %51 = fmul double %50, 1.500000e+00
  %52 = fptosi double %51 to i32
  call void @_ZN5sc_dt13sc_string_rep6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %47, i32 noundef %52)
  %53 = load ptr, ptr %1, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = getelementptr inbounds i8, ptr %55, i64 %indvars.iv
  %.pre = load i8, ptr %3, align 1, !tbaa !16
  br label %57

57:                                               ; preds = %43, %36
  %58 = phi i8 [ %.pre, %43 ], [ %33, %36 ]
  %.1 = phi ptr [ %56, %43 ], [ %.026, %36 ]
  %59 = getelementptr inbounds i8, ptr %.1, i64 1
  store i8 %58, ptr %.1, align 1, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi3getERc(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %61 = load ptr, ptr %0, align 8, !tbaa !14
  %62 = getelementptr i8, ptr %61, i64 -24
  %63 = load i64, ptr %62, align 8
  %64 = getelementptr inbounds i8, ptr %0, i64 %63
  %65 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264) %64)
  br i1 %65, label %.lr.ph, label %.critedge2, !llvm.loop !20

.critedge2:                                       ; preds = %.lr.ph, %57, %.critedge
  %.0.lcssa = phi ptr [ %16, %.critedge ], [ %59, %57 ], [ %.026, %.lr.ph ]
  store i8 0, ptr %.0.lcssa, align 1, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #9
  ret ptr %0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi3getERc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @isspace(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #6 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 nofree nounwind willreturn memory(read) 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 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { builtin nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }

!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, !7, i64 0}
!6 = !{!"_ZTSN5sc_dt13sc_string_oldE", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !12, i64 0}
!11 = !{!"_ZTSN5sc_dt13sc_string_repE", !12, i64 0, !12, i64 4, !7, i64 8}
!12 = !{!"int", !8, i64 0}
!13 = !{!11, !7, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !9, i64 0}
!16 = !{!8, !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !12, i64 4}
!20 = distinct !{!20, !18}


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