; LLVM IR from div-bargali/Data-Structures-and-Algorithms :: C++/Algorithms/Dynamic-Programming (Longest  Palindromic Sequence)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3lcsRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i1, align 1
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %22) #5
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  %27 = trunc i64 %26 to i32
  store i32 %27, ptr %8, align 4, !tbaa !9
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  %30 = zext i32 %29 to i64
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = add nsw i32 %31, 1
  %33 = zext i32 %32 to i64
  %34 = call ptr @llvm.stacksave.p0()
  store ptr %34, ptr %9, align 8
  %35 = mul nuw i64 %30, %33
  %36 = alloca i32, i64 %35, align 16
  store i64 %30, ptr %10, align 8
  store i64 %33, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %129, %3
  %38 = load i32, ptr %12, align 4, !tbaa !9
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %132

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %125, %42
  %44 = load i32, ptr %14, align 4, !tbaa !9
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %128

48:                                               ; preds = %43
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %54, label %51

51:                                               ; preds = %48
  %52 = load i32, ptr %14, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %62

54:                                               ; preds = %51, %48
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = mul nsw i64 %56, %33
  %58 = getelementptr inbounds i32, ptr %36, i64 %57
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i32, ptr %58, i64 %60
  store i32 0, ptr %61, align 4, !tbaa !9
  br label %124

62:                                               ; preds = %51
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %63, i64 noundef %66)
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = load i32, ptr %14, align 4, !tbaa !9
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %70, i64 noundef %73)
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = sext i8 %75 to i32
  %77 = icmp eq i32 %69, %76
  br i1 %77, label %78, label %97

78:                                               ; preds = %62
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = mul nsw i64 %81, %33
  %83 = getelementptr inbounds i32, ptr %36, i64 %82
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr %83, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %91, %33
  %93 = getelementptr inbounds i32, ptr %36, i64 %92
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  store i32 %89, ptr %96, align 4, !tbaa !9
  br label %123

97:                                               ; preds = %62
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = mul nsw i64 %100, %33
  %102 = getelementptr inbounds i32, ptr %36, i64 %101
  %103 = load i32, ptr %14, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %102, i64 %104
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = mul nsw i64 %107, %33
  %109 = getelementptr inbounds i32, ptr %36, i64 %108
  %110 = load i32, ptr %14, align 4, !tbaa !9
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %109, i64 %112
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %105, ptr noundef nonnull align 4 dereferenceable(4) %113)
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = load i32, ptr %12, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 %117, %33
  %119 = getelementptr inbounds i32, ptr %36, i64 %118
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i32, ptr %119, i64 %121
  store i32 %115, ptr %122, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %97, %78
  br label %124

124:                                              ; preds = %123, %54
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %14, align 4, !tbaa !9
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %14, align 4, !tbaa !9
  br label %43, !llvm.loop !12

128:                                              ; preds = %47
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %12, align 4, !tbaa !9
  br label %37, !llvm.loop !14

132:                                              ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %133 = load i32, ptr %7, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = mul nsw i64 %134, %33
  %136 = getelementptr inbounds i32, ptr %36, i64 %135
  %137 = load i32, ptr %8, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr %136, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !9
  store i32 %140, ptr %15, align 4, !tbaa !9
  store i1 false, ptr %16, align 1
  %141 = load i32, ptr %15, align 4, !tbaa !9
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEmcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %143, i8 noundef signext 0, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %144 unwind label %192

144:                                              ; preds = %132
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %145 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %145, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %146 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %146, ptr %21, align 4, !tbaa !9
  br label %147

147:                                              ; preds = %227, %144
  %148 = load i32, ptr %20, align 4, !tbaa !9
  %149 = icmp sgt i32 %148, 0
  br i1 %149, label %150, label %153

150:                                              ; preds = %147
  %151 = load i32, ptr %21, align 4, !tbaa !9
  %152 = icmp sgt i32 %151, 0
  br label %153

153:                                              ; preds = %150, %147
  %154 = phi i1 [ false, %147 ], [ %152, %150 ]
  br i1 %154, label %155, label %228

155:                                              ; preds = %153
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = load i32, ptr %20, align 4, !tbaa !9
  %158 = sub nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %156, i64 noundef %159)
          to label %161 unwind label %196

161:                                              ; preds = %155
  %162 = load i8, ptr %160, align 1, !tbaa !11
  %163 = sext i8 %162 to i32
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = load i32, ptr %21, align 4, !tbaa !9
  %166 = sub nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %164, i64 noundef %167)
          to label %169 unwind label %196

169:                                              ; preds = %161
  %170 = load i8, ptr %168, align 1, !tbaa !11
  %171 = sext i8 %170 to i32
  %172 = icmp eq i32 %163, %171
  br i1 %172, label %173, label %200

173:                                              ; preds = %169
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = load i32, ptr %20, align 4, !tbaa !9
  %176 = sub nsw i32 %175, 1
  %177 = sext i32 %176 to i64
  %178 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %174, i64 noundef %177)
          to label %179 unwind label %196

179:                                              ; preds = %173
  %180 = load i8, ptr %178, align 1, !tbaa !11
  %181 = load i32, ptr %15, align 4, !tbaa !9
  %182 = sub nsw i32 %181, 1
  %183 = sext i32 %182 to i64
  %184 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %183)
          to label %185 unwind label %196

185:                                              ; preds = %179
  store i8 %180, ptr %184, align 1, !tbaa !11
  %186 = load i32, ptr %20, align 4, !tbaa !9
  %187 = add nsw i32 %186, -1
  store i32 %187, ptr %20, align 4, !tbaa !9
  %188 = load i32, ptr %21, align 4, !tbaa !9
  %189 = add nsw i32 %188, -1
  store i32 %189, ptr %21, align 4, !tbaa !9
  %190 = load i32, ptr %15, align 4, !tbaa !9
  %191 = add nsw i32 %190, -1
  store i32 %191, ptr %15, align 4, !tbaa !9
  br label %227

192:                                              ; preds = %132
  %193 = landingpad { ptr, i32 }
          cleanup
  %194 = extractvalue { ptr, i32 } %193, 0
  store ptr %194, ptr %18, align 8
  %195 = extractvalue { ptr, i32 } %193, 1
  store i32 %195, ptr %19, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  br label %233

196:                                              ; preds = %179, %173, %161, %155
  %197 = landingpad { ptr, i32 }
          cleanup
  %198 = extractvalue { ptr, i32 } %197, 0
  store ptr %198, ptr %18, align 8
  %199 = extractvalue { ptr, i32 } %197, 1
  store i32 %199, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %233

200:                                              ; preds = %169
  %201 = load i32, ptr %20, align 4, !tbaa !9
  %202 = sub nsw i32 %201, 1
  %203 = sext i32 %202 to i64
  %204 = mul nsw i64 %203, %33
  %205 = getelementptr inbounds i32, ptr %36, i64 %204
  %206 = load i32, ptr %21, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds i32, ptr %205, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !9
  %210 = load i32, ptr %20, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = mul nsw i64 %211, %33
  %213 = getelementptr inbounds i32, ptr %36, i64 %212
  %214 = load i32, ptr %21, align 4, !tbaa !9
  %215 = sub nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds i32, ptr %213, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !9
  %219 = icmp sgt i32 %209, %218
  br i1 %219, label %220, label %223

220:                                              ; preds = %200
  %221 = load i32, ptr %20, align 4, !tbaa !9
  %222 = add nsw i32 %221, -1
  store i32 %222, ptr %20, align 4, !tbaa !9
  br label %226

223:                                              ; preds = %200
  %224 = load i32, ptr %21, align 4, !tbaa !9
  %225 = add nsw i32 %224, -1
  store i32 %225, ptr %21, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %223, %220
  br label %227

227:                                              ; preds = %226, %185
  br label %147, !llvm.loop !15

228:                                              ; preds = %153
  store i1 true, ptr %16, align 1
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  %229 = load i1, ptr %16, align 1
  br i1 %229, label %231, label %230

230:                                              ; preds = %228
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  br label %231

231:                                              ; preds = %230, %228
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  %232 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %232)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void

233:                                              ; preds = %196, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %234

234:                                              ; preds = %233
  %235 = load ptr, ptr %18, align 8
  %236 = load i32, ptr %19, align 4
  %237 = insertvalue { ptr, i32 } poison, ptr %235, 0
  %238 = insertvalue { ptr, i32 } %237, i32 %236, 1
  resume { ptr, i32 } %238
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEmcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i8 noundef signext, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 = { 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 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 #5 = { 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}


; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3lcsRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::allocator", align 1
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %6 = trunc i64 %5 to i32
  %7 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %8 = trunc i64 %7 to i32
  %9 = add i64 %5, 1
  %10 = and i64 %9, 4294967295
  %11 = add i64 %7, 1
  %12 = and i64 %11, 4294967295
  %13 = mul nuw i64 %12, %10
  %14 = alloca i32, i64 %13, align 16
  %15 = or i64 %5, %7
  %16 = and i64 %15, 2147483648
  %or.cond.not = icmp eq i64 %16, 0
  br i1 %or.cond.not, label %.preheader.preheader, label %._crit_edge69

.preheader.preheader:                             ; preds = %3
  %17 = add nuw nsw i64 %7, 1
  %18 = shl nuw nsw i64 %12, 2
  %wide.trip.count = and i64 %17, 4294967295
  %exitcond.peel.not = icmp eq i64 %wide.trip.count, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %.05768 = phi i32 [ %37, %._crit_edge ], [ 0, %.preheader.preheader ]
  %19 = zext i32 %.05768 to i64
  %20 = icmp eq i32 %.05768, 0
  %21 = add nsw i32 %.05768, -1
  %22 = sext i32 %21 to i64
  %23 = mul nsw i64 %12, %22
  %24 = getelementptr inbounds i32, ptr %14, i64 %23
  %25 = mul nuw nsw i64 %12, %19
  %26 = getelementptr inbounds i32, ptr %14, i64 %25
  br i1 %20, label %.lr.ph.split.us.preheader, label %27

27:                                               ; preds = %.preheader
  store i32 0, ptr %26, align 4, !tbaa !5
  br i1 %exitcond.peel.not, label %._crit_edge, label %.lr.ph.split.peel.next

.lr.ph.split.us.preheader:                        ; preds = %.preheader
  %28 = mul nuw nsw i64 %18, %19
  %scevgep = getelementptr i8, ptr %14, i64 %28
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %18, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge69:                                    ; preds = %._crit_edge, %3
  %sext = shl i64 %5, 32
  %29 = ashr exact i64 %sext, 32
  %30 = mul nsw i64 %12, %29
  %31 = getelementptr inbounds i32, ptr %14, i64 %30
  %sext62 = shl i64 %7, 32
  %32 = ashr exact i64 %sext62, 30
  %33 = getelementptr inbounds i8, ptr %31, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEmcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %36, i8 noundef signext 0, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %55 unwind label %74

._crit_edge:                                      ; preds = %53, %27, %.lr.ph.split.us.preheader
  %37 = add i32 %.05768, 1
  %.not = icmp sgt i32 %37, %6
  br i1 %.not, label %._crit_edge69, label %.preheader, !llvm.loop !9

.lr.ph.split.peel.next:                           ; preds = %27, %53
  %indvars.iv = phi i64 [ %indvars.iv.next, %53 ], [ 1, %27 ]
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %22)
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = add nsw i64 %indvars.iv, -1
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %40)
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = icmp eq i8 %39, %42
  br i1 %43, label %44, label %48

44:                                               ; preds = %.lr.ph.split.peel.next
  %45 = getelementptr inbounds i32, ptr %24, i64 %40
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  br label %53

48:                                               ; preds = %.lr.ph.split.peel.next
  %49 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv
  %50 = getelementptr inbounds i32, ptr %26, i64 %40
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %49, ptr noundef nonnull align 4 dereferenceable(4) %50)
  %52 = load i32, ptr %51, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %48, %44
  %.sink = phi i32 [ %52, %48 ], [ %47, %44 ]
  %54 = getelementptr inbounds i32, ptr %26, i64 %indvars.iv
  store i32 %.sink, ptr %54, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split.peel.next, !llvm.loop !12

55:                                               ; preds = %._crit_edge69
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %56 = icmp sgt i32 %6, 0
  %57 = icmp sgt i32 %8, 0
  %58 = and i1 %56, %57
  br i1 %58, label %.lr.ph, label %._crit_edge74

.lr.ph:                                           ; preds = %55, %88
  %.072 = phi i32 [ %.1, %88 ], [ %8, %55 ]
  %.05571 = phi i32 [ %.156, %88 ], [ %6, %55 ]
  %.05870 = phi i32 [ %.159, %88 ], [ %34, %55 ]
  %59 = add nsw i32 %.05571, -1
  %60 = zext nneg i32 %59 to i64
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %60)
  %62 = load i8, ptr %61, align 1, !tbaa !11
  %63 = add nsw i32 %.072, -1
  %64 = zext nneg i32 %63 to i64
  %65 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %64)
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = icmp eq i8 %62, %66
  br i1 %67, label %68, label %76

68:                                               ; preds = %.lr.ph
  %69 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %60)
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = add nsw i32 %.05870, -1
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %72)
  store i8 %70, ptr %73, align 1, !tbaa !11
  br label %88

74:                                               ; preds = %._crit_edge69
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  resume { ptr, i32 } %75

76:                                               ; preds = %.lr.ph
  %77 = mul nuw nsw i64 %12, %60
  %78 = getelementptr inbounds i32, ptr %14, i64 %77
  %79 = zext nneg i32 %.072 to i64
  %80 = getelementptr inbounds i32, ptr %78, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = zext nneg i32 %.05571 to i64
  %83 = mul nuw nsw i64 %12, %82
  %84 = getelementptr inbounds i32, ptr %14, i64 %83
  %85 = getelementptr inbounds i32, ptr %84, i64 %64
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = icmp sgt i32 %81, %86
  %spec.select = select i1 %87, i32 %59, i32 %.05571
  %spec.select64 = select i1 %87, i32 %.072, i32 %63
  br label %88

88:                                               ; preds = %76, %68
  %.159 = phi i32 [ %71, %68 ], [ %.05870, %76 ]
  %.156 = phi i32 [ %59, %68 ], [ %spec.select, %76 ]
  %.1 = phi i32 [ %63, %68 ], [ %spec.select64, %76 ]
  %89 = icmp sgt i32 %.156, 0
  %90 = icmp sgt i32 %.1, 0
  %91 = select i1 %89, i1 %90, i1 false
  br i1 %91, label %.lr.ph, label %._crit_edge74, !llvm.loop !14

._crit_edge74:                                    ; preds = %88, %55
  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: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEmcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i8 noundef signext, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass