; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt11scfx_csd2tcERNS_11scfx_stringE(ptr noundef nonnull align 8 dereferenceable(24) %0) #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.sc_dt::scfx_string", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #4
  call void @_ZN5sc_dt11scfx_stringC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = add nsw i32 %9, 1
  store i32 %10, ptr %4, align 4, !tbaa !9
  %11 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %9)
          to label %12 unwind label %54

12:                                               ; preds = %1
  store i8 48, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 4, ptr %7, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %72, %12
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %15)
          to label %17 unwind label %58

17:                                               ; preds = %13
  %18 = load i8, ptr %16, align 1, !tbaa !11
  %19 = icmp ne i8 %18, 0
  br i1 %19, label %20, label %75

20:                                               ; preds = %17
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %21, i32 noundef %22)
          to label %24 unwind label %58

24:                                               ; preds = %20
  %25 = load i8, ptr %23, align 1, !tbaa !11
  %26 = sext i8 %25 to i32
  %27 = icmp eq i32 %26, 45
  br i1 %27, label %44, label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %29, i32 noundef %30)
          to label %32 unwind label %58

32:                                               ; preds = %28
  %33 = load i8, ptr %31, align 1, !tbaa !11
  %34 = sext i8 %33 to i32
  %35 = icmp eq i32 %34, 48
  br i1 %35, label %44, label %36

36:                                               ; preds = %32
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %37, i32 noundef %38)
          to label %40 unwind label %58

40:                                               ; preds = %36
  %41 = load i8, ptr %39, align 1, !tbaa !11
  %42 = sext i8 %41 to i32
  %43 = icmp eq i32 %42, 49
  br i1 %43, label %44, label %62

44:                                               ; preds = %40, %32, %24
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !9
  %47 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %45, i32 noundef %46)
          to label %48 unwind label %58

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

53:                                               ; preds = %48
  store i8 %49, ptr %52, align 1, !tbaa !11
  br label %72

54:                                               ; preds = %1
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %5, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %6, align 4
  br label %198

58:                                               ; preds = %75, %62, %48, %44, %36, %28, %20, %13
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %5, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %6, align 4
  br label %197

62:                                               ; preds = %40
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !9
  %65 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %63, i32 noundef %64)
          to label %66 unwind label %58

66:                                               ; preds = %62
  %67 = load i8, ptr %65, align 1, !tbaa !11
  %68 = sext i8 %67 to i32
  %69 = icmp ne i32 %68, 46
  br i1 %69, label %70, label %71

70:                                               ; preds = %66
  br label %75

71:                                               ; preds = %66
  br label %72

72:                                               ; preds = %71, %53
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %7, align 4, !tbaa !9
  br label %13, !llvm.loop !12

75:                                               ; preds = %70, %17
  %76 = load i32, ptr %4, align 4, !tbaa !9
  %77 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %76)
          to label %78 unwind label %58

78:                                               ; preds = %75
  store i8 0, ptr %77, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %79 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %79, ptr %8, align 4, !tbaa !9
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %141, %78
  %81 = load i32, ptr %4, align 4, !tbaa !9
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %84, label %142

84:                                               ; preds = %80
  br label %85

85:                                               ; preds = %98, %84
  %86 = load i32, ptr %4, align 4, !tbaa !9
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %89, label %96

89:                                               ; preds = %85
  %90 = load i32, ptr %4, align 4, !tbaa !9
  %91 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %90)
          to label %92 unwind label %101

92:                                               ; preds = %89
  %93 = load i8, ptr %91, align 1, !tbaa !11
  %94 = sext i8 %93 to i32
  %95 = icmp ne i32 %94, 45
  br label %96

96:                                               ; preds = %92, %85
  %97 = phi i1 [ false, %85 ], [ %95, %92 ]
  br i1 %97, label %98, label %105

98:                                               ; preds = %96
  %99 = load i32, ptr %4, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %4, align 4, !tbaa !9
  br label %85, !llvm.loop !14

101:                                              ; preds = %189, %185, %174, %168, %159, %154, %145, %142, %136, %128, %119, %109, %89
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %5, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %197

105:                                              ; preds = %96
  %106 = load i32, ptr %4, align 4, !tbaa !9
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %141

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

115:                                              ; preds = %109
  store i8 49, ptr %114, align 1, !tbaa !11
  br label %116

116:                                              ; preds = %132, %115
  %117 = load i32, ptr %7, align 4, !tbaa !9
  %118 = icmp sge i32 %117, 0
  br i1 %118, label %119, label %126

119:                                              ; preds = %116
  %120 = load i32, ptr %7, align 4, !tbaa !9
  %121 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %120)
          to label %122 unwind label %101

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

126:                                              ; preds = %122, %116
  %127 = phi i1 [ false, %116 ], [ %125, %122 ]
  br i1 %127, label %128, label %133

128:                                              ; preds = %126
  %129 = load i32, ptr %7, align 4, !tbaa !9
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %7, align 4, !tbaa !9
  %131 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %129)
          to label %132 unwind label %101

132:                                              ; preds = %128
  store i8 49, ptr %131, align 1, !tbaa !11
  br label %116, !llvm.loop !15

133:                                              ; preds = %126
  %134 = load i32, ptr %7, align 4, !tbaa !9
  %135 = icmp sge i32 %134, 0
  br i1 %135, label %136, label %140

136:                                              ; preds = %133
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %137)
          to label %139 unwind label %101

139:                                              ; preds = %136
  store i8 48, ptr %138, align 1, !tbaa !11
  br label %140

140:                                              ; preds = %139, %133
  br label %141

141:                                              ; preds = %140, %105
  br label %80, !llvm.loop !16

142:                                              ; preds = %80
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = invoke noundef i32 @_ZNK5sc_dt11scfx_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(24) %143)
          to label %145 unwind label %101

145:                                              ; preds = %142
  store i32 %144, ptr %7, align 4, !tbaa !9
  %146 = load ptr, ptr %2, align 8, !tbaa !5
  %147 = load i32, ptr %7, align 4, !tbaa !9
  %148 = add nsw i32 %147, 1
  %149 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %146, i32 noundef %148)
          to label %150 unwind label %101

150:                                              ; preds = %145
  store i8 0, ptr %149, align 1, !tbaa !11
  br label %151

151:                                              ; preds = %164, %150
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = icmp sgt i32 %152, 4
  br i1 %153, label %154, label %167

154:                                              ; preds = %151
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  %156 = load i32, ptr %7, align 4, !tbaa !9
  %157 = sub nsw i32 %156, 1
  %158 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %155, i32 noundef %157)
          to label %159 unwind label %101

159:                                              ; preds = %154
  %160 = load i8, ptr %158, align 1, !tbaa !11
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = load i32, ptr %7, align 4, !tbaa !9
  %163 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %161, i32 noundef %162)
          to label %164 unwind label %101

164:                                              ; preds = %159
  store i8 %160, ptr %163, align 1, !tbaa !11
  %165 = load i32, ptr %7, align 4, !tbaa !9
  %166 = add nsw i32 %165, -1
  store i32 %166, ptr %7, align 4, !tbaa !9
  br label %151, !llvm.loop !17

167:                                              ; preds = %151
  store i32 0, ptr %4, align 4, !tbaa !9
  store i32 4, ptr %7, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %195, %167
  %169 = load i32, ptr %4, align 4, !tbaa !9
  %170 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %169)
          to label %171 unwind label %101

171:                                              ; preds = %168
  %172 = load i8, ptr %170, align 1, !tbaa !11
  %173 = icmp ne i8 %172, 0
  br i1 %173, label %174, label %196

174:                                              ; preds = %171
  %175 = load ptr, ptr %2, align 8, !tbaa !5
  %176 = load i32, ptr %7, align 4, !tbaa !9
  %177 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %175, i32 noundef %176)
          to label %178 unwind label %101

178:                                              ; preds = %174
  %179 = load i8, ptr %177, align 1, !tbaa !11
  %180 = sext i8 %179 to i32
  %181 = icmp eq i32 %180, 46
  br i1 %181, label %182, label %185

182:                                              ; preds = %178
  %183 = load i32, ptr %7, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %7, align 4, !tbaa !9
  br label %185

185:                                              ; preds = %182, %178
  %186 = load i32, ptr %4, align 4, !tbaa !9
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %4, align 4, !tbaa !9
  %188 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %186)
          to label %189 unwind label %101

189:                                              ; preds = %185
  %190 = load i8, ptr %188, align 1, !tbaa !11
  %191 = load ptr, ptr %2, align 8, !tbaa !5
  %192 = load i32, ptr %7, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %7, align 4, !tbaa !9
  %194 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %191, i32 noundef %192)
          to label %195 unwind label %101

195:                                              ; preds = %189
  store i8 %190, ptr %194, align 1, !tbaa !11
  br label %168, !llvm.loop !18

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

197:                                              ; preds = %101, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %198

198:                                              ; preds = %197, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %5, align 8
  %201 = load i32, ptr %6, align 4
  %202 = insertvalue { ptr, i32 } poison, ptr %200, 0
  %203 = insertvalue { ptr, i32 } %202, i32 %201, 1
  resume { ptr, i32 } %203
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt11scfx_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #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}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5sc_dt11scfx_csd2tcERNS_11scfx_stringE(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.sc_dt::scfx_string", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  call void @_ZN5sc_dt11scfx_stringC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %3 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef 0)
          to label %4 unwind label %31

4:                                                ; preds = %1
  store i8 48, ptr %3, align 1, !tbaa !5
  br label %5

5:                                                ; preds = %37, %4
  %.051 = phi i32 [ 4, %4 ], [ %38, %37 ]
  %.0 = phi i32 [ 1, %4 ], [ %.1, %37 ]
  %6 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.051)
          to label %7 unwind label %.loopexit79

7:                                                ; preds = %5
  %8 = load i8, ptr %6, align 1, !tbaa !5
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %39, 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 %.051)
          to label %11 unwind label %.loopexit79

11:                                               ; preds = %9
  %12 = load i8, ptr %10, align 1, !tbaa !5
  %13 = icmp eq i8 %12, 45
  br i1 %13, label %24, 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 %.051)
          to label %16 unwind label %.loopexit79

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

19:                                               ; preds = %16
  %20 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.051)
          to label %21 unwind label %.loopexit79

21:                                               ; preds = %19
  %22 = load i8, ptr %20, align 1, !tbaa !5
  %23 = icmp eq i8 %22, 49
  br i1 %23, label %24, label %33

24:                                               ; preds = %21, %16, %11
  %25 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.051)
          to label %26 unwind label %.loopexit79

26:                                               ; preds = %24
  %27 = load i8, ptr %25, align 1, !tbaa !5
  %28 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.0)
          to label %29 unwind label %.loopexit79

29:                                               ; preds = %26
  %30 = add nsw i32 %.0, 1
  store i8 %27, ptr %28, align 1, !tbaa !5
  br label %37

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

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

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

33:                                               ; preds = %21
  %34 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.051)
          to label %35 unwind label %.loopexit79

35:                                               ; preds = %33
  %36 = load i8, ptr %34, align 1, !tbaa !5
  %.not60 = icmp eq i8 %36, 46
  br i1 %.not60, label %37, label %39

37:                                               ; preds = %35, %29
  %.1 = phi i32 [ %30, %29 ], [ %.0, %35 ]
  %38 = add nuw nsw i32 %.051, 1
  br label %5, !llvm.loop !8

39:                                               ; preds = %35, %7
  %40 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.0)
          to label %41 unwind label %.loopexit.split-lp80

41:                                               ; preds = %39
  store i8 0, ptr %40, align 1, !tbaa !5
  %42 = icmp sgt i32 %.0, 1
  br i1 %42, label %.preheader72, label %._crit_edge

.preheader72:                                     ; preds = %41, %.preheader72.backedge
  %.389 = phi i32 [ %46, %.preheader72.backedge ], [ 1, %41 ]
  %43 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.389)
          to label %44 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

44:                                               ; preds = %.preheader72
  %45 = load i8, ptr %43, align 1, !tbaa !5
  %.not62 = icmp eq i8 %45, 45
  %46 = add nuw nsw i32 %.389, 1
  br i1 %.not62, label %.critedge, label %47

47:                                               ; preds = %44
  %48 = icmp slt i32 %46, %.0
  %49 = icmp slt i32 %46, %.0
  %or.cond = or i1 %48, %49
  br i1 %or.cond, label %.preheader72.backedge, label %._crit_edge

.preheader72.backedge:                            ; preds = %47, %.critedge65
  br label %.preheader72, !llvm.loop !10

.loopexit:                                        ; preds = %.preheader, %76, %78, %84
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

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

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

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

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

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

.critedge:                                        ; preds = %44
  %50 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.389)
          to label %.lr.ph.preheader unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

.lr.ph.preheader:                                 ; preds = %.critedge
  store i8 49, ptr %50, align 1, !tbaa !5
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %57
  %.15291.in = phi i32 [ %.15291, %57 ], [ %.389, %.lr.ph.preheader ]
  %.15291 = add nsw i32 %.15291.in, -1
  %51 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.15291)
          to label %52 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit

52:                                               ; preds = %.lr.ph
  %53 = load i8, ptr %51, align 1, !tbaa !5
  %54 = icmp eq i8 %53, 48
  br i1 %54, label %55, label %.critedge2

55:                                               ; preds = %52
  %56 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.15291)
          to label %57 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit

57:                                               ; preds = %55
  store i8 49, ptr %56, align 1, !tbaa !5
  %58 = icmp ugt i32 %.15291.in, 1
  br i1 %58, label %.lr.ph, label %.critedge65, !llvm.loop !11

.critedge2:                                       ; preds = %52
  %59 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.15291)
          to label %60 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit

60:                                               ; preds = %.critedge2
  store i8 48, ptr %59, align 1, !tbaa !5
  br label %.critedge65

.critedge65:                                      ; preds = %57, %60
  %.old = icmp slt i32 %46, %.0
  br i1 %.old, label %.preheader72.backedge, label %._crit_edge

._crit_edge:                                      ; preds = %.critedge65, %47, %41
  %61 = call noundef i32 @_ZNK5sc_dt11scfx_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %62 = add nsw i32 %61, 1
  %63 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %62)
          to label %64 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp

64:                                               ; preds = %._crit_edge
  store i8 0, ptr %63, align 1, !tbaa !5
  %65 = icmp sgt i32 %61, 4
  br i1 %65, label %.lr.ph95, label %.preheader.preheader

.lr.ph95:                                         ; preds = %64, %71
  %.25393 = phi i32 [ %66, %71 ], [ %61, %64 ]
  %66 = add nsw i32 %.25393, -1
  %67 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %66)
          to label %68 unwind label %.loopexit.split-lp.loopexit

68:                                               ; preds = %.lr.ph95
  %69 = load i8, ptr %67, align 1, !tbaa !5
  %70 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %.25393)
          to label %71 unwind label %.loopexit.split-lp.loopexit

71:                                               ; preds = %68
  store i8 %69, ptr %70, align 1, !tbaa !5
  %72 = icmp ugt i32 %.25393, 5
  br i1 %72, label %.lr.ph95, label %.preheader.preheader, !llvm.loop !12

.preheader.preheader:                             ; preds = %71, %64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %87
  %.354 = phi i32 [ %88, %87 ], [ 4, %.preheader.preheader ]
  %.5 = phi i32 [ %82, %87 ], [ 0, %.preheader.preheader ]
  %73 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZN5sc_dt11scfx_stringixEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %.5)
          to label %74 unwind label %.loopexit

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

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

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

84:                                               ; preds = %78
  %85 = load i8, ptr %83, align 1, !tbaa !5
  %86 = 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 %87 unwind label %.loopexit

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

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

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit, %.loopexit79, %.loopexit.split-lp80, %31
  %.pn.pn = phi { ptr, i32 } [ %32, %31 ], [ %lpad.loopexit81, %.loopexit79 ], [ %lpad.loopexit.split-lp82, %.loopexit.split-lp80 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit67, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit70, %.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit74, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit77, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN5sc_dt11scfx_stringD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5sc_dt11scfx_string6lengthEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #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}
!13 = distinct !{!13, !9}


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