; LLVM IR from AdarshGaur/Competitive-Programming :: Codechef/Random Problems/Little Chef and Sums.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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@_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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  %19 = 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)
  %20 = load i64, ptr %1, align 8, !tbaa !5
  %21 = call ptr @llvm.stacksave.p0()
  store ptr %21, ptr %2, align 8
  %22 = alloca i64, i64 %20, align 16
  store i64 %20, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store ptr %22, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %23 = load ptr, ptr %4, align 8, !tbaa !9
  store ptr %23, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %24 = load ptr, ptr %4, align 8, !tbaa !9
  %25 = mul nuw i64 8, %20
  %26 = udiv i64 %25, 8
  %27 = getelementptr inbounds i64, ptr %24, i64 %26
  store ptr %27, ptr %6, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %37, %0
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = load ptr, ptr %6, align 8, !tbaa !9
  %31 = icmp ne ptr %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  store ptr %34, ptr %7, align 8, !tbaa !9
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %35)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %37

37:                                               ; preds = %33
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds i64, ptr %38, i32 1
  store ptr %39, ptr %5, align 8, !tbaa !9
  br label %28

40:                                               ; preds = %32
  %41 = load i64, ptr %1, align 8, !tbaa !5
  %42 = alloca i64, i64 %41, align 16
  store i64 %41, ptr %8, align 8
  %43 = getelementptr inbounds i64, ptr %22, i64 0
  %44 = load i64, ptr %43, align 16, !tbaa !5
  %45 = getelementptr inbounds i64, ptr %42, i64 0
  store i64 %44, ptr %45, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 1, ptr %9, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %62, %40
  %47 = load i64, ptr %9, align 8, !tbaa !5
  %48 = load i64, ptr %1, align 8, !tbaa !5
  %49 = icmp slt i64 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %65

51:                                               ; preds = %46
  %52 = load i64, ptr %9, align 8, !tbaa !5
  %53 = sub nsw i64 %52, 1
  %54 = getelementptr inbounds i64, ptr %42, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = load i64, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds i64, ptr %22, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = add nsw i64 %55, %58
  %60 = load i64, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds i64, ptr %42, i64 %60
  store i64 %59, ptr %61, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %51
  %63 = load i64, ptr %9, align 8, !tbaa !5
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %9, align 8, !tbaa !5
  br label %46, !llvm.loop !11

65:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  %66 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %66, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %67 unwind label %95

67:                                               ; preds = %65
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  %68 = load i64, ptr %1, align 8, !tbaa !5
  %69 = alloca i64, i64 %68, align 16
  store i64 %68, ptr %14, align 8
  %70 = load i64, ptr %1, align 8, !tbaa !5
  %71 = sub nsw i64 %70, 1
  %72 = getelementptr inbounds i64, ptr %22, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = load i64, ptr %1, align 8, !tbaa !5
  %75 = sub nsw i64 %74, 1
  %76 = getelementptr inbounds i64, ptr %69, i64 %75
  store i64 %73, ptr %76, align 8, !tbaa !5
  %77 = load i64, ptr %1, align 8, !tbaa !5
  %78 = sub nsw i64 %77, 1
  %79 = getelementptr inbounds i64, ptr %69, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = load i64, ptr %1, align 8, !tbaa !5
  %82 = sub nsw i64 %81, 1
  %83 = getelementptr inbounds i64, ptr %42, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = add nsw i64 %80, %84
  %86 = load i64, ptr %1, align 8, !tbaa !5
  %87 = sub nsw i64 %86, 1
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %87) #5
  store i64 %85, ptr %88, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %89 = load i64, ptr %1, align 8, !tbaa !5
  %90 = sub nsw i64 %89, 2
  store i64 %90, ptr %15, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %119, %67
  %92 = load i64, ptr %15, align 8, !tbaa !5
  %93 = icmp sge i64 %92, 0
  br i1 %93, label %99, label %94

94:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %122

95:                                               ; preds = %65
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %12, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %13, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #5
  br label %155

99:                                               ; preds = %91
  %100 = load i64, ptr %15, align 8, !tbaa !5
  %101 = add nsw i64 %100, 1
  %102 = getelementptr inbounds i64, ptr %69, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = load i64, ptr %15, align 8, !tbaa !5
  %105 = getelementptr inbounds i64, ptr %22, i64 %104
  %106 = load i64, ptr %105, align 8, !tbaa !5
  %107 = add nsw i64 %103, %106
  %108 = load i64, ptr %15, align 8, !tbaa !5
  %109 = getelementptr inbounds i64, ptr %69, i64 %108
  store i64 %107, ptr %109, align 8, !tbaa !5
  %110 = load i64, ptr %15, align 8, !tbaa !5
  %111 = getelementptr inbounds i64, ptr %69, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !5
  %113 = load i64, ptr %15, align 8, !tbaa !5
  %114 = getelementptr inbounds i64, ptr %42, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = add nsw i64 %112, %115
  %117 = load i64, ptr %15, align 8, !tbaa !5
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %117) #5
  store i64 %116, ptr %118, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %99
  %120 = load i64, ptr %15, align 8, !tbaa !5
  %121 = add nsw i64 %120, -1
  store i64 %121, ptr %15, align 8, !tbaa !5
  br label %91, !llvm.loop !13

122:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store i64 2000000000000000000, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  store i64 0, ptr %18, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %141, %122
  %124 = load i64, ptr %18, align 8, !tbaa !5
  %125 = load i64, ptr %1, align 8, !tbaa !5
  %126 = icmp slt i64 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %144

128:                                              ; preds = %123
  %129 = load i64, ptr %18, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %129) #5
  %131 = load i64, ptr %130, align 8, !tbaa !5
  %132 = load i64, ptr %16, align 8, !tbaa !5
  %133 = icmp slt i64 %131, %132
  br i1 %133, label %134, label %140

134:                                              ; preds = %128
  %135 = load i64, ptr %18, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %135) #5
  %137 = load i64, ptr %136, align 8, !tbaa !5
  store i64 %137, ptr %16, align 8, !tbaa !5
  %138 = load i64, ptr %18, align 8, !tbaa !5
  %139 = add nsw i64 %138, 1
  store i64 %139, ptr %17, align 8, !tbaa !5
  br label %140

140:                                              ; preds = %134, %128
  br label %141

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

144:                                              ; preds = %127
  %145 = load i64, ptr %17, align 8, !tbaa !5
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %145)
          to label %147 unwind label %151

147:                                              ; preds = %144
  %148 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef @.str)
          to label %149 unwind label %151

149:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  %150 = load ptr, ptr %2, align 8
  call void @llvm.stackrestore.p0(ptr %150)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void

151:                                              ; preds = %147, %144
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %12, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #5
  br label %155

155:                                              ; preds = %151, %95
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %12, align 8
  %158 = load i32, ptr %13, align 4
  %159 = insertvalue { ptr, i32 } poison, ptr %157, 0
  %160 = insertvalue { ptr, i32 } %159, i32 %158, 1
  resume { ptr, i32 } %160
}

; 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 @_ZNSirsERx(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: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 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 = { 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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@_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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %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 = load i64, ptr %1, align 8, !tbaa !5
  %6 = call ptr @llvm.stacksave.p0()
  %7 = alloca i64, i64 %5, align 16
  %8 = getelementptr inbounds i64, ptr %7, i64 %5
  %.not38 = icmp eq i64 %5, 0
  br i1 %.not38, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr %7, align 16, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %9 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ undef, %0 ]
  %10 = load i64, ptr %1, align 8, !tbaa !5
  %11 = alloca i64, i64 %10, align 16
  store i64 %9, ptr %11, align 16, !tbaa !5
  %12 = icmp sgt i64 %10, 1
  br i1 %12, label %.lr.ph42.preheader, label %._crit_edge43

.lr.ph42.preheader:                               ; preds = %._crit_edge
  %load_initial = load i64, ptr %11, align 16
  %13 = add nsw i64 %10, -1
  %14 = add nsw i64 %10, -2
  %xtraiter = and i64 %13, 3
  %15 = icmp ult i64 %14, 3
  br i1 %15, label %._crit_edge43.loopexit.unr-lcssa, label %.lr.ph42.preheader.new

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

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03339 = phi ptr [ %17, %.lr.ph ], [ %7, %0 ]
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %.03339)
  %17 = getelementptr inbounds i8, ptr %.03339, i64 8
  %.not = icmp eq ptr %17, %8
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph

._crit_edge43.loopexit.unr-lcssa:                 ; preds = %.lr.ph42, %.lr.ph42.preheader
  %store_forwarded.unr = phi i64 [ %load_initial, %.lr.ph42.preheader ], [ %41, %.lr.ph42 ]
  %.03640.unr = phi i64 [ 1, %.lr.ph42.preheader ], [ %42, %.lr.ph42 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge43, label %.lr.ph42.epil

.lr.ph42.epil:                                    ; preds = %._crit_edge43.loopexit.unr-lcssa, %.lr.ph42.epil
  %store_forwarded.epil = phi i64 [ %21, %.lr.ph42.epil ], [ %store_forwarded.unr, %._crit_edge43.loopexit.unr-lcssa ]
  %.03640.epil = phi i64 [ %22, %.lr.ph42.epil ], [ %.03640.unr, %._crit_edge43.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph42.epil ], [ 0, %._crit_edge43.loopexit.unr-lcssa ]
  %18 = getelementptr i64, ptr %11, i64 %.03640.epil
  %19 = getelementptr inbounds i64, ptr %7, i64 %.03640.epil
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = add nsw i64 %20, %store_forwarded.epil
  store i64 %21, ptr %18, align 8, !tbaa !5
  %22 = add nuw nsw i64 %.03640.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 %._crit_edge43, label %.lr.ph42.epil, !llvm.loop !9

._crit_edge43:                                    ; preds = %._crit_edge43.loopexit.unr-lcssa, %.lr.ph42.epil, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %10, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %43 unwind label %59

.lr.ph42:                                         ; preds = %.lr.ph42, %.lr.ph42.preheader.new
  %store_forwarded = phi i64 [ %load_initial, %.lr.ph42.preheader.new ], [ %41, %.lr.ph42 ]
  %.03640 = phi i64 [ 1, %.lr.ph42.preheader.new ], [ %42, %.lr.ph42 ]
  %niter = phi i64 [ 0, %.lr.ph42.preheader.new ], [ %niter.next.3, %.lr.ph42 ]
  %23 = getelementptr i64, ptr %11, i64 %.03640
  %24 = getelementptr inbounds i64, ptr %7, i64 %.03640
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = add nsw i64 %25, %store_forwarded
  store i64 %26, ptr %23, align 8, !tbaa !5
  %27 = add nuw nsw i64 %.03640, 1
  %28 = getelementptr i64, ptr %11, i64 %27
  %29 = getelementptr inbounds i64, ptr %7, i64 %27
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = add nsw i64 %30, %26
  store i64 %31, ptr %28, align 8, !tbaa !5
  %32 = add nuw nsw i64 %.03640, 2
  %33 = getelementptr i64, ptr %11, i64 %32
  %34 = getelementptr inbounds i64, ptr %7, i64 %32
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = add nsw i64 %35, %31
  store i64 %36, ptr %33, align 8, !tbaa !5
  %37 = add nuw nsw i64 %.03640, 3
  %38 = getelementptr i64, ptr %11, i64 %37
  %39 = getelementptr inbounds i64, ptr %7, i64 %37
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = add nsw i64 %40, %36
  store i64 %41, ptr %38, align 8, !tbaa !5
  %42 = add nuw nsw i64 %.03640, 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 %._crit_edge43.loopexit.unr-lcssa, label %.lr.ph42, !llvm.loop !11

43:                                               ; preds = %._crit_edge43
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  %44 = load i64, ptr %1, align 8, !tbaa !5
  %45 = alloca i64, i64 %44, align 16
  %46 = add nsw i64 %44, -1
  %47 = getelementptr inbounds i64, ptr %7, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds i64, ptr %45, i64 %46
  store i64 %48, ptr %49, align 8, !tbaa !5
  %50 = getelementptr inbounds i64, ptr %11, i64 %46
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = add nsw i64 %51, %48
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %46) #6
  store i64 %52, ptr %53, align 8, !tbaa !5
  %54 = load i64, ptr %1, align 8, !tbaa !5
  %55 = icmp sgt i64 %54, 1
  br i1 %55, label %.lr.ph46.preheader, label %.preheader

.lr.ph46.preheader:                               ; preds = %43
  %56 = add nsw i64 %54, -2
  br label %.lr.ph46

.preheader.loopexit:                              ; preds = %.lr.ph46
  %.pre52 = load i64, ptr %1, align 8, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %43
  %57 = phi i64 [ %.pre52, %.preheader.loopexit ], [ %54, %43 ]
  %58 = icmp sgt i64 %57, 0
  call void @llvm.assume(i1 %58)
  br label %.lr.ph50

59:                                               ; preds = %._crit_edge43
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %88

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %.lr.ph46
  %.03244 = phi i64 [ %71, %.lr.ph46 ], [ %56, %.lr.ph46.preheader ]
  %61 = getelementptr inbounds i64, ptr %45, i64 %.03244
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = getelementptr inbounds i64, ptr %7, i64 %.03244
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = add nsw i64 %65, %63
  store i64 %66, ptr %61, align 8, !tbaa !5
  %67 = getelementptr inbounds i64, ptr %11, i64 %.03244
  %68 = load i64, ptr %67, align 8, !tbaa !5
  %69 = add nsw i64 %68, %66
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03244) #6
  store i64 %69, ptr %70, align 8, !tbaa !5
  %71 = add nsw i64 %.03244, -1
  %.not54 = icmp eq i64 %.03244, 0
  br i1 %.not54, label %.preheader.loopexit, label %.lr.ph46, !llvm.loop !13

._crit_edge51:                                    ; preds = %80
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.1)
          to label %83 unwind label %86

.lr.ph50:                                         ; preds = %.preheader, %80
  %.049 = phi i64 [ %.pre-phi, %80 ], [ 0, %.preheader ]
  %.02948 = phi i64 [ %.1, %80 ], [ undef, %.preheader ]
  %.03047 = phi i64 [ %.131, %80 ], [ 2000000000000000000, %.preheader ]
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.049) #6
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = icmp slt i64 %74, %.03047
  br i1 %75, label %76, label %.lr.ph50._crit_edge

.lr.ph50._crit_edge:                              ; preds = %.lr.ph50
  %.pre53 = add nuw nsw i64 %.049, 1
  br label %80

76:                                               ; preds = %.lr.ph50
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.049) #6
  %78 = load i64, ptr %77, align 8, !tbaa !5
  %79 = add nuw nsw i64 %.049, 1
  br label %80

80:                                               ; preds = %.lr.ph50._crit_edge, %76
  %.pre-phi = phi i64 [ %.pre53, %.lr.ph50._crit_edge ], [ %79, %76 ]
  %.131 = phi i64 [ %.03047, %.lr.ph50._crit_edge ], [ %78, %76 ]
  %.1 = phi i64 [ %.02948, %.lr.ph50._crit_edge ], [ %79, %76 ]
  %81 = load i64, ptr %1, align 8, !tbaa !5
  %82 = icmp slt i64 %.pre-phi, %81
  br i1 %82, label %.lr.ph50, label %._crit_edge51, !llvm.loop !14

83:                                               ; preds = %._crit_edge51
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @.str)
          to label %85 unwind label %86

85:                                               ; preds = %83
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.stackrestore.p0(ptr %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void

86:                                               ; preds = %83, %._crit_edge51
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %88

88:                                               ; preds = %86, %59
  %.pn = phi { ptr, i32 } [ %87, %86 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

; 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 @_ZNSirsERx(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: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; 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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

; 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { 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 = !{!"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}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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