; LLVM IR from ncduy0303/Competitive-Programming :: Dynamic Programming/Matrix Chain.ll (Z5solvev)

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  br label %13

13:                                               ; preds = %224, %0
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr %14, i64 %17
  %19 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %18)
  br i1 %19, label %20, label %235

20:                                               ; preds = %13
  %21 = load i32, ptr %1, align 4, !tbaa !8
  %22 = zext i32 %21 to i64
  %23 = load i32, ptr %1, align 4, !tbaa !8
  %24 = zext i32 %23 to i64
  %25 = call ptr @llvm.stacksave.p0()
  store ptr %25, ptr %2, align 8
  %26 = mul nuw i64 %22, %24
  %27 = alloca i32, i64 %26, align 16
  store i64 %22, ptr %3, align 8
  store i64 %24, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %28

28:                                               ; preds = %42, %20
  %29 = load i32, ptr %5, align 4, !tbaa !8
  %30 = load i32, ptr %1, align 4, !tbaa !8
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %45

33:                                               ; preds = %28
  %34 = load i32, ptr %5, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = mul nsw i64 %35, %24
  %37 = getelementptr inbounds i32, ptr %27, i64 %36
  %38 = load i32, ptr %5, align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %37, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %40)
  br label %42

42:                                               ; preds = %33
  %43 = load i32, ptr %5, align 4, !tbaa !8
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %5, align 4, !tbaa !8
  br label %28, !llvm.loop !11

45:                                               ; preds = %32
  %46 = load i32, ptr %1, align 4, !tbaa !8
  %47 = zext i32 %46 to i64
  %48 = load i32, ptr %1, align 4, !tbaa !8
  %49 = zext i32 %48 to i64
  %50 = mul nuw i64 %47, %49
  %51 = alloca i32, i64 %50, align 16
  store i64 %47, ptr %6, align 8
  store i64 %49, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %221, %45
  %53 = load i32, ptr %8, align 4, !tbaa !8
  %54 = load i32, ptr %1, align 4, !tbaa !8
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %224

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %58 = load i32, ptr %10, align 4, !tbaa !8
  %59 = load i32, ptr %8, align 4, !tbaa !8
  %60 = add nsw i32 %58, %59
  store i32 %60, ptr %11, align 4, !tbaa !8
  br label %61

61:                                               ; preds = %215, %57
  %62 = load i32, ptr %11, align 4, !tbaa !8
  %63 = load i32, ptr %1, align 4, !tbaa !8
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %220

66:                                               ; preds = %61
  %67 = load i32, ptr %8, align 4, !tbaa !8
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %69, label %77

69:                                               ; preds = %66
  %70 = load i32, ptr %10, align 4, !tbaa !8
  %71 = sext i32 %70 to i64
  %72 = mul nsw i64 %71, %49
  %73 = getelementptr inbounds i32, ptr %51, i64 %72
  %74 = load i32, ptr %11, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr %73, i64 %75
  store i32 0, ptr %76, align 4, !tbaa !8
  br label %214

77:                                               ; preds = %66
  %78 = load i32, ptr %10, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = mul nsw i64 %79, %49
  %81 = getelementptr inbounds i32, ptr %51, i64 %80
  %82 = load i32, ptr %11, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %81, i64 %83
  store i32 1000000000, ptr %84, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %85 = load i32, ptr %10, align 4, !tbaa !8
  store i32 %85, ptr %12, align 4, !tbaa !8
  br label %86

86:                                               ; preds = %210, %77
  %87 = load i32, ptr %12, align 4, !tbaa !8
  %88 = load i32, ptr %11, align 4, !tbaa !8
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %213

91:                                               ; preds = %86
  %92 = load i32, ptr %10, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %49
  %95 = getelementptr inbounds i32, ptr %51, i64 %94
  %96 = load i32, ptr %11, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr %95, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !8
  %100 = load i32, ptr %10, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = mul nsw i64 %101, %49
  %103 = getelementptr inbounds i32, ptr %51, i64 %102
  %104 = load i32, ptr %12, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr %103, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !8
  %108 = load i32, ptr %12, align 4, !tbaa !8
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = mul nsw i64 %110, %49
  %112 = getelementptr inbounds i32, ptr %51, i64 %111
  %113 = load i32, ptr %11, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %112, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !8
  %117 = add nsw i32 %107, %116
  %118 = load i32, ptr %10, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = mul nsw i64 %119, %24
  %121 = getelementptr inbounds i32, ptr %27, i64 %120
  %122 = load i32, ptr %12, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %121, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !8
  %126 = load i32, ptr %12, align 4, !tbaa !8
  %127 = add nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = mul nsw i64 %128, %24
  %130 = getelementptr inbounds i32, ptr %27, i64 %129
  %131 = load i32, ptr %11, align 4, !tbaa !8
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %130, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !8
  %135 = mul nsw i32 %125, %134
  %136 = add nsw i32 %117, %135
  %137 = icmp sgt i32 %99, %136
  br i1 %137, label %138, label %209

138:                                              ; preds = %91
  %139 = load i32, ptr %10, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = mul nsw i64 %140, %49
  %142 = getelementptr inbounds i32, ptr %51, i64 %141
  %143 = load i32, ptr %12, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = load i32, ptr %12, align 4, !tbaa !8
  %148 = add nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = mul nsw i64 %149, %49
  %151 = getelementptr inbounds i32, ptr %51, i64 %150
  %152 = load i32, ptr %11, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i32, ptr %151, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !8
  %156 = add nsw i32 %146, %155
  %157 = load i32, ptr %10, align 4, !tbaa !8
  %158 = sext i32 %157 to i64
  %159 = mul nsw i64 %158, %24
  %160 = getelementptr inbounds i32, ptr %27, i64 %159
  %161 = load i32, ptr %12, align 4, !tbaa !8
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %160, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !8
  %165 = load i32, ptr %12, align 4, !tbaa !8
  %166 = add nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = mul nsw i64 %167, %24
  %169 = getelementptr inbounds i32, ptr %27, i64 %168
  %170 = load i32, ptr %11, align 4, !tbaa !8
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %169, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !8
  %174 = mul nsw i32 %164, %173
  %175 = add nsw i32 %156, %174
  %176 = load i32, ptr %10, align 4, !tbaa !8
  %177 = sext i32 %176 to i64
  %178 = mul nsw i64 %177, %49
  %179 = getelementptr inbounds i32, ptr %51, i64 %178
  %180 = load i32, ptr %11, align 4, !tbaa !8
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i32, ptr %179, i64 %181
  store i32 %175, ptr %182, align 4, !tbaa !8
  %183 = load i32, ptr %10, align 4, !tbaa !8
  %184 = sext i32 %183 to i64
  %185 = mul nsw i64 %184, %24
  %186 = getelementptr inbounds i32, ptr %27, i64 %185
  %187 = load i32, ptr %12, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds i32, ptr %186, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !8
  %191 = load i32, ptr %12, align 4, !tbaa !8
  %192 = add nsw i32 %191, 1
  %193 = sext i32 %192 to i64
  %194 = mul nsw i64 %193, %24
  %195 = getelementptr inbounds i32, ptr %27, i64 %194
  %196 = load i32, ptr %11, align 4, !tbaa !8
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds i32, ptr %195, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !8
  %200 = add nsw i32 %190, %199
  %201 = srem i32 %200, 100
  %202 = load i32, ptr %10, align 4, !tbaa !8
  %203 = sext i32 %202 to i64
  %204 = mul nsw i64 %203, %24
  %205 = getelementptr inbounds i32, ptr %27, i64 %204
  %206 = load i32, ptr %11, align 4, !tbaa !8
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds i32, ptr %205, i64 %207
  store i32 %201, ptr %208, align 4, !tbaa !8
  br label %209

209:                                              ; preds = %138, %91
  br label %210

210:                                              ; preds = %209
  %211 = load i32, ptr %12, align 4, !tbaa !8
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %12, align 4, !tbaa !8
  br label %86, !llvm.loop !13

213:                                              ; preds = %90
  br label %214

214:                                              ; preds = %213, %69
  br label %215

215:                                              ; preds = %214
  %216 = load i32, ptr %10, align 4, !tbaa !8
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %10, align 4, !tbaa !8
  %218 = load i32, ptr %11, align 4, !tbaa !8
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %11, align 4, !tbaa !8
  br label %61, !llvm.loop !14

220:                                              ; preds = %65
  br label %221

221:                                              ; preds = %220
  %222 = load i32, ptr %8, align 4, !tbaa !8
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %8, align 4, !tbaa !8
  br label %52, !llvm.loop !15

224:                                              ; preds = %56
  %225 = mul nsw i64 0, %49
  %226 = getelementptr inbounds i32, ptr %51, i64 %225
  %227 = load i32, ptr %1, align 4, !tbaa !8
  %228 = sub nsw i32 %227, 1
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds i32, ptr %226, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !8
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %231)
  %233 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %232, ptr noundef @.str)
  %234 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %234)
  br label %13, !llvm.loop !16

235:                                              ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #0 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr %2, i64 %5
  %7 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %6)
  br i1 %7, label %.lr.ph66, label %._crit_edge67

.lr.ph66:                                         ; preds = %0, %._crit_edge64.loopexit
  %8 = load i32, ptr %1, align 4, !tbaa !8
  %9 = zext i32 %8 to i64
  %10 = call ptr @llvm.stacksave.p0()
  %11 = mul nuw i64 %9, %9
  %12 = alloca i32, i64 %11, align 16
  %13 = load i32, ptr %1, align 4, !tbaa !8
  %14 = icmp sgt i32 %13, 0
  call void @llvm.assume(i1 %14)
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %15 = zext nneg i32 %23 to i64
  %16 = mul nuw nsw i64 %15, %15
  %17 = alloca i32, i64 %16, align 16
  %18 = icmp sgt i32 %23, 0
  call void @llvm.assume(i1 %18)
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph66, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph66 ]
  %19 = mul nuw nsw i64 %indvars.iv, %9
  %20 = getelementptr inbounds i32, ptr %12, i64 %19
  %21 = getelementptr inbounds i32, ptr %20, i64 %indvars.iv
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr %1, align 4, !tbaa !8
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge, %.split.us
  %indvars.iv83 = phi i32 [ %indvars.iv.next84, %.split.us ], [ %23, %._crit_edge ]
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.split.us ], [ 0, %._crit_edge ]
  %26 = zext i32 %indvars.iv83 to i64
  %27 = and i64 %indvars.iv76, 4294967295
  %28 = icmp eq i64 %27, 0
  %wide.trip.count = zext i32 %indvars.iv83 to i64
  br i1 %28, label %.preheader.split.us.preheader, label %.preheader.split

.preheader.split.us.preheader:                    ; preds = %.preheader
  %29 = add nsw i64 %26, -1
  %xtraiter = and i64 %26, 3
  %30 = icmp ult i64 %29, 3
  br i1 %30, label %.split.us.loopexit.unr-lcssa, label %.preheader.split.us.preheader.new

.preheader.split.us.preheader.new:                ; preds = %.preheader.split.us.preheader
  %unroll_iter = and i64 %26, 4294967292
  br label %.preheader.split.us

.preheader.split.us:                              ; preds = %.preheader.split.us, %.preheader.split.us.preheader.new
  %indvars.iv89 = phi i64 [ 0, %.preheader.split.us.preheader.new ], [ %indvars.iv.next90.3, %.preheader.split.us ]
  %indvars.iv87 = phi i64 [ %indvars.iv76, %.preheader.split.us.preheader.new ], [ %indvars.iv.next88.3, %.preheader.split.us ]
  %niter = phi i64 [ 0, %.preheader.split.us.preheader.new ], [ %niter.next.3, %.preheader.split.us ]
  %31 = mul nuw nsw i64 %indvars.iv89, %15
  %32 = getelementptr inbounds i32, ptr %17, i64 %31
  %33 = getelementptr inbounds i32, ptr %32, i64 %indvars.iv87
  store i32 0, ptr %33, align 4, !tbaa !8
  %indvars.iv.next90 = or disjoint i64 %indvars.iv89, 1
  %indvars.iv.next88 = or disjoint i64 %indvars.iv87, 1
  %34 = mul nuw nsw i64 %indvars.iv.next90, %15
  %35 = getelementptr inbounds i32, ptr %17, i64 %34
  %36 = getelementptr inbounds i32, ptr %35, i64 %indvars.iv.next88
  store i32 0, ptr %36, align 4, !tbaa !8
  %indvars.iv.next90.1 = or disjoint i64 %indvars.iv89, 2
  %indvars.iv.next88.1 = or disjoint i64 %indvars.iv87, 2
  %37 = mul nuw nsw i64 %indvars.iv.next90.1, %15
  %38 = getelementptr inbounds i32, ptr %17, i64 %37
  %39 = getelementptr inbounds i32, ptr %38, i64 %indvars.iv.next88.1
  store i32 0, ptr %39, align 4, !tbaa !8
  %indvars.iv.next90.2 = or disjoint i64 %indvars.iv89, 3
  %indvars.iv.next88.2 = or disjoint i64 %indvars.iv87, 3
  %40 = mul nuw nsw i64 %indvars.iv.next90.2, %15
  %41 = getelementptr inbounds i32, ptr %17, i64 %40
  %42 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv.next88.2
  store i32 0, ptr %42, align 4, !tbaa !8
  %indvars.iv.next90.3 = add nuw nsw i64 %indvars.iv89, 4
  %indvars.iv.next88.3 = add nuw nsw i64 %indvars.iv87, 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 %.split.us.loopexit.unr-lcssa, label %.preheader.split.us, !llvm.loop !13

._crit_edge64.loopexit:                           ; preds = %.split.us
  %.phi.trans.insert = zext nneg i32 %23 to i64
  %.phi.trans.insert98 = getelementptr i32, ptr %17, i64 %.phi.trans.insert
  %.phi.trans.insert99 = getelementptr i8, ptr %.phi.trans.insert98, i64 -4
  %.pre = load i32, ptr %.phi.trans.insert99, align 4, !tbaa !8
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.pre)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @.str)
  call void @llvm.stackrestore.p0(ptr %10)
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr i8, ptr %46, i64 -24
  %48 = load i64, ptr %47, align 8
  %49 = getelementptr inbounds i8, ptr %45, i64 %48
  %50 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %49)
  br i1 %50, label %.lr.ph66, label %._crit_edge67, !llvm.loop !14

.split.us.loopexit.unr-lcssa:                     ; preds = %.preheader.split.us, %.preheader.split.us.preheader
  %indvars.iv89.unr = phi i64 [ 0, %.preheader.split.us.preheader ], [ %indvars.iv.next90.3, %.preheader.split.us ]
  %indvars.iv87.unr = phi i64 [ %indvars.iv76, %.preheader.split.us.preheader ], [ %indvars.iv.next88.3, %.preheader.split.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.split.us, label %.preheader.split.us.epil

.preheader.split.us.epil:                         ; preds = %.split.us.loopexit.unr-lcssa, %.preheader.split.us.epil
  %indvars.iv89.epil = phi i64 [ %indvars.iv.next90.epil, %.preheader.split.us.epil ], [ %indvars.iv89.unr, %.split.us.loopexit.unr-lcssa ]
  %indvars.iv87.epil = phi i64 [ %indvars.iv.next88.epil, %.preheader.split.us.epil ], [ %indvars.iv87.unr, %.split.us.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader.split.us.epil ], [ 0, %.split.us.loopexit.unr-lcssa ]
  %51 = mul nuw nsw i64 %indvars.iv89.epil, %15
  %52 = getelementptr inbounds i32, ptr %17, i64 %51
  %53 = getelementptr inbounds i32, ptr %52, i64 %indvars.iv87.epil
  store i32 0, ptr %53, align 4, !tbaa !8
  %indvars.iv.next90.epil = add nuw nsw i64 %indvars.iv89.epil, 1
  %indvars.iv.next88.epil = add nuw nsw i64 %indvars.iv87.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 %.split.us, label %.preheader.split.us.epil, !llvm.loop !15

.split.us:                                        ; preds = %.loopexit, %.split.us.loopexit.unr-lcssa, %.preheader.split.us.epil
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %indvars.iv.next84 = add i32 %indvars.iv83, -1
  %exitcond97.not = icmp eq i64 %indvars.iv.next77, %15
  br i1 %exitcond97.not, label %._crit_edge64.loopexit, label %.preheader, !llvm.loop !17

.preheader.split:                                 ; preds = %.preheader, %.loopexit
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.loopexit ], [ %indvars.iv76, %.preheader ]
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %.loopexit ], [ 0, %.preheader ]
  %54 = mul nuw nsw i64 %indvars.iv71, %15
  %55 = getelementptr inbounds i32, ptr %17, i64 %54
  %56 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv78
  store i32 1000000000, ptr %56, align 4, !tbaa !8
  %invariant.gep = getelementptr inbounds i32, ptr %17, i64 %indvars.iv78
  %invariant.gep54 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv78
  %57 = icmp ult i64 %indvars.iv71, %indvars.iv78
  br i1 %57, label %.lr.ph58, label %.loopexit

.lr.ph58:                                         ; preds = %.preheader.split
  %58 = mul nuw nsw i64 %indvars.iv71, %9
  %59 = getelementptr inbounds i32, ptr %12, i64 %58
  %60 = getelementptr inbounds i32, ptr %59, i64 %indvars.iv78
  br label %61

61:                                               ; preds = %.lr.ph58, %78
  %indvars.iv73 = phi i64 [ %indvars.iv71, %.lr.ph58 ], [ %indvars.iv.next74, %78 ]
  %62 = phi i32 [ 1000000000, %.lr.ph58 ], [ %79, %78 ]
  %63 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv73
  %64 = load i32, ptr %63, align 4, !tbaa !8
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %65 = mul nuw nsw i64 %indvars.iv.next74, %15
  %gep = getelementptr inbounds i32, ptr %invariant.gep, i64 %65
  %66 = load i32, ptr %gep, align 4, !tbaa !8
  %67 = add nsw i32 %66, %64
  %68 = getelementptr inbounds i32, ptr %59, i64 %indvars.iv73
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %70 = mul nuw nsw i64 %indvars.iv.next74, %9
  %gep55 = getelementptr inbounds i32, ptr %invariant.gep54, i64 %70
  %71 = load i32, ptr %gep55, align 4, !tbaa !8
  %72 = mul nsw i32 %71, %69
  %73 = add nsw i32 %67, %72
  %74 = icmp sgt i32 %62, %73
  br i1 %74, label %75, label %78

75:                                               ; preds = %61
  store i32 %73, ptr %56, align 4, !tbaa !8
  %76 = add nsw i32 %71, %69
  %77 = srem i32 %76, 100
  store i32 %77, ptr %60, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %61, %75
  %79 = phi i32 [ %62, %61 ], [ %73, %75 ]
  %exitcond.not = icmp eq i64 %indvars.iv.next74, %indvars.iv78
  br i1 %exitcond.not, label %.loopexit, label %61, !llvm.loop !18

.loopexit:                                        ; preds = %78, %.preheader.split
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count
  br i1 %exitcond86.not, label %.split.us, label %.preheader.split, !llvm.loop !13

._crit_edge67:                                    ; preds = %._crit_edge64.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void
}

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

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 #2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5

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


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