; LLVM IR from MinhasKamal/AlgorithmImplementations :: dataStructures/string/StringLongestCommonSubSecuence.ll (Z9LCSFinderPcS_)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9LCSFinderPcS_(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = call noundef i32 @_Z12stringLengthPc(ptr noundef %19)
  store i32 %20, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noundef i32 @_Z12stringLengthPc(ptr noundef %21)
  store i32 %22, ptr %6, align 4, !tbaa !9
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = add nsw i32 %23, 1
  %25 = zext i32 %24 to i64
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = add nsw i32 %26, 1
  %28 = zext i32 %27 to i64
  %29 = call ptr @llvm.stacksave.p0()
  store ptr %29, ptr %7, align 8
  %30 = mul nuw i64 %25, %28
  %31 = alloca i32, i64 %30, align 16
  store i64 %25, ptr %8, align 8
  store i64 %28, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %33, i64 8)
  %35 = extractvalue { i64, i1 } %34, 1
  %36 = extractvalue { i64, i1 } %34, 0
  %37 = select i1 %35, i64 -1, i64 %36
  %38 = call noalias noundef nonnull ptr @_Znam(i64 noundef %37) #9
  store ptr %38, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %52, %2
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %55

44:                                               ; preds = %39
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = call noalias noundef nonnull ptr @_Znam(i64 noundef %46) #9
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  store ptr %47, ptr %51, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %44
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %11, align 4, !tbaa !9
  br label %39, !llvm.loop !11

55:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %68, %55
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %71

62:                                               ; preds = %56
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = mul nsw i64 %64, %28
  %66 = getelementptr inbounds i32, ptr %31, i64 %65
  %67 = getelementptr inbounds i32, ptr %66, i64 0
  store i32 0, ptr %67, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %62
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %12, align 4, !tbaa !9
  br label %56, !llvm.loop !13

71:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %84, %71
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = load i32, ptr %6, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  %76 = icmp slt i32 %73, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %87

78:                                               ; preds = %72
  %79 = mul nsw i64 0, %28
  %80 = getelementptr inbounds i32, ptr %31, i64 %79
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr %80, i64 %82
  store i32 0, ptr %83, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %78
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %13, align 4, !tbaa !9
  br label %72, !llvm.loop !14

87:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %224, %87
  %89 = load i32, ptr %14, align 4, !tbaa !9
  %90 = load i32, ptr %5, align 4, !tbaa !9
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %227

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %220, %93
  %95 = load i32, ptr %16, align 4, !tbaa !9
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = icmp sle i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %223

99:                                               ; preds = %94
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = load i32, ptr %14, align 4, !tbaa !9
  %102 = sub nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i8, ptr %100, i64 %103
  %105 = load i8, ptr %104, align 1, !tbaa !15
  %106 = sext i8 %105 to i32
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load i32, ptr %16, align 4, !tbaa !9
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i8, ptr %107, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !15
  %113 = sext i8 %112 to i32
  %114 = icmp eq i32 %106, %113
  br i1 %114, label %115, label %144

115:                                              ; preds = %99
  %116 = load i32, ptr %14, align 4, !tbaa !9
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = mul nsw i64 %118, %28
  %120 = getelementptr inbounds i32, ptr %31, i64 %119
  %121 = load i32, ptr %16, align 4, !tbaa !9
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %120, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = mul nsw i64 %128, %28
  %130 = getelementptr inbounds i32, ptr %31, i64 %129
  %131 = load i32, ptr %16, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %130, i64 %132
  store i32 %126, ptr %133, align 4, !tbaa !9
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  %135 = load i32, ptr %14, align 4, !tbaa !9
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds ptr, ptr %134, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = load i32, ptr %16, align 4, !tbaa !9
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %139, i64 %142
  store i8 92, ptr %143, align 1, !tbaa !15
  br label %219

144:                                              ; preds = %99
  %145 = load i32, ptr %14, align 4, !tbaa !9
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = mul nsw i64 %147, %28
  %149 = getelementptr inbounds i32, ptr %31, i64 %148
  %150 = load i32, ptr %16, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds i32, ptr %149, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !9
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = mul nsw i64 %155, %28
  %157 = getelementptr inbounds i32, ptr %31, i64 %156
  %158 = load i32, ptr %16, align 4, !tbaa !9
  %159 = sub nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i32, ptr %157, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !9
  %163 = icmp sge i32 %153, %162
  br i1 %163, label %164, label %191

164:                                              ; preds = %144
  %165 = load i32, ptr %14, align 4, !tbaa !9
  %166 = sub nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = mul nsw i64 %167, %28
  %169 = getelementptr inbounds i32, ptr %31, i64 %168
  %170 = load i32, ptr %16, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %169, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !9
  %174 = load i32, ptr %14, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = mul nsw i64 %175, %28
  %177 = getelementptr inbounds i32, ptr %31, i64 %176
  %178 = load i32, ptr %16, align 4, !tbaa !9
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr %177, i64 %179
  store i32 %173, ptr %180, align 4, !tbaa !9
  %181 = load ptr, ptr %10, align 8, !tbaa !5
  %182 = load i32, ptr %14, align 4, !tbaa !9
  %183 = sub nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds ptr, ptr %181, i64 %184
  %186 = load ptr, ptr %185, align 8, !tbaa !5
  %187 = load i32, ptr %16, align 4, !tbaa !9
  %188 = sub nsw i32 %187, 1
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i8, ptr %186, i64 %189
  store i8 124, ptr %190, align 1, !tbaa !15
  br label %218

191:                                              ; preds = %144
  %192 = load i32, ptr %14, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = mul nsw i64 %193, %28
  %195 = getelementptr inbounds i32, ptr %31, i64 %194
  %196 = load i32, ptr %16, align 4, !tbaa !9
  %197 = sub nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i32, ptr %195, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !9
  %201 = load i32, ptr %14, align 4, !tbaa !9
  %202 = sext i32 %201 to i64
  %203 = mul nsw i64 %202, %28
  %204 = getelementptr inbounds i32, ptr %31, i64 %203
  %205 = load i32, ptr %16, align 4, !tbaa !9
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds i32, ptr %204, i64 %206
  store i32 %200, ptr %207, align 4, !tbaa !9
  %208 = load ptr, ptr %10, align 8, !tbaa !5
  %209 = load i32, ptr %14, align 4, !tbaa !9
  %210 = sub nsw i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds ptr, ptr %208, i64 %211
  %213 = load ptr, ptr %212, align 8, !tbaa !5
  %214 = load i32, ptr %16, align 4, !tbaa !9
  %215 = sub nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds i8, ptr %213, i64 %216
  store i8 45, ptr %217, align 1, !tbaa !15
  br label %218

218:                                              ; preds = %191, %164
  br label %219

219:                                              ; preds = %218, %115
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %16, align 4, !tbaa !9
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %16, align 4, !tbaa !9
  br label %94, !llvm.loop !16

223:                                              ; preds = %98
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %14, align 4, !tbaa !9
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %14, align 4, !tbaa !9
  br label %88, !llvm.loop !17

227:                                              ; preds = %92
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %229

229:                                              ; preds = %268, %227
  %230 = load i32, ptr %17, align 4, !tbaa !9
  %231 = load i32, ptr %5, align 4, !tbaa !9
  %232 = icmp slt i32 %230, %231
  br i1 %232, label %234, label %233

233:                                              ; preds = %229
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %271

234:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %235

235:                                              ; preds = %263, %234
  %236 = load i32, ptr %18, align 4, !tbaa !9
  %237 = load i32, ptr %6, align 4, !tbaa !9
  %238 = icmp slt i32 %236, %237
  br i1 %238, label %240, label %239

239:                                              ; preds = %235
  store i32 20, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %266

240:                                              ; preds = %235
  %241 = load i32, ptr %17, align 4, !tbaa !9
  %242 = add nsw i32 %241, 1
  %243 = sext i32 %242 to i64
  %244 = mul nsw i64 %243, %28
  %245 = getelementptr inbounds i32, ptr %31, i64 %244
  %246 = load i32, ptr %18, align 4, !tbaa !9
  %247 = add nsw i32 %246, 1
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds i32, ptr %245, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !9
  %251 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %250)
  %252 = load ptr, ptr %10, align 8, !tbaa !5
  %253 = load i32, ptr %17, align 4, !tbaa !9
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds ptr, ptr %252, i64 %254
  %256 = load ptr, ptr %255, align 8, !tbaa !5
  %257 = load i32, ptr %18, align 4, !tbaa !9
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds i8, ptr %256, i64 %258
  %260 = load i8, ptr %259, align 1, !tbaa !15
  %261 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %251, i8 noundef signext %260)
  %262 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %261, ptr noundef @.str.4)
  br label %263

263:                                              ; preds = %240
  %264 = load i32, ptr %18, align 4, !tbaa !9
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %18, align 4, !tbaa !9
  br label %235, !llvm.loop !18

266:                                              ; preds = %239
  %267 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %268

268:                                              ; preds = %266
  %269 = load i32, ptr %17, align 4, !tbaa !9
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %17, align 4, !tbaa !9
  br label %229, !llvm.loop !19

271:                                              ; preds = %233
  %272 = load ptr, ptr %10, align 8, !tbaa !5
  %273 = load ptr, ptr %3, align 8, !tbaa !5
  %274 = load i32, ptr %5, align 4, !tbaa !9
  %275 = load i32, ptr %6, align 4, !tbaa !9
  call void @_Z8printLcsPPcS_ii(ptr noundef %272, ptr noundef %273, i32 noundef %274, i32 noundef %275)
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %276 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %276)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12stringLengthPc(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #7

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8printLcsPPcS_ii(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #3

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

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9LCSFinderPcS_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = tail call noundef i32 @_Z12stringLengthPc(ptr noundef %0)
  %4 = tail call noundef i32 @_Z12stringLengthPc(ptr noundef %1)
  %5 = add i32 %3, 1
  %6 = zext i32 %5 to i64
  %7 = add i32 %4, 1
  %8 = zext i32 %7 to i64
  %9 = mul nuw i64 %8, %6
  %10 = alloca i32, i64 %9, align 16
  %11 = zext i32 %3 to i64
  %12 = icmp slt i32 %3, 0
  %13 = shl nuw nsw i64 %11, 3
  %14 = select i1 %12, i64 -1, i64 %13
  %15 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %14) #6
  %16 = icmp sgt i32 %3, 0
  br i1 %16, label %.lr.ph, label %.preheader85

.lr.ph:                                           ; preds = %2
  %17 = sext i32 %4 to i64
  br label %19

.preheader85:                                     ; preds = %19, %2
  br i1 %12, label %.preheader84, label %.lr.ph89.preheader

.lr.ph89.preheader:                               ; preds = %.preheader85
  %xtraiter = and i64 %6, 3
  %18 = icmp ult i32 %5, 4
  br i1 %18, label %.preheader84.loopexit.unr-lcssa, label %.lr.ph89.preheader.new

.lr.ph89.preheader.new:                           ; preds = %.lr.ph89.preheader
  %unroll_iter = and i64 %6, 4294967292
  br label %.lr.ph89

19:                                               ; preds = %.lr.ph, %19
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %19 ]
  %20 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %17) #6
  %21 = getelementptr inbounds ptr, ptr %15, i64 %indvars.iv
  store ptr %20, ptr %21, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %11
  br i1 %exitcond.not, label %.preheader85, label %19, !llvm.loop !9

.preheader84.loopexit.unr-lcssa:                  ; preds = %.lr.ph89, %.lr.ph89.preheader
  %indvars.iv107.unr = phi i64 [ 0, %.lr.ph89.preheader ], [ %indvars.iv.next108.3, %.lr.ph89 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader84, label %.lr.ph89.epil

.lr.ph89.epil:                                    ; preds = %.preheader84.loopexit.unr-lcssa, %.lr.ph89.epil
  %indvars.iv107.epil = phi i64 [ %indvars.iv.next108.epil, %.lr.ph89.epil ], [ %indvars.iv107.unr, %.preheader84.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph89.epil ], [ 0, %.preheader84.loopexit.unr-lcssa ]
  %22 = mul nuw nsw i64 %indvars.iv107.epil, %8
  %23 = getelementptr inbounds i32, ptr %10, i64 %22
  store i32 0, ptr %23, align 4, !tbaa !11
  %indvars.iv.next108.epil = add nuw nsw i64 %indvars.iv107.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader84, label %.lr.ph89.epil, !llvm.loop !13

.preheader84:                                     ; preds = %.preheader84.loopexit.unr-lcssa, %.lr.ph89.epil, %.preheader85
  %.not7890 = icmp slt i32 %4, 0
  br i1 %.not7890, label %.preheader83, label %.lr.ph92.preheader

.lr.ph92.preheader:                               ; preds = %.preheader84
  %24 = shl nuw nsw i64 %8, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %10, i8 0, i64 %24, i1 false), !tbaa !11
  br label %.preheader83

.lr.ph89:                                         ; preds = %.lr.ph89, %.lr.ph89.preheader.new
  %indvars.iv107 = phi i64 [ 0, %.lr.ph89.preheader.new ], [ %indvars.iv.next108.3, %.lr.ph89 ]
  %niter = phi i64 [ 0, %.lr.ph89.preheader.new ], [ %niter.next.3, %.lr.ph89 ]
  %25 = mul nuw nsw i64 %indvars.iv107, %8
  %26 = getelementptr inbounds i32, ptr %10, i64 %25
  store i32 0, ptr %26, align 16, !tbaa !11
  %indvars.iv.next108 = or disjoint i64 %indvars.iv107, 1
  %27 = mul nuw nsw i64 %indvars.iv.next108, %8
  %28 = getelementptr inbounds i32, ptr %10, i64 %27
  store i32 0, ptr %28, align 4, !tbaa !11
  %indvars.iv.next108.1 = or disjoint i64 %indvars.iv107, 2
  %29 = mul nuw nsw i64 %indvars.iv.next108.1, %8
  %30 = getelementptr inbounds i32, ptr %10, i64 %29
  store i32 0, ptr %30, align 8, !tbaa !11
  %indvars.iv.next108.2 = or disjoint i64 %indvars.iv107, 3
  %31 = mul nuw nsw i64 %indvars.iv.next108.2, %8
  %32 = getelementptr inbounds i32, ptr %10, i64 %31
  store i32 0, ptr %32, align 4, !tbaa !11
  %indvars.iv.next108.3 = add nuw nsw i64 %indvars.iv107, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader84.loopexit.unr-lcssa, label %.lr.ph89, !llvm.loop !15

.preheader83:                                     ; preds = %.lr.ph92.preheader, %.preheader84
  %.not7996 = icmp slt i32 %3, 1
  br i1 %.not7996, label %._crit_edge98.thread136, label %.preheader82.lr.ph

._crit_edge98.thread136:                          ; preds = %.preheader83
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  br label %._crit_edge103

.preheader82.lr.ph:                               ; preds = %.preheader83
  %.not8093 = icmp slt i32 %4, 1
  br i1 %.not8093, label %.preheader.lr.ph.thread, label %.preheader82

.preheader.lr.ph.thread:                          ; preds = %.preheader82.lr.ph
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  br label %.preheader

.preheader82:                                     ; preds = %.preheader82.lr.ph, %._crit_edge
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %._crit_edge ], [ 1, %.preheader82.lr.ph ]
  %35 = add nsw i64 %indvars.iv120, -1
  %36 = getelementptr inbounds i8, ptr %0, i64 %35
  %37 = mul nuw nsw i64 %35, %8
  %38 = getelementptr inbounds i32, ptr %10, i64 %37
  %39 = mul nuw nsw i64 %indvars.iv120, %8
  %40 = getelementptr inbounds i32, ptr %10, i64 %39
  %41 = getelementptr inbounds ptr, ptr %15, i64 %35
  br label %56

._crit_edge98:                                    ; preds = %._crit_edge
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  br i1 %16, label %.preheader.us.preheader, label %._crit_edge103

.preheader.us.preheader:                          ; preds = %._crit_edge98
  %wide.trip.count129 = zext nneg i32 %4 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge101.us
  %indvars.iv131 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next132, %._crit_edge101.us ]
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %43 = mul nuw nsw i64 %indvars.iv.next132, %8
  %44 = getelementptr inbounds i32, ptr %10, i64 %43
  %45 = getelementptr inbounds ptr, ptr %15, i64 %indvars.iv131
  br label %46

46:                                               ; preds = %.preheader.us, %46
  %indvars.iv126 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next127, %46 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %47 = getelementptr inbounds i32, ptr %44, i64 %indvars.iv.next127
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %48)
  %50 = load ptr, ptr %45, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 %indvars.iv126
  %52 = load i8, ptr %51, align 1, !tbaa !16
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %49, i8 noundef signext %52)
  %54 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @.str.4)
  %exitcond130.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count129
  br i1 %exitcond130.not, label %._crit_edge101.us, label %46, !llvm.loop !17

._crit_edge101.us:                                ; preds = %46
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %exitcond135.not = icmp eq i64 %indvars.iv.next132, %11
  br i1 %exitcond135.not, label %._crit_edge103, label %.preheader.us, !llvm.loop !18

._crit_edge:                                      ; preds = %75
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %exitcond124.not = icmp eq i64 %indvars.iv.next121, %6
  br i1 %exitcond124.not, label %._crit_edge98, label %.preheader82, !llvm.loop !19

56:                                               ; preds = %.preheader82, %75
  %indvars.iv115 = phi i64 [ 1, %.preheader82 ], [ %indvars.iv.next116, %75 ]
  %57 = load i8, ptr %36, align 1, !tbaa !16
  %58 = add nsw i64 %indvars.iv115, -1
  %59 = getelementptr inbounds i8, ptr %1, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !16
  %61 = icmp eq i8 %57, %60
  br i1 %61, label %62, label %67

62:                                               ; preds = %56
  %63 = getelementptr inbounds i32, ptr %38, i64 %58
  %64 = load i32, ptr %63, align 4, !tbaa !11
  %65 = add nsw i32 %64, 1
  %66 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv115
  store i32 %65, ptr %66, align 4, !tbaa !11
  br label %75

67:                                               ; preds = %56
  %68 = getelementptr inbounds i32, ptr %38, i64 %indvars.iv115
  %69 = load i32, ptr %68, align 4, !tbaa !11
  %70 = getelementptr inbounds i32, ptr %40, i64 %58
  %71 = load i32, ptr %70, align 4, !tbaa !11
  %.not81 = icmp slt i32 %69, %71
  %72 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv115
  br i1 %.not81, label %74, label %73

73:                                               ; preds = %67
  store i32 %69, ptr %72, align 4, !tbaa !11
  br label %75

74:                                               ; preds = %67
  store i32 %71, ptr %72, align 4, !tbaa !11
  br label %75

75:                                               ; preds = %62, %74, %73
  %.sink = phi i8 [ 92, %62 ], [ 45, %74 ], [ 124, %73 ]
  %76 = load ptr, ptr %41, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 %58
  store i8 %.sink, ptr %77, align 1, !tbaa !16
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next116, %8
  br i1 %exitcond119.not, label %._crit_edge, label %56, !llvm.loop !20

.preheader:                                       ; preds = %.preheader.lr.ph.thread, %.preheader
  %.069102 = phi i32 [ %79, %.preheader ], [ 0, %.preheader.lr.ph.thread ]
  %78 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %79 = add nuw nsw i32 %.069102, 1
  %exitcond125.not = icmp eq i32 %79, %3
  br i1 %exitcond125.not, label %._crit_edge103, label %.preheader, !llvm.loop !18

._crit_edge103:                                   ; preds = %._crit_edge101.us, %.preheader, %._crit_edge98.thread136, %._crit_edge98
  tail call void @_Z8printLcsPPcS_ii(ptr noundef nonnull %15, ptr noundef %0, i32 noundef %3, i32 noundef %4)
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z12stringLengthPc(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #0

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8printLcsPPcS_ii(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

attributes #0 = { 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 #1 = { 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 = { 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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { builtin allocsize(0) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass