; LLVM IR from ravireddy07/cpp-book :: src/Subsequences/PrintLCS.ll/Z3LCSNSt7 (cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_)

; 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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3LCSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [1000 x [1000 x i32]], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %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 ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = 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 4000000, ptr %5) #7
  call void @llvm.memset.p0.i64(ptr align 16 %5, i8 0, i64 4000000, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %20 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %22 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %23 = trunc i64 %22 to i32
  store i32 %23, ptr %7, align 4, !tbaa !9
  %24 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 0
  %25 = getelementptr inbounds [1000 x i32], ptr %24, i64 0, i64 0
  store i32 0, ptr %25, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %36, %2
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %33
  %35 = getelementptr inbounds [1000 x i32], ptr %34, i64 0, i64 0
  store i32 0, ptr %35, align 16, !tbaa !9
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %8, align 4, !tbaa !9
  br label %26, !llvm.loop !11

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %50, %39
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %53

45:                                               ; preds = %40
  %46 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 0
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1000 x i32], ptr %46, i64 0, i64 %48
  store i32 0, ptr %49, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %45
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %9, align 4, !tbaa !9
  br label %40, !llvm.loop !13

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %124, %53
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %127

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

60:                                               ; preds = %120, %59
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %123

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

79:                                               ; preds = %65
  %80 = load i32, ptr %10, align 4, !tbaa !9
  %81 = sub nsw i32 %80, 1
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %82
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1000 x i32], ptr %83, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = add nsw i32 1, %88
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %91
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [1000 x i32], ptr %92, i64 0, i64 %94
  store i32 %89, ptr %95, align 4, !tbaa !9
  br label %119

96:                                               ; preds = %65
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %98
  %100 = load i32, ptr %12, align 4, !tbaa !9
  %101 = sub nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1000 x i32], ptr %99, i64 0, i64 %102
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %106
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1000 x i32], ptr %107, i64 0, i64 %109
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %103, ptr noundef nonnull align 4 dereferenceable(4) %110)
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %114
  %116 = load i32, ptr %12, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1000 x i32], ptr %115, i64 0, i64 %117
  store i32 %112, ptr %118, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %96, %79
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %12, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %12, align 4, !tbaa !9
  br label %60, !llvm.loop !15

123:                                              ; preds = %64
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %10, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %10, align 4, !tbaa !9
  br label %54, !llvm.loop !16

127:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %128 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %128, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %129 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %129, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %130 = load i32, ptr %6, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %131
  %133 = load i32, ptr %7, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [1000 x i32], ptr %132, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !9
  store i32 %136, ptr %15, align 4, !tbaa !9
  %137 = load i32, ptr %15, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  %139 = zext i32 %138 to i64
  %140 = call ptr @llvm.stacksave.p0()
  store ptr %140, ptr %16, align 8
  %141 = alloca i8, i64 %139, align 16
  store i64 %139, ptr %17, align 8
  %142 = load i32, ptr %15, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i8, ptr %141, i64 %143
  store i8 0, ptr %144, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %145 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %145, ptr %18, align 4, !tbaa !9
  br label %146

146:                                              ; preds = %209, %127
  %147 = load i32, ptr %13, align 4, !tbaa !9
  %148 = icmp sgt i32 %147, 0
  br i1 %148, label %149, label %152

149:                                              ; preds = %146
  %150 = load i32, ptr %14, align 4, !tbaa !9
  %151 = icmp sgt i32 %150, 0
  br label %152

152:                                              ; preds = %149, %146
  %153 = phi i1 [ false, %146 ], [ %151, %149 ]
  br i1 %153, label %154, label %210

154:                                              ; preds = %152
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = sub nsw i32 %155, 1
  %157 = sext i32 %156 to i64
  %158 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %157)
  %159 = load i8, ptr %158, align 1, !tbaa !14
  %160 = sext i8 %159 to i32
  %161 = load i32, ptr %14, align 4, !tbaa !9
  %162 = sub nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %163)
  %165 = load i8, ptr %164, align 1, !tbaa !14
  %166 = sext i8 %165 to i32
  %167 = icmp eq i32 %160, %166
  br i1 %167, label %168, label %184

168:                                              ; preds = %154
  %169 = load i32, ptr %13, align 4, !tbaa !9
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %171)
  %173 = load i8, ptr %172, align 1, !tbaa !14
  %174 = load i32, ptr %15, align 4, !tbaa !9
  %175 = sub nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i8, ptr %141, i64 %176
  store i8 %173, ptr %177, align 1, !tbaa !14
  %178 = load i32, ptr %13, align 4, !tbaa !9
  %179 = add nsw i32 %178, -1
  store i32 %179, ptr %13, align 4, !tbaa !9
  %180 = load i32, ptr %14, align 4, !tbaa !9
  %181 = add nsw i32 %180, -1
  store i32 %181, ptr %14, align 4, !tbaa !9
  %182 = load i32, ptr %15, align 4, !tbaa !9
  %183 = add nsw i32 %182, -1
  store i32 %183, ptr %15, align 4, !tbaa !9
  br label %209

184:                                              ; preds = %154
  %185 = load i32, ptr %13, align 4, !tbaa !9
  %186 = sub nsw i32 %185, 1
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %187
  %189 = load i32, ptr %14, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [1000 x i32], ptr %188, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !9
  %193 = load i32, ptr %13, align 4, !tbaa !9
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [1000 x [1000 x i32]], ptr %5, i64 0, i64 %194
  %196 = load i32, ptr %14, align 4, !tbaa !9
  %197 = sub nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [1000 x i32], ptr %195, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !9
  %201 = icmp sgt i32 %192, %200
  br i1 %201, label %202, label %205

202:                                              ; preds = %184
  %203 = load i32, ptr %13, align 4, !tbaa !9
  %204 = add nsw i32 %203, -1
  store i32 %204, ptr %13, align 4, !tbaa !9
  br label %208

205:                                              ; preds = %184
  %206 = load i32, ptr %14, align 4, !tbaa !9
  %207 = add nsw i32 %206, -1
  store i32 %207, ptr %14, align 4, !tbaa !9
  br label %208

208:                                              ; preds = %205, %202
  br label %209

209:                                              ; preds = %208, %168
  br label %146, !llvm.loop !17

210:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %211

211:                                              ; preds = %222, %210
  %212 = load i32, ptr %19, align 4, !tbaa !9
  %213 = load i32, ptr %18, align 4, !tbaa !9
  %214 = icmp slt i32 %212, %213
  br i1 %214, label %216, label %215

215:                                              ; preds = %211
  store i32 16, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %225

216:                                              ; preds = %211
  %217 = load i32, ptr %19, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds i8, ptr %141, i64 %218
  %220 = load i8, ptr %219, align 1, !tbaa !14
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %220)
  br label %222

222:                                              ; preds = %216
  %223 = load i32, ptr %19, align 4, !tbaa !9
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %19, align 4, !tbaa !9
  br label %211, !llvm.loop !18

225:                                              ; preds = %215
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  %227 = load ptr, ptr %16, align 8
  call void @llvm.stackrestore.p0(ptr %227)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4000000, ptr %5) #7
  ret void
}

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

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

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

; 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 noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 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
declare ptr @llvm.stacksave.p0() #5

; 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) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3LCSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [1000 x [1000 x i32]], align 16
  call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %3) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000000) %3, i8 0, i64 4000000, i1 false)
  %4 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  %5 = trunc i64 %4 to i32
  %6 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %7 = trunc i64 %6 to i32
  store i32 0, ptr %3, align 16, !tbaa !5
  %.not71 = icmp slt i32 %5, 0
  br i1 %.not71, label %.preheader70, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %8 = add nuw nsw i64 %4, 1
  %wide.trip.count = and i64 %8, 4294967295
  %9 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %8, 3
  %10 = icmp ult i64 %9, 3
  br i1 %10, label %.preheader70.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph

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

.lr.ph.epil:                                      ; preds = %.preheader70.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader70.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader70.loopexit.unr-lcssa ]
  %11 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %indvars.iv.epil
  store i32 0, ptr %11, align 16, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.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 %.preheader70, label %.lr.ph.epil, !llvm.loop !9

.preheader70:                                     ; preds = %.preheader70.loopexit.unr-lcssa, %.lr.ph.epil, %2
  %.not6373 = icmp slt i32 %7, 0
  br i1 %.not6373, label %.preheader69, label %.lr.ph75.preheader

.lr.ph75.preheader:                               ; preds = %.preheader70
  %12 = shl i64 %6, 2
  %13 = add nuw nsw i64 %12, 4
  %14 = and i64 %13, 17179869180
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %3, i8 0, i64 %14, i1 false), !tbaa !5
  br label %.preheader69

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %15 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %indvars.iv
  store i32 0, ptr %15, align 16, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %16 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %16, align 16, !tbaa !5
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %17 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %indvars.iv.next.1
  store i32 0, ptr %17, align 16, !tbaa !5
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %18 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %indvars.iv.next.2
  store i32 0, ptr %18, align 16, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 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 %.preheader70.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

.preheader69:                                     ; preds = %.lr.ph75.preheader, %.preheader70
  %.not6479 = icmp slt i32 %5, 1
  %.not6676 = icmp slt i32 %7, 1
  %or.cond = or i1 %.not6479, %.not6676
  br i1 %or.cond, label %._crit_edge81, label %.preheader68.preheader

.preheader68.preheader:                           ; preds = %.preheader69
  %19 = add nuw nsw i64 %6, 1
  %20 = add nuw nsw i64 %4, 1
  %wide.trip.count103 = and i64 %20, 4294967295
  %wide.trip.count98 = and i64 %19, 4294967295
  br label %.preheader68

.preheader68:                                     ; preds = %.preheader68.preheader, %._crit_edge
  %indvars.iv100 = phi i64 [ 1, %.preheader68.preheader ], [ %indvars.iv.next101, %._crit_edge ]
  %21 = add nsw i64 %indvars.iv100, -1
  br label %35

._crit_edge81:                                    ; preds = %._crit_edge, %.preheader69
  %sext = shl i64 %4, 32
  %22 = ashr exact i64 %sext, 32
  %sext65 = shl i64 %6, 32
  %23 = ashr exact i64 %sext65, 32
  %24 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %22, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = zext i32 %26 to i64
  %28 = call ptr @llvm.stacksave.p0()
  %29 = alloca i8, i64 %27, align 16
  %30 = sext i32 %25 to i64
  %31 = getelementptr inbounds i8, ptr %29, i64 %30
  store i8 0, ptr %31, align 1, !tbaa !13
  %invariant.gep = getelementptr i8, ptr %29, i64 -1
  %32 = icmp sgt i32 %5, 0
  %33 = icmp sgt i32 %7, 0
  %34 = and i1 %32, %33
  br i1 %34, label %.lr.ph86, label %.preheader

._crit_edge:                                      ; preds = %51
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count103
  br i1 %exitcond104.not, label %._crit_edge81, label %.preheader68, !llvm.loop !14

35:                                               ; preds = %.preheader68, %51
  %indvars.iv95 = phi i64 [ 1, %.preheader68 ], [ %indvars.iv.next96, %51 ]
  %36 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %21)
  %37 = load i8, ptr %36, align 1, !tbaa !13
  %38 = add nsw i64 %indvars.iv95, -1
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %38)
  %40 = load i8, ptr %39, align 1, !tbaa !13
  %41 = icmp eq i8 %37, %40
  br i1 %41, label %42, label %46

42:                                               ; preds = %35
  %43 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %21, i64 %38
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  br label %51

46:                                               ; preds = %35
  %47 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %indvars.iv100, i64 %38
  %48 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %21, i64 %indvars.iv95
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %47, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %42, %46
  %.sink = phi i32 [ %45, %42 ], [ %50, %46 ]
  %52 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %indvars.iv100, i64 %indvars.iv95
  store i32 %.sink, ptr %52, align 4
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98
  br i1 %exitcond99.not, label %._crit_edge, label %35, !llvm.loop !15

.preheader:                                       ; preds = %76, %._crit_edge81
  %53 = icmp sgt i32 %25, 0
  br i1 %53, label %.lr.ph88.preheader, label %._crit_edge89

.lr.ph88.preheader:                               ; preds = %.preheader
  %wide.trip.count108 = zext nneg i32 %25 to i64
  br label %.lr.ph88

.lr.ph86:                                         ; preds = %._crit_edge81, %76
  %.05584 = phi i32 [ %.1, %76 ], [ %25, %._crit_edge81 ]
  %.05683 = phi i32 [ %.157, %76 ], [ %7, %._crit_edge81 ]
  %.05882 = phi i32 [ %.159, %76 ], [ %5, %._crit_edge81 ]
  %54 = add nsw i32 %.05882, -1
  %55 = zext nneg i32 %54 to i64
  %56 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %55)
  %57 = load i8, ptr %56, align 1, !tbaa !13
  %58 = add nsw i32 %.05683, -1
  %59 = zext nneg i32 %58 to i64
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %59)
  %61 = load i8, ptr %60, align 1, !tbaa !13
  %62 = icmp eq i8 %57, %61
  br i1 %62, label %63, label %68

63:                                               ; preds = %.lr.ph86
  %64 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %55)
  %65 = load i8, ptr %64, align 1, !tbaa !13
  %66 = sext i32 %.05584 to i64
  %gep = getelementptr i8, ptr %invariant.gep, i64 %66
  store i8 %65, ptr %gep, align 1, !tbaa !13
  %67 = add nsw i32 %.05584, -1
  br label %76

68:                                               ; preds = %.lr.ph86
  %69 = zext nneg i32 %.05683 to i64
  %70 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %55, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = zext nneg i32 %.05882 to i64
  %73 = getelementptr inbounds [1000 x [1000 x i32]], ptr %3, i64 0, i64 %72, i64 %59
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp sgt i32 %71, %74
  %spec.select = select i1 %75, i32 %54, i32 %.05882
  %spec.select67 = select i1 %75, i32 %.05683, i32 %58
  br label %76

76:                                               ; preds = %68, %63
  %.159 = phi i32 [ %54, %63 ], [ %spec.select, %68 ]
  %.157 = phi i32 [ %58, %63 ], [ %spec.select67, %68 ]
  %.1 = phi i32 [ %67, %63 ], [ %.05584, %68 ]
  %77 = icmp sgt i32 %.159, 0
  %78 = icmp sgt i32 %.157, 0
  %79 = select i1 %77, i1 %78, i1 false
  br i1 %79, label %.lr.ph86, label %.preheader, !llvm.loop !16

._crit_edge89:                                    ; preds = %.lr.ph88, %.preheader
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %28)
  call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %3) #7
  ret void

.lr.ph88:                                         ; preds = %.lr.ph88.preheader, %.lr.ph88
  %indvars.iv105 = phi i64 [ 0, %.lr.ph88.preheader ], [ %indvars.iv.next106, %.lr.ph88 ]
  %81 = getelementptr inbounds i8, ptr %29, i64 %indvars.iv105
  %82 = load i8, ptr %81, align 1, !tbaa !13
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %82)
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
  br i1 %exitcond109.not, label %._crit_edge89, label %.lr.ph88, !llvm.loop !17
}

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

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

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

; 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 noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 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 #4

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

; 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 #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { 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.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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