; LLVM IR from eyangch/competitive-programming :: Codeforces/1358 (d)

; 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

; 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 ptr, 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 i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %21 = 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)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %23 = load i64, ptr %2, align 8, !tbaa !8
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %4, align 8
  %25 = alloca i64, i64 %23, align 16
  store i64 %23, ptr %5, align 8
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = alloca i64, i64 %26, align 16
  store i64 %26, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %28

28:                                               ; preds = %53, %0
  %29 = load i32, ptr %7, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %56

34:                                               ; preds = %28
  %35 = load i32, ptr %7, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i64, ptr %25, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %39 = load i32, ptr %7, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i64, ptr %25, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !8
  %43 = load i32, ptr %7, align 4, !tbaa !11
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i64, ptr %25, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = add nsw i64 %46, 1
  %48 = mul nsw i64 %42, %47
  %49 = sdiv i64 %48, 2
  %50 = load i32, ptr %7, align 4, !tbaa !11
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i64, ptr %27, i64 %51
  store i64 %49, ptr %52, align 8, !tbaa !8
  br label %53

53:                                               ; preds = %34
  %54 = load i32, ptr %7, align 4, !tbaa !11
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %7, align 4, !tbaa !11
  br label %28, !llvm.loop !13

56:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %57 = load i64, ptr %2, align 8, !tbaa !8
  %58 = sub nsw i64 %57, 1
  %59 = getelementptr inbounds i64, ptr %25, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !8
  store i64 %60, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %61 = load i64, ptr %2, align 8, !tbaa !8
  %62 = sub nsw i64 %61, 1
  %63 = getelementptr inbounds i64, ptr %27, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  store i64 %64, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %65 = load i64, ptr %2, align 8, !tbaa !8
  %66 = sub nsw i64 %65, 1
  store i64 %66, ptr %10, align 8, !tbaa !8
  br label %67

67:                                               ; preds = %71, %56
  %68 = load i64, ptr %8, align 8, !tbaa !8
  %69 = load i64, ptr %3, align 8, !tbaa !8
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %71, label %84

71:                                               ; preds = %67
  %72 = load i64, ptr %10, align 8, !tbaa !8
  %73 = add nsw i64 %72, -1
  store i64 %73, ptr %10, align 8, !tbaa !8
  %74 = load i64, ptr %10, align 8, !tbaa !8
  %75 = getelementptr inbounds i64, ptr %25, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = load i64, ptr %8, align 8, !tbaa !8
  %78 = add nsw i64 %77, %76
  store i64 %78, ptr %8, align 8, !tbaa !8
  %79 = load i64, ptr %10, align 8, !tbaa !8
  %80 = getelementptr inbounds i64, ptr %27, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = load i64, ptr %9, align 8, !tbaa !8
  %83 = add nsw i64 %82, %81
  store i64 %83, ptr %9, align 8, !tbaa !8
  br label %67, !llvm.loop !15

84:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store i64 0, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %85

85:                                               ; preds = %157, %84
  %86 = load i32, ptr %12, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = load i64, ptr %2, align 8, !tbaa !8
  %89 = icmp slt i64 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %160

91:                                               ; preds = %85
  %92 = load i32, ptr %12, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i64, ptr %25, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !8
  %96 = load i64, ptr %8, align 8, !tbaa !8
  %97 = add nsw i64 %96, %95
  store i64 %97, ptr %8, align 8, !tbaa !8
  %98 = load i32, ptr %12, align 4, !tbaa !11
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i64, ptr %27, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !8
  %102 = load i64, ptr %9, align 8, !tbaa !8
  %103 = add nsw i64 %102, %101
  store i64 %103, ptr %9, align 8, !tbaa !8
  br label %104

104:                                              ; preds = %125, %91
  %105 = load i64, ptr %8, align 8, !tbaa !8
  %106 = load i64, ptr %3, align 8, !tbaa !8
  %107 = icmp sge i64 %105, %106
  br i1 %107, label %108, label %126

108:                                              ; preds = %104
  %109 = load i64, ptr %10, align 8, !tbaa !8
  %110 = getelementptr inbounds i64, ptr %25, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !8
  %112 = load i64, ptr %8, align 8, !tbaa !8
  %113 = sub nsw i64 %112, %111
  store i64 %113, ptr %8, align 8, !tbaa !8
  %114 = load i64, ptr %10, align 8, !tbaa !8
  %115 = getelementptr inbounds i64, ptr %27, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = load i64, ptr %9, align 8, !tbaa !8
  %118 = sub nsw i64 %117, %116
  store i64 %118, ptr %9, align 8, !tbaa !8
  %119 = load i64, ptr %10, align 8, !tbaa !8
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %10, align 8, !tbaa !8
  %121 = load i64, ptr %10, align 8, !tbaa !8
  %122 = load i64, ptr %2, align 8, !tbaa !8
  %123 = icmp sge i64 %121, %122
  br i1 %123, label %124, label %125

124:                                              ; preds = %108
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %125

125:                                              ; preds = %124, %108
  br label %104, !llvm.loop !16

126:                                              ; preds = %104
  %127 = load i64, ptr %10, align 8, !tbaa !8
  %128 = add nsw i64 %127, -1
  store i64 %128, ptr %10, align 8, !tbaa !8
  %129 = load i64, ptr %10, align 8, !tbaa !8
  %130 = icmp slt i64 %129, 0
  br i1 %130, label %131, label %134

131:                                              ; preds = %126
  %132 = load i64, ptr %2, align 8, !tbaa !8
  %133 = sub nsw i64 %132, 1
  store i64 %133, ptr %10, align 8, !tbaa !8
  br label %134

134:                                              ; preds = %131, %126
  %135 = load i64, ptr %10, align 8, !tbaa !8
  %136 = getelementptr inbounds i64, ptr %25, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !8
  %138 = load i64, ptr %8, align 8, !tbaa !8
  %139 = add nsw i64 %138, %137
  store i64 %139, ptr %8, align 8, !tbaa !8
  %140 = load i64, ptr %10, align 8, !tbaa !8
  %141 = getelementptr inbounds i64, ptr %27, i64 %140
  %142 = load i64, ptr %141, align 8, !tbaa !8
  %143 = load i64, ptr %9, align 8, !tbaa !8
  %144 = add nsw i64 %143, %142
  store i64 %144, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %145 = load i64, ptr %8, align 8, !tbaa !8
  %146 = load i64, ptr %3, align 8, !tbaa !8
  %147 = sub nsw i64 %145, %146
  store i64 %147, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %148 = load i64, ptr %9, align 8, !tbaa !8
  %149 = load i64, ptr %13, align 8, !tbaa !8
  %150 = load i64, ptr %13, align 8, !tbaa !8
  %151 = add nsw i64 %150, 1
  %152 = mul nsw i64 %149, %151
  %153 = sdiv i64 %152, 2
  %154 = sub nsw i64 %148, %153
  store i64 %154, ptr %14, align 8, !tbaa !8
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %156 = load i64, ptr %155, align 8, !tbaa !8
  store i64 %156, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %157

157:                                              ; preds = %134
  %158 = load i32, ptr %12, align 4, !tbaa !11
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %12, align 4, !tbaa !11
  br label %85, !llvm.loop !17

160:                                              ; preds = %90
  %161 = load i64, ptr %11, align 8, !tbaa !8
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %161)
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %162, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %164 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %164)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

; 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)) #4 align 2

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

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

; 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)) #6

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 }
attributes #6 = { 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 #7 = { 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 #8 = { nounwind }

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

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


; 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

; 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
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %11 = 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)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %13 = load i64, ptr %1, align 8, !tbaa !8
  %14 = call ptr @llvm.stacksave.p0()
  %15 = alloca i64, i64 %13, align 16
  %16 = load i64, ptr %1, align 8
  %17 = alloca i64, i64 %16, align 16
  %18 = icmp sgt i64 %16, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %19 = phi i64 [ %16, %0 ], [ %34, %.lr.ph ]
  %20 = add nsw i64 %19, -1
  %21 = getelementptr inbounds i64, ptr %15, i64 %20
  %22 = load i64, ptr %21, align 8, !tbaa !8
  %23 = getelementptr inbounds i64, ptr %17, i64 %20
  %24 = load i64, ptr %23, align 8, !tbaa !8
  %25 = load i64, ptr %2, align 8, !tbaa !8
  %26 = icmp slt i64 %22, %25
  br i1 %26, label %.lr.ph55, label %._crit_edge56

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %27 = getelementptr inbounds i64, ptr %15, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %29 = load i64, ptr %27, align 8, !tbaa !8
  %30 = add nsw i64 %29, 1
  %31 = mul nsw i64 %30, %29
  %32 = sdiv i64 %31, 2
  %33 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv
  store i64 %32, ptr %33, align 8, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i64, ptr %1, align 8
  %35 = icmp sgt i64 %34, %indvars.iv.next
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph55:                                         ; preds = %._crit_edge, %.lr.ph55
  %.03653 = phi i64 [ %36, %.lr.ph55 ], [ %20, %._crit_edge ]
  %.03752 = phi i64 [ %42, %.lr.ph55 ], [ %24, %._crit_edge ]
  %.04051 = phi i64 [ %39, %.lr.ph55 ], [ %22, %._crit_edge ]
  %36 = add nsw i64 %.03653, -1
  %37 = getelementptr inbounds i64, ptr %15, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = add nsw i64 %38, %.04051
  %40 = getelementptr inbounds i64, ptr %17, i64 %36
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = add nsw i64 %41, %.03752
  %43 = icmp slt i64 %39, %25
  br i1 %43, label %.lr.ph55, label %._crit_edge56, !llvm.loop !13

._crit_edge56:                                    ; preds = %.lr.ph55, %._crit_edge
  %.040.lcssa = phi i64 [ %22, %._crit_edge ], [ %39, %.lr.ph55 ]
  %.037.lcssa = phi i64 [ %24, %._crit_edge ], [ %42, %.lr.ph55 ]
  %.036.lcssa = phi i64 [ %20, %._crit_edge ], [ %36, %.lr.ph55 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 0, ptr %3, align 8, !tbaa !8
  %44 = icmp sgt i64 %19, 0
  br i1 %44, label %.lr.ph76, label %._crit_edge77

._crit_edge77:                                    ; preds = %._crit_edge66, %._crit_edge56
  %45 = phi i64 [ 0, %._crit_edge56 ], [ %75, %._crit_edge66 ]
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %45)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.stackrestore.p0(ptr %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0

.lr.ph76:                                         ; preds = %._crit_edge56, %._crit_edge66
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %._crit_edge66 ], [ 0, %._crit_edge56 ]
  %48 = phi i64 [ %76, %._crit_edge66 ], [ %19, %._crit_edge56 ]
  %.173 = phi i64 [ %.3, %._crit_edge66 ], [ %.036.lcssa, %._crit_edge56 ]
  %.13872 = phi i64 [ %69, %._crit_edge66 ], [ %.037.lcssa, %._crit_edge56 ]
  %.14171 = phi i64 [ %66, %._crit_edge66 ], [ %.040.lcssa, %._crit_edge56 ]
  %49 = getelementptr inbounds i64, ptr %15, i64 %indvars.iv84
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = add nsw i64 %50, %.14171
  %52 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv84
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = add nsw i64 %53, %.13872
  %55 = load i64, ptr %2, align 8, !tbaa !8
  %.not60 = icmp slt i64 %51, %55
  br i1 %.not60, label %._crit_edge66, label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph76, %.lr.ph65
  %.263 = phi i64 [ %spec.store.select, %.lr.ph65 ], [ %.173, %.lr.ph76 ]
  %.23962 = phi i64 [ %61, %.lr.ph65 ], [ %54, %.lr.ph76 ]
  %.24261 = phi i64 [ %58, %.lr.ph65 ], [ %51, %.lr.ph76 ]
  %56 = getelementptr inbounds i64, ptr %15, i64 %.263
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = sub nsw i64 %.24261, %57
  %59 = getelementptr inbounds i64, ptr %17, i64 %.263
  %60 = load i64, ptr %59, align 8, !tbaa !8
  %61 = sub nsw i64 %.23962, %60
  %62 = add nsw i64 %.263, 1
  %.not48 = icmp slt i64 %62, %48
  %spec.store.select = select i1 %.not48, i64 %62, i64 0
  %.not = icmp slt i64 %58, %55
  br i1 %.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !14

._crit_edge66:                                    ; preds = %.lr.ph65, %.lr.ph76
  %.242.lcssa = phi i64 [ %51, %.lr.ph76 ], [ %58, %.lr.ph65 ]
  %.239.lcssa = phi i64 [ %54, %.lr.ph76 ], [ %61, %.lr.ph65 ]
  %.2.lcssa = phi i64 [ %.173, %.lr.ph76 ], [ %spec.store.select, %.lr.ph65 ]
  %63 = icmp slt i64 %.2.lcssa, 1
  %spec.select = select i1 %63, i64 %48, i64 %.2.lcssa
  %.3 = add nsw i64 %spec.select, -1
  %64 = getelementptr inbounds i64, ptr %15, i64 %.3
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = add nsw i64 %65, %.242.lcssa
  %67 = getelementptr inbounds i64, ptr %17, i64 %.3
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = add nsw i64 %68, %.239.lcssa
  %70 = sub nsw i64 %66, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %71 = add nsw i64 %70, 1
  %72 = mul nsw i64 %71, %70
  %.neg = sdiv i64 %72, -2
  %73 = add i64 %.neg, %69
  store i64 %73, ptr %4, align 8, !tbaa !8
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %75 = load i64, ptr %74, align 8, !tbaa !8
  store i64 %75, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %76 = load i64, ptr %1, align 8
  %77 = icmp sgt i64 %76, %indvars.iv.next85
  br i1 %77, label %.lr.ph76, label %._crit_edge77, !llvm.loop !15
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

; 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 #4 align 2

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

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

; 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 #6

; 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 #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { 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 #8 = { nounwind }

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

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


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