; LLVM IR from div-bargali/Data-Structures-and-Algorithms :: C++/Algorithms/Dynamic-Programming (egg_dropping_problem)

; 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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %11 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = add nsw i64 %15, 1
  %17 = load i64, ptr %5, align 8, !tbaa !5
  %18 = add nsw i64 %17, 1
  %19 = call ptr @llvm.stacksave.p0()
  store ptr %19, ptr %6, align 8
  %20 = mul nuw i64 %16, %18
  %21 = alloca i64, i64 %20, align 16
  store i64 %16, ptr %7, align 8
  store i64 %18, ptr %8, align 8
  store i64 1, ptr %3, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %35, %0
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = load i64, ptr %2, align 8, !tbaa !5
  %25 = icmp sle i64 %23, %24
  br i1 %25, label %26, label %38

26:                                               ; preds = %22
  %27 = load i64, ptr %3, align 8, !tbaa !5
  %28 = mul nsw i64 %27, %18
  %29 = getelementptr inbounds i64, ptr %21, i64 %28
  %30 = getelementptr inbounds i64, ptr %29, i64 1
  store i64 1, ptr %30, align 8, !tbaa !5
  %31 = load i64, ptr %3, align 8, !tbaa !5
  %32 = mul nsw i64 %31, %18
  %33 = getelementptr inbounds i64, ptr %21, i64 %32
  %34 = getelementptr inbounds i64, ptr %33, i64 0
  store i64 0, ptr %34, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %26
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %37 = add nsw i64 %36, 1
  store i64 %37, ptr %3, align 8, !tbaa !5
  br label %22, !llvm.loop !9

38:                                               ; preds = %22
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %49, %38
  %40 = load i64, ptr %4, align 8, !tbaa !5
  %41 = load i64, ptr %5, align 8, !tbaa !5
  %42 = icmp sle i64 %40, %41
  br i1 %42, label %43, label %52

43:                                               ; preds = %39
  %44 = load i64, ptr %4, align 8, !tbaa !5
  %45 = mul nsw i64 1, %18
  %46 = getelementptr inbounds i64, ptr %21, i64 %45
  %47 = load i64, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds i64, ptr %46, i64 %47
  store i64 %44, ptr %48, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %43
  %50 = load i64, ptr %4, align 8, !tbaa !5
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %4, align 8, !tbaa !5
  br label %39, !llvm.loop !11

52:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 2, ptr %3, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %114, %52
  %54 = load i64, ptr %3, align 8, !tbaa !5
  %55 = load i64, ptr %2, align 8, !tbaa !5
  %56 = icmp sle i64 %54, %55
  br i1 %56, label %57, label %117

57:                                               ; preds = %53
  store i64 2, ptr %4, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %110, %57
  %59 = load i64, ptr %4, align 8, !tbaa !5
  %60 = load i64, ptr %5, align 8, !tbaa !5
  %61 = icmp sle i64 %59, %60
  br i1 %61, label %62, label %113

62:                                               ; preds = %58
  %63 = load i64, ptr %3, align 8, !tbaa !5
  %64 = mul nsw i64 %63, %18
  %65 = getelementptr inbounds i64, ptr %21, i64 %64
  %66 = load i64, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds i64, ptr %65, i64 %66
  store i64 2147483647, ptr %67, align 8, !tbaa !5
  store i64 1, ptr %10, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %106, %62
  %69 = load i64, ptr %10, align 8, !tbaa !5
  %70 = load i64, ptr %4, align 8, !tbaa !5
  %71 = icmp sle i64 %69, %70
  br i1 %71, label %72, label %109

72:                                               ; preds = %68
  %73 = load i64, ptr %3, align 8, !tbaa !5
  %74 = sub nsw i64 %73, 1
  %75 = mul nsw i64 %74, %18
  %76 = getelementptr inbounds i64, ptr %21, i64 %75
  %77 = load i64, ptr %10, align 8, !tbaa !5
  %78 = sub nsw i64 %77, 1
  %79 = getelementptr inbounds i64, ptr %76, i64 %78
  %80 = load i64, ptr %3, align 8, !tbaa !5
  %81 = mul nsw i64 %80, %18
  %82 = getelementptr inbounds i64, ptr %21, i64 %81
  %83 = load i64, ptr %4, align 8, !tbaa !5
  %84 = load i64, ptr %10, align 8, !tbaa !5
  %85 = sub nsw i64 %83, %84
  %86 = getelementptr inbounds i64, ptr %82, i64 %85
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull align 8 dereferenceable(8) %86)
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = add nsw i64 1, %88
  store i64 %89, ptr %9, align 8, !tbaa !5
  %90 = load i64, ptr %9, align 8, !tbaa !5
  %91 = load i64, ptr %3, align 8, !tbaa !5
  %92 = mul nsw i64 %91, %18
  %93 = getelementptr inbounds i64, ptr %21, i64 %92
  %94 = load i64, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds i64, ptr %93, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = icmp slt i64 %90, %96
  br i1 %97, label %98, label %105

98:                                               ; preds = %72
  %99 = load i64, ptr %9, align 8, !tbaa !5
  %100 = load i64, ptr %3, align 8, !tbaa !5
  %101 = mul nsw i64 %100, %18
  %102 = getelementptr inbounds i64, ptr %21, i64 %101
  %103 = load i64, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds i64, ptr %102, i64 %103
  store i64 %99, ptr %104, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %98, %72
  br label %106

106:                                              ; preds = %105
  %107 = load i64, ptr %10, align 8, !tbaa !5
  %108 = add nsw i64 %107, 1
  store i64 %108, ptr %10, align 8, !tbaa !5
  br label %68, !llvm.loop !12

109:                                              ; preds = %68
  br label %110

110:                                              ; preds = %109
  %111 = load i64, ptr %4, align 8, !tbaa !5
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %4, align 8, !tbaa !5
  br label %58, !llvm.loop !13

113:                                              ; preds = %58
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %3, align 8, !tbaa !5
  %116 = add nsw i64 %115, 1
  store i64 %116, ptr %3, align 8, !tbaa !5
  br label %53, !llvm.loop !14

117:                                              ; preds = %53
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %119 = load i64, ptr %2, align 8, !tbaa !5
  %120 = mul nsw i64 %119, %18
  %121 = getelementptr inbounds i64, ptr %21, i64 %120
  %122 = load i64, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds i64, ptr %121, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %118, i64 noundef %124)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %126 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %126)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %127 = load i32, ptr %1, align 4
  ret i32 %127
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 = !{!"long long", !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::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %3 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %5 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = add nsw i64 %7, 1
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = add nsw i64 %9, 1
  %11 = call ptr @llvm.stacksave.p0()
  %12 = mul nuw i64 %10, %8
  %13 = alloca i64, i64 %12, align 16
  %14 = load i64, ptr %1, align 8, !tbaa !5
  %.not39 = icmp slt i64 %14, 1
  br i1 %.not39, label %.preheader38, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %xtraiter = and i64 %14, 3
  %15 = icmp ult i64 %14, 4
  br i1 %15, label %.preheader38.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %14, 9223372036854775804
  br label %.lr.ph

.preheader38.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %.02940.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %40, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader38, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader38.loopexit.unr-lcssa, %.lr.ph.epil
  %.02940.epil = phi i64 [ %19, %.lr.ph.epil ], [ %.02940.unr, %.preheader38.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader38.loopexit.unr-lcssa ]
  %16 = mul nsw i64 %.02940.epil, %10
  %17 = getelementptr inbounds i64, ptr %13, i64 %16
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  store i64 1, ptr %18, align 8, !tbaa !5
  store i64 0, ptr %17, align 8, !tbaa !5
  %19 = add nuw i64 %.02940.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 %.preheader38, label %.lr.ph.epil, !llvm.loop !9

.preheader38:                                     ; preds = %.preheader38.loopexit.unr-lcssa, %.lr.ph.epil, %0
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %.not3341 = icmp slt i64 %20, 1
  br i1 %.not3341, label %.preheader37, label %.lr.ph43

.lr.ph43:                                         ; preds = %.preheader38
  %21 = getelementptr inbounds i64, ptr %13, i64 %10
  %min.iters.check = icmp ult i64 %20, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph43
  %.03042.ph = phi i64 [ 1, %.lr.ph43 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph43
  %n.vec = and i64 %20, 9223372036854775804
  %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 <2 x i64> [ <i64 1, i64 2>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %offset.idx = or disjoint i64 %index, 1
  %22 = getelementptr inbounds i64, ptr %21, i64 %offset.idx
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <2 x i64> %vec.ind, ptr %22, align 8, !tbaa !5
  store <2 x i64> %step.add, ptr %23, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %20, %n.vec
  br i1 %cmp.n, label %.preheader37, label %scalar.ph.preheader

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.02940 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %40, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %25 = mul nsw i64 %.02940, %10
  %26 = getelementptr inbounds i64, ptr %13, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  store i64 1, ptr %27, align 8, !tbaa !5
  store i64 0, ptr %26, align 8, !tbaa !5
  %28 = add nuw nsw i64 %.02940, 1
  %29 = mul nsw i64 %28, %10
  %30 = getelementptr inbounds i64, ptr %13, i64 %29
  %31 = getelementptr inbounds i8, ptr %30, i64 8
  store i64 1, ptr %31, align 8, !tbaa !5
  store i64 0, ptr %30, align 8, !tbaa !5
  %32 = add nuw nsw i64 %.02940, 2
  %33 = mul nsw i64 %32, %10
  %34 = getelementptr inbounds i64, ptr %13, i64 %33
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  store i64 1, ptr %35, align 8, !tbaa !5
  store i64 0, ptr %34, align 8, !tbaa !5
  %36 = add nuw i64 %.02940, 3
  %37 = mul nsw i64 %36, %10
  %38 = getelementptr inbounds i64, ptr %13, i64 %37
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  store i64 1, ptr %39, align 8, !tbaa !5
  store i64 0, ptr %38, align 8, !tbaa !5
  %40 = add nuw i64 %.02940, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader38.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !15

.preheader37:                                     ; preds = %scalar.ph, %middle.block, %.preheader38
  %.not3450 = icmp slt i64 %14, 2
  br i1 %.not3450, label %._crit_edge52, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader37
  %invariant.gep45 = getelementptr i8, ptr %13, i64 -8
  %41 = icmp slt i64 %20, 2
  br i1 %41, label %._crit_edge52, label %.preheader

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.03042 = phi i64 [ %43, %scalar.ph ], [ %.03042.ph, %scalar.ph.preheader ]
  %42 = getelementptr inbounds i64, ptr %21, i64 %.03042
  store i64 %.03042, ptr %42, align 8, !tbaa !5
  %43 = add nuw i64 %.03042, 1
  %exitcond54.not = icmp eq i64 %.03042, %20
  br i1 %exitcond54.not, label %.preheader37, label %scalar.ph, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %44 = phi i64 [ %66, %._crit_edge ], [ %14, %.preheader.lr.ph ]
  %45 = phi i64 [ %67, %._crit_edge ], [ %20, %.preheader.lr.ph ]
  %.151 = phi i64 [ %68, %._crit_edge ], [ 2, %.preheader.lr.ph ]
  %.not3547 = icmp slt i64 %45, 2
  br i1 %.not3547, label %._crit_edge, label %.lr.ph49

.lr.ph49:                                         ; preds = %.preheader
  %46 = mul nsw i64 %.151, %10
  %47 = getelementptr inbounds i64, ptr %13, i64 %46
  %48 = add nsw i64 %.151, -1
  %49 = mul nsw i64 %48, %10
  %gep46 = getelementptr i64, ptr %invariant.gep45, i64 %49
  br label %50

50:                                               ; preds = %.lr.ph49, %63
  %indvars.iv = phi i64 [ 3, %.lr.ph49 ], [ %indvars.iv.next, %63 ]
  %.13148 = phi i64 [ 2, %.lr.ph49 ], [ %64, %63 ]
  %51 = getelementptr inbounds i64, ptr %47, i64 %.13148
  store i64 2147483647, ptr %51, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %50, %61
  %.044 = phi i64 [ 1, %50 ], [ %62, %61 ]
  %gep = getelementptr i64, ptr %gep46, i64 %.044
  %53 = sub nsw i64 %.13148, %.044
  %54 = getelementptr inbounds i64, ptr %47, i64 %53
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %gep, ptr noundef nonnull align 8 dereferenceable(8) %54)
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = add nsw i64 %56, 1
  %58 = load i64, ptr %51, align 8, !tbaa !5
  %59 = icmp slt i64 %57, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %52
  store i64 %57, ptr %51, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %52, %60
  %62 = add nuw i64 %.044, 1
  %exitcond55.not = icmp eq i64 %62, %indvars.iv
  br i1 %exitcond55.not, label %63, label %52, !llvm.loop !17

63:                                               ; preds = %61
  %64 = add nuw nsw i64 %.13148, 1
  %65 = load i64, ptr %2, align 8, !tbaa !5
  %.not35.not = icmp slt i64 %.13148, %65
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  br i1 %.not35.not, label %50, label %._crit_edge.loopexit, !llvm.loop !18

._crit_edge.loopexit:                             ; preds = %63
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %66 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %44, %.preheader ]
  %67 = phi i64 [ %65, %._crit_edge.loopexit ], [ %45, %.preheader ]
  %68 = add nuw nsw i64 %.151, 1
  %.not34.not = icmp slt i64 %.151, %66
  br i1 %.not34.not, label %.preheader, label %._crit_edge52, !llvm.loop !19

._crit_edge52:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader37
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %70 = load i64, ptr %1, align 8, !tbaa !5
  %71 = mul nsw i64 %70, %10
  %72 = getelementptr inbounds i64, ptr %13, i64 %71
  %73 = load i64, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds i64, ptr %72, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !5
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %69, i64 noundef %75)
  call void @llvm.stackrestore.p0(ptr %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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 #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

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

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


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