; LLVM IR from eyangch/competitive-programming :: CSES/Sorting_and_Searching (nested_ranges_count)

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

%struct.r = type { i32, i32, i32 }
%"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::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.anon = type { i8 }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = 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.2 = type { i8 }

@N = external dso_local global i32, align 4
@a = external dso_local global [200000 x %struct.r], align 16
@ans = external dso_local global [200000 x i32], align 16
@pv = external dso_local global %"class.__gnu_pbds::tree", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %class.anon, align 1
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca %"struct.std::pair.0", align 8
  %9 = alloca i32, align 4
  %10 = alloca %class.anon.2, align 1
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca %"struct.std::pair.0", align 8
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %24

24:                                               ; preds = %45, %0
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = load i32, ptr @N, align 4, !tbaa !8
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.r, ptr %32, i32 0, i32 0
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.r, ptr %37, i32 0, i32 1
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 4 dereferenceable(4) %38)
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.r, ptr %43, i32 0, i32 2
  store i32 %40, ptr %44, align 4, !tbaa !11
  br label %45

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

48:                                               ; preds = %28
  %49 = load i32, ptr @N, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.r, ptr @a, i64 %50
  call void @"_ZSt4sortIP1rZ4mainE3$_0EvT_S3_T0_"(ptr noundef @a, ptr noundef %51)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %83, %48
  %53 = load i32, ptr %4, align 4, !tbaa !8
  %54 = load i32, ptr @N, align 4, !tbaa !8
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %86

57:                                               ; preds = %52
  %58 = load i32, ptr %4, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %60 = load i32, ptr %4, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.r, ptr %62, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 -1, ptr %6, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %63, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %64 = call noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_ISt4pairIiiEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_E12order_of_keyESE_(ptr noundef nonnull align 8 dereferenceable(8) @pv, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %65 = sub i64 %59, %64
  %66 = trunc i64 %65 to i32
  %67 = load i32, ptr %4, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.r, ptr %69, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %72
  store i32 %66, ptr %73, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %74 = load i32, ptr %4, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.r, ptr %76, i32 0, i32 0
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %77, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %78 = call { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(32) @pv, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %79 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 0
  %80 = extractvalue { ptr, i8 } %78, 0
  store ptr %80, ptr %79, align 8
  %81 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 1
  %82 = extractvalue { ptr, i8 } %78, 1
  store i8 %82, ptr %81, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %83

83:                                               ; preds = %57
  %84 = load i32, ptr %4, align 4, !tbaa !8
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %4, align 4, !tbaa !8
  br label %52, !llvm.loop !15

86:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %87

87:                                               ; preds = %99, %86
  %88 = load i32, ptr %9, align 4, !tbaa !8
  %89 = load i32, ptr @N, align 4, !tbaa !8
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %102

92:                                               ; preds = %87
  %93 = load i32, ptr %9, align 4, !tbaa !8
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !8
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %96)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef @.str)
  br label %99

99:                                               ; preds = %92
  %100 = load i32, ptr %9, align 4, !tbaa !8
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %9, align 4, !tbaa !8
  br label %87, !llvm.loop !16

102:                                              ; preds = %91
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %104 = load i32, ptr @N, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %struct.r, ptr @a, i64 %105
  call void @"_ZSt4sortIP1rZ4mainE3$_1EvT_S3_T0_"(ptr noundef @a, ptr noundef %106)
  call void @_ZN10__gnu_pbds6detail19bin_search_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32) @pv)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %107

107:                                              ; preds = %138, %102
  %108 = load i32, ptr %11, align 4, !tbaa !8
  %109 = load i32, ptr @N, align 4, !tbaa !8
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %112, label %111

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

112:                                              ; preds = %107
  %113 = load i32, ptr %11, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %115 = load i32, ptr %11, align 4, !tbaa !8
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %116
  %118 = getelementptr inbounds %struct.r, ptr %117, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 -1, ptr %13, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %118, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %119 = call noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_ISt4pairIiiEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_E12order_of_keyESE_(ptr noundef nonnull align 8 dereferenceable(8) @pv, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %120 = sub i64 %114, %119
  %121 = trunc i64 %120 to i32
  %122 = load i32, ptr %11, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.r, ptr %124, i32 0, i32 2
  %126 = load i32, ptr %125, align 4, !tbaa !11
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %127
  store i32 %121, ptr %128, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %129 = load i32, ptr %11, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %130
  %132 = getelementptr inbounds %struct.r, ptr %131, i32 0, i32 1
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(4) %132, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %133 = call { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(32) @pv, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %134 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 0
  %135 = extractvalue { ptr, i8 } %133, 0
  store ptr %135, ptr %134, align 8
  %136 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 1
  %137 = extractvalue { ptr, i8 } %133, 1
  store i8 %137, ptr %136, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %138

138:                                              ; preds = %112
  %139 = load i32, ptr %11, align 4, !tbaa !8
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %11, align 4, !tbaa !8
  br label %107, !llvm.loop !17

141:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %142

142:                                              ; preds = %154, %141
  %143 = load i32, ptr %16, align 4, !tbaa !8
  %144 = load i32, ptr @N, align 4, !tbaa !8
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %157

147:                                              ; preds = %142
  %148 = load i32, ptr %16, align 4, !tbaa !8
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !8
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %151)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @.str)
  br label %154

154:                                              ; preds = %147
  %155 = load i32, ptr %16, align 4, !tbaa !8
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %16, align 4, !tbaa !8
  br label %142, !llvm.loop !18

157:                                              ; preds = %146
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %159 = load i32, ptr %1, align 4
  ret i32 %159
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP1rZ4mainE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) #4

; 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_ISt4pairIiiEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_E12order_of_keyESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 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) #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP1rZ4mainE3$_1EvT_S3_T0_"(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds6detail19bin_search_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!12, !9, i64 8}
!12 = !{!"_ZTS1r", !9, i64 0, !9, i64 4, !9, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

%struct.r = type { i32, i32, i32 }
%"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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i32, i32 }

@N = external dso_local global i32, align 4
@a = external dso_local global [200000 x %struct.r], align 16
@ans = external dso_local local_unnamed_addr global [200000 x i32], align 16
@pv = external dso_local global %"class.__gnu_pbds::tree", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %16 = load i32, ptr @N, align 4, !tbaa !8
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %.._crit_edge_crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %28, %.lr.ph ]
  %18 = getelementptr inbounds %struct.r, ptr @a, i64 %.pre-phi
  tail call void @"_ZSt4sortIP1rZ4mainE3$_0EvT_S3_T0_"(ptr noundef nonnull @a, ptr noundef nonnull %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !8
  %19 = load i32, ptr @N, align 4, !tbaa !8
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph24, label %._crit_edge25.thread

._crit_edge25.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %._crit_edge29

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %21 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %indvars.iv
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %23 = getelementptr inbounds i8, ptr %21, i64 4
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %26, ptr %25, align 4, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr @N, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge25:                                    ; preds = %.lr.ph24
  %30 = icmp sgt i32 %46, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br i1 %30, label %.lr.ph28, label %._crit_edge29

.lr.ph24:                                         ; preds = %._crit_edge, %.lr.ph24
  %storemerge22 = phi i32 [ %45, %.lr.ph24 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %31 = sext i32 %storemerge22 to i64
  %32 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %31
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 -1, ptr %3, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %33 = call noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_ISt4pairIiiEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_E12order_of_keyESE_(ptr noundef nonnull align 8 dereferenceable(8) @pv, ptr noundef nonnull align 4 dereferenceable(8) %2)
  %34 = trunc i64 %33 to i32
  %35 = sub i32 %storemerge22, %34
  %36 = load i32, ptr %1, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %37, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %40
  store i32 %35, ptr %41, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %42 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %37
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %42, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %43 = call { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(32) @pv, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %44 = load i32, ptr %1, align 4, !tbaa !8
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %1, align 4, !tbaa !8
  %46 = load i32, ptr @N, align 4, !tbaa !8
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph24, label %._crit_edge25, !llvm.loop !15

._crit_edge29:                                    ; preds = %.lr.ph28, %._crit_edge25.thread, %._crit_edge25
  %48 = call 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_)
  %49 = load i32, ptr @N, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.r, ptr @a, i64 %50
  call void @"_ZSt4sortIP1rZ4mainE3$_1EvT_S3_T0_"(ptr noundef nonnull @a, ptr noundef nonnull %51)
  call void @_ZN10__gnu_pbds6detail19bin_search_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32) @pv)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 0, ptr %5, align 4, !tbaa !8
  %52 = load i32, ptr @N, align 4, !tbaa !8
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph32, label %._crit_edge33.thread

._crit_edge33.thread:                             ; preds = %._crit_edge29
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %._crit_edge37

.lr.ph28:                                         ; preds = %._crit_edge25, %.lr.ph28
  %indvars.iv40 = phi i64 [ %indvars.iv.next41, %.lr.ph28 ], [ 0, %._crit_edge25 ]
  %54 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %indvars.iv40
  %55 = load i32, ptr %54, align 4, !tbaa !8
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %55)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull @.str)
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %58 = load i32, ptr @N, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next41, %59
  br i1 %60, label %.lr.ph28, label %._crit_edge29, !llvm.loop !16

._crit_edge33:                                    ; preds = %.lr.ph32
  %61 = icmp sgt i32 %77, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br i1 %61, label %.lr.ph36, label %._crit_edge37

.lr.ph32:                                         ; preds = %._crit_edge29, %.lr.ph32
  %storemerge2030 = phi i32 [ %76, %.lr.ph32 ], [ 0, %._crit_edge29 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %62 = sext i32 %storemerge2030 to i64
  %63 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %62, i32 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 -1, ptr %7, align 4, !tbaa !8
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %63, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %64 = call noundef i64 @_ZNK10__gnu_pbds33tree_order_statistics_node_updateINS_6detail30bin_search_tree_const_node_it_INS1_13rb_tree_node_ISt4pairIiiEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_E12order_of_keyESE_(ptr noundef nonnull align 8 dereferenceable(8) @pv, ptr noundef nonnull align 4 dereferenceable(8) %6)
  %65 = trunc i64 %64 to i32
  %66 = sub i32 %storemerge2030, %65
  %67 = load i32, ptr %5, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %68, i32 2
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %71
  store i32 %66, ptr %72, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %73 = getelementptr inbounds [200000 x %struct.r], ptr @a, i64 0, i64 %68, i32 1
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %73, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %74 = call { ptr, i8 } @_ZN10__gnu_pbds6detail11rb_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E6insertERKS3_(ptr noundef nonnull align 8 dereferenceable(32) @pv, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %75 = load i32, ptr %5, align 4, !tbaa !8
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %5, align 4, !tbaa !8
  %77 = load i32, ptr @N, align 4, !tbaa !8
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %.lr.ph32, label %._crit_edge33, !llvm.loop !17

._crit_edge37:                                    ; preds = %.lr.ph36, %._crit_edge33.thread, %._crit_edge33
  %79 = call 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_)
  ret i32 0

.lr.ph36:                                         ; preds = %._crit_edge33, %.lr.ph36
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %.lr.ph36 ], [ 0, %._crit_edge33 ]
  %80 = getelementptr inbounds [200000 x i32], ptr @ans, i64 0, i64 %indvars.iv43
  %81 = load i32, ptr %80, align 4, !tbaa !8
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %81)
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef nonnull @.str)
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %84 = load i32, ptr @N, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %indvars.iv.next44, %85
  br i1 %86, label %.lr.ph36, label %._crit_edge37, !llvm.loop !18
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP1rZ4mainE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #4

; 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_ISt4pairIiiEmSaIcEEENS1_25bin_search_tree_const_it_IPS7_S5_PS5_PKS5_RS5_RSB_Lb1ES6_EESF_S6_EESG_St4lessIS5_ES6_E12order_of_keyESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 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 #4

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

; 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 #5 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)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP1rZ4mainE3$_1EvT_S3_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN10__gnu_pbds6detail19bin_search_tree_setISt4pairIiiENS_9null_typeESt4lessIS3_ENS0_11tree_traitsIS3_S4_S6_NS_33tree_order_statistics_node_updateENS_11rb_tree_tagESaIcEEESA_E5clearEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!12, !9, i64 8}
!12 = !{!"_ZTS1r", !9, i64 0, !9, i64 4, !9, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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