; LLVM IR from AdarshGaur/Competitive-Programming :: Codeforces/Codeforces Round #727 (Div. 2)/D. PriceFixed (main)

; 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" }
%"struct.std::pair" = type { i64, i64 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %11 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %19
  %21 = call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %20, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %23 = load i64, ptr %2, align 8, !tbaa !8
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %3, align 8
  %25 = alloca %"struct.std::pair", i64 %23, align 16
  store i64 %23, ptr %4, align 8
  %26 = icmp eq i64 %23, 0
  br i1 %26, label %33, label %27

27:                                               ; preds = %0
  %28 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %23
  br label %29

29:                                               ; preds = %29, %27
  %30 = phi ptr [ %25, %27 ], [ %31, %29 ]
  call void @_ZNSt4pairIllEC2IllTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
  %31 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 1
  %32 = icmp eq ptr %31, %28
  br i1 %32, label %33, label %29

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

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

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %51

39:                                               ; preds = %34
  %40 = load i64, ptr %5, align 8, !tbaa !8
  %41 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %40
  %42 = getelementptr inbounds %"struct.std::pair", ptr %41, i32 0, i32 1
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %42)
  %44 = load i64, ptr %5, align 8, !tbaa !8
  %45 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %44
  %46 = getelementptr inbounds %"struct.std::pair", ptr %45, i32 0, i32 0
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 8 dereferenceable(8) %46)
  br label %48

48:                                               ; preds = %39
  %49 = load i64, ptr %5, align 8, !tbaa !8
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %5, align 8, !tbaa !8
  br label %34, !llvm.loop !11

51:                                               ; preds = %38
  %52 = load i64, ptr %2, align 8, !tbaa !8
  %53 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %52
  call void @_ZSt4sortIPSt4pairIllEEvT_S3_(ptr noundef %25, ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %54 = load i64, ptr %2, align 8, !tbaa !8
  %55 = sub nsw i64 %54, 1
  store i64 %55, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %56

56:                                               ; preds = %126, %51
  %57 = load i64, ptr %6, align 8, !tbaa !8
  %58 = load i64, ptr %7, align 8, !tbaa !8
  %59 = icmp sle i64 %57, %58
  br i1 %59, label %60, label %127

60:                                               ; preds = %56
  %61 = load i64, ptr %9, align 8, !tbaa !8
  %62 = load i64, ptr %6, align 8, !tbaa !8
  %63 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %62
  %64 = getelementptr inbounds %"struct.std::pair", ptr %63, i32 0, i32 0
  %65 = load i64, ptr %64, align 16, !tbaa !13
  %66 = icmp sge i64 %61, %65
  br i1 %66, label %67, label %82

67:                                               ; preds = %60
  %68 = load i64, ptr %6, align 8, !tbaa !8
  %69 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %68
  %70 = getelementptr inbounds %"struct.std::pair", ptr %69, i32 0, i32 1
  %71 = load i64, ptr %70, align 8, !tbaa !15
  %72 = load i64, ptr %9, align 8, !tbaa !8
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr %9, align 8, !tbaa !8
  %74 = load i64, ptr %6, align 8, !tbaa !8
  %75 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %74
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !15
  %78 = load i64, ptr %8, align 8, !tbaa !8
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %8, align 8, !tbaa !8
  %80 = load i64, ptr %6, align 8, !tbaa !8
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %6, align 8, !tbaa !8
  br label %126

82:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %83 = load i64, ptr %6, align 8, !tbaa !8
  %84 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %83
  %85 = getelementptr inbounds %"struct.std::pair", ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 16, !tbaa !13
  %87 = load i64, ptr %9, align 8, !tbaa !8
  %88 = sub nsw i64 %86, %87
  store i64 %88, ptr %10, align 8, !tbaa !8
  %89 = load i64, ptr %10, align 8, !tbaa !8
  %90 = load i64, ptr %7, align 8, !tbaa !8
  %91 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %90
  %92 = getelementptr inbounds %"struct.std::pair", ptr %91, i32 0, i32 1
  %93 = load i64, ptr %92, align 8, !tbaa !15
  %94 = icmp sgt i64 %89, %93
  br i1 %94, label %95, label %111

95:                                               ; preds = %82
  %96 = load i64, ptr %7, align 8, !tbaa !8
  %97 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %96
  %98 = getelementptr inbounds %"struct.std::pair", ptr %97, i32 0, i32 1
  %99 = load i64, ptr %98, align 8, !tbaa !15
  %100 = load i64, ptr %9, align 8, !tbaa !8
  %101 = add nsw i64 %100, %99
  store i64 %101, ptr %9, align 8, !tbaa !8
  %102 = load i64, ptr %7, align 8, !tbaa !8
  %103 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %102
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 1
  %105 = load i64, ptr %104, align 8, !tbaa !15
  %106 = mul nsw i64 2, %105
  %107 = load i64, ptr %8, align 8, !tbaa !8
  %108 = add nsw i64 %107, %106
  store i64 %108, ptr %8, align 8, !tbaa !8
  %109 = load i64, ptr %7, align 8, !tbaa !8
  %110 = add nsw i64 %109, -1
  store i64 %110, ptr %7, align 8, !tbaa !8
  br label %125

111:                                              ; preds = %82
  %112 = load i64, ptr %10, align 8, !tbaa !8
  %113 = load i64, ptr %9, align 8, !tbaa !8
  %114 = add nsw i64 %113, %112
  store i64 %114, ptr %9, align 8, !tbaa !8
  %115 = load i64, ptr %10, align 8, !tbaa !8
  %116 = load i64, ptr %7, align 8, !tbaa !8
  %117 = getelementptr inbounds %"struct.std::pair", ptr %25, i64 %116
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 1
  %119 = load i64, ptr %118, align 8, !tbaa !15
  %120 = sub nsw i64 %119, %115
  store i64 %120, ptr %118, align 8, !tbaa !15
  %121 = load i64, ptr %10, align 8, !tbaa !8
  %122 = mul nsw i64 %121, 2
  %123 = load i64, ptr %8, align 8, !tbaa !8
  %124 = add nsw i64 %123, %122
  store i64 %124, ptr %8, align 8, !tbaa !8
  br label %125

125:                                              ; preds = %111, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %126

126:                                              ; preds = %125, %67
  br label %56, !llvm.loop !16

127:                                              ; preds = %56
  %128 = load i64, ptr %8, align 8, !tbaa !8
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %128)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %131 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %131)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %132 = load i32, ptr %1, align 4
  ret i32 %132
}

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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 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 @_ZNSirsERl(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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IllTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; 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 uwtable
declare dso_local void @_ZSt4sortIPSt4pairIllEEvT_S3_(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

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

; 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 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 }

!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", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 0}
!14 = !{!"_ZTSSt4pairIllE", !9, i64 0, !9, i64 8}
!15 = !{!14, !9, i64 8}
!16 = distinct !{!16, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i64, i64 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  %8 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %10
  %12 = tail call noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216) %11, i64 noundef 20)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %14 = load i64, ptr %1, align 8, !tbaa !8
  %15 = call ptr @llvm.stacksave.p0()
  %16 = alloca %"struct.std::pair", i64 %14, align 16
  %17 = icmp eq i64 %14, 0
  br i1 %17, label %.loopexit, label %18

18:                                               ; preds = %0
  %19 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %14
  br label %20

20:                                               ; preds = %20, %18
  %21 = phi ptr [ %16, %18 ], [ %22, %20 ]
  call void @_ZNSt4pairIllEC2IllTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %21)
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %23 = icmp eq ptr %22, %19
  br i1 %23, label %.loopexit, label %20

.loopexit:                                        ; preds = %20, %0
  %24 = load i64, ptr %1, align 8, !tbaa !8
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.loopexit
  %.lcssa = phi i64 [ %24, %.loopexit ], [ %34, %.lr.ph ]
  %26 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %.lcssa
  call void @_ZSt4sortIPSt4pairIllEEvT_S3_(ptr noundef nonnull %16, ptr noundef nonnull %26)
  %27 = load i64, ptr %1, align 8, !tbaa !8
  %.not48 = icmp slt i64 %27, 1
  br i1 %.not48, label %._crit_edge55, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %._crit_edge
  %28 = add nsw i64 %27, -1
  br label %.lr.ph54

.lr.ph:                                           ; preds = %.loopexit, %.lr.ph
  %.03847 = phi i64 [ %33, %.lr.ph ], [ 0, %.loopexit ]
  %29 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %.03847
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %33 = add nuw nsw i64 %.03847, 1
  %34 = load i64, ptr %1, align 8, !tbaa !8
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph54:                                         ; preds = %.lr.ph54.preheader, %54
  %.052 = phi i64 [ %.2, %54 ], [ 0, %.lr.ph54.preheader ]
  %.03051 = phi i64 [ %.232, %54 ], [ 0, %.lr.ph54.preheader ]
  %.03350 = phi i64 [ %.235, %54 ], [ %28, %.lr.ph54.preheader ]
  %.03649 = phi i64 [ %.137, %54 ], [ 0, %.lr.ph54.preheader ]
  %36 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %.03649
  %37 = load i64, ptr %36, align 16, !tbaa !13
  %.not45 = icmp slt i64 %.052, %37
  br i1 %.not45, label %43, label %38

38:                                               ; preds = %.lr.ph54
  %39 = getelementptr inbounds i8, ptr %36, i64 8
  %40 = load i64, ptr %39, align 8, !tbaa !15
  %41 = add nsw i64 %40, %.052
  %42 = add nsw i64 %.03649, 1
  br label %54

43:                                               ; preds = %.lr.ph54
  %44 = sub nsw i64 %37, %.052
  %45 = getelementptr inbounds %"struct.std::pair", ptr %16, i64 %.03350, i32 1
  %46 = load i64, ptr %45, align 8, !tbaa !15
  %47 = icmp sgt i64 %44, %46
  br i1 %47, label %48, label %51

48:                                               ; preds = %43
  %49 = add nsw i64 %46, %.052
  %50 = add nsw i64 %.03350, -1
  br label %53

51:                                               ; preds = %43
  %52 = sub nsw i64 %46, %44
  store i64 %52, ptr %45, align 8, !tbaa !15
  br label %53

53:                                               ; preds = %51, %48
  %.134 = phi i64 [ %50, %48 ], [ %.03350, %51 ]
  %.pn.in = phi i64 [ %46, %48 ], [ %44, %51 ]
  %.1 = phi i64 [ %49, %48 ], [ %37, %51 ]
  %.pn = shl nsw i64 %.pn.in, 1
  br label %54

54:                                               ; preds = %53, %38
  %.137 = phi i64 [ %42, %38 ], [ %.03649, %53 ]
  %.235 = phi i64 [ %.03350, %38 ], [ %.134, %53 ]
  %.pn46 = phi i64 [ %40, %38 ], [ %.pn, %53 ]
  %.2 = phi i64 [ %41, %38 ], [ %.1, %53 ]
  %.232 = add nsw i64 %.pn46, %.03051
  %.not = icmp sgt i64 %.137, %.235
  br i1 %.not, label %._crit_edge55, label %.lr.ph54, !llvm.loop !16

._crit_edge55:                                    ; preds = %54, %._crit_edge
  %.030.lcssa = phi i64 [ 0, %._crit_edge ], [ %.232, %54 ]
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.030.lcssa)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @.str)
  call void @llvm.stackrestore.p0(ptr %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0
}

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 nounwind uwtable
declare dso_local noundef i64 @_ZNSt8ios_base9precisionEl(ptr noundef nonnull align 8 dereferenceable(216), i64 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 @_ZNSirsERl(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 nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IllTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 align 2

; 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 uwtable
declare dso_local void @_ZSt4sortIPSt4pairIllEEvT_S3_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

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

; 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 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 }

!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", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 0}
!14 = !{!"_ZTSSt4pairIllE", !9, i64 0, !9, i64 8}
!15 = !{!14, !9, i64 8}
!16 = distinct !{!16, !12}


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