; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/202 Division 2/Problem C (C)

; 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_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@a = external dso_local global [100000 x i32], align 16
@mx = external dso_local global i32, align 4
@cnt = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %17, %0
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp slt i32 %8, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %7
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %14
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %15)
  br label %17

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %2, align 4, !tbaa !5
  br label %7, !llvm.loop !9

20:                                               ; preds = %11
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr @a, i64 %22
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %23)
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = sub nsw i32 %24, 1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %28, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %45, %20
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = sub nsw i32 %31, 1
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %48

35:                                               ; preds = %29
  %36 = load i32, ptr @mx, align 4, !tbaa !5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sub nsw i32 %36, %40
  %42 = sext i32 %41 to i64
  %43 = load i64, ptr @cnt, align 8, !tbaa !11
  %44 = add nsw i64 %43, %42
  store i64 %44, ptr @cnt, align 8, !tbaa !11
  br label %45

45:                                               ; preds = %35
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %3, align 4, !tbaa !5
  br label %29, !llvm.loop !13

48:                                               ; preds = %34
  %49 = load i64, ptr @cnt, align 8, !tbaa !11
  %50 = load i32, ptr @mx, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = icmp sge i64 %49, %51
  br i1 %52, label %53, label %57

53:                                               ; preds = %48
  %54 = load i32, ptr @mx, align 4, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %54)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %108

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %58 = load i32, ptr @mx, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = load i64, ptr @cnt, align 8, !tbaa !11
  %61 = sub nsw i64 %59, %60
  %62 = sitofp i64 %61 to double
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  %65 = sitofp i32 %64 to double
  %66 = fdiv double %62, %65
  %67 = call double @llvm.ceil.f64(double %66)
  %68 = fptosi double %67 to i32
  store i32 %68, ptr %5, align 4, !tbaa !5
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = load i32, ptr @a, align 16, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %72, label %78

72:                                               ; preds = %57
  %73 = load i32, ptr @mx, align 4, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = add nsw i32 %73, %74
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %75)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %107

78:                                               ; preds = %57
  br label %79

79:                                               ; preds = %93, %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = sub nsw i32 %81, 1
  %83 = icmp slt i32 %80, %82
  br i1 %83, label %84, label %91

84:                                               ; preds = %79
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = icmp sle i32 %88, %89
  br label %91

91:                                               ; preds = %84, %79
  %92 = phi i1 [ false, %79 ], [ %90, %84 ]
  br i1 %92, label %93, label %96

93:                                               ; preds = %91
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %4, align 4, !tbaa !5
  br label %79, !llvm.loop !14

96:                                               ; preds = %91
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr %4, align 4, !tbaa !5
  %99 = load i32, ptr @mx, align 4, !tbaa !5
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = add nsw i32 %99, %103
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %104)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %107

107:                                              ; preds = %96, %72
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %108

108:                                              ; preds = %107, %53
  %109 = load i32, ptr %1, align 4
  ret i32 %109
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@a = external dso_local global [100000 x i32], align 16
@mx = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %25, %.lr.ph ]
  %4 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %4)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = add nsw i32 %5, -1
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %9, ptr @mx, align 4, !tbaa !5
  %cnt.promoted = load i64, ptr @cnt, align 8, !tbaa !9
  %10 = icmp sgt i32 %5, 1
  br i1 %10, label %.lr.ph26.preheader, label %27

.lr.ph26.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %6 to i64
  %min.iters.check = icmp ult i32 %5, 5
  br i1 %min.iters.check, label %.lr.ph26.preheader54, label %vector.ph

.lr.ph26.preheader54:                             ; preds = %middle.block, %.lr.ph26.preheader
  %indvars.iv37.ph = phi i64 [ 0, %.lr.ph26.preheader ], [ %n.vec, %middle.block ]
  %.ph = phi i64 [ %cnt.promoted, %.lr.ph26.preheader ], [ %21, %middle.block ]
  br label %.lr.ph26

vector.ph:                                        ; preds = %.lr.ph26.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  %11 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %cnt.promoted, i64 0
  %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %9, i64 0
  %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ %11, %vector.ph ], [ %18, %vector.body ]
  %vec.phi51 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
  %12 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %index
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %wide.load = load <2 x i32>, ptr %12, align 16, !tbaa !5
  %wide.load52 = load <2 x i32>, ptr %13, align 8, !tbaa !5
  %14 = sub nsw <2 x i32> %broadcast.splat, %wide.load
  %15 = sub nsw <2 x i32> %broadcast.splat, %wide.load52
  %16 = sext <2 x i32> %14 to <2 x i64>
  %17 = sext <2 x i32> %15 to <2 x i64>
  %18 = add <2 x i64> %vec.phi, %16
  %19 = add <2 x i64> %vec.phi51, %17
  %index.next = add nuw i64 %index, 4
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %19, %18
  %21 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge27, label %.lr.ph26.preheader54

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %22 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv
  %23 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %22)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge27:                                    ; preds = %.lr.ph26, %middle.block
  %.lcssa = phi i64 [ %21, %middle.block ], [ %35, %.lr.ph26 ]
  store i64 %.lcssa, ptr @cnt, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %._crit_edge27, %._crit_edge
  %28 = phi i64 [ %.lcssa, %._crit_edge27 ], [ %cnt.promoted, %._crit_edge ]
  %29 = sext i32 %9 to i64
  %.not = icmp slt i64 %28, %29
  br i1 %.not, label %36, label %56

.lr.ph26:                                         ; preds = %.lr.ph26.preheader54, %.lr.ph26
  %indvars.iv37 = phi i64 [ %indvars.iv.next38, %.lr.ph26 ], [ %indvars.iv37.ph, %.lr.ph26.preheader54 ]
  %30 = phi i64 [ %35, %.lr.ph26 ], [ %.ph, %.lr.ph26.preheader54 ]
  %31 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv37
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sub nsw i32 %9, %32
  %34 = sext i32 %33 to i64
  %35 = add nsw i64 %30, %34
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge27, label %.lr.ph26, !llvm.loop !16

36:                                               ; preds = %27
  %37 = sub nsw i64 %29, %28
  %38 = sitofp i64 %37 to double
  %39 = sitofp i32 %6 to double
  %40 = fdiv double %38, %39
  %41 = tail call double @llvm.ceil.f64(double %40)
  %42 = fptosi double %41 to i32
  %43 = load i32, ptr @a, align 16, !tbaa !5
  %44 = icmp sgt i32 %43, %42
  br i1 %44, label %45, label %.preheader

.preheader:                                       ; preds = %36
  br i1 %10, label %.lr.ph30.preheader, label %.critedge

.lr.ph30.preheader:                               ; preds = %.preheader
  %wide.trip.count43 = zext nneg i32 %6 to i64
  br label %.lr.ph30

45:                                               ; preds = %36
  %46 = add nsw i32 %9, %42
  br label %56

.lr.ph30:                                         ; preds = %.lr.ph30.preheader, %49
  %indvars.iv40 = phi i64 [ 0, %.lr.ph30.preheader ], [ %indvars.iv.next41, %49 ]
  %47 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv40
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %.not22 = icmp sgt i32 %48, %42
  br i1 %.not22, label %.critedge.loopexit.split.loop.exit46, label %49

49:                                               ; preds = %.lr.ph30
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %exitcond44.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count43
  br i1 %exitcond44.not, label %.critedge.loopexit, label %.lr.ph30, !llvm.loop !17

.critedge.loopexit.split.loop.exit46:             ; preds = %.lr.ph30
  %50 = trunc nuw nsw i64 %indvars.iv40 to i32
  br label %.critedge.loopexit

.critedge.loopexit:                               ; preds = %49, %.critedge.loopexit.split.loop.exit46
  %.015.lcssa.ph = phi i32 [ %50, %.critedge.loopexit.split.loop.exit46 ], [ %6, %49 ]
  %51 = add nsw i32 %.015.lcssa.ph, -1
  %52 = sext i32 %51 to i64
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %.015.lcssa = phi i64 [ -1, %.preheader ], [ %52, %.critedge.loopexit ]
  %53 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %.015.lcssa
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = add nsw i32 %54, %9
  br label %56

56:                                               ; preds = %27, %45, %.critedge
  %.sink48 = phi i32 [ %46, %45 ], [ %55, %.critedge ], [ %9, %27 ]
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.sink48)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6

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 = { nofree nounwind "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 = { 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 #3 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}


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