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

; 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<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" = 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 }
%"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 }

@_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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_pbds::tree", align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"class.__gnu_pbds::detail::bin_search_tree_const_it_", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.__gnu_pbds::detail::bin_search_tree_const_it_", align 8
  %15 = alloca %"class.__gnu_pbds::detail::bin_search_tree_const_it_", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca %"class.__gnu_pbds::detail::bin_search_tree_const_it_", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %18 = 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)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #7
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %22 unwind label %28

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

23:                                               ; preds = %38, %22
  %24 = load i32, ptr %8, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %32, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %45

28:                                               ; preds = %0
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %6, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  br label %161

32:                                               ; preds = %23
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %34) #7
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %37 unwind label %41

37:                                               ; preds = %32
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %8, align 4, !tbaa !5
  br label %23, !llvm.loop !9

41:                                               ; preds = %32
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %6, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %160

45:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #7
  invoke void @_ZN10__gnu_pbds4treeIiNS_9null_typeESt10less_equalIiENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %46 unwind label %52

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %66, %46
  %48 = load i32, ptr %10, align 4, !tbaa !5
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %56, label %51

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

52:                                               ; preds = %45
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %6, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %7, align 4
  br label %159

56:                                               ; preds = %47
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %58) #7
  %60 = 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) %9, ptr noundef nonnull align 4 dereferenceable(4) %59)
          to label %61 unwind label %69

61:                                               ; preds = %56
  %62 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %63 = extractvalue { ptr, i8 } %60, 0
  store ptr %63, ptr %62, align 8
  %64 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %65 = extractvalue { ptr, i8 } %60, 1
  store i8 %65, ptr %64, align 8
  br label %66

66:                                               ; preds = %61
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %10, align 4, !tbaa !5
  br label %47, !llvm.loop !11

69:                                               ; preds = %56
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %6, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %158

73:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = sdiv i32 %75, 2
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = invoke ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef %78)
          to label %80 unwind label %94

80:                                               ; preds = %73
  %81 = getelementptr inbounds %"class.__gnu_pbds::detail::bin_search_tree_const_it_", ptr %12, i32 0, i32 0
  store ptr %79, ptr %81, align 8
  %82 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK10__gnu_pbds6detail25bin_search_tree_const_it_IPNS0_13rb_tree_node_IimSaIcEEEiPiPKiRiRS7_Lb1ES3_EdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %83 unwind label %94

83:                                               ; preds = %80
  %84 = load i32, ptr %82, align 4, !tbaa !5
  %85 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %84)
          to label %86 unwind label %94

86:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %138, %86
  %88 = load i32, ptr %13, align 4, !tbaa !5
  %89 = load i32, ptr %2, align 4, !tbaa !5
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = sub nsw i32 %89, %90
  %92 = icmp slt i32 %88, %91
  br i1 %92, label %98, label %93

93:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %150

94:                                               ; preds = %83, %80, %73
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %6, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %158

98:                                               ; preds = %87
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %100) #7
  %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) %9, ptr noundef nonnull align 4 dereferenceable(4) %101)
          to label %103 unwind label %141

103:                                              ; preds = %98
  %104 = invoke ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef %102)
          to label %105 unwind label %141

105:                                              ; preds = %103
  %106 = getelementptr inbounds %"class.__gnu_pbds::detail::bin_search_tree_const_it_", ptr %14, i32 0, i32 0
  store ptr %104, ptr %106, align 8
  %107 = getelementptr inbounds %"class.__gnu_pbds::detail::bin_search_tree_const_it_", ptr %14, i32 0, i32 0
  %108 = load ptr, ptr %107, align 8
  %109 = invoke ptr @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E5eraseENS0_25bin_search_tree_const_it_IPNS0_13rb_tree_node_IimS8_EEiPiPKiRiRSG_Lb1ES8_EE(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr %108)
          to label %110 unwind label %141

110:                                              ; preds = %105
  %111 = getelementptr inbounds %"class.__gnu_pbds::detail::bin_search_tree_const_it_", ptr %15, i32 0, i32 0
  store ptr %109, ptr %111, align 8
  %112 = load i32, ptr %13, align 4, !tbaa !5
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = add nsw i32 %112, %113
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %115) #7
  %117 = 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) %9, ptr noundef nonnull align 4 dereferenceable(4) %116)
          to label %118 unwind label %141

118:                                              ; preds = %110
  %119 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 0
  %120 = extractvalue { ptr, i8 } %117, 0
  store ptr %120, ptr %119, align 8
  %121 = getelementptr inbounds { ptr, i8 }, ptr %16, i32 0, i32 1
  %122 = extractvalue { ptr, i8 } %117, 1
  store i8 %122, ptr %121, align 8
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %124 unwind label %141

124:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  %127 = sdiv i32 %126, 2
  %128 = sub nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = invoke ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8) %9, i64 noundef %129)
          to label %131 unwind label %145

131:                                              ; preds = %124
  %132 = getelementptr inbounds %"class.__gnu_pbds::detail::bin_search_tree_const_it_", ptr %17, i32 0, i32 0
  store ptr %130, ptr %132, align 8
  %133 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK10__gnu_pbds6detail25bin_search_tree_const_it_IPNS0_13rb_tree_node_IimSaIcEEEiPiPKiRiRS7_Lb1ES3_EdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %134 unwind label %145

134:                                              ; preds = %131
  %135 = load i32, ptr %133, align 4, !tbaa !5
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %123, i32 noundef %135)
          to label %137 unwind label %145

137:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %13, align 4, !tbaa !5
  br label %87, !llvm.loop !12

141:                                              ; preds = %118, %110, %105, %103, %98
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %6, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %7, align 4
  br label %149

145:                                              ; preds = %134, %131, %124
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %6, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %149

149:                                              ; preds = %145, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %158

150:                                              ; preds = %93
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %152 unwind label %154

152:                                              ; preds = %150
  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) %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, 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
  %153 = load i32, ptr %1, align 4
  ret i32 %153

154:                                              ; preds = %150
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %6, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %7, align 4
  br label %158

158:                                              ; preds = %154, %149, %94, %69
  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) %9) #7
  br label %159

159:                                              ; preds = %158, %52
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #7
  br label %160

160:                                              ; preds = %159, %41
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %161

161:                                              ; preds = %160, %28
  call void @llvm.lifetime.end.p0(i64 24, 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 %162

162:                                              ; preds = %161
  %163 = load ptr, ptr %6, align 8
  %164 = load i32, ptr %7, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

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

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 @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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

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) #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #5 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; 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<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" = 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_pbds::detail::bin_search_tree_const_it_" = 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 [2 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 %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.__gnu_pbds::tree", align 8
  %6 = alloca %"class.__gnu_pbds::detail::bin_search_tree_const_it_", align 8
  %7 = alloca %"class.__gnu_pbds::detail::bin_search_tree_const_it_", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %8 = 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)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %11, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %12 unwind label %17

12:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %21, %12
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #7
  invoke void @_ZN10__gnu_pbds4treeIiNS_9null_typeESt10less_equalIiENS_11rb_tree_tagENS_33tree_order_statistics_node_updateESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %.preheader unwind label %32

.preheader:                                       ; preds = %._crit_edge
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph34, label %._crit_edge35

17:                                               ; preds = %0
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  br label %95

.lr.ph:                                           ; preds = %12, %21
  %indvars.iv = phi i64 [ %indvars.iv.next, %21 ], [ 0, %12 ]
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #7
  %20 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %21 unwind label %25

21:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !9

25:                                               ; preds = %.lr.ph
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %94

._crit_edge35:                                    ; preds = %36, %.preheader
  %.lcssa = phi i32 [ %15, %.preheader ], [ %37, %36 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %27 = add nsw i32 %.lcssa, 1
  %28 = sdiv i32 %27, 2
  %29 = add nsw i32 %28, -1
  %30 = sext i32 %29 to i64
  %31 = invoke ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %30)
          to label %42 unwind label %51

32:                                               ; preds = %._crit_edge
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %93

.lr.ph34:                                         ; preds = %.preheader, %36
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %36 ], [ 0, %.preheader ]
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv42) #7
  %35 = 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) %5, ptr noundef nonnull align 4 dereferenceable(4) %34)
          to label %36 unwind label %40

36:                                               ; preds = %.lr.ph34
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = icmp slt i64 %indvars.iv.next43, %38
  br i1 %39, label %.lr.ph34, label %._crit_edge35, !llvm.loop !11

40:                                               ; preds = %.lr.ph34
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %92

42:                                               ; preds = %._crit_edge35
  store ptr %31, ptr %6, align 8
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK10__gnu_pbds6detail25bin_search_tree_const_it_IPNS0_13rb_tree_node_IimSaIcEEEiPiPKiRiRS7_Lb1ES3_EdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %44)
          to label %46 unwind label %51

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = icmp sgt i32 %47, %48
  br i1 %49, label %.lr.ph38, label %._crit_edge39

._crit_edge39:                                    ; preds = %79, %46
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %89 unwind label %90

51:                                               ; preds = %42, %._crit_edge35
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %92

.lr.ph38:                                         ; preds = %46, %79
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %79 ], [ 0, %46 ]
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv45) #7
  %54 = 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) %5, ptr noundef nonnull align 4 dereferenceable(4) %53)
          to label %55 unwind label %85

55:                                               ; preds = %.lr.ph38
  %56 = invoke ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %54)
          to label %57 unwind label %85

57:                                               ; preds = %55
  %58 = invoke ptr @_ZN10__gnu_pbds6detail11rb_tree_setIiNS_9null_typeESt10less_equalIiENS0_11tree_traitsIiS2_S4_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEES8_E5eraseENS0_25bin_search_tree_const_it_IPNS0_13rb_tree_node_IimS8_EEiPiPKiRiRSG_Lb1ES8_EE(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr %56)
          to label %59 unwind label %85

59:                                               ; preds = %57
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = trunc nuw nsw i64 %indvars.iv45 to i32
  %62 = add nsw i32 %60, %61
  %63 = sext i32 %62 to i64
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %63) #7
  %65 = 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) %5, ptr noundef nonnull align 4 dereferenceable(4) %64)
          to label %66 unwind label %85

66:                                               ; preds = %59
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
          to label %68 unwind label %85

68:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %71 = sdiv i32 %70, 2
  %72 = add nsw i32 %71, -1
  %73 = sext i32 %72 to i64
  %74 = invoke ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %73)
          to label %75 unwind label %87

75:                                               ; preds = %68
  store ptr %74, ptr %7, align 8
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK10__gnu_pbds6detail25bin_search_tree_const_it_IPNS0_13rb_tree_node_IimSaIcEEEiPiPKiRiRS7_Lb1ES3_EdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %67, i32 noundef %77)
          to label %79 unwind label %87

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %80 = load i32, ptr %1, align 4, !tbaa !5
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = sub nsw i32 %80, %81
  %83 = sext i32 %82 to i64
  %84 = icmp slt i64 %indvars.iv.next46, %83
  br i1 %84, label %.lr.ph38, label %._crit_edge39, !llvm.loop !12

85:                                               ; preds = %66, %59, %57, %55, %.lr.ph38
  %86 = landingpad { ptr, i32 }
          cleanup
  br label %92

87:                                               ; preds = %75, %68
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %92

89:                                               ; preds = %._crit_edge39
  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) %5) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, 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

90:                                               ; preds = %._crit_edge39
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %92

92:                                               ; preds = %85, %87, %90, %51, %40
  %.pn25 = phi { ptr, i32 } [ %41, %40 ], [ %91, %90 ], [ %52, %51 ], [ %88, %87 ], [ %86, %85 ]
  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) %5) #7
  br label %93

93:                                               ; preds = %92, %32
  %.pn25.pn = phi { ptr, i32 } [ %.pn25, %92 ], [ %33, %32 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #7
  br label %94

94:                                               ; preds = %93, %25
  %.pn28 = phi { ptr, i32 } [ %26, %25 ], [ %.pn25.pn, %93 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %95

95:                                               ; preds = %94, %17
  %.pn28.pn = phi { ptr, i32 } [ %.pn28, %94 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 24, 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 } %.pn28.pn
}

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

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 @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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

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) #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZN10__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_E13find_by_orderEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #5 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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