; LLVM IR from gem5/gem5 :: ext/systemc/src/sysc/datatypes/fx (scfx_utils)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.sc_dt::scfx_string" = type { i64, i64, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt11scfx_tc2csdERNS_11scfx_stringEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.sc_dt::scfx_string", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %10 = load i32, ptr %4, align 4, !tbaa !9
  %11 = icmp ne i32 %10, 0
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  br label %13

13:                                               ; preds = %12, %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #4
  call void @_ZN5sc_dt11scfx_stringC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %14 = load i32, ptr %4, align 4, !tbaa !9
  %15 = icmp ne i32 %14, 0
  %16 = zext i1 %15 to i64
  %17 = select i1 %15, i32 4, i32 0
  store i32 %17, ptr %7, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %65, %13
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %19, i32 noundef %20)
          to label %22 unwind label %51

22:                                               ; preds = %18
  %23 = load i8, ptr %21, align 1, !tbaa !11
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %25, label %68

25:                                               ; preds = %22
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %26, i32 noundef %27)
          to label %29 unwind label %51

29:                                               ; preds = %25
  %30 = load i8, ptr %28, align 1, !tbaa !11
  %31 = sext i8 %30 to i32
  %32 = icmp eq i32 %31, 48
  br i1 %32, label %41, label %33

33:                                               ; preds = %29
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %34, i32 noundef %35)
          to label %37 unwind label %51

37:                                               ; preds = %33
  %38 = load i8, ptr %36, align 1, !tbaa !11
  %39 = sext i8 %38 to i32
  %40 = icmp eq i32 %39, 49
  br i1 %40, label %41, label %55

41:                                               ; preds = %37, %29
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %42, i32 noundef %43)
          to label %45 unwind label %51

45:                                               ; preds = %41
  %46 = load i8, ptr %44, align 1, !tbaa !11
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %6, align 4, !tbaa !9
  %49 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %47)
          to label %50 unwind label %51

50:                                               ; preds = %45
  store i8 %46, ptr %49, align 1, !tbaa !11
  br label %65

51:                                               ; preds = %177, %173, %162, %156, %141, %134, %126, %117, %109, %104, %90, %77, %68, %55, %45, %41, %33, %25, %18
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %8, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  br label %185

55:                                               ; preds = %37
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %56, i32 noundef %57)
          to label %59 unwind label %51

59:                                               ; preds = %55
  %60 = load i8, ptr %58, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  %62 = icmp ne i32 %61, 46
  br i1 %62, label %63, label %64

63:                                               ; preds = %59
  br label %68

64:                                               ; preds = %59
  br label %65

65:                                               ; preds = %64, %50
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !9
  br label %18, !llvm.loop !12

68:                                               ; preds = %63, %22
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %69)
          to label %71 unwind label %51

71:                                               ; preds = %68
  store i8 0, ptr %70, align 1, !tbaa !11
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %6, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %150, %71
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = icmp sge i32 %75, 0
  br i1 %76, label %77, label %151

77:                                               ; preds = %74
  %78 = load i32, ptr %6, align 4, !tbaa !9
  %79 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %78)
          to label %80 unwind label %51

80:                                               ; preds = %77
  %81 = load i8, ptr %79, align 1, !tbaa !11
  %82 = sext i8 %81 to i32
  %83 = icmp eq i32 %82, 48
  br i1 %83, label %84, label %87

84:                                               ; preds = %80
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %6, align 4, !tbaa !9
  br label %150

87:                                               ; preds = %80
  %88 = load i32, ptr %6, align 4, !tbaa !9
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %101

90:                                               ; preds = %87
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = sub nsw i32 %91, 1
  %93 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %92)
          to label %94 unwind label %51

94:                                               ; preds = %90
  %95 = load i8, ptr %93, align 1, !tbaa !11
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %96, 48
  br i1 %97, label %98, label %101

98:                                               ; preds = %94
  %99 = load i32, ptr %6, align 4, !tbaa !9
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %6, align 4, !tbaa !9
  br label %149

101:                                              ; preds = %94, %87
  %102 = load i32, ptr %6, align 4, !tbaa !9
  %103 = icmp eq i32 %102, 0
  br i1 %103, label %104, label %109

104:                                              ; preds = %101
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %6, align 4, !tbaa !9
  %107 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %105)
          to label %108 unwind label %51

108:                                              ; preds = %104
  store i8 45, ptr %107, align 1, !tbaa !11
  br label %148

109:                                              ; preds = %101
  %110 = load i32, ptr %6, align 4, !tbaa !9
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %6, align 4, !tbaa !9
  %112 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %110)
          to label %113 unwind label %51

113:                                              ; preds = %109
  store i8 45, ptr %112, align 1, !tbaa !11
  br label %114

114:                                              ; preds = %130, %113
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = icmp sge i32 %115, 0
  br i1 %116, label %117, label %124

117:                                              ; preds = %114
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %118)
          to label %120 unwind label %51

120:                                              ; preds = %117
  %121 = load i8, ptr %119, align 1, !tbaa !11
  %122 = sext i8 %121 to i32
  %123 = icmp eq i32 %122, 49
  br label %124

124:                                              ; preds = %120, %114
  %125 = phi i1 [ false, %114 ], [ %123, %120 ]
  br i1 %125, label %126, label %131

126:                                              ; preds = %124
  %127 = load i32, ptr %6, align 4, !tbaa !9
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %6, align 4, !tbaa !9
  %129 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %127)
          to label %130 unwind label %51

130:                                              ; preds = %126
  store i8 48, ptr %129, align 1, !tbaa !11
  br label %114, !llvm.loop !14

131:                                              ; preds = %124
  %132 = load i32, ptr %6, align 4, !tbaa !9
  %133 = icmp sgt i32 %132, 0
  br i1 %133, label %134, label %138

134:                                              ; preds = %131
  %135 = load i32, ptr %6, align 4, !tbaa !9
  %136 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %135)
          to label %137 unwind label %51

137:                                              ; preds = %134
  store i8 49, ptr %136, align 1, !tbaa !11
  br label %147

138:                                              ; preds = %131
  %139 = load i32, ptr %6, align 4, !tbaa !9
  %140 = icmp eq i32 %139, 0
  br i1 %140, label %141, label %146

141:                                              ; preds = %138
  %142 = load i32, ptr %6, align 4, !tbaa !9
  %143 = add nsw i32 %142, -1
  store i32 %143, ptr %6, align 4, !tbaa !9
  %144 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %142)
          to label %145 unwind label %51

145:                                              ; preds = %141
  store i8 49, ptr %144, align 1, !tbaa !11
  br label %146

146:                                              ; preds = %145, %138
  br label %147

147:                                              ; preds = %146, %137
  br label %148

148:                                              ; preds = %147, %108
  br label %149

149:                                              ; preds = %148, %98
  br label %150

150:                                              ; preds = %149, %84
  br label %74, !llvm.loop !15

151:                                              ; preds = %74
  store i32 0, ptr %6, align 4, !tbaa !9
  %152 = load i32, ptr %4, align 4, !tbaa !9
  %153 = icmp ne i32 %152, 0
  %154 = zext i1 %153 to i64
  %155 = select i1 %153, i32 4, i32 0
  store i32 %155, ptr %7, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %183, %151
  %157 = load i32, ptr %6, align 4, !tbaa !9
  %158 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %157)
          to label %159 unwind label %51

159:                                              ; preds = %156
  %160 = load i8, ptr %158, align 1, !tbaa !11
  %161 = icmp ne i8 %160, 0
  br i1 %161, label %162, label %184

162:                                              ; preds = %159
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = load i32, ptr %7, align 4, !tbaa !9
  %165 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %163, i32 noundef %164)
          to label %166 unwind label %51

166:                                              ; preds = %162
  %167 = load i8, ptr %165, align 1, !tbaa !11
  %168 = sext i8 %167 to i32
  %169 = icmp eq i32 %168, 46
  br i1 %169, label %170, label %173

170:                                              ; preds = %166
  %171 = load i32, ptr %7, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %7, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %170, %166
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %6, align 4, !tbaa !9
  %176 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %174)
          to label %177 unwind label %51

177:                                              ; preds = %173
  %178 = load i8, ptr %176, align 1, !tbaa !11
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = load i32, ptr %7, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %7, align 4, !tbaa !9
  %182 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %179, i32 noundef %180)
          to label %183 unwind label %51

183:                                              ; preds = %177
  store i8 %178, ptr %182, align 1, !tbaa !11
  br label %156, !llvm.loop !16

184:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  ret void

185:                                              ; preds = %51
  %186 = load ptr, ptr %8, align 8
  %187 = load i32, ptr %9, align 4
  %188 = insertvalue { ptr, i32 } poison, ptr %186, 0
  %189 = insertvalue { ptr, i32 } %188, i32 %187, 1
  resume { ptr, i32 } %189
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


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

%"class.sc_dt::scfx_string" = type { i64, i64, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt11scfx_tc2csdERNS_11scfx_stringEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.sc_dt::scfx_string", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #4
  call void @_ZN5sc_dt11scfx_stringC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %.not = icmp eq i32 %1, 0
  %4 = select i1 %.not, i32 0, i32 4
  br label %5

5:                                                ; preds = %30, %2
  %.041 = phi i32 [ %4, %2 ], [ %31, %30 ]
  %.0 = phi i32 [ 0, %2 ], [ %.1, %30 ]
  %6 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.041)
          to label %7 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

7:                                                ; preds = %5
  %8 = load i8, ptr %6, align 1, !tbaa !5
  %.not44 = icmp eq i8 %8, 0
  br i1 %.not44, label %32, label %9

9:                                                ; preds = %7
  %10 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.041)
          to label %11 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

11:                                               ; preds = %9
  %12 = load i8, ptr %10, align 1, !tbaa !5
  %13 = icmp eq i8 %12, 48
  br i1 %13, label %19, label %14

14:                                               ; preds = %11
  %15 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.041)
          to label %16 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

16:                                               ; preds = %14
  %17 = load i8, ptr %15, align 1, !tbaa !5
  %18 = icmp eq i8 %17, 49
  br i1 %18, label %19, label %26

19:                                               ; preds = %16, %11
  %20 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.041)
          to label %21 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

21:                                               ; preds = %19
  %22 = load i8, ptr %20, align 1, !tbaa !5
  %23 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.0)
          to label %24 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

24:                                               ; preds = %21
  %25 = add nsw i32 %.0, 1
  store i8 %22, ptr %23, align 1, !tbaa !5
  br label %30

.loopexit:                                        ; preds = %.preheader, %75, %77, %83
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %61, %.lr.ph
  %lpad.loopexit50 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit: ; preds = %65, %53, %44, %.lr.ph67
  %lpad.loopexit74 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit.split-lp: ; preds = %68, %50
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit: ; preds = %26, %21, %19, %14, %9, %5
  %lpad.loopexit55 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp: ; preds = %32
  %lpad.loopexit.split-lp56 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit.split-lp, %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit50, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit55, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp56, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp ], [ %lpad.loopexit74, %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit.split-lp ]
  call void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  resume { ptr, i32 } %lpad.phi

26:                                               ; preds = %16
  %27 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.041)
          to label %28 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

28:                                               ; preds = %26
  %29 = load i8, ptr %27, align 1, !tbaa !5
  %.not45 = icmp eq i8 %29, 46
  br i1 %.not45, label %30, label %32

30:                                               ; preds = %28, %24
  %.1 = phi i32 [ %25, %24 ], [ %.0, %28 ]
  %31 = add nuw nsw i32 %.041, 1
  br label %5, !llvm.loop !8

32:                                               ; preds = %28, %7
  %33 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.0)
          to label %34 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp

34:                                               ; preds = %32
  store i8 0, ptr %33, align 1, !tbaa !5
  %35 = icmp sgt i32 %.0, 0
  br i1 %35, label %.lr.ph67.preheader, label %.preheader.preheader

.lr.ph67.preheader:                               ; preds = %34
  %36 = add nsw i32 %.0, -1
  br label %.lr.ph67

.lr.ph67:                                         ; preds = %.lr.ph67.preheader, %.loopexit49
  %.266 = phi i32 [ %.4, %.loopexit49 ], [ %36, %.lr.ph67.preheader ]
  %37 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.266)
          to label %38 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit

38:                                               ; preds = %.lr.ph67
  %39 = load i8, ptr %37, align 1, !tbaa !5
  %40 = icmp eq i8 %39, 48
  br i1 %40, label %41, label %43

41:                                               ; preds = %38
  %42 = add nsw i32 %.266, -1
  br label %.loopexit49

43:                                               ; preds = %38
  %cond = icmp eq i32 %.266, 0
  br i1 %cond, label %50, label %44

44:                                               ; preds = %43
  %45 = add nsw i32 %.266, -1
  %46 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %45)
          to label %47 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit

47:                                               ; preds = %44
  %48 = load i8, ptr %46, align 1, !tbaa !5
  %49 = icmp eq i8 %48, 48
  br i1 %49, label %.loopexit49, label %53

50:                                               ; preds = %43
  %51 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef 0)
          to label %52 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit.split-lp

52:                                               ; preds = %50
  store i8 45, ptr %51, align 1, !tbaa !5
  br label %.preheader.preheader

53:                                               ; preds = %47
  %54 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.266)
          to label %55 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit

55:                                               ; preds = %53
  store i8 45, ptr %54, align 1, !tbaa !5
  %56 = icmp sgt i32 %.266, 0
  br i1 %56, label %.lr.ph, label %.preheader.preheader

.lr.ph:                                           ; preds = %55, %63
  %.3.in64 = phi i32 [ %.365, %63 ], [ %.266, %55 ]
  %.365 = add nsw i32 %.3.in64, -1
  %57 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.365)
          to label %58 unwind label %.loopexit.split-lp.loopexit

58:                                               ; preds = %.lr.ph
  %59 = load i8, ptr %57, align 1, !tbaa !5
  %60 = icmp eq i8 %59, 49
  br i1 %60, label %61, label %.critedge

61:                                               ; preds = %58
  %62 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.365)
          to label %63 unwind label %.loopexit.split-lp.loopexit

63:                                               ; preds = %61
  store i8 48, ptr %62, align 1, !tbaa !5
  %64 = icmp ugt i32 %.3.in64, 1
  br i1 %64, label %.lr.ph, label %.preheader.preheader, !llvm.loop !10

.critedge:                                        ; preds = %58
  %.not48 = icmp eq i32 %.3.in64, 1
  br i1 %.not48, label %68, label %65

65:                                               ; preds = %.critedge
  %66 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.365)
          to label %67 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit

67:                                               ; preds = %65
  store i8 49, ptr %66, align 1, !tbaa !5
  br label %.loopexit49

68:                                               ; preds = %.critedge
  %69 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef 0)
          to label %70 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.loopexit.split-lp

70:                                               ; preds = %68
  store i8 49, ptr %69, align 1, !tbaa !5
  br label %.preheader.preheader

.loopexit49:                                      ; preds = %47, %67, %41
  %.4 = phi i32 [ %42, %41 ], [ %.365, %67 ], [ %45, %47 ]
  %71 = icmp sgt i32 %.4, -1
  br i1 %71, label %.lr.ph67, label %.preheader.preheader, !llvm.loop !11

.preheader.preheader:                             ; preds = %55, %.loopexit49, %63, %70, %52, %34
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %86
  %.142 = phi i32 [ %87, %86 ], [ %4, %.preheader.preheader ]
  %.5 = phi i32 [ %81, %86 ], [ 0, %.preheader.preheader ]
  %72 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.5)
          to label %73 unwind label %.loopexit

73:                                               ; preds = %.preheader
  %74 = load i8, ptr %72, align 1, !tbaa !5
  %.not46 = icmp eq i8 %74, 0
  br i1 %.not46, label %88, label %75

75:                                               ; preds = %73
  %76 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.142)
          to label %77 unwind label %.loopexit

77:                                               ; preds = %75
  %78 = load i8, ptr %76, align 1, !tbaa !5
  %79 = icmp eq i8 %78, 46
  %80 = zext i1 %79 to i32
  %spec.select = add nsw i32 %.142, %80
  %81 = add nuw nsw i32 %.5, 1
  %82 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.5)
          to label %83 unwind label %.loopexit

83:                                               ; preds = %77
  %84 = load i8, ptr %82, align 1, !tbaa !5
  %85 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %spec.select)
          to label %86 unwind label %.loopexit

86:                                               ; preds = %83
  %87 = add nsw i32 %spec.select, 1
  store i8 %84, ptr %85, align 1, !tbaa !5
  br label %.preheader, !llvm.loop !12

88:                                               ; preds = %73
  call void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #4
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass