; LLVM IR from upupming/algorithm :: acwing/算法基础课/第五讲 动态规划/线性DP/899. 编辑距离 (main)

; 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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@f = external dso_local global [20 x [20 x i32]], align 16
@a = external dso_local global [1010 x [20 x i8]], align 16
@b = external dso_local global [1010 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 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
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %29, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %32

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1010 x [20 x i8]], ptr @a, i64 0, i64 %24
  %26 = getelementptr inbounds [20 x i8], ptr %25, i64 0, i64 0
  %27 = getelementptr inbounds i8, ptr %26, i64 1
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %27)
  br label %29

29:                                               ; preds = %22
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

32:                                               ; preds = %21
  br label %33

33:                                               ; preds = %185, %32
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr @m, align 4, !tbaa !5
  %36 = icmp ne i32 %34, 0
  br i1 %36, label %37, label %189

37:                                               ; preds = %33
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef getelementptr inbounds (i8, ptr @b, i64 1), ptr noundef @c)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %182, %37
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = icmp sle i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %185

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1010 x [20 x i8]], ptr @a, i64 0, i64 %46
  %48 = getelementptr inbounds [20 x i8], ptr %47, i64 0, i64 0
  %49 = getelementptr inbounds i8, ptr %48, i64 1
  %50 = call i64 @strlen(ptr noundef %49) #8
  %51 = trunc i64 %50 to i32
  store i32 %51, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %52 = call i64 @strlen(ptr noundef getelementptr inbounds (i8, ptr @b, i64 1)) #8
  %53 = trunc i64 %52 to i32
  store i32 %53, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %64, %44
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

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

59:                                               ; preds = %54
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [20 x i32], ptr @f, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %59
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %8, align 4, !tbaa !5
  br label %54, !llvm.loop !11

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

68:                                               ; preds = %79, %67
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %82

73:                                               ; preds = %68
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %76
  %78 = getelementptr inbounds [20 x i32], ptr %77, i64 0, i64 0
  store i32 %74, ptr %78, align 16, !tbaa !5
  br label %79

79:                                               ; preds = %73
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %9, align 4, !tbaa !5
  br label %68, !llvm.loop !12

82:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %165, %82
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %168

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %161, %88
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = icmp sle i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %164

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %97
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [20 x i32], ptr %98, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [20 x i32], ptr %106, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %13, align 4, !tbaa !5
  %113 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %116
  %118 = load i32, ptr %11, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [20 x i32], ptr %117, i64 0, i64 %119
  store i32 %114, ptr %120, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %122
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [20 x i32], ptr %123, i64 0, i64 %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = sub nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %129
  %131 = load i32, ptr %11, align 4, !tbaa !5
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [20 x i32], ptr %130, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1010 x [20 x i8]], ptr @a, i64 0, i64 %137
  %139 = load i32, ptr %10, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [20 x i8], ptr %138, i64 0, i64 %140
  %142 = load i8, ptr %141, align 1, !tbaa !13
  %143 = sext i8 %142 to i32
  %144 = load i32, ptr %11, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %145
  %147 = load i8, ptr %146, align 1, !tbaa !13
  %148 = sext i8 %147 to i32
  %149 = icmp eq i32 %143, %148
  %150 = zext i1 %149 to i64
  %151 = select i1 %149, i32 0, i32 1
  %152 = add nsw i32 %135, %151
  store i32 %152, ptr %14, align 4, !tbaa !5
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %126, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = load i32, ptr %10, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %156
  %158 = load i32, ptr %11, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [20 x i32], ptr %157, i64 0, i64 %159
  store i32 %154, ptr %160, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %161

161:                                              ; preds = %94
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %11, align 4, !tbaa !5
  br label %89, !llvm.loop !14

164:                                              ; preds = %93
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %10, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %10, align 4, !tbaa !5
  br label %83, !llvm.loop !15

168:                                              ; preds = %87
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %170
  %172 = load i32, ptr %7, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [20 x i32], ptr %171, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = load i32, ptr @c, align 4, !tbaa !5
  %177 = icmp sle i32 %175, %176
  br i1 %177, label %178, label %181

178:                                              ; preds = %168
  %179 = load i32, ptr %3, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %3, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %178, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %4, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %4, align 4, !tbaa !5
  br label %39, !llvm.loop !16

185:                                              ; preds = %43
  %186 = load i32, ptr %3, align 4, !tbaa !5
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %186)
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %187, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %33, !llvm.loop !17

189:                                              ; preds = %33
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 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

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 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 #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 }
attributes #8 = { 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 = !{!"int", !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 = distinct !{!12, !10}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; 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" }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@f = external dso_local global [20 x [20 x i32]], align 16
@a = external dso_local global [1010 x [20 x i8]], align 16
@b = external dso_local global [1010 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], 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 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not60 = icmp slt i32 %6, 1
  br i1 %.not60, label %.preheader59, label %.lr.ph

.preheader59:                                     ; preds = %.lr.ph, %0
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @m, align 4, !tbaa !5
  %.not4980 = icmp eq i32 %7, 0
  br i1 %.not4980, label %._crit_edge82, label %.lr.ph81

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %9 = getelementptr inbounds [1010 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv, i64 1
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %.not.not = icmp slt i64 %indvars.iv, %12
  br i1 %.not.not, label %.lr.ph, label %.preheader59, !llvm.loop !9

.lr.ph81:                                         ; preds = %.preheader59, %._crit_edge79
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 1), ptr noundef nonnull @c)
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %.not5074 = icmp slt i32 %14, 1
  br i1 %.not5074, label %._crit_edge79, label %.lr.ph78

._crit_edge79:                                    ; preds = %._crit_edge73, %.lr.ph81
  %.045.lcssa = phi i32 [ 0, %.lr.ph81 ], [ %spec.select, %._crit_edge73 ]
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.045.lcssa)
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr @m, align 4, !tbaa !5
  %.not49 = icmp eq i32 %17, 0
  br i1 %.not49, label %._crit_edge82, label %.lr.ph81, !llvm.loop !11

.lr.ph78:                                         ; preds = %.lr.ph81, %._crit_edge73
  %19 = phi i32 [ %48, %._crit_edge73 ], [ %14, %.lr.ph81 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge73 ], [ 1, %.lr.ph81 ]
  %.04576 = phi i32 [ %spec.select, %._crit_edge73 ], [ 0, %.lr.ph81 ]
  %20 = getelementptr inbounds [1010 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv103, i64 1
  %21 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %20) #8
  %22 = trunc i64 %21 to i32
  %23 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @b, i64 1)) #8
  %24 = trunc i64 %23 to i32
  %.not5162 = icmp slt i32 %24, 0
  br i1 %.not5162, label %.preheader58, label %.lr.ph64.preheader

.lr.ph64.preheader:                               ; preds = %.lr.ph78
  %25 = add nuw nsw i64 %23, 1
  %wide.trip.count = and i64 %25, 4294967295
  %min.iters.check = icmp ult i64 %wide.trip.count, 8
  br i1 %min.iters.check, label %.lr.ph64.preheader109, label %vector.ph

.lr.ph64.preheader109:                            ; preds = %middle.block, %.lr.ph64.preheader
  %indvars.iv85.ph = phi i64 [ 0, %.lr.ph64.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph64

vector.ph:                                        ; preds = %.lr.ph64.preheader
  %n.mod.vf = and i64 %25, 7
  %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %26 = getelementptr inbounds [20 x i32], ptr @f, i64 0, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store <4 x i32> %vec.ind, ptr %26, align 16, !tbaa !5
  store <4 x i32> %step.add, ptr %27, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %.preheader58, label %.lr.ph64.preheader109

.preheader58:                                     ; preds = %.lr.ph64, %middle.block, %.lr.ph78
  %.not5265 = icmp slt i32 %22, 0
  br i1 %.not5265, label %._crit_edge73, label %.lr.ph67.preheader

.lr.ph67.preheader:                               ; preds = %.preheader58
  %29 = add nuw nsw i64 %21, 1
  %wide.trip.count91 = and i64 %29, 4294967295
  %30 = add nsw i64 %wide.trip.count91, -1
  %xtraiter = and i64 %29, 3
  %31 = icmp ult i64 %30, 3
  br i1 %31, label %.preheader57.unr-lcssa, label %.lr.ph67.preheader.new

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

.lr.ph64:                                         ; preds = %.lr.ph64.preheader109, %.lr.ph64
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph64 ], [ %indvars.iv85.ph, %.lr.ph64.preheader109 ]
  %32 = getelementptr inbounds [20 x i32], ptr @f, i64 0, i64 %indvars.iv85
  %33 = trunc nuw nsw i64 %indvars.iv85 to i32
  store i32 %33, ptr %32, align 4, !tbaa !5
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count
  br i1 %exitcond.not, label %.preheader58, label %.lr.ph64, !llvm.loop !15

.preheader57.unr-lcssa:                           ; preds = %.lr.ph67, %.lr.ph67.preheader
  %indvars.iv88.unr = phi i64 [ 0, %.lr.ph67.preheader ], [ %indvars.iv.next89.3, %.lr.ph67 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader57, label %.lr.ph67.epil

.lr.ph67.epil:                                    ; preds = %.preheader57.unr-lcssa, %.lr.ph67.epil
  %indvars.iv88.epil = phi i64 [ %indvars.iv.next89.epil, %.lr.ph67.epil ], [ %indvars.iv88.unr, %.preheader57.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph67.epil ], [ 0, %.preheader57.unr-lcssa ]
  %34 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %indvars.iv88.epil
  %35 = trunc nuw nsw i64 %indvars.iv88.epil to i32
  store i32 %35, ptr %34, align 16, !tbaa !5
  %indvars.iv.next89.epil = add nuw nsw i64 %indvars.iv88.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 %.preheader57, label %.lr.ph67.epil, !llvm.loop !16

.preheader57:                                     ; preds = %.lr.ph67.epil, %.preheader57.unr-lcssa
  %.not5371 = icmp eq i32 %22, 0
  %.not5668 = icmp slt i32 %24, 1
  %or.cond = or i1 %.not5371, %.not5668
  br i1 %or.cond, label %._crit_edge73, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader57
  %36 = add nuw nsw i64 %23, 1
  %37 = add nuw nsw i64 %21, 1
  %wide.trip.count101 = and i64 %37, 4294967295
  %wide.trip.count96 = and i64 %36, 4294967295
  br label %.preheader

.lr.ph67:                                         ; preds = %.lr.ph67, %.lr.ph67.preheader.new
  %indvars.iv88 = phi i64 [ 0, %.lr.ph67.preheader.new ], [ %indvars.iv.next89.3, %.lr.ph67 ]
  %niter = phi i64 [ 0, %.lr.ph67.preheader.new ], [ %niter.next.3, %.lr.ph67 ]
  %38 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %indvars.iv88
  %39 = trunc nuw nsw i64 %indvars.iv88 to i32
  store i32 %39, ptr %38, align 16, !tbaa !5
  %indvars.iv.next89 = or disjoint i64 %indvars.iv88, 1
  %40 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %indvars.iv.next89
  %41 = trunc nuw nsw i64 %indvars.iv.next89 to i32
  store i32 %41, ptr %40, align 16, !tbaa !5
  %indvars.iv.next89.1 = or disjoint i64 %indvars.iv88, 2
  %42 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %indvars.iv.next89.1
  %43 = trunc nuw nsw i64 %indvars.iv.next89.1 to i32
  store i32 %43, ptr %42, align 16, !tbaa !5
  %indvars.iv.next89.2 = or disjoint i64 %indvars.iv88, 3
  %44 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %indvars.iv.next89.2
  %45 = trunc nuw nsw i64 %indvars.iv.next89.2 to i32
  store i32 %45, ptr %44, align 16, !tbaa !5
  %indvars.iv.next89.3 = add nuw nsw i64 %indvars.iv88, 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 %.preheader57.unr-lcssa, label %.lr.ph67, !llvm.loop !18

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv98 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next99, %._crit_edge ]
  %46 = add nsw i64 %indvars.iv98, -1
  %47 = getelementptr inbounds [1010 x [20 x i8]], ptr @a, i64 0, i64 %indvars.iv103, i64 %indvars.iv98
  %.phi.trans.insert = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %indvars.iv98, i64 0
  %.pre = load i32, ptr %.phi.trans.insert, align 16, !tbaa !5
  br label %56

._crit_edge73.loopexit83:                         ; preds = %._crit_edge
  %.pre106 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge73

._crit_edge73:                                    ; preds = %.preheader58, %._crit_edge73.loopexit83, %.preheader57
  %48 = phi i32 [ %.pre106, %._crit_edge73.loopexit83 ], [ %19, %.preheader57 ], [ %19, %.preheader58 ]
  %sext = shl i64 %21, 32
  %49 = ashr exact i64 %sext, 32
  %sext54 = shl i64 %23, 32
  %50 = ashr exact i64 %sext54, 32
  %51 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %49, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr @c, align 4, !tbaa !5
  %.not55 = icmp sle i32 %52, %53
  %54 = zext i1 %.not55 to i32
  %spec.select = add nuw nsw i32 %.04576, %54
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %55 = sext i32 %48 to i64
  %.not50.not = icmp slt i64 %indvars.iv103, %55
  br i1 %.not50.not, label %.lr.ph78, label %._crit_edge79, !llvm.loop !19

._crit_edge:                                      ; preds = %56
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
  br i1 %exitcond102.not, label %._crit_edge73.loopexit83, label %.preheader, !llvm.loop !20

56:                                               ; preds = %.preheader, %56
  %57 = phi i32 [ %.pre, %.preheader ], [ %75, %56 ]
  %indvars.iv93 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next94, %56 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %58 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %46, i64 %indvars.iv93
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %61 = add nsw i64 %indvars.iv93, -1
  %62 = add nsw i32 %57, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %indvars.iv98, i64 %indvars.iv93
  store i32 %64, ptr %65, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %66 = getelementptr inbounds [20 x [20 x i32]], ptr @f, i64 0, i64 %46, i64 %61
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = load i8, ptr %47, align 1, !tbaa !21
  %69 = getelementptr inbounds [1010 x i8], ptr @b, i64 0, i64 %indvars.iv93
  %70 = load i8, ptr %69, align 1, !tbaa !21
  %71 = icmp ne i8 %68, %70
  %72 = zext i1 %71 to i32
  %73 = add nsw i32 %67, %72
  store i32 %73, ptr %3, align 4, !tbaa !5
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %65, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %65, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %._crit_edge, label %56, !llvm.loop !22

._crit_edge82:                                    ; preds = %._crit_edge79, %.preheader59
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

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

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

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

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

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

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


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