; LLVM IR from upupming/algorithm :: acwing/算法基础课/第五讲 动态规划/数位统计DP/338. 计数问题.ll (Z2dpii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@f = external dso_local global [15 x [10 x [10 x i32]]], align 16

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z2dpii(i32 noundef %0, i32 noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca i32, align 4
  %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
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %25

21:                                               ; preds = %2
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 0
  %24 = zext i1 %23 to i32
  store i32 %24, ptr %3, align 4
  br label %151

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %26

26:                                               ; preds = %32, %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %39

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = srem i32 %30, 10
  store i32 %31, ptr %7, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %32 unwind label %35

32:                                               ; preds = %29
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sdiv i32 %33, 10
  store i32 %34, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %26, !llvm.loop !9

35:                                               ; preds = %29
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %8, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %150

39:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %40 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %41 = trunc i64 %40 to i32
  store i32 %41, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  store i32 %43, ptr %13, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %110, %39
  %45 = load i32, ptr %13, align 4, !tbaa !5
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %49 = load i32, ptr %13, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %50) #5
  %52 = load i32, ptr %51, align 4, !tbaa !5
  store i32 %52, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %53 = load i32, ptr %13, align 4, !tbaa !5
  %54 = load i32, ptr %10, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 1
  %56 = icmp eq i32 %53, %55
  %57 = zext i1 %56 to i32
  store i32 %57, ptr %16, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %77, %48
  %59 = load i32, ptr %16, align 4, !tbaa !5
  %60 = load i32, ptr %15, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 7, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %80

63:                                               ; preds = %58
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %66
  %68 = load i32, ptr %16, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [10 x [10 x i32]], ptr %67, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [10 x i32], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = add nsw i32 %75, %74
  store i32 %76, ptr %11, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %63
  %78 = load i32, ptr %16, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %16, align 4, !tbaa !5
  br label %58, !llvm.loop !11

80:                                               ; preds = %62
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = load i32, ptr %15, align 4, !tbaa !5
  %83 = mul nsw i32 %81, %82
  %84 = sitofp i32 %83 to double
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = invoke noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 10, i32 noundef %85)
          to label %87 unwind label %98

87:                                               ; preds = %80
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sitofp i32 %88 to double
  %90 = call double @llvm.fmuladd.f64(double %84, double %86, double %89)
  %91 = fptosi double %90 to i32
  store i32 %91, ptr %11, align 4, !tbaa !5
  %92 = load i32, ptr %15, align 4, !tbaa !5
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = icmp eq i32 %92, %93
  br i1 %94, label %95, label %102

95:                                               ; preds = %87
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !5
  br label %102

98:                                               ; preds = %80
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %8, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %150

102:                                              ; preds = %95, %87
  %103 = load i32, ptr %13, align 4, !tbaa !5
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %102
  %106 = load i32, ptr %12, align 4, !tbaa !5
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = add nsw i32 %107, %106
  store i32 %108, ptr %11, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %105, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %13, align 4, !tbaa !5
  br label %44, !llvm.loop !12

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

114:                                              ; preds = %145, %113
  %115 = load i32, ptr %17, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %118 = icmp ult i64 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %114
  store i32 10, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %148

120:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %121 = load i32, ptr %17, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 1
  %123 = zext i1 %122 to i32
  store i32 %123, ptr %18, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %141, %120
  %125 = load i32, ptr %18, align 4, !tbaa !5
  %126 = icmp sle i32 %125, 9
  br i1 %126, label %128, label %127

127:                                              ; preds = %124
  store i32 13, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %144

128:                                              ; preds = %124
  %129 = load i32, ptr %17, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %130
  %132 = load i32, ptr %18, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [10 x [10 x i32]], ptr %131, i64 0, i64 %133
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [10 x i32], ptr %134, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = add nsw i32 %139, %138
  store i32 %140, ptr %11, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %128
  %142 = load i32, ptr %18, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %18, align 4, !tbaa !5
  br label %124, !llvm.loop !13

144:                                              ; preds = %127
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %17, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %17, align 4, !tbaa !5
  br label %114, !llvm.loop !14

148:                                              ; preds = %119
  %149 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %149, ptr %3, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  br label %151

150:                                              ; preds = %98, %35
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  br label %153

151:                                              ; preds = %148, %21
  %152 = load i32, ptr %3, align 4
  ret i32 %152

153:                                              ; preds = %150
  %154 = load ptr, ptr %8, align 8
  %155 = load i32, ptr %9, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"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 = distinct !{!13, !10}
!14 = distinct !{!14, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@f = external dso_local local_unnamed_addr global [15 x [10 x [10 x i32]]], align 16

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z2dpii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  %5 = icmp eq i32 %0, 0
  br i1 %5, label %6, label %9

6:                                                ; preds = %2
  %7 = icmp eq i32 %1, 0
  %8 = zext i1 %7 to i32
  br label %107

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %10

10:                                               ; preds = %9, %13
  %.04751 = phi i32 [ %0, %9 ], [ %12, %13 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %11 = srem i32 %.04751, 10
  %12 = sdiv i32 %.04751, 10
  store i32 %11, ptr %4, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %13 unwind label %14

13:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %.04751.off = add i32 %.04751, 9
  %.not = icmp ult i32 %.04751.off, 19
  br i1 %.not, label %16, label %10, !llvm.loop !9

14:                                               ; preds = %10
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  resume { ptr, i32 } %15

16:                                               ; preds = %13
  %17 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %18 = trunc i64 %17 to i32
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph58, label %.preheader

.lr.ph58:                                         ; preds = %16
  %20 = add i64 %17, 4294967295
  %21 = sext i32 %1 to i64
  %22 = and i64 %20, 4294967295
  br label %26

.preheader:                                       ; preds = %._crit_edge, %16
  %.045.lcssa = phi i32 [ 0, %16 ], [ %.2, %._crit_edge ]
  %23 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %24 = icmp ugt i64 %23, 1
  br i1 %24, label %.lr.ph64, label %._crit_edge65

.lr.ph64:                                         ; preds = %.preheader
  %25 = sext i32 %1 to i64
  br label %.prol.preheader

26:                                               ; preds = %.lr.ph58, %._crit_edge
  %indvars.iv69 = phi i64 [ %22, %.lr.ph58 ], [ %indvars.iv.next70, %._crit_edge ]
  %.04455 = phi i32 [ 0, %.lr.ph58 ], [ %spec.select, %._crit_edge ]
  %.04554 = phi i32 [ 0, %.lr.ph58 ], [ %.2, %._crit_edge ]
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv69) #6
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp eq i64 %indvars.iv69, %22
  %30 = zext i1 %29 to i32
  %31 = icmp sgt i32 %28, %30
  br i1 %31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %26
  %32 = add nuw nsw i64 %indvars.iv69, 1
  %33 = zext i1 %29 to i64
  %wide.trip.count = zext nneg i32 %28 to i64
  %34 = sub nsw i64 %wide.trip.count, %33
  %min.iters.check = icmp ult i64 %34, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ %33, %.lr.ph ], [ %ind.end, %middle.block ]
  %.14652.ph = phi i32 [ %.04554, %.lr.ph ], [ %70, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %34, -8
  %ind.end = or disjoint i64 %n.vec, %33
  %35 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.04554, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %35, %vector.ph ], [ %67, %vector.body ]
  %vec.phi81 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %68, %vector.body ]
  %offset.idx = or disjoint i64 %index, %33
  %36 = add nuw nsw i64 %offset.idx, 1
  %37 = or disjoint i64 %offset.idx, 2
  %38 = add nuw nsw i64 %offset.idx, 3
  %39 = or disjoint i64 %offset.idx, 4
  %40 = add nuw nsw i64 %offset.idx, 5
  %41 = or disjoint i64 %offset.idx, 6
  %42 = add i64 %offset.idx, 7
  %43 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %offset.idx, i64 %21
  %44 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %36, i64 %21
  %45 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %37, i64 %21
  %46 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %38, i64 %21
  %47 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %39, i64 %21
  %48 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %40, i64 %21
  %49 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %41, i64 %21
  %50 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %42, i64 %21
  %51 = load i32, ptr %43, align 4, !tbaa !5
  %52 = load i32, ptr %44, align 4, !tbaa !5
  %53 = load i32, ptr %45, align 4, !tbaa !5
  %54 = load i32, ptr %46, align 4, !tbaa !5
  %55 = insertelement <4 x i32> poison, i32 %51, i64 0
  %56 = insertelement <4 x i32> %55, i32 %52, i64 1
  %57 = insertelement <4 x i32> %56, i32 %53, i64 2
  %58 = insertelement <4 x i32> %57, i32 %54, i64 3
  %59 = load i32, ptr %47, align 4, !tbaa !5
  %60 = load i32, ptr %48, align 4, !tbaa !5
  %61 = load i32, ptr %49, align 4, !tbaa !5
  %62 = load i32, ptr %50, align 4, !tbaa !5
  %63 = insertelement <4 x i32> poison, i32 %59, i64 0
  %64 = insertelement <4 x i32> %63, i32 %60, i64 1
  %65 = insertelement <4 x i32> %64, i32 %61, i64 2
  %66 = insertelement <4 x i32> %65, i32 %62, i64 3
  %67 = add <4 x i32> %58, %vec.phi
  %68 = add <4 x i32> %66, %vec.phi81
  %index.next = add nuw i64 %index, 8
  %69 = icmp eq i64 %index.next, %n.vec
  br i1 %69, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %68, %67
  %70 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %34, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %26
  %.146.lcssa = phi i32 [ %.04554, %26 ], [ %70, %middle.block ], [ %85, %scalar.ph ]
  %71 = mul nsw i32 %28, %.04455
  %72 = sitofp i32 %71 to double
  %73 = trunc nuw nsw i64 %indvars.iv69 to i32
  %74 = call noundef double @_ZSt3powIiiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i32 noundef 10, i32 noundef %73)
  %75 = sitofp i32 %.146.lcssa to double
  %76 = call double @llvm.fmuladd.f64(double %72, double %74, double %75)
  %77 = fptosi double %76 to i32
  %78 = icmp eq i32 %28, %1
  %79 = zext i1 %78 to i32
  %spec.select = add nuw nsw i32 %.04455, %79
  %80 = icmp eq i64 %indvars.iv69, 0
  %81 = select i1 %80, i32 %spec.select, i32 0
  %.2 = add nsw i32 %81, %77
  %indvars.iv.next70 = add nsw i64 %indvars.iv69, -1
  %82 = icmp sgt i64 %indvars.iv69, 0
  br i1 %82, label %26, label %.preheader, !llvm.loop !14

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.14652 = phi i32 [ %85, %scalar.ph ], [ %.14652.ph, %scalar.ph.preheader ]
  %83 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %32, i64 %indvars.iv, i64 %21
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = add nsw i32 %84, %.14652
  %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

._crit_edge65:                                    ; preds = %.unr-lcssa, %.preheader
  %.3.lcssa = phi i32 [ %.045.lcssa, %.preheader ], [ %106, %.unr-lcssa ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  br label %107

.prol.preheader:                                  ; preds = %.lr.ph64, %.unr-lcssa
  %indvars.iv76 = phi i64 [ 1, %.lr.ph64 ], [ %indvars.iv.next77, %.unr-lcssa ]
  %.362 = phi i32 [ %.045.lcssa, %.lr.ph64 ], [ %106, %.unr-lcssa ]
  %86 = icmp ne i64 %indvars.iv76, 1
  %87 = select i1 %86, i64 1, i64 2
  %88 = zext i1 %86 to i64
  br label %89

89:                                               ; preds = %89, %.prol.preheader
  %indvars.iv72.prol = phi i64 [ %88, %.prol.preheader ], [ %indvars.iv.next73.prol, %89 ]
  %.460.prol = phi i32 [ %.362, %.prol.preheader ], [ %92, %89 ]
  %prol.iter = phi i64 [ 0, %.prol.preheader ], [ %prol.iter.next, %89 ]
  %90 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %indvars.iv76, i64 %indvars.iv72.prol, i64 %25
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, %.460.prol
  %indvars.iv.next73.prol = add nuw nsw i64 %indvars.iv72.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %87
  br i1 %prol.iter.cmp.not, label %.new, label %89, !llvm.loop !16

.unr-lcssa:                                       ; preds = %.new
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %93 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %94 = icmp ugt i64 %93, %indvars.iv.next77
  br i1 %94, label %.prol.preheader, label %._crit_edge65, !llvm.loop !18

.new:                                             ; preds = %89, %.new
  %indvars.iv72 = phi i64 [ %indvars.iv.next73.3, %.new ], [ %indvars.iv.next73.prol, %89 ]
  %.460 = phi i32 [ %106, %.new ], [ %92, %89 ]
  %95 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %indvars.iv76, i64 %indvars.iv72, i64 %25
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %96, %.460
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %98 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %indvars.iv76, i64 %indvars.iv.next73, i64 %25
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = add nsw i32 %99, %97
  %indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 2
  %101 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %indvars.iv76, i64 %indvars.iv.next73.1, i64 %25
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, %100
  %indvars.iv.next73.2 = add nuw nsw i64 %indvars.iv72, 3
  %104 = getelementptr inbounds [15 x [10 x [10 x i32]]], ptr @f, i64 0, i64 %indvars.iv76, i64 %indvars.iv.next73.2, i64 %25
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, %103
  %indvars.iv.next73.3 = add nuw nsw i64 %indvars.iv72, 4
  %exitcond75.not.3 = icmp eq i64 %indvars.iv.next73.3, 10
  br i1 %exitcond75.not.3, label %.unr-lcssa, label %.new, !llvm.loop !19

107:                                              ; preds = %._crit_edge65, %6
  %.042 = phi i32 [ %8, %6 ], [ %.3.lcssa, %._crit_edge65 ]
  ret i32 %.042
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass