; LLVM IR from the-hyp0cr1t3/CC :: CSES/Dynamic Programming (Edit Distance)

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

@dp = external dso_local global [5005 x [5005 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@chmin = external hidden global %class.anon, align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %15
  %17 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  %19 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %20 unwind label %46

20:                                               ; preds = %0
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %22 unwind label %46

22:                                               ; preds = %20
  %23 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %4, align 4, !tbaa !8
  %25 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr %5, align 4, !tbaa !8
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %27

27:                                               ; preds = %51, %22
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %29 = load i32, ptr %4, align 4, !tbaa !8
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %31, label %54

31:                                               ; preds = %27
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %32

32:                                               ; preds = %43, %31
  %33 = load i32, ptr %3, align 4, !tbaa !8
  %34 = load i32, ptr %5, align 4, !tbaa !8
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %36, label %50

36:                                               ; preds = %32
  %37 = load i32, ptr %2, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %38
  %40 = load i32, ptr %3, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [5005 x i32], ptr %39, i64 0, i64 %41
  store i32 2000000000, ptr %42, align 4, !tbaa !8
  br label %43

43:                                               ; preds = %36
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %3, align 4, !tbaa !8
  br label %32, !llvm.loop !11

46:                                               ; preds = %167, %20, %0
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %8, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %9, align 4
  br label %178

50:                                               ; preds = %32
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %2, align 4, !tbaa !8
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %2, align 4, !tbaa !8
  br label %27, !llvm.loop !13

54:                                               ; preds = %27
  store i32 0, ptr @dp, align 16, !tbaa !8
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %55

55:                                               ; preds = %164, %54
  %56 = load i32, ptr %2, align 4, !tbaa !8
  %57 = load i32, ptr %4, align 4, !tbaa !8
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %59, label %167

59:                                               ; preds = %55
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %60

60:                                               ; preds = %160, %59
  %61 = load i32, ptr %3, align 4, !tbaa !8
  %62 = load i32, ptr %5, align 4, !tbaa !8
  %63 = icmp sle i32 %61, %62
  br i1 %63, label %64, label %163

64:                                               ; preds = %60
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %89

67:                                               ; preds = %64
  %68 = load i32, ptr %2, align 4, !tbaa !8
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %69
  %71 = load i32, ptr %3, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [5005 x i32], ptr %70, i64 0, i64 %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %74 = load i32, ptr %2, align 4, !tbaa !8
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %76
  %78 = load i32, ptr %3, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [5005 x i32], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %10, align 4, !tbaa !8
  %83 = invoke noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %73, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %84 unwind label %85

84:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %89

85:                                               ; preds = %67
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %8, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %178

89:                                               ; preds = %84, %64
  %90 = load i32, ptr %3, align 4, !tbaa !8
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %114

92:                                               ; preds = %89
  %93 = load i32, ptr %2, align 4, !tbaa !8
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %94
  %96 = load i32, ptr %3, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [5005 x i32], ptr %95, i64 0, i64 %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %99 = load i32, ptr %2, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %100
  %102 = load i32, ptr %3, align 4, !tbaa !8
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [5005 x i32], ptr %101, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !8
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %11, align 4, !tbaa !8
  %108 = invoke noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %98, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %109 unwind label %110

109:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %114

110:                                              ; preds = %92
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %8, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %178

114:                                              ; preds = %109, %89
  %115 = load i32, ptr %2, align 4, !tbaa !8
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %159

117:                                              ; preds = %114
  %118 = load i32, ptr %3, align 4, !tbaa !8
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %159

120:                                              ; preds = %117
  %121 = load i32, ptr %2, align 4, !tbaa !8
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %122
  %124 = load i32, ptr %3, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [5005 x i32], ptr %123, i64 0, i64 %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %127 = load i32, ptr %2, align 4, !tbaa !8
  %128 = sub nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %129
  %131 = load i32, ptr %3, align 4, !tbaa !8
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [5005 x i32], ptr %130, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !8
  %136 = load i32, ptr %2, align 4, !tbaa !8
  %137 = sub nsw i32 %136, 1
  %138 = sext i32 %137 to i64
  %139 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %138)
          to label %140 unwind label %155

140:                                              ; preds = %120
  %141 = load i8, ptr %139, align 1, !tbaa !14
  %142 = sext i8 %141 to i32
  %143 = load i32, ptr %3, align 4, !tbaa !8
  %144 = sub nsw i32 %143, 1
  %145 = sext i32 %144 to i64
  %146 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %145)
          to label %147 unwind label %155

147:                                              ; preds = %140
  %148 = load i8, ptr %146, align 1, !tbaa !14
  %149 = sext i8 %148 to i32
  %150 = icmp ne i32 %142, %149
  %151 = zext i1 %150 to i32
  %152 = add nsw i32 %135, %151
  store i32 %152, ptr %12, align 4, !tbaa !8
  %153 = invoke noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %126, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %154 unwind label %155

154:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %159

155:                                              ; preds = %147, %140, %120
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %8, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %178

159:                                              ; preds = %154, %117, %114
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %3, align 4, !tbaa !8
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %3, align 4, !tbaa !8
  br label %60, !llvm.loop !15

163:                                              ; preds = %60
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %2, align 4, !tbaa !8
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %2, align 4, !tbaa !8
  br label %55, !llvm.loop !16

167:                                              ; preds = %55
  %168 = load i32, ptr %4, align 4, !tbaa !8
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %169
  %171 = load i32, ptr %5, align 4, !tbaa !8
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [5005 x i32], ptr %170, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !8
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %174)
          to label %176 unwind label %46

176:                                              ; preds = %167
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %177 = load i32, ptr %1, align 4
  ret i32 %177

178:                                              ; preds = %155, %110, %85, %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %8, align 8
  %181 = load i32, ptr %9, align 4
  %182 = insertvalue { ptr, i32 } poison, ptr %180, 0
  %183 = insertvalue { ptr, i32 } %182, i32 %181, 1
  resume { ptr, i32 } %183
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !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_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.anon = type { i8 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@dp = external dso_local global [5005 x [5005 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@chmin = external hidden global %class.anon, align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %12 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %13 unwind label %28

13:                                               ; preds = %0
  %14 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %15 unwind label %28

15:                                               ; preds = %13
  %16 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %17 = trunc i64 %16 to i32
  %18 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  %19 = trunc i64 %18 to i32
  %20 = or i64 %16, %18
  %21 = and i64 %20, 2147483648
  %or.cond83.not = icmp eq i64 %21, 0
  br i1 %or.cond83.not, label %.preheader45.preheader, label %._crit_edge56.sink.split

.preheader45.preheader:                           ; preds = %15
  %22 = add nuw nsw i64 %18, 1
  %23 = add nuw nsw i64 %16, 1
  %wide.trip.count66 = and i64 %23, 4294967295
  %wide.trip.count = and i64 %22, 4294967295
  %min.iters.check = icmp ult i64 %wide.trip.count, 8
  %n.mod.vf = and i64 %22, 7
  %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br label %.preheader45

.preheader45:                                     ; preds = %.preheader45.preheader, %._crit_edge
  %indvars.iv63 = phi i64 [ 0, %.preheader45.preheader ], [ %indvars.iv.next64, %._crit_edge ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader45, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader45 ]
  %24 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv63, i64 %index
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  store <4 x i32> <i32 2000000000, i32 2000000000, i32 2000000000, i32 2000000000>, ptr %24, align 4, !tbaa !8
  store <4 x i32> <i32 2000000000, i32 2000000000, i32 2000000000, i32 2000000000>, ptr %25, align 4, !tbaa !8
  %index.next = add nuw i64 %index, 8
  %26 = icmp eq i64 %index.next, %n.vec
  br i1 %26, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader45
  %indvars.iv.ph = phi i64 [ 0, %.preheader45 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %27 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %indvars.iv63, i64 %indvars.iv
  store i32 2000000000, ptr %27, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !15

28:                                               ; preds = %._crit_edge56, %13, %0
  %29 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  resume { ptr, i32 } %29

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66
  br i1 %exitcond67.not, label %._crit_edge50, label %.preheader45, !llvm.loop !16

._crit_edge50:                                    ; preds = %._crit_edge
  store i32 0, ptr @dp, align 16, !tbaa !8
  %30 = or i64 %16, %18
  %31 = and i64 %30, 2147483648
  %or.cond.not = icmp eq i64 %31, 0
  br i1 %or.cond.not, label %.preheader.preheader, label %._crit_edge56

.preheader.preheader:                             ; preds = %._crit_edge50
  %32 = add nuw i32 %19, 1
  %wide.trip.count71 = zext i32 %32 to i64
  %exitcond72.peel.not = icmp eq i32 %19, 0
  %wide.trip.count77 = zext i32 %32 to i64
  %exitcond78.peel.not = icmp eq i32 %19, 0
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge53
  %.155 = phi i32 [ %67, %._crit_edge53 ], [ 0, %.preheader.preheader ]
  %.not = icmp eq i32 %.155, 0
  %33 = zext nneg i32 %.155 to i64
  %34 = add nsw i32 %.155, -1
  %35 = sext i32 %34 to i64
  br i1 %.not, label %.thread.peel, label %.thread.us.peel

.thread.us.peel:                                  ; preds = %.preheader
  %36 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %33, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %37 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %35, i64 0
  %38 = load i32, ptr %37, align 4, !tbaa !8
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %3, align 4, !tbaa !8
  %40 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %36, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br i1 %exitcond72.peel.not, label %._crit_edge53, label %.thread.us

.thread.peel:                                     ; preds = %.preheader
  br i1 %exitcond78.peel.not, label %._crit_edge53, label %.thread

.thread.us:                                       ; preds = %.thread.us.peel, %.thread.us
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %.thread.us ], [ 1, %.thread.us.peel ]
  %41 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %33, i64 %indvars.iv68
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %42 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %35, i64 %indvars.iv68
  %43 = load i32, ptr %42, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %3, align 4, !tbaa !8
  %45 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %46 = add nsw i64 %indvars.iv68, -1
  %47 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %33, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !8
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %4, align 4, !tbaa !8
  %50 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %51 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %35, i64 %46
  %52 = load i32, ptr %51, align 4, !tbaa !8
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %35)
  %54 = load i8, ptr %53, align 1, !tbaa !17
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %2, i64 noundef %46)
  %56 = load i8, ptr %55, align 1, !tbaa !17
  %57 = icmp ne i8 %54, %56
  %58 = zext i1 %57 to i32
  %59 = add nsw i32 %52, %58
  store i32 %59, ptr %5, align 4, !tbaa !8
  %60 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71
  br i1 %exitcond72.not, label %._crit_edge53, label %.thread.us, !llvm.loop !18

.thread:                                          ; preds = %.thread.peel, %.thread
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.thread ], [ 1, %.thread.peel ]
  %61 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %33, i64 %indvars.iv74
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %62 = add nsw i64 %indvars.iv74, -1
  %63 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %33, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !8
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %4, align 4, !tbaa !8
  %66 = call noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1) @chmin, ptr noundef nonnull align 4 dereferenceable(4) %61, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge53, label %.thread, !llvm.loop !20

._crit_edge53:                                    ; preds = %.thread.us, %.thread, %.thread.us.peel, %.thread.peel
  %67 = add i32 %.155, 1
  %.not40 = icmp sgt i32 %67, %17
  br i1 %.not40, label %._crit_edge56, label %.preheader, !llvm.loop !21

._crit_edge56.sink.split:                         ; preds = %15
  store i32 0, ptr @dp, align 16, !tbaa !8
  br label %._crit_edge56

._crit_edge56:                                    ; preds = %._crit_edge53, %._crit_edge56.sink.split, %._crit_edge50
  %sext = shl i64 %16, 32
  %68 = ashr exact i64 %sext, 32
  %sext41 = shl i64 %18, 32
  %69 = ashr exact i64 %sext41, 32
  %70 = getelementptr inbounds [5005 x [5005 x i32]], ptr @dp, i64 0, i64 %68, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %71)
          to label %73 unwind label %28

73:                                               ; preds = %._crit_edge56
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  ret i32 0
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZNK3$_0clIiiEEDaRT_OT0_"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

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

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

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

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

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

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

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


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