; LLVM IR from pranjalwalia/Competitive-programming :: codeforces/contests/627D3 (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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %21 = getelementptr i8, ptr %20, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %22
  %24 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %23, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  %25 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %26, i64 8)
  %28 = extractvalue { i64, i1 } %27, 1
  %29 = extractvalue { i64, i1 } %27, 0
  %30 = select i1 %28, i64 -1, i64 %29
  %31 = call noalias noundef nonnull ptr @_Znam(i64 noundef %30) #9
  store ptr %31, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %32 = load i64, ptr %2, align 8, !tbaa !8
  %33 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %32, i64 8)
  %34 = extractvalue { i64, i1 } %33, 1
  %35 = extractvalue { i64, i1 } %33, 0
  %36 = select i1 %34, i64 -1, i64 %35
  %37 = call noalias noundef nonnull ptr @_Znam(i64 noundef %36) #9
  store ptr %37, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %38, i64 8)
  %40 = extractvalue { i64, i1 } %39, 1
  %41 = extractvalue { i64, i1 } %39, 0
  %42 = select i1 %40, i64 -1, i64 %41
  %43 = call noalias noundef nonnull ptr @_Znam(i64 noundef %42) #9
  store ptr %43, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %44

44:                                               ; preds = %54, %0
  %45 = load i64, ptr %6, align 8, !tbaa !8
  %46 = load i64, ptr %2, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %57

49:                                               ; preds = %44
  %50 = load ptr, ptr %3, align 8, !tbaa !11
  %51 = load i64, ptr %6, align 8, !tbaa !8
  %52 = getelementptr inbounds i64, ptr %50, i64 %51
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %52)
  br label %54

54:                                               ; preds = %49
  %55 = load i64, ptr %6, align 8, !tbaa !8
  %56 = add nsw i64 %55, 1
  store i64 %56, ptr %6, align 8, !tbaa !8
  br label %44, !llvm.loop !13

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

58:                                               ; preds = %68, %57
  %59 = load i64, ptr %7, align 8, !tbaa !8
  %60 = load i64, ptr %2, align 8, !tbaa !8
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %71

63:                                               ; preds = %58
  %64 = load ptr, ptr %4, align 8, !tbaa !11
  %65 = load i64, ptr %7, align 8, !tbaa !8
  %66 = getelementptr inbounds i64, ptr %64, i64 %65
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %66)
  br label %68

68:                                               ; preds = %63
  %69 = load i64, ptr %7, align 8, !tbaa !8
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr %7, align 8, !tbaa !8
  br label %58, !llvm.loop !15

71:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %72

72:                                               ; preds = %90, %71
  %73 = load i64, ptr %8, align 8, !tbaa !8
  %74 = load i64, ptr %2, align 8, !tbaa !8
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %93

77:                                               ; preds = %72
  %78 = load ptr, ptr %4, align 8, !tbaa !11
  %79 = load i64, ptr %8, align 8, !tbaa !8
  %80 = getelementptr inbounds i64, ptr %78, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = load ptr, ptr %3, align 8, !tbaa !11
  %83 = load i64, ptr %8, align 8, !tbaa !8
  %84 = getelementptr inbounds i64, ptr %82, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = sub nsw i64 %81, %85
  %87 = load ptr, ptr %5, align 8, !tbaa !11
  %88 = load i64, ptr %8, align 8, !tbaa !8
  %89 = getelementptr inbounds i64, ptr %87, i64 %88
  store i64 %86, ptr %89, align 8, !tbaa !8
  br label %90

90:                                               ; preds = %77
  %91 = load i64, ptr %8, align 8, !tbaa !8
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %8, align 8, !tbaa !8
  br label %72, !llvm.loop !16

93:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 0, ptr %9, align 8, !tbaa !8
  %94 = load ptr, ptr %5, align 8, !tbaa !11
  %95 = load ptr, ptr %5, align 8, !tbaa !11
  %96 = load i64, ptr %2, align 8, !tbaa !8
  %97 = getelementptr inbounds i64, ptr %95, i64 %96
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef %94, ptr noundef %97)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %98

98:                                               ; preds = %129, %93
  %99 = load i64, ptr %10, align 8, !tbaa !8
  %100 = load i64, ptr %2, align 8, !tbaa !8
  %101 = icmp slt i64 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %132

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %104 = load ptr, ptr %5, align 8, !tbaa !11
  %105 = load i64, ptr %10, align 8, !tbaa !8
  %106 = getelementptr inbounds i64, ptr %104, i64 %105
  %107 = getelementptr inbounds i64, ptr %106, i64 1
  %108 = load ptr, ptr %5, align 8, !tbaa !11
  %109 = load i64, ptr %2, align 8, !tbaa !8
  %110 = getelementptr inbounds i64, ptr %108, i64 %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %111 = load ptr, ptr %5, align 8, !tbaa !11
  %112 = load i64, ptr %10, align 8, !tbaa !8
  %113 = getelementptr inbounds i64, ptr %111, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %115 = sub nsw i64 0, %114
  store i64 %115, ptr %12, align 8, !tbaa !8
  %116 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef %107, ptr noundef %110, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  store ptr %116, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %117 = load ptr, ptr %11, align 8, !tbaa !11
  %118 = load ptr, ptr %5, align 8, !tbaa !11
  %119 = ptrtoint ptr %117 to i64
  %120 = ptrtoint ptr %118 to i64
  %121 = sub i64 %119, %120
  %122 = sdiv exact i64 %121, 8
  store i64 %122, ptr %13, align 8, !tbaa !8
  %123 = load i64, ptr %13, align 8, !tbaa !8
  %124 = load i64, ptr %10, align 8, !tbaa !8
  %125 = add nsw i64 %124, 1
  %126 = sub nsw i64 %123, %125
  %127 = load i64, ptr %9, align 8, !tbaa !8
  %128 = add nsw i64 %127, %126
  store i64 %128, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %129

129:                                              ; preds = %103
  %130 = load i64, ptr %10, align 8, !tbaa !8
  %131 = add nsw i64 %130, 1
  store i64 %131, ptr %10, align 8, !tbaa !8
  br label %98, !llvm.loop !17

132:                                              ; preds = %102
  %133 = load i64, ptr %9, align 8, !tbaa !8
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %133)
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %134, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %136 = load i32, ptr %1, align 4
  ret i32 %136
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) #7

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

; 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

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

!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 = !{!"any pointer", !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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %15 = load i64, ptr %1, align 8, !tbaa !8
  %16 = icmp ugt i64 %15, 2305843009213693951
  %17 = shl i64 %15, 3
  %18 = select i1 %16, i64 -1, i64 %17
  %19 = call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #8
  %20 = call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #8
  %21 = call noalias noundef nonnull ptr @_Znam(i64 noundef %18) #8
  %22 = icmp sgt i64 %15, 0
  br i1 %22, label %.lr.ph, label %._crit_edge

.preheader37:                                     ; preds = %.lr.ph
  %23 = icmp sgt i64 %27, 0
  br i1 %23, label %.lr.ph40, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.038 = phi i64 [ %26, %.lr.ph ], [ 0, %0 ]
  %24 = getelementptr inbounds i64, ptr %19, i64 %.038
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %26 = add nuw nsw i64 %.038, 1
  %27 = load i64, ptr %1, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %.preheader37, !llvm.loop !11

.preheader:                                       ; preds = %.lr.ph40
  %29 = icmp sgt i64 %42, 0
  br i1 %29, label %.lr.ph42.preheader, label %._crit_edge

.lr.ph42.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i64 %42, 4
  br i1 %min.iters.check, label %.lr.ph42.preheader60, label %vector.ph

.lr.ph42.preheader60:                             ; preds = %middle.block, %.lr.ph42.preheader
  %.03441.ph = phi i64 [ 0, %.lr.ph42.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph42

vector.ph:                                        ; preds = %.lr.ph42.preheader
  %n.vec = and i64 %42, 9223372036854775804
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %30 = getelementptr inbounds i64, ptr %20, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %wide.load = load <2 x i64>, ptr %30, align 8, !tbaa !8
  %wide.load57 = load <2 x i64>, ptr %31, align 8, !tbaa !8
  %32 = getelementptr inbounds i64, ptr %19, i64 %index
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %wide.load58 = load <2 x i64>, ptr %32, align 8, !tbaa !8
  %wide.load59 = load <2 x i64>, ptr %33, align 8, !tbaa !8
  %34 = sub nsw <2 x i64> %wide.load, %wide.load58
  %35 = sub nsw <2 x i64> %wide.load57, %wide.load59
  %36 = getelementptr inbounds i64, ptr %21, i64 %index
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  store <2 x i64> %34, ptr %36, align 8, !tbaa !8
  store <2 x i64> %35, ptr %37, align 8, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %38 = icmp eq i64 %index.next, %n.vec
  br i1 %38, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %42, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph42.preheader60

.lr.ph40:                                         ; preds = %.preheader37, %.lr.ph40
  %.03139 = phi i64 [ %41, %.lr.ph40 ], [ 0, %.preheader37 ]
  %39 = getelementptr inbounds i64, ptr %20, i64 %.03139
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = add nuw nsw i64 %.03139, 1
  %42 = load i64, ptr %1, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %.lr.ph40, label %.preheader, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph42, %middle.block, %0, %.preheader37, %.preheader
  %.lcssa52 = phi i64 [ %42, %.preheader ], [ %27, %.preheader37 ], [ %15, %0 ], [ %42, %middle.block ], [ %42, %.lr.ph42 ]
  %44 = getelementptr inbounds i64, ptr %21, i64 %.lcssa52
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull %21, ptr noundef nonnull %44)
  %45 = load i64, ptr %1, align 8, !tbaa !8
  %46 = icmp sgt i64 %45, 0
  br i1 %46, label %.lr.ph46, label %._crit_edge47

.lr.ph46:                                         ; preds = %._crit_edge
  %47 = ptrtoint ptr %21 to i64
  br label %57

.lr.ph42:                                         ; preds = %.lr.ph42.preheader60, %.lr.ph42
  %.03441 = phi i64 [ %54, %.lr.ph42 ], [ %.03441.ph, %.lr.ph42.preheader60 ]
  %48 = getelementptr inbounds i64, ptr %20, i64 %.03441
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = getelementptr inbounds i64, ptr %19, i64 %.03441
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %52 = sub nsw i64 %49, %51
  %53 = getelementptr inbounds i64, ptr %21, i64 %.03441
  store i64 %52, ptr %53, align 8, !tbaa !8
  %54 = add nuw nsw i64 %.03441, 1
  %exitcond.not = icmp eq i64 %54, %42
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph42, !llvm.loop !17

._crit_edge47:                                    ; preds = %57, %._crit_edge
  %.033.lcssa = phi i64 [ 0, %._crit_edge ], [ %70, %57 ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.033.lcssa)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

57:                                               ; preds = %.lr.ph46, %57
  %58 = phi i64 [ %45, %.lr.ph46 ], [ %71, %57 ]
  %.03244 = phi i64 [ 0, %.lr.ph46 ], [ %68, %57 ]
  %.03343 = phi i64 [ 0, %.lr.ph46 ], [ %70, %57 ]
  %59 = getelementptr inbounds i64, ptr %21, i64 %.03244
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = getelementptr inbounds i64, ptr %21, i64 %58
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %62 = load i64, ptr %59, align 8, !tbaa !8
  %63 = sub nsw i64 0, %62
  store i64 %63, ptr %2, align 8, !tbaa !8
  %64 = call noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef nonnull %60, ptr noundef nonnull %61, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %65 = ptrtoint ptr %64 to i64
  %66 = sub i64 %65, %47
  %67 = ashr exact i64 %66, 3
  %68 = add nuw nsw i64 %.03244, 1
  %.neg = xor i64 %.03244, -1
  %69 = add i64 %.03343, %.neg
  %70 = add i64 %69, %67
  %71 = load i64, ptr %1, align 8, !tbaa !8
  %72 = icmp slt i64 %68, %71
  br i1 %72, label %57, label %._crit_edge47, !llvm.loop !18
}

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPxxET_S1_S1_RKT0_(ptr noundef, ptr noundef, 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)) #6

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

!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, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12, !15, !14}
!18 = distinct !{!18, !12}


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