; LLVM IR from eyangch/competitive-programming :: Codeforces/1324 (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 nounwind uwtable
declare dso_local noundef i64 @_Z7binsrchxPxxx(i64 noundef, ptr noundef, i64 noundef, i64 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca [200000 x i64], align 16
  %7 = alloca i64, align 8
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %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) %2)
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = call ptr @llvm.stacksave.p0()
  store ptr %16, ptr %3, align 8
  %17 = alloca i64, i64 %15, align 16
  store i64 %15, ptr %4, align 8
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = alloca i64, i64 %18, align 16
  store i64 %18, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 1600000, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %29, %0
  %21 = load i64, ptr %7, align 8, !tbaa !5
  %22 = load i64, ptr %2, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %32

25:                                               ; preds = %20
  %26 = load i64, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds i64, ptr %17, i64 %26
  %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)
  br label %29

29:                                               ; preds = %25
  %30 = load i64, ptr %7, align 8, !tbaa !5
  %31 = add nsw i64 %30, 1
  store i64 %31, ptr %7, align 8, !tbaa !5
  br label %20, !llvm.loop !9

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

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

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %45

38:                                               ; preds = %33
  %39 = load i64, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds i64, ptr %19, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %40)
  br label %42

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

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

46:                                               ; preds = %61, %45
  %47 = load i64, ptr %9, align 8, !tbaa !5
  %48 = load i64, ptr %2, 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) #6
  br label %64

51:                                               ; preds = %46
  %52 = load i64, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds i64, ptr %17, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = load i64, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds i64, ptr %19, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = sub nsw i64 %54, %57
  %59 = load i64, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds [200000 x i64], ptr %6, i64 0, i64 %59
  store i64 %58, ptr %60, align 8, !tbaa !5
  br label %61

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

64:                                               ; preds = %50
  %65 = getelementptr inbounds [200000 x i64], ptr %6, i64 0, i64 0
  %66 = getelementptr inbounds [200000 x i64], ptr %6, i64 0, i64 0
  %67 = load i64, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds i64, ptr %66, i64 %67
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef %65, ptr noundef %68)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %69 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %69, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %96, %64
  %71 = load i64, ptr %12, align 8, !tbaa !5
  %72 = load i64, ptr %2, align 8, !tbaa !5
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %99

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %76 = load i64, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds [200000 x i64], ptr %6, i64 0, i64 0
  %78 = load i64, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds [200000 x i64], ptr %6, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = load i64, ptr %11, align 8, !tbaa !5
  %82 = call noundef i64 @_Z7binsrchxPxxx(i64 noundef %76, ptr noundef %77, i64 noundef %80, i64 noundef %81)
  store i64 %82, ptr %13, align 8, !tbaa !5
  %83 = load i64, ptr %2, align 8, !tbaa !5
  %84 = load i64, ptr %13, align 8, !tbaa !5
  %85 = sub nsw i64 %83, %84
  %86 = load i64, ptr %10, align 8, !tbaa !5
  %87 = add nsw i64 %86, %85
  store i64 %87, ptr %10, align 8, !tbaa !5
  %88 = load i64, ptr %13, align 8, !tbaa !5
  %89 = load i64, ptr %12, align 8, !tbaa !5
  %90 = icmp sle i64 %88, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %75
  %92 = load i64, ptr %10, align 8, !tbaa !5
  %93 = add nsw i64 %92, -1
  store i64 %93, ptr %10, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %91, %75
  %95 = load i64, ptr %13, align 8, !tbaa !5
  store i64 %95, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %96

96:                                               ; preds = %94
  %97 = load i64, ptr %12, align 8, !tbaa !5
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %12, align 8, !tbaa !5
  br label %70, !llvm.loop !13

99:                                               ; preds = %74
  %100 = load i64, ptr %10, align 8, !tbaa !5
  %101 = sdiv i64 %100, 2
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1600000, ptr %6) #6
  %104 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %104)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %105 = load i32, ptr %1, align 4
  ret i32 %105
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #5

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

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

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

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


; 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 nounwind uwtable
declare dso_local noundef i64 @_Z7binsrchxPxxx(i64 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca [200000 x i64], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %3 = 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)
  %4 = load i64, ptr %1, align 8, !tbaa !5
  %5 = call ptr @llvm.stacksave.p0()
  %6 = alloca i64, i64 %4, align 16
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = alloca i64, i64 %7, align 16
  call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %2) #6
  %9 = icmp sgt i64 %7, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.preheader30:                                     ; preds = %.lr.ph
  %10 = icmp sgt i64 %14, 0
  br i1 %10, label %.lr.ph33, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02731 = phi i64 [ %13, %.lr.ph ], [ 0, %0 ]
  %11 = getelementptr inbounds i64, ptr %6, i64 %.02731
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %13 = add nuw nsw i64 %.02731, 1
  %14 = load i64, ptr %1, align 8, !tbaa !5
  %15 = icmp slt i64 %13, %14
  br i1 %15, label %.lr.ph, label %.preheader30, !llvm.loop !9

.preheader:                                       ; preds = %.lr.ph33
  %16 = icmp sgt i64 %29, 0
  br i1 %16, label %.lr.ph35.preheader, label %._crit_edge

.lr.ph35.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i64 %29, 4
  br i1 %min.iters.check, label %.lr.ph35.preheader51, label %vector.ph

.lr.ph35.preheader51:                             ; preds = %middle.block, %.lr.ph35.preheader
  %.02534.ph = phi i64 [ 0, %.lr.ph35.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph35

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %17 = getelementptr inbounds i64, ptr %6, i64 %index
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  %wide.load = load <2 x i64>, ptr %17, align 16, !tbaa !5
  %wide.load48 = load <2 x i64>, ptr %18, align 16, !tbaa !5
  %19 = getelementptr inbounds i64, ptr %8, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %wide.load49 = load <2 x i64>, ptr %19, align 16, !tbaa !5
  %wide.load50 = load <2 x i64>, ptr %20, align 16, !tbaa !5
  %21 = sub nsw <2 x i64> %wide.load, %wide.load49
  %22 = sub nsw <2 x i64> %wide.load48, %wide.load50
  %23 = getelementptr inbounds [200000 x i64], ptr %2, i64 0, i64 %index
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  store <2 x i64> %21, ptr %23, align 16, !tbaa !5
  store <2 x i64> %22, ptr %24, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %29, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph35.preheader51

.lr.ph33:                                         ; preds = %.preheader30, %.lr.ph33
  %.02632 = phi i64 [ %28, %.lr.ph33 ], [ 0, %.preheader30 ]
  %26 = getelementptr inbounds i64, ptr %8, i64 %.02632
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = add nuw nsw i64 %.02632, 1
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %.lr.ph33, label %.preheader, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph35, %middle.block, %0, %.preheader30, %.preheader
  %.lcssa45 = phi i64 [ %29, %.preheader ], [ %14, %.preheader30 ], [ %7, %0 ], [ %29, %middle.block ], [ %29, %.lr.ph35 ]
  %31 = getelementptr inbounds i64, ptr %2, i64 %.lcssa45
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull %2, ptr noundef nonnull %31)
  %32 = load i64, ptr %1, align 8, !tbaa !5
  %33 = icmp sgt i64 %32, 0
  br i1 %33, label %.lr.ph40, label %._crit_edge41

.lr.ph35:                                         ; preds = %.lr.ph35.preheader51, %.lr.ph35
  %.02534 = phi i64 [ %40, %.lr.ph35 ], [ %.02534.ph, %.lr.ph35.preheader51 ]
  %34 = getelementptr inbounds i64, ptr %6, i64 %.02534
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds i64, ptr %8, i64 %.02534
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = sub nsw i64 %35, %37
  %39 = getelementptr inbounds [200000 x i64], ptr %2, i64 0, i64 %.02534
  store i64 %38, ptr %39, align 8, !tbaa !5
  %40 = add nuw nsw i64 %.02534, 1
  %exitcond.not = icmp eq i64 %40, %29
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph35, !llvm.loop !15

._crit_edge41.loopexit:                           ; preds = %.lr.ph40
  %41 = sdiv i64 %spec.select, 2
  br label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge41.loopexit, %._crit_edge
  %.024.lcssa = phi i64 [ 0, %._crit_edge ], [ %41, %._crit_edge41.loopexit ]
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.024.lcssa)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %2) #6
  call void @llvm.stackrestore.p0(ptr %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.lr.ph40:                                         ; preds = %._crit_edge, %.lr.ph40
  %44 = phi i64 [ %48, %.lr.ph40 ], [ %32, %._crit_edge ]
  %.038 = phi i64 [ %52, %.lr.ph40 ], [ 0, %._crit_edge ]
  %.02337 = phi i64 [ %47, %.lr.ph40 ], [ %32, %._crit_edge ]
  %.02436 = phi i64 [ %spec.select, %.lr.ph40 ], [ 0, %._crit_edge ]
  %45 = getelementptr inbounds [200000 x i64], ptr %2, i64 0, i64 %.038
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = call noundef i64 @_Z7binsrchxPxxx(i64 noundef %44, ptr noundef nonnull %2, i64 noundef %46, i64 noundef %.02337)
  %48 = load i64, ptr %1, align 8, !tbaa !5
  %.not = icmp sle i64 %47, %.038
  %49 = sext i1 %.not to i64
  %50 = sub i64 %.02436, %47
  %51 = add i64 %50, %48
  %spec.select = add nsw i64 %51, %49
  %52 = add nuw nsw i64 %.038, 1
  %53 = icmp slt i64 %52, %48
  br i1 %53, label %.lr.ph40, label %._crit_edge41.loopexit, !llvm.loop !16
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 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)) #5

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

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

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

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


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