; LLVM IR from abeaumont/competitive-programming :: cses (2168)

; 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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Tuple_impl.1", %"struct.std::_Head_base.2" }
%"struct.std::_Tuple_impl.1" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.2" = type { i32 }
%"struct.std::_Head_base.3" = type { i32 }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.6" = type { i8 }
%"class.__gnu_pbds::tree" = type { %"class.__gnu_pbds::basic_branch" }
%"class.__gnu_pbds::basic_branch" = type { %"class.__gnu_pbds::detail::rb_tree_set" }
%"class.__gnu_pbds::detail::rb_tree_set" = type { %"class.__gnu_pbds::detail::bin_search_tree_set" }
%"class.__gnu_pbds::detail::bin_search_tree_set" = type { %"class.__gnu_pbds::tree_order_statistics_node_update", [8 x i8], ptr, i64 }
%"class.__gnu_pbds::tree_order_statistics_node_update" = type { %"struct.__gnu_pbds::detail::branch_policy" }
%"struct.__gnu_pbds::detail::branch_policy" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon = type { i8 }
%"class.std::tuple.9" = type { %"struct.std::_Tuple_impl.10" }
%"struct.std::_Tuple_impl.10" = type { %"struct.std::_Tuple_impl.11", %"struct.std::_Head_base.15" }
%"struct.std::_Tuple_impl.11" = type { %"struct.std::_Tuple_impl.12", %"struct.std::_Head_base.14" }
%"struct.std::_Tuple_impl.12" = type { %"struct.std::_Head_base.13" }
%"struct.std::_Head_base.13" = type { ptr }
%"struct.std::_Head_base.14" = type { ptr }
%"struct.std::_Head_base.15" = type { ptr }
%"struct.std::pair" = type <{ %"class.__gnu_pbds::detail::bin_search_tree_const_it_", i8, [7 x i8] }>
%"class.__gnu_pbds::detail::bin_search_tree_const_it_" = type { ptr }
%class.anon.16 = type { i8 }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %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
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::tuple", align 4
  %12 = alloca %"class.std::vector.4", align 8
  %13 = alloca %"class.std::allocator.6", align 1
  %14 = alloca %"class.__gnu_pbds::tree", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %class.anon, align 1
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::tuple.9", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca i32, align 4
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca %class.anon.16, align 1
  %25 = alloca i32, align 4
  %26 = alloca %"class.std::tuple.9", align 8
  %27 = alloca %"struct.std::pair", align 8
  %28 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %29 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %31
  %33 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %32, ptr noundef null)
  %34 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  %36 = load i32, ptr %2, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  call void @_ZNSaISt5tupleIJiiiEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  invoke void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %37, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %38 unwind label %44

38:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorISt5tupleIJiiiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !8
  br label %39

39:                                               ; preds = %57, %38
  %40 = load i32, ptr %10, align 4, !tbaa !8
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %48, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %64

44:                                               ; preds = %0
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %8, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %9, align 4
  call void @_ZNSt15__new_allocatorISt5tupleIJiiiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  br label %235

48:                                               ; preds = %39
  %49 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %50 unwind label %60

50:                                               ; preds = %48
  %51 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %52 unwind label %60

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #7
  call void @_ZNSt5tupleIJiiiEEC2IJRiS2_S2_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS4_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %10) #7
  %53 = load i32, ptr %10, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %54) #7
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12) %55, ptr noundef nonnull align 4 dereferenceable(12) %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #7
  br label %57

57:                                               ; preds = %52
  %58 = load i32, ptr %10, align 4, !tbaa !8
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %10, align 4, !tbaa !8
  br label %39, !llvm.loop !11

60:                                               ; preds = %50, %48
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %8, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %234

64:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %66, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %67 unwind label %83

67:                                               ; preds = %64
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #7
  invoke void @_ZN10__gnu_pbds4treeIiNS_9null_typeESt10less_equalIiENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %68 unwind label %87

68:                                               ; preds = %67
  %69 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %70 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %69, ptr %70, align 8
  %71 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %72 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_0EvT_SA_T0_"(ptr %74, ptr %76)
          to label %77 unwind label %91

77:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %115, %77
  %79 = load i32, ptr %18, align 4, !tbaa !8
  %80 = load i32, ptr %2, align 4, !tbaa !8
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %95, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %122

83:                                               ; preds = %64
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %8, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  br label %233

87:                                               ; preds = %67
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %8, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %9, align 4
  br label %232

91:                                               ; preds = %155, %154, %68
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %8, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %9, align 4
  br label %231

95:                                               ; preds = %78
  %96 = load i32, ptr %18, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %97) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  call void @_ZSt3tieIJiiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.9") align 8 %19, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #7
  %99 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRiS0_S0_EEaSIJiiiEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(12) %98) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  %100 = invoke noundef i64 @_ZNK10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %101 unwind label %118

101:                                              ; preds = %95
  %102 = invoke noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_IimSaIcEEENS1_25bin_search_tree_const_it_IPS5_iPiPKiRiRS9_Lb1ES4_EESD_S4_EESE_St10less_equalIiES4_E12order_of_keyESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %103 unwind label %118

103:                                              ; preds = %101
  %104 = sub i64 %100, %102
  %105 = trunc i64 %104 to i32
  %106 = load i32, ptr %5, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %107) #7
  store i32 %105, ptr %108, align 4, !tbaa !8
  %109 = invoke { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E6insertERKi(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %110 unwind label %118

110:                                              ; preds = %103
  %111 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 0
  %112 = extractvalue { ptr, i8 } %109, 0
  store ptr %112, ptr %111, align 8
  %113 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 1
  %114 = extractvalue { ptr, i8 } %109, 1
  store i8 %114, ptr %113, align 8
  br label %115

115:                                              ; preds = %110
  %116 = load i32, ptr %18, align 4, !tbaa !8
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %18, align 4, !tbaa !8
  br label %78, !llvm.loop !13

118:                                              ; preds = %103, %101, %95
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %8, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %231

122:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !8
  br label %123

123:                                              ; preds = %147, %122
  %124 = load i32, ptr %21, align 4, !tbaa !8
  %125 = load i32, ptr %2, align 4, !tbaa !8
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %154

128:                                              ; preds = %123
  %129 = load i32, ptr %21, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %130) #7
  %132 = load i32, ptr %131, align 4, !tbaa !8
  %133 = icmp ne i32 %132, 0
  %134 = zext i1 %133 to i64
  %135 = select i1 %133, i32 1, i32 0
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %135)
          to label %137 unwind label %150

137:                                              ; preds = %128
  %138 = load i32, ptr %21, align 4, !tbaa !8
  %139 = load i32, ptr %2, align 4, !tbaa !8
  %140 = sub nsw i32 %139, 1
  %141 = icmp eq i32 %138, %140
  %142 = zext i1 %141 to i64
  %143 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !14
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %136, i8 noundef signext %144)
          to label %146 unwind label %150

146:                                              ; preds = %137
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %21, align 4, !tbaa !8
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %21, align 4, !tbaa !8
  br label %123, !llvm.loop !15

150:                                              ; preds = %137, %128
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %8, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %231

154:                                              ; preds = %127
  invoke void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %155 unwind label %91

155:                                              ; preds = %154
  %156 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %157 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %156, ptr %157, align 8
  %158 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  %159 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %158, ptr %159, align 8
  %160 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8
  %162 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_1EvT_SA_T0_"(ptr %161, ptr %163)
          to label %164 unwind label %91

164:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !8
  br label %165

165:                                              ; preds = %190, %164
  %166 = load i32, ptr %25, align 4, !tbaa !8
  %167 = load i32, ptr %2, align 4, !tbaa !8
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %197

170:                                              ; preds = %165
  %171 = load i32, ptr %25, align 4, !tbaa !8
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %172) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #7
  call void @_ZSt3tieIJiiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.9") align 8 %26, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #7
  %174 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRiS0_S0_EEaSIJiiiEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(12) %173) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #7
  %175 = invoke noundef i64 @_ZNK10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %176 unwind label %193

176:                                              ; preds = %170
  %177 = invoke noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_IimSaIcEEENS1_25bin_search_tree_const_it_IPS5_iPiPKiRiRS9_Lb1ES4_EESD_S4_EESE_St10less_equalIiES4_E12order_of_keyESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %178 unwind label %193

178:                                              ; preds = %176
  %179 = sub i64 %175, %177
  %180 = trunc i64 %179 to i32
  %181 = load i32, ptr %5, align 4, !tbaa !8
  %182 = sext i32 %181 to i64
  %183 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %182) #7
  store i32 %180, ptr %183, align 4, !tbaa !8
  %184 = invoke { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E6insertERKi(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %185 unwind label %193

185:                                              ; preds = %178
  %186 = getelementptr inbounds { ptr, i8 }, ptr %27, i32 0, i32 0
  %187 = extractvalue { ptr, i8 } %184, 0
  store ptr %187, ptr %186, align 8
  %188 = getelementptr inbounds { ptr, i8 }, ptr %27, i32 0, i32 1
  %189 = extractvalue { ptr, i8 } %184, 1
  store i8 %189, ptr %188, align 8
  br label %190

190:                                              ; preds = %185
  %191 = load i32, ptr %25, align 4, !tbaa !8
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %25, align 4, !tbaa !8
  br label %165, !llvm.loop !16

193:                                              ; preds = %178, %176, %170
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %8, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %231

197:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !8
  br label %198

198:                                              ; preds = %222, %197
  %199 = load i32, ptr %28, align 4, !tbaa !8
  %200 = load i32, ptr %2, align 4, !tbaa !8
  %201 = icmp slt i32 %199, %200
  br i1 %201, label %203, label %202

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

203:                                              ; preds = %198
  %204 = load i32, ptr %28, align 4, !tbaa !8
  %205 = sext i32 %204 to i64
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %205) #7
  %207 = load i32, ptr %206, align 4, !tbaa !8
  %208 = icmp ne i32 %207, 0
  %209 = zext i1 %208 to i64
  %210 = select i1 %208, i32 1, i32 0
  %211 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %210)
          to label %212 unwind label %225

212:                                              ; preds = %203
  %213 = load i32, ptr %28, align 4, !tbaa !8
  %214 = load i32, ptr %2, align 4, !tbaa !8
  %215 = sub nsw i32 %214, 1
  %216 = icmp eq i32 %213, %215
  %217 = zext i1 %216 to i64
  %218 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %217
  %219 = load i8, ptr %218, align 1, !tbaa !14
  %220 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %211, i8 noundef signext %219)
          to label %221 unwind label %225

221:                                              ; preds = %212
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %28, align 4, !tbaa !8
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %28, align 4, !tbaa !8
  br label %198, !llvm.loop !17

225:                                              ; preds = %212, %203
  %226 = landingpad { ptr, i32 }
          cleanup
  %227 = extractvalue { ptr, i32 } %226, 0
  store ptr %227, ptr %8, align 8
  %228 = extractvalue { ptr, i32 } %226, 1
  store i32 %228, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  br label %231

229:                                              ; preds = %202
  call void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_ED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %230 = load i32, ptr %1, align 4
  ret i32 %230

231:                                              ; preds = %225, %193, %150, %118, %91
  call void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_ED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  br label %232

232:                                              ; preds = %231, %87
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #7
  br label %233

233:                                              ; preds = %232, %83
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  br label %234

234:                                              ; preds = %233, %60
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  br label %235

235:                                              ; preds = %234, %44
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %236

236:                                              ; preds = %235
  %237 = load ptr, ptr %8, align 8
  %238 = load i32, ptr %9, align 4
  %239 = insertvalue { ptr, i32 } poison, ptr %237, 0
  %240 = insertvalue { ptr, i32 } %239, i32 %238, 1
  resume { ptr, i32 } %240
}

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt5tupleIJiiiEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiiEEC2IJRiS2_S2_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds4treeIiNS_9null_typeESt10less_equalIiENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_0EvT_SA_T0_"(ptr, ptr) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.9") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRiS0_S0_EEaSIJiiiEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E6insertERKi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_1EvT_SA_T0_"(ptr, ptr) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_ED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt5tupleIJiiiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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 = { 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 #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 = { 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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<int, int, int>, std::allocator<std::tuple<int, int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Tuple_impl.1", %"struct.std::_Head_base.2" }
%"struct.std::_Tuple_impl.1" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.2" = type { i32 }
%"struct.std::_Head_base.3" = type { i32 }
%"class.std::vector.4" = type { %"struct.std::_Vector_base.5" }
%"struct.std::_Vector_base.5" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.6" = type { i8 }
%"class.__gnu_pbds::tree" = type { %"class.__gnu_pbds::basic_branch" }
%"class.__gnu_pbds::basic_branch" = type { %"class.__gnu_pbds::detail::rb_tree_set" }
%"class.__gnu_pbds::detail::rb_tree_set" = type { %"class.__gnu_pbds::detail::bin_search_tree_set" }
%"class.__gnu_pbds::detail::bin_search_tree_set" = type { %"class.__gnu_pbds::tree_order_statistics_node_update", [8 x i8], ptr, i64 }
%"class.__gnu_pbds::tree_order_statistics_node_update" = type { %"struct.__gnu_pbds::detail::branch_policy" }
%"struct.__gnu_pbds::detail::branch_policy" = type { ptr }
%"class.std::tuple.9" = type { %"struct.std::_Tuple_impl.10" }
%"struct.std::_Tuple_impl.10" = type { %"struct.std::_Tuple_impl.11", %"struct.std::_Head_base.15" }
%"struct.std::_Tuple_impl.11" = type { %"struct.std::_Tuple_impl.12", %"struct.std::_Head_base.14" }
%"struct.std::_Tuple_impl.12" = type { %"struct.std::_Head_base.13" }
%"struct.std::_Head_base.13" = type { ptr }
%"struct.std::_Head_base.14" = type { ptr }
%"struct.std::_Head_base.15" = type { ptr }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::tuple", align 4
  %9 = alloca %"class.std::vector.4", align 8
  %10 = alloca %"class.std::allocator.6", align 1
  %11 = alloca %"class.__gnu_pbds::tree", align 8
  %12 = alloca %"class.std::tuple.9", align 8
  %13 = alloca %"class.std::tuple.9", align 8
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  %21 = load i32, ptr %1, align 4, !tbaa !8
  %22 = sext i32 %21 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSaISt5tupleIJiiiEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %22, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %23 unwind label %27

23:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorISt5tupleIJiiiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  %24 = load i32, ptr %1, align 4, !tbaa !8
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %32, %23
  %.lcssa = phi i32 [ %24, %23 ], [ %39, %32 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  %26 = sext i32 %.lcssa to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %26, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %43 unwind label %50

27:                                               ; preds = %0
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt5tupleIJiiiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  br label %138

.lr.ph:                                           ; preds = %23, %32
  %29 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %30 unwind label %41

30:                                               ; preds = %.lr.ph
  %31 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %32 unwind label %41

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #7
  call void @_ZNSt5tupleIJiiiEEC2IJRiS2_S2_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS4_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %7) #7
  %33 = load i32, ptr %7, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %34) #7
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12) %35, ptr noundef nonnull align 4 dereferenceable(12) %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #7
  %37 = load i32, ptr %7, align 4, !tbaa !8
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %7, align 4, !tbaa !8
  %39 = load i32, ptr %1, align 4, !tbaa !8
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %.lr.ph, label %._crit_edge, !llvm.loop !11

41:                                               ; preds = %30, %.lr.ph
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %137

43:                                               ; preds = %._crit_edge
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #7
  invoke void @_ZN10__gnu_pbds4treeIiNS_9null_typeESt10less_equalIiENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %44 unwind label %52

44:                                               ; preds = %43
  %45 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %46 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_0EvT_SA_T0_"(ptr %45, ptr %46)
          to label %.preheader40 unwind label %54

.preheader40:                                     ; preds = %44
  %47 = load i32, ptr %1, align 4, !tbaa !8
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph43, label %._crit_edge46

.preheader39:                                     ; preds = %67
  %49 = icmp sgt i32 %68, 0
  br i1 %49, label %.lr.ph45, label %._crit_edge46

50:                                               ; preds = %._crit_edge
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  br label %136

52:                                               ; preds = %43
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %135

54:                                               ; preds = %92, %._crit_edge46, %44
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %134

.lr.ph43:                                         ; preds = %.preheader40, %67
  %indvars.iv = phi i64 [ %indvars.iv.next, %67 ], [ 0, %.preheader40 ]
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #7
  call void @_ZSt3tieIJiiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.9") align 8 %12, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRiS0_S0_EEaSIJiiiEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 4 dereferenceable(12) %56) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #7
  %58 = call noundef i64 @_ZNK10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %59 = invoke noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_IimSaIcEEENS1_25bin_search_tree_const_it_IPS5_iPiPKiRiRS9_Lb1ES4_EESD_S4_EESE_St10less_equalIiES4_E12order_of_keyESC_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %60 unwind label %71

60:                                               ; preds = %.lr.ph43
  %61 = sub i64 %58, %59
  %62 = trunc i64 %61 to i32
  %63 = load i32, ptr %4, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %64) #7
  store i32 %62, ptr %65, align 4, !tbaa !8
  %66 = invoke { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E6insertERKi(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %67 unwind label %71

67:                                               ; preds = %60
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %68 = load i32, ptr %1, align 4, !tbaa !8
  %69 = sext i32 %68 to i64
  %70 = icmp slt i64 %indvars.iv.next, %69
  br i1 %70, label %.lr.ph43, label %.preheader39, !llvm.loop !13

71:                                               ; preds = %60, %.lr.ph43
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %134

._crit_edge46:                                    ; preds = %86, %.preheader40, %.preheader39
  invoke void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %92 unwind label %54

.lr.ph45:                                         ; preds = %.preheader39, %86
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %86 ], [ 0, %.preheader39 ]
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv54) #7
  %74 = load i32, ptr %73, align 4, !tbaa !8
  %.not31 = icmp ne i32 %74, 0
  %75 = zext i1 %.not31 to i32
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %75)
          to label %77 unwind label %90

77:                                               ; preds = %.lr.ph45
  %78 = load i32, ptr %1, align 4, !tbaa !8
  %79 = add nsw i32 %78, -1
  %80 = zext i32 %79 to i64
  %81 = icmp eq i64 %indvars.iv54, %80
  %82 = zext i1 %81 to i64
  %83 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !14
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %76, i8 noundef signext %84)
          to label %86 unwind label %90

86:                                               ; preds = %77
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %87 = load i32, ptr %1, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next55, %88
  br i1 %89, label %.lr.ph45, label %._crit_edge46, !llvm.loop !15

90:                                               ; preds = %77, %.lr.ph45
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %134

92:                                               ; preds = %._crit_edge46
  %93 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %94 = call ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_1EvT_SA_T0_"(ptr %93, ptr %94)
          to label %.preheader38 unwind label %54

.preheader38:                                     ; preds = %92
  %95 = load i32, ptr %1, align 4, !tbaa !8
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %.lr.ph48, label %._crit_edge51

.preheader:                                       ; preds = %109
  %97 = icmp sgt i32 %110, 0
  br i1 %97, label %.lr.ph50, label %._crit_edge51

.lr.ph48:                                         ; preds = %.preheader38, %109
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %109 ], [ 0, %.preheader38 ]
  %98 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv57) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  call void @_ZSt3tieIJiiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.9") align 8 %13, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #7
  %99 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRiS0_S0_EEaSIJiiiEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(12) %98) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  %100 = call noundef i64 @_ZNK10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %101 = invoke noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_IimSaIcEEENS1_25bin_search_tree_const_it_IPS5_iPiPKiRiRS9_Lb1ES4_EESD_S4_EESE_St10less_equalIiES4_E12order_of_keyESC_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %102 unwind label %113

102:                                              ; preds = %.lr.ph48
  %103 = sub i64 %100, %101
  %104 = trunc i64 %103 to i32
  %105 = load i32, ptr %4, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %106) #7
  store i32 %104, ptr %107, align 4, !tbaa !8
  %108 = invoke { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E6insertERKi(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %109 unwind label %113

109:                                              ; preds = %102
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %110 = load i32, ptr %1, align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = icmp slt i64 %indvars.iv.next58, %111
  br i1 %112, label %.lr.ph48, label %.preheader, !llvm.loop !16

113:                                              ; preds = %102, %.lr.ph48
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %134

._crit_edge51:                                    ; preds = %128, %.preheader38, %.preheader
  call void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_ED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph50:                                         ; preds = %.preheader, %128
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %128 ], [ 0, %.preheader ]
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %indvars.iv60) #7
  %116 = load i32, ptr %115, align 4, !tbaa !8
  %.not = icmp ne i32 %116, 0
  %117 = zext i1 %.not to i32
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %117)
          to label %119 unwind label %132

119:                                              ; preds = %.lr.ph50
  %120 = load i32, ptr %1, align 4, !tbaa !8
  %121 = add nsw i32 %120, -1
  %122 = zext i32 %121 to i64
  %123 = icmp eq i64 %indvars.iv60, %122
  %124 = zext i1 %123 to i64
  %125 = getelementptr inbounds [3 x i8], ptr @.str, i64 0, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !14
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %118, i8 noundef signext %126)
          to label %128 unwind label %132

128:                                              ; preds = %119
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %129 = load i32, ptr %1, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = icmp slt i64 %indvars.iv.next61, %130
  br i1 %131, label %.lr.ph50, label %._crit_edge51, !llvm.loop !17

132:                                              ; preds = %119, %.lr.ph50
  %133 = landingpad { ptr, i32 }
          cleanup
  br label %134

134:                                              ; preds = %132, %113, %90, %71, %54
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %91, %90 ], [ %114, %113 ], [ %133, %132 ], [ %55, %54 ]
  call void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_ED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  br label %135

135:                                              ; preds = %134, %52
  %.pn.pn = phi { ptr, i32 } [ %.pn, %134 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  br label %136

136:                                              ; preds = %135, %50
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %135 ], [ %51, %50 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  br label %137

137:                                              ; preds = %136, %41
  %.pn35 = phi { ptr, i32 } [ %42, %41 ], [ %.pn.pn.pn, %136 ]
  call void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  br label %138

138:                                              ; preds = %137, %27
  %.pn35.pn = phi { ptr, i32 } [ %.pn35, %137 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn35.pn
}

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt5tupleIJiiiEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5tupleIJiiiEEC2IJRiS2_S2_ELb1ETnNSt9enable_ifIXclsr4_TCCIXT0_EEE29__is_implicitly_constructibleIDpT_EEEbE4typeELb1EEEDpOS4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5tupleIJiiiEEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds4treeIiNS_9null_typeESt10less_equalIiENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_0EvT_SA_T0_"(ptr, ptr) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJiiiEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.9") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRiS0_S0_EEaSIJiiiEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E4sizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E6insertERKi(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiiEESt6vectorIS3_SaIS3_EEEEZ4mainE3$_1EvT_SA_T0_"(ptr, ptr) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10__gnu_pbds6detail19bin_search_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_ED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt5tupleIJiiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt5tupleIJiiiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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 = { 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 #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 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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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