; LLVM IR from codeIIEST/Algorithms :: Competitive Coding/Dynamic Programming/Edit Distance (SPOJ_edist)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@dp = external dso_local global [2002 x [2002 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca [20001 x i8], align 16
  %8 = alloca [20001 x i8], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 20001, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 20001, ptr %8) #5
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  br label %10

10:                                               ; preds = %195, %0
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = add nsw i64 %11, -1
  store i64 %12, ptr %2, align 8, !tbaa !5
  %13 = icmp ne i64 %11, 0
  br i1 %13, label %14, label %203

14:                                               ; preds = %10
  %15 = getelementptr inbounds [20001 x i8], ptr %7, i64 0, i64 0
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %15)
  %17 = getelementptr inbounds [20001 x i8], ptr %8, i64 0, i64 0
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %17)
  %19 = getelementptr inbounds [20001 x i8], ptr %7, i64 0, i64 0
  %20 = call i64 @strlen(ptr noundef %19) #6
  store i64 %20, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds [20001 x i8], ptr %8, i64 0, i64 0
  %22 = call i64 @strlen(ptr noundef %21) #6
  store i64 %22, ptr %4, align 8, !tbaa !5
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = add nsw i64 %23, 1
  %25 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %24
  %26 = load i64, ptr %4, align 8, !tbaa !5
  %27 = add nsw i64 %26, 1
  %28 = getelementptr inbounds [2002 x i64], ptr %25, i64 0, i64 %27
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %192, %14
  %30 = load i64, ptr %5, align 8, !tbaa !5
  %31 = load i64, ptr %3, align 8, !tbaa !5
  %32 = add nsw i64 %31, 1
  %33 = icmp slt i64 %30, %32
  br i1 %33, label %34, label %195

34:                                               ; preds = %29
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %187, %34
  %36 = load i64, ptr %6, align 8, !tbaa !5
  %37 = load i64, ptr %4, align 8, !tbaa !5
  %38 = add nsw i64 %37, 1
  %39 = icmp slt i64 %36, %38
  br i1 %39, label %40, label %190

40:                                               ; preds = %35
  %41 = load i64, ptr %5, align 8, !tbaa !5
  %42 = icmp eq i64 %41, 0
  br i1 %42, label %43, label %49

43:                                               ; preds = %40
  %44 = load i64, ptr %6, align 8, !tbaa !5
  %45 = load i64, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %45
  %47 = load i64, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds [2002 x i64], ptr %46, i64 0, i64 %47
  store i64 %44, ptr %48, align 8, !tbaa !5
  br label %179

49:                                               ; preds = %40
  %50 = load i64, ptr %6, align 8, !tbaa !5
  %51 = icmp eq i64 %50, 0
  br i1 %51, label %52, label %58

52:                                               ; preds = %49
  %53 = load i64, ptr %5, align 8, !tbaa !5
  %54 = load i64, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %54
  %56 = load i64, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds [2002 x i64], ptr %55, i64 0, i64 %56
  store i64 %53, ptr %57, align 8, !tbaa !5
  br label %178

58:                                               ; preds = %49
  %59 = load i64, ptr %5, align 8, !tbaa !5
  %60 = sub nsw i64 %59, 1
  %61 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %60
  %62 = load i64, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds [2002 x i64], ptr %61, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %65 = add nsw i64 %64, 1
  %66 = load i64, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %66
  %68 = load i64, ptr %6, align 8, !tbaa !5
  %69 = sub nsw i64 %68, 1
  %70 = getelementptr inbounds [2002 x i64], ptr %67, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = add nsw i64 %71, 1
  %73 = icmp slt i64 %65, %72
  br i1 %73, label %74, label %82

74:                                               ; preds = %58
  %75 = load i64, ptr %5, align 8, !tbaa !5
  %76 = sub nsw i64 %75, 1
  %77 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %76
  %78 = load i64, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds [2002 x i64], ptr %77, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = add nsw i64 %80, 1
  br label %90

82:                                               ; preds = %58
  %83 = load i64, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %83
  %85 = load i64, ptr %6, align 8, !tbaa !5
  %86 = sub nsw i64 %85, 1
  %87 = getelementptr inbounds [2002 x i64], ptr %84, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = add nsw i64 %88, 1
  br label %90

90:                                               ; preds = %82, %74
  %91 = phi i64 [ %81, %74 ], [ %89, %82 ]
  %92 = load i64, ptr %5, align 8, !tbaa !5
  %93 = sub nsw i64 %92, 1
  %94 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %93
  %95 = load i64, ptr %6, align 8, !tbaa !5
  %96 = sub nsw i64 %95, 1
  %97 = getelementptr inbounds [2002 x i64], ptr %94, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = load i64, ptr %5, align 8, !tbaa !5
  %100 = sub nsw i64 %99, 1
  %101 = getelementptr inbounds [20001 x i8], ptr %7, i64 0, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !9
  %103 = sext i8 %102 to i32
  %104 = load i64, ptr %6, align 8, !tbaa !5
  %105 = sub nsw i64 %104, 1
  %106 = getelementptr inbounds [20001 x i8], ptr %8, i64 0, i64 %105
  %107 = load i8, ptr %106, align 1, !tbaa !9
  %108 = sext i8 %107 to i32
  %109 = icmp eq i32 %103, %108
  %110 = zext i1 %109 to i64
  %111 = select i1 %109, i32 0, i32 100
  %112 = sext i32 %111 to i64
  %113 = add nsw i64 %98, %112
  %114 = icmp slt i64 %91, %113
  br i1 %114, label %115, label %149

115:                                              ; preds = %90
  %116 = load i64, ptr %5, align 8, !tbaa !5
  %117 = sub nsw i64 %116, 1
  %118 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %117
  %119 = load i64, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds [2002 x i64], ptr %118, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !5
  %122 = add nsw i64 %121, 1
  %123 = load i64, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %123
  %125 = load i64, ptr %6, align 8, !tbaa !5
  %126 = sub nsw i64 %125, 1
  %127 = getelementptr inbounds [2002 x i64], ptr %124, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !5
  %129 = add nsw i64 %128, 1
  %130 = icmp slt i64 %122, %129
  br i1 %130, label %131, label %139

131:                                              ; preds = %115
  %132 = load i64, ptr %5, align 8, !tbaa !5
  %133 = sub nsw i64 %132, 1
  %134 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %133
  %135 = load i64, ptr %6, align 8, !tbaa !5
  %136 = getelementptr inbounds [2002 x i64], ptr %134, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !5
  %138 = add nsw i64 %137, 1
  br label %147

139:                                              ; preds = %115
  %140 = load i64, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %140
  %142 = load i64, ptr %6, align 8, !tbaa !5
  %143 = sub nsw i64 %142, 1
  %144 = getelementptr inbounds [2002 x i64], ptr %141, i64 0, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !5
  %146 = add nsw i64 %145, 1
  br label %147

147:                                              ; preds = %139, %131
  %148 = phi i64 [ %138, %131 ], [ %146, %139 ]
  br label %172

149:                                              ; preds = %90
  %150 = load i64, ptr %5, align 8, !tbaa !5
  %151 = sub nsw i64 %150, 1
  %152 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %151
  %153 = load i64, ptr %6, align 8, !tbaa !5
  %154 = sub nsw i64 %153, 1
  %155 = getelementptr inbounds [2002 x i64], ptr %152, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !5
  %157 = load i64, ptr %5, align 8, !tbaa !5
  %158 = sub nsw i64 %157, 1
  %159 = getelementptr inbounds [20001 x i8], ptr %7, i64 0, i64 %158
  %160 = load i8, ptr %159, align 1, !tbaa !9
  %161 = sext i8 %160 to i32
  %162 = load i64, ptr %6, align 8, !tbaa !5
  %163 = sub nsw i64 %162, 1
  %164 = getelementptr inbounds [20001 x i8], ptr %8, i64 0, i64 %163
  %165 = load i8, ptr %164, align 1, !tbaa !9
  %166 = sext i8 %165 to i32
  %167 = icmp eq i32 %161, %166
  %168 = zext i1 %167 to i64
  %169 = select i1 %167, i32 0, i32 100
  %170 = sext i32 %169 to i64
  %171 = add nsw i64 %156, %170
  br label %172

172:                                              ; preds = %149, %147
  %173 = phi i64 [ %148, %147 ], [ %171, %149 ]
  %174 = load i64, ptr %5, align 8, !tbaa !5
  %175 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %174
  %176 = load i64, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds [2002 x i64], ptr %175, i64 0, i64 %176
  store i64 %173, ptr %177, align 8, !tbaa !5
  br label %178

178:                                              ; preds = %172, %52
  br label %179

179:                                              ; preds = %178, %43
  %180 = load i64, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %180
  %182 = load i64, ptr %6, align 8, !tbaa !5
  %183 = getelementptr inbounds [2002 x i64], ptr %181, i64 0, i64 %182
  %184 = load i64, ptr %183, align 8, !tbaa !5
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %184)
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %185, ptr noundef @.str)
  br label %187

187:                                              ; preds = %179
  %188 = load i64, ptr %6, align 8, !tbaa !5
  %189 = add nsw i64 %188, 1
  store i64 %189, ptr %6, align 8, !tbaa !5
  br label %35, !llvm.loop !10

190:                                              ; preds = %35
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %192

192:                                              ; preds = %190
  %193 = load i64, ptr %5, align 8, !tbaa !5
  %194 = add nsw i64 %193, 1
  store i64 %194, ptr %5, align 8, !tbaa !5
  br label %29, !llvm.loop !12

195:                                              ; preds = %29
  %196 = load i64, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %196
  %198 = load i64, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds [2002 x i64], ptr %197, i64 0, i64 %198
  %200 = load i64, ptr %199, align 8, !tbaa !5
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %200)
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %201, ptr noundef @.str.1)
  br label %10, !llvm.loop !13

203:                                              ; preds = %10
  call void @llvm.lifetime.end.p0(i64 20001, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 20001, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

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

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

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

attributes #0 = { mustprogress norecurse 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 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(read) "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 }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}


; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@dp = external dso_local local_unnamed_addr global [2002 x [2002 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca [20001 x i8], align 16
  %3 = alloca [20001 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 20001, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 20001, ptr nonnull %3) #6
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %5 = load i64, ptr %1, align 8, !tbaa !5
  %6 = add nsw i64 %5, -1
  store i64 %6, ptr %1, align 8, !tbaa !5
  %.not60 = icmp eq i64 %5, 0
  br i1 %.not60, label %._crit_edge62, label %.lr.ph

.lr.ph:                                           ; preds = %0, %._crit_edge59
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %2)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef %3)
  %9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #7
  %10 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #7
  %.not5256 = icmp slt i64 %9, 0
  br i1 %.not5256, label %._crit_edge59, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.lr.ph
  %.not5354 = icmp slt i64 %10, 0
  br i1 %.not5354, label %.preheader.us, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %exitcond.peel.not = icmp eq i64 %10, 0
  br label %.preheader

.preheader.us:                                    ; preds = %.preheader.lr.ph, %.preheader.us
  %.04657.us = phi i64 [ %12, %.preheader.us ], [ 0, %.preheader.lr.ph ]
  %11 = 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.1)
  %12 = add nuw i64 %.04657.us, 1
  %exitcond68.not = icmp eq i64 %.04657.us, %9
  br i1 %exitcond68.not, label %._crit_edge59, label %.preheader.us, !llvm.loop !9

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %.04657 = phi i64 [ %52, %._crit_edge ], [ 0, %.preheader.preheader ]
  %13 = icmp eq i64 %.04657, 0
  %14 = add nsw i64 %.04657, -1
  %15 = getelementptr inbounds [20001 x i8], ptr %2, i64 0, i64 %14
  br i1 %13, label %.lr.ph.split.us, label %16

16:                                               ; preds = %.preheader
  %17 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %.04657
  store i64 %.04657, ptr %17, align 16, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.04657)
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @.str)
  br i1 %exitcond.peel.not, label %._crit_edge, label %.lr.ph.split.peel.next

.lr.ph.split.us:                                  ; preds = %.preheader, %.lr.ph.split.us
  %.055.us = phi i64 [ %23, %.lr.ph.split.us ], [ 0, %.preheader ]
  %20 = getelementptr inbounds [2002 x i64], ptr @dp, i64 0, i64 %.055.us
  store i64 %.055.us, ptr %20, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.055.us)
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @.str)
  %23 = add nuw i64 %.055.us, 1
  %exitcond66.not = icmp eq i64 %.055.us, %10
  br i1 %exitcond66.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !11

.lr.ph.split.peel.next:                           ; preds = %16, %45
  %.055 = phi i64 [ %50, %45 ], [ 1, %16 ]
  %24 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %14, i64 %.055
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = add nsw i64 %.055, -1
  %27 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %.04657, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %. = call i64 @llvm.smin.i64(i64 %25, i64 %28)
  %29 = add nsw i64 %., 1
  %30 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %14, i64 %26
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = load i8, ptr %15, align 1, !tbaa !12
  %33 = getelementptr inbounds [20001 x i8], ptr %3, i64 0, i64 %26
  %34 = load i8, ptr %33, align 1, !tbaa !12
  %35 = icmp eq i8 %32, %34
  %36 = select i1 %35, i64 0, i64 100
  %37 = add nsw i64 %36, %31
  %38 = icmp slt i64 %29, %37
  br i1 %38, label %39, label %45

39:                                               ; preds = %.lr.ph.split.peel.next
  %40 = icmp slt i64 %25, %28
  br i1 %40, label %41, label %43

41:                                               ; preds = %39
  %42 = add nsw i64 %25, 1
  br label %45

43:                                               ; preds = %39
  %44 = add nsw i64 %28, 1
  br label %45

45:                                               ; preds = %43, %41, %.lr.ph.split.peel.next
  %46 = phi i64 [ %42, %41 ], [ %44, %43 ], [ %37, %.lr.ph.split.peel.next ]
  %47 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %.04657, i64 %.055
  store i64 %46, ptr %47, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %46)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @.str)
  %50 = add nuw i64 %.055, 1
  %exitcond.not = icmp eq i64 %.055, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split.peel.next, !llvm.loop !13

._crit_edge:                                      ; preds = %45, %.lr.ph.split.us, %16
  %51 = 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.1)
  %52 = add nuw i64 %.04657, 1
  %exitcond67.not = icmp eq i64 %.04657, %9
  br i1 %exitcond67.not, label %._crit_edge59, label %.preheader, !llvm.loop !9

._crit_edge59:                                    ; preds = %._crit_edge, %.preheader.us, %.lr.ph
  %53 = getelementptr inbounds [2002 x [2002 x i64]], ptr @dp, i64 0, i64 %9, i64 %10
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %54)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @.str.1)
  %57 = load i64, ptr %1, align 8, !tbaa !5
  %58 = add nsw i64 %57, -1
  store i64 %58, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %57, 0
  br i1 %.not, label %._crit_edge62, label %.lr.ph, !llvm.loop !15

._crit_edge62:                                    ; preds = %._crit_edge59, %0
  call void @llvm.lifetime.end.p0(i64 20001, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 20001, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

; 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 uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_PS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #5

attributes #0 = { mustprogress norecurse 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 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 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 nofree nounwind willreturn memory(argmem: read) "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 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = distinct !{!15, !10}


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