; LLVM IR from smv1999/CompetitiveProgrammingQuestionBank :: 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"

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z11minDistanceNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %15 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %17 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr %6, align 4, !tbaa !9
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = add nsw i32 %19, 1
  %21 = zext i32 %20 to i64
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  %24 = zext i32 %23 to i64
  %25 = call ptr @llvm.stacksave.p0()
  store ptr %25, ptr %7, align 8
  %26 = mul nuw i64 %21, %24
  %27 = alloca i32, i64 %26, align 16
  store i64 %21, ptr %8, align 8
  store i64 %24, ptr %9, align 8
  %28 = mul nsw i64 0, %24
  %29 = getelementptr inbounds i32, ptr %27, i64 %28
  %30 = getelementptr inbounds i32, ptr %29, i64 0
  store i32 0, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %44, %2
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = add nsw i32 %33, 1
  %35 = icmp slt i32 %32, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %31
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = mul nsw i64 0, %24
  %40 = getelementptr inbounds i32, ptr %27, i64 %39
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  store i32 %38, ptr %43, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %37
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %10, align 4, !tbaa !9
  br label %31, !llvm.loop !11

47:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %61, %47
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = load i32, ptr %5, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  %52 = icmp slt i32 %49, %51
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %48
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = mul nsw i64 %57, %24
  %59 = getelementptr inbounds i32, ptr %27, i64 %58
  %60 = getelementptr inbounds i32, ptr %59, i64 0
  store i32 %55, ptr %60, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %54
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %11, align 4, !tbaa !9
  br label %48, !llvm.loop !13

64:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %152, %64
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = add nsw i32 %67, 1
  %69 = icmp slt i32 %66, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %65
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %155

71:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %72

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

77:                                               ; preds = %72
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %151

78:                                               ; preds = %72
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %81)
  %83 = load i8, ptr %82, align 1, !tbaa !14
  %84 = sext i8 %83 to i32
  %85 = load i32, ptr %14, align 4, !tbaa !9
  %86 = sub nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %87)
  %89 = load i8, ptr %88, align 1, !tbaa !14
  %90 = sext i8 %89 to i32
  %91 = icmp eq i32 %84, %90
  br i1 %91, label %92, label %110

92:                                               ; preds = %78
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = mul nsw i64 %95, %24
  %97 = getelementptr inbounds i32, ptr %27, i64 %96
  %98 = load i32, ptr %14, align 4, !tbaa !9
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %97, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !9
  %103 = load i32, ptr %12, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = mul nsw i64 %104, %24
  %106 = getelementptr inbounds i32, ptr %27, i64 %105
  %107 = load i32, ptr %14, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds i32, ptr %106, i64 %108
  store i32 %102, ptr %109, align 4, !tbaa !9
  br label %147

110:                                              ; preds = %78
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = sub nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = mul nsw i64 %113, %24
  %115 = getelementptr inbounds i32, ptr %27, i64 %114
  %116 = load i32, ptr %14, align 4, !tbaa !9
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %115, i64 %118
  %120 = load i32, ptr %12, align 4, !tbaa !9
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = mul nsw i64 %122, %24
  %124 = getelementptr inbounds i32, ptr %27, i64 %123
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %124, i64 %126
  %128 = load i32, ptr %12, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = mul nsw i64 %129, %24
  %131 = getelementptr inbounds i32, ptr %27, i64 %130
  %132 = load i32, ptr %14, align 4, !tbaa !9
  %133 = sub nsw i32 %132, 1
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds i32, ptr %131, i64 %134
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %127, ptr noundef nonnull align 4 dereferenceable(4) %135)
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %119, ptr noundef nonnull align 4 dereferenceable(4) %136)
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = mul nsw i64 %141, %24
  %143 = getelementptr inbounds i32, ptr %27, i64 %142
  %144 = load i32, ptr %14, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds i32, ptr %143, i64 %145
  store i32 %139, ptr %146, align 4, !tbaa !9
  br label %147

147:                                              ; preds = %110, %92
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %14, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %14, align 4, !tbaa !9
  br label %72, !llvm.loop !15

151:                                              ; preds = %77
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %12, align 4, !tbaa !9
  br label %65, !llvm.loop !16

155:                                              ; preds = %70
  %156 = load i32, ptr %5, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = mul nsw i64 %157, %24
  %159 = getelementptr inbounds i32, ptr %27, i64 %158
  %160 = load i32, ptr %6, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i32, ptr %159, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !9
  store i32 1, ptr %13, align 4
  %164 = load ptr, ptr %7, align 8
  call void @llvm.stackrestore.p0(ptr %164)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret i32 %163
}

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

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

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

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

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

; 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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z11minDistanceNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #2
  %4 = trunc i64 %3 to i32
  %5 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #2
  %6 = trunc i64 %5 to i32
  %7 = add i64 %3, 1
  %8 = and i64 %7, 4294967295
  %9 = add i64 %5, 1
  %10 = and i64 %9, 4294967295
  %11 = mul nuw i64 %10, %8
  %12 = alloca i32, i64 %11, align 16
  store i32 0, ptr %12, align 16, !tbaa !5
  %.not45 = icmp slt i32 %6, 1
  br i1 %.not45, label %.preheader44, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %2
  %13 = add nuw nsw i64 %5, 1
  %wide.trip.count = and i64 %13, 4294967295
  %14 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i64 %14, 8
  br i1 %min.iters.check, label %.lr.ph.preheader75, label %vector.ph

.lr.ph.preheader75:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %14, -8
  %ind.end = or disjoint i64 %n.vec, 1
  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 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %offset.idx = or disjoint i64 %index, 1
  %15 = getelementptr inbounds i32, ptr %12, i64 %offset.idx
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  store <4 x i32> %vec.ind, ptr %15, align 4, !tbaa !5
  store <4 x i32> %step.add, ptr %16, align 4, !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>
  %17 = icmp eq i64 %index.next, %n.vec
  br i1 %17, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %14, %n.vec
  br i1 %cmp.n, label %.preheader44, label %.lr.ph.preheader75

.preheader44:                                     ; preds = %.lr.ph, %middle.block, %2
  %.not3947 = icmp slt i32 %4, 1
  br i1 %.not3947, label %._crit_edge55, label %.lr.ph49.preheader

.lr.ph49.preheader:                               ; preds = %.preheader44
  %18 = add nuw nsw i64 %3, 1
  %wide.trip.count61 = and i64 %18, 4294967295
  %19 = add nsw i64 %wide.trip.count61, -1
  %20 = add nsw i64 %wide.trip.count61, -2
  %xtraiter = and i64 %19, 3
  %21 = icmp ult i64 %20, 3
  br i1 %21, label %.preheader43.unr-lcssa, label %.lr.ph49.preheader.new

.lr.ph49.preheader.new:                           ; preds = %.lr.ph49.preheader
  %unroll_iter = and i64 %19, -4
  br label %.lr.ph49

.lr.ph:                                           ; preds = %.lr.ph.preheader75, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader75 ]
  %22 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv
  %23 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %23, ptr %22, align 4, !tbaa !5
  %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 %.preheader44, label %.lr.ph, !llvm.loop !13

.preheader43.unr-lcssa:                           ; preds = %.lr.ph49, %.lr.ph49.preheader
  %indvars.iv58.unr = phi i64 [ 1, %.lr.ph49.preheader ], [ %indvars.iv.next59.3, %.lr.ph49 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader43, label %.lr.ph49.epil

.lr.ph49.epil:                                    ; preds = %.preheader43.unr-lcssa, %.lr.ph49.epil
  %indvars.iv58.epil = phi i64 [ %indvars.iv.next59.epil, %.lr.ph49.epil ], [ %indvars.iv58.unr, %.preheader43.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph49.epil ], [ 0, %.preheader43.unr-lcssa ]
  %24 = mul nuw nsw i64 %10, %indvars.iv58.epil
  %25 = getelementptr inbounds i32, ptr %12, i64 %24
  %26 = trunc nuw nsw i64 %indvars.iv58.epil to i32
  store i32 %26, ptr %25, align 4, !tbaa !5
  %indvars.iv.next59.epil = add nuw nsw i64 %indvars.iv58.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 %.preheader43, label %.lr.ph49.epil, !llvm.loop !14

.preheader43:                                     ; preds = %.lr.ph49.epil, %.preheader43.unr-lcssa
  %brmerge = or i1 %.not3947, %.not45
  br i1 %brmerge, label %._crit_edge55, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader43
  %27 = add nuw nsw i64 %5, 1
  %28 = add nuw nsw i64 %3, 1
  %wide.trip.count71 = and i64 %28, 4294967295
  %wide.trip.count66 = and i64 %27, 4294967295
  br label %.preheader

.lr.ph49:                                         ; preds = %.lr.ph49, %.lr.ph49.preheader.new
  %indvars.iv58 = phi i64 [ 1, %.lr.ph49.preheader.new ], [ %indvars.iv.next59.3, %.lr.ph49 ]
  %niter = phi i64 [ 0, %.lr.ph49.preheader.new ], [ %niter.next.3, %.lr.ph49 ]
  %29 = mul nuw nsw i64 %10, %indvars.iv58
  %30 = getelementptr inbounds i32, ptr %12, i64 %29
  %31 = trunc nuw nsw i64 %indvars.iv58 to i32
  store i32 %31, ptr %30, align 4, !tbaa !5
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %32 = mul nuw nsw i64 %10, %indvars.iv.next59
  %33 = getelementptr inbounds i32, ptr %12, i64 %32
  %34 = trunc nuw nsw i64 %indvars.iv.next59 to i32
  store i32 %34, ptr %33, align 4, !tbaa !5
  %indvars.iv.next59.1 = add nuw nsw i64 %indvars.iv58, 2
  %35 = mul nuw nsw i64 %10, %indvars.iv.next59.1
  %36 = getelementptr inbounds i32, ptr %12, i64 %35
  %37 = trunc nuw nsw i64 %indvars.iv.next59.1 to i32
  store i32 %37, ptr %36, align 4, !tbaa !5
  %indvars.iv.next59.2 = add nuw nsw i64 %indvars.iv58, 3
  %38 = mul nuw nsw i64 %10, %indvars.iv.next59.2
  %39 = getelementptr inbounds i32, ptr %12, i64 %38
  %40 = trunc nuw nsw i64 %indvars.iv.next59.2 to i32
  store i32 %40, ptr %39, align 4, !tbaa !5
  %indvars.iv.next59.3 = add nuw nsw i64 %indvars.iv58, 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 %.preheader43.unr-lcssa, label %.lr.ph49, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv68 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next69, %._crit_edge ]
  %41 = add nsw i64 %indvars.iv68, -1
  %42 = mul nuw nsw i64 %10, %41
  %43 = getelementptr inbounds i32, ptr %12, i64 %42
  %44 = mul nuw nsw i64 %10, %indvars.iv68
  %45 = getelementptr inbounds i32, ptr %12, i64 %44
  br label %52

._crit_edge55:                                    ; preds = %._crit_edge, %.preheader43, %.preheader44
  %sext = shl i64 %3, 32
  %46 = ashr exact i64 %sext, 32
  %47 = mul nsw i64 %10, %46
  %48 = getelementptr inbounds i32, ptr %12, i64 %47
  %sext41 = shl i64 %5, 32
  %49 = ashr exact i64 %sext41, 30
  %50 = getelementptr inbounds i8, ptr %48, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  ret i32 %51

._crit_edge:                                      ; preds = %69
  %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_edge55, label %.preheader, !llvm.loop !17

52:                                               ; preds = %.preheader, %69
  %indvars.iv63 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next64, %69 ]
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %41)
  %54 = load i8, ptr %53, align 1, !tbaa !18
  %55 = add nsw i64 %indvars.iv63, -1
  %56 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %1, i64 noundef %55)
  %57 = load i8, ptr %56, align 1, !tbaa !18
  %58 = icmp eq i8 %54, %57
  %59 = getelementptr inbounds i32, ptr %43, i64 %55
  br i1 %58, label %60, label %62

60:                                               ; preds = %52
  %61 = load i32, ptr %59, align 4, !tbaa !5
  br label %69

62:                                               ; preds = %52
  %63 = getelementptr inbounds i32, ptr %43, i64 %indvars.iv63
  %64 = getelementptr inbounds i32, ptr %45, i64 %55
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %63, ptr noundef nonnull align 4 dereferenceable(4) %64)
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %59, ptr noundef nonnull align 4 dereferenceable(4) %65)
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  br label %69

69:                                               ; preds = %60, %62
  %.sink = phi i32 [ %61, %60 ], [ %68, %62 ]
  %70 = getelementptr inbounds i32, ptr %45, i64 %indvars.iv63
  store i32 %.sink, ptr %70, align 4, !tbaa !5
  %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_edge, label %52, !llvm.loop !19
}

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

; 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 #0 align 2

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

attributes #0 = { 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 #1 = { 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 #2 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !10}


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