; LLVM IR from AdarshGaur/Competitive-Programming :: Atcoder/AtCoder Beginner Contest 208/D - Shortest Path Queries 2.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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %20 = load i64, ptr %1, align 8, !tbaa !5
  %21 = add nsw i64 %20, 1
  %22 = load i64, ptr %1, align 8, !tbaa !5
  %23 = add nsw i64 %22, 1
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %3, align 8
  %25 = mul nuw i64 %21, %23
  %26 = alloca i64, i64 %25, align 16
  store i64 %21, ptr %4, align 8
  store i64 %23, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %53, %0
  %28 = load i64, ptr %6, align 8, !tbaa !5
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %30 = icmp sle i64 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %44, %32
  %34 = load i64, ptr %8, align 8, !tbaa !5
  %35 = load i64, ptr %1, align 8, !tbaa !5
  %36 = icmp sle i64 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i64, ptr %6, align 8, !tbaa !5
  %40 = mul nsw i64 %39, %23
  %41 = getelementptr inbounds i64, ptr %26, i64 %40
  %42 = load i64, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds i64, ptr %41, i64 %42
  store i64 2000000000000000000, ptr %43, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %38
  %45 = load i64, ptr %8, align 8, !tbaa !5
  %46 = add nsw i64 %45, 1
  store i64 %46, ptr %8, align 8, !tbaa !5
  br label %33, !llvm.loop !9

47:                                               ; preds = %37
  %48 = load i64, ptr %6, align 8, !tbaa !5
  %49 = mul nsw i64 %48, %23
  %50 = getelementptr inbounds i64, ptr %26, i64 %49
  %51 = load i64, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds i64, ptr %50, i64 %51
  store i64 0, ptr %52, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %47
  %54 = load i64, ptr %6, align 8, !tbaa !5
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %6, align 8, !tbaa !5
  br label %27, !llvm.loop !11

56:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %72, %56
  %58 = load i64, ptr %9, align 8, !tbaa !5
  %59 = load i64, ptr %2, align 8, !tbaa !5
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %66 = load i64, ptr %12, align 8, !tbaa !5
  %67 = load i64, ptr %10, align 8, !tbaa !5
  %68 = mul nsw i64 %67, %23
  %69 = getelementptr inbounds i64, ptr %26, i64 %68
  %70 = load i64, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds i64, ptr %69, i64 %70
  store i64 %66, ptr %71, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %72

72:                                               ; preds = %62
  %73 = load i64, ptr %9, align 8, !tbaa !5
  %74 = add nsw i64 %73, 1
  store i64 %74, ptr %9, align 8, !tbaa !5
  br label %57, !llvm.loop !12

75:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 1, ptr %14, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %144, %75
  %77 = load i64, ptr %14, align 8, !tbaa !5
  %78 = load i64, ptr %1, align 8, !tbaa !5
  %79 = icmp sle i64 %77, %78
  br i1 %79, label %81, label %80

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

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 1, ptr %15, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %140, %81
  %83 = load i64, ptr %15, align 8, !tbaa !5
  %84 = load i64, ptr %1, align 8, !tbaa !5
  %85 = icmp sle i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %143

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 1, ptr %16, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %136, %87
  %89 = load i64, ptr %16, align 8, !tbaa !5
  %90 = load i64, ptr %1, align 8, !tbaa !5
  %91 = icmp sle i64 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %139

93:                                               ; preds = %88
  %94 = load i64, ptr %15, align 8, !tbaa !5
  %95 = mul nsw i64 %94, %23
  %96 = getelementptr inbounds i64, ptr %26, i64 %95
  %97 = load i64, ptr %16, align 8, !tbaa !5
  %98 = getelementptr inbounds i64, ptr %96, i64 %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %99 = load i64, ptr %15, align 8, !tbaa !5
  %100 = mul nsw i64 %99, %23
  %101 = getelementptr inbounds i64, ptr %26, i64 %100
  %102 = load i64, ptr %14, align 8, !tbaa !5
  %103 = getelementptr inbounds i64, ptr %101, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !5
  %105 = load i64, ptr %14, align 8, !tbaa !5
  %106 = mul nsw i64 %105, %23
  %107 = getelementptr inbounds i64, ptr %26, i64 %106
  %108 = load i64, ptr %16, align 8, !tbaa !5
  %109 = getelementptr inbounds i64, ptr %107, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !5
  %111 = add nsw i64 %104, %110
  store i64 %111, ptr %17, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %113 = load i64, ptr %112, align 8, !tbaa !5
  %114 = load i64, ptr %15, align 8, !tbaa !5
  %115 = mul nsw i64 %114, %23
  %116 = getelementptr inbounds i64, ptr %26, i64 %115
  %117 = load i64, ptr %16, align 8, !tbaa !5
  %118 = getelementptr inbounds i64, ptr %116, i64 %117
  store i64 %113, ptr %118, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %119 = load i64, ptr %15, align 8, !tbaa !5
  %120 = mul nsw i64 %119, %23
  %121 = getelementptr inbounds i64, ptr %26, i64 %120
  %122 = load i64, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds i64, ptr %121, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !5
  %125 = icmp slt i64 %124, 2000000000000000000
  br i1 %125, label %126, label %135

126:                                              ; preds = %93
  %127 = load i64, ptr %15, align 8, !tbaa !5
  %128 = mul nsw i64 %127, %23
  %129 = getelementptr inbounds i64, ptr %26, i64 %128
  %130 = load i64, ptr %16, align 8, !tbaa !5
  %131 = getelementptr inbounds i64, ptr %129, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !5
  %133 = load i64, ptr %13, align 8, !tbaa !5
  %134 = add nsw i64 %133, %132
  store i64 %134, ptr %13, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %126, %93
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %16, align 8, !tbaa !5
  %138 = add nsw i64 %137, 1
  store i64 %138, ptr %16, align 8, !tbaa !5
  br label %88, !llvm.loop !13

139:                                              ; preds = %92
  br label %140

140:                                              ; preds = %139
  %141 = load i64, ptr %15, align 8, !tbaa !5
  %142 = add nsw i64 %141, 1
  store i64 %142, ptr %15, align 8, !tbaa !5
  br label %82, !llvm.loop !14

143:                                              ; preds = %86
  br label %144

144:                                              ; preds = %143
  %145 = load i64, ptr %14, align 8, !tbaa !5
  %146 = add nsw i64 %145, 1
  store i64 %146, ptr %14, align 8, !tbaa !5
  br label %76, !llvm.loop !15

147:                                              ; preds = %80
  %148 = load i64, ptr %13, align 8, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %148)
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %151 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %151)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, 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

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

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

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; 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

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

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

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 = { nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #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 = !{!"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}
!15 = distinct !{!15, !10}


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

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

@_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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %9 = load i64, ptr %1, align 8, !tbaa !5
  %10 = add nsw i64 %9, 1
  %11 = call ptr @llvm.stacksave.p0()
  %12 = mul nuw i64 %10, %10
  %13 = alloca i64, i64 %12, align 16
  %14 = load i64, ptr %1, align 8, !tbaa !5
  %.not47 = icmp slt i64 %14, 0
  br i1 %.not47, label %.preheader43, label %.preheader44.preheader

.preheader44.preheader:                           ; preds = %0
  %15 = add nuw i64 %14, 1
  %min.iters.check = icmp ult i64 %14, 3
  %n.vec = and i64 %15, -4
  %cmp.n = icmp eq i64 %15, %n.vec
  br label %.preheader44

.preheader44:                                     ; preds = %.preheader44.preheader, %._crit_edge
  %.03548 = phi i64 [ %24, %._crit_edge ], [ 0, %.preheader44.preheader ]
  %16 = mul nsw i64 %.03548, %10
  %17 = getelementptr inbounds i64, ptr %13, i64 %16
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader44
  %.03446.ph = phi i64 [ 0, %.preheader44 ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.body:                                      ; preds = %.preheader44, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader44 ]
  %18 = getelementptr inbounds i64, ptr %17, i64 %index
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store <2 x i64> <i64 2000000000000000000, i64 2000000000000000000>, ptr %18, align 8, !tbaa !5
  store <2 x i64> <i64 2000000000000000000, i64 2000000000000000000>, ptr %19, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

.preheader43:                                     ; preds = %._crit_edge, %0
  %21 = load i64, ptr %2, align 8, !tbaa !5
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph, label %.preheader42

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %23 = getelementptr inbounds i64, ptr %17, i64 %.03548
  store i64 0, ptr %23, align 8, !tbaa !5
  %24 = add nuw i64 %.03548, 1
  %exitcond69.not = icmp eq i64 %.03548, %14
  br i1 %exitcond69.not, label %.preheader43, label %.preheader44, !llvm.loop !13

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.03446 = phi i64 [ %26, %scalar.ph ], [ %.03446.ph, %scalar.ph.preheader ]
  %25 = getelementptr inbounds i64, ptr %17, i64 %.03446
  store i64 2000000000000000000, ptr %25, align 8, !tbaa !5
  %26 = add nuw i64 %.03446, 1
  %exitcond.not = icmp eq i64 %.03446, %14
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !14

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

.preheader42:                                     ; preds = %.preheader42.loopexit, %.preheader43
  %27 = phi i64 [ %.pre, %.preheader42.loopexit ], [ %14, %.preheader43 ]
  %.not3760 = icmp slt i64 %27, 1
  br i1 %.not3760, label %._crit_edge64, label %.preheader41

.lr.ph:                                           ; preds = %.preheader43, %.lr.ph
  %.03349 = phi i64 [ %37, %.lr.ph ], [ 0, %.preheader43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %31 = load i64, ptr %5, align 8, !tbaa !5
  %32 = load i64, ptr %3, align 8, !tbaa !5
  %33 = mul nsw i64 %32, %10
  %34 = getelementptr inbounds i64, ptr %13, i64 %33
  %35 = load i64, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds i64, ptr %34, i64 %35
  store i64 %31, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %37 = add nuw nsw i64 %.03349, 1
  %38 = load i64, ptr %2, align 8, !tbaa !5
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %.lr.ph, label %.preheader42.loopexit, !llvm.loop !15

.preheader41:                                     ; preds = %.preheader42, %._crit_edge58
  %40 = phi i64 [ %50, %._crit_edge58 ], [ %27, %.preheader42 ]
  %.03162 = phi i64 [ %51, %._crit_edge58 ], [ 1, %.preheader42 ]
  %.03261 = phi i64 [ %.1.lcssa, %._crit_edge58 ], [ 0, %.preheader42 ]
  %.not3855 = icmp slt i64 %40, 1
  br i1 %.not3855, label %._crit_edge58, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader41
  %41 = mul nsw i64 %.03162, %10
  %42 = getelementptr inbounds i64, ptr %13, i64 %41
  br label %.preheader

._crit_edge64:                                    ; preds = %._crit_edge58, %.preheader42
  %.032.lcssa = phi i64 [ 0, %.preheader42 ], [ %.1.lcssa, %._crit_edge58 ]
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.032.lcssa)
  %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 %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret void

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge54
  %45 = phi i64 [ %52, %._crit_edge54 ], [ %40, %.preheader.preheader ]
  %46 = phi i64 [ %53, %._crit_edge54 ], [ %40, %.preheader.preheader ]
  %.03057 = phi i64 [ %54, %._crit_edge54 ], [ 1, %.preheader.preheader ]
  %.156 = phi i64 [ %.2.lcssa, %._crit_edge54 ], [ %.03261, %.preheader.preheader ]
  %.not3950 = icmp slt i64 %46, 1
  br i1 %.not3950, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %.preheader
  %47 = mul nsw i64 %.03057, %10
  %48 = getelementptr inbounds i64, ptr %13, i64 %47
  %49 = getelementptr inbounds i64, ptr %48, i64 %.03162
  br label %55

._crit_edge58:                                    ; preds = %._crit_edge54, %.preheader41
  %50 = phi i64 [ %40, %.preheader41 ], [ %52, %._crit_edge54 ]
  %.1.lcssa = phi i64 [ %.03261, %.preheader41 ], [ %.2.lcssa, %._crit_edge54 ]
  %51 = add nuw nsw i64 %.03162, 1
  %.not37.not = icmp slt i64 %.03162, %50
  br i1 %.not37.not, label %.preheader41, label %._crit_edge64, !llvm.loop !16

._crit_edge54:                                    ; preds = %55, %.preheader
  %52 = phi i64 [ %45, %.preheader ], [ %66, %55 ]
  %53 = phi i64 [ %46, %.preheader ], [ %66, %55 ]
  %.2.lcssa = phi i64 [ %.156, %.preheader ], [ %spec.select, %55 ]
  %54 = add nuw nsw i64 %.03057, 1
  %.not38.not = icmp slt i64 %.03057, %53
  br i1 %.not38.not, label %.preheader, label %._crit_edge58, !llvm.loop !18

55:                                               ; preds = %.lr.ph53, %55
  %.052 = phi i64 [ 1, %.lr.ph53 ], [ %65, %55 ]
  %.251 = phi i64 [ %.156, %.lr.ph53 ], [ %spec.select, %55 ]
  %56 = getelementptr inbounds i64, ptr %48, i64 %.052
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %57 = load i64, ptr %49, align 8, !tbaa !5
  %58 = getelementptr inbounds i64, ptr %42, i64 %.052
  %59 = load i64, ptr %58, align 8, !tbaa !5
  %60 = add nsw i64 %59, %57
  store i64 %60, ptr %6, align 8, !tbaa !5
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %62 = load i64, ptr %61, align 8, !tbaa !5
  store i64 %62, ptr %56, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %63 = icmp slt i64 %62, 2000000000000000000
  %64 = select i1 %63, i64 %62, i64 0
  %spec.select = add nsw i64 %64, %.251
  %65 = add nuw nsw i64 %.052, 1
  %66 = load i64, ptr %1, align 8, !tbaa !5
  %.not39.not = icmp slt i64 %.052, %66
  br i1 %.not39.not, label %55, label %._crit_edge54, !llvm.loop !19
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; 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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !10, !17}
!19 = distinct !{!19, !10}


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