; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/101 Hacks/101 Hack 2016/101 Hack April/Problem C (C)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type { i32, %"struct.std::pair.7" }
%"struct.std::pair.7" = type { i32, i32 }
%"struct.std::pair.9" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@cur = external dso_local global i64, align 8
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@w = external dso_local global %"class.std::vector", align 8
@qr = external dso_local global %"class.std::vector", align 8
@res = external dso_local global [300300 x i64], align 16
@comp = external dso_local global %"class.std::set", align 8
@f = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6createi(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5mergeii(i32 noundef, i32 noundef) #1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 i32, align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca %"struct.std::pair.7", align 4
  %9 = alloca { i64, i32 }, align 8
  %10 = alloca %"struct.std::pair.9", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca %"struct.std::pair.7", align 4
  %16 = alloca { i64, i32 }, align 8
  %17 = alloca %"struct.std::pair.9", align 8
  %18 = alloca %"struct.std::pair.9", align 8
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %36, %0
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z6createi(i32 noundef %35)
  br label %36

36:                                               ; preds = %34
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !9

39:                                               ; preds = %33
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %54, %39
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %40
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %47 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %47, ptr %8, align 4
  %48 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store { i64, i32 } %48, ptr %9, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 8 %9, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @w, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  %49 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @comp, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %50 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 0
  %51 = extractvalue { ptr, i8 } %49, 0
  store ptr %51, ptr %50, align 8
  %52 = getelementptr inbounds { ptr, i8 }, ptr %10, i32 0, i32 1
  %53 = extractvalue { ptr, i8 } %49, 1
  store i8 %53, ptr %52, align 8
  br label %54

54:                                               ; preds = %45
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %6, align 4, !tbaa !5
  br label %40, !llvm.loop !11

57:                                               ; preds = %44
  %58 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #7
  %59 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %58, ptr %59, align 8
  %60 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #7
  %61 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %60, ptr %61, align 8
  %62 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %63, ptr %65)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %85, %57
  %67 = load i32, ptr %13, align 4, !tbaa !5
  %68 = load i32, ptr @q, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

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

71:                                               ; preds = %66
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %73 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %73, ptr %15, align 4
  %74 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(8) %15)
  store { i64, i32 } %74, ptr %16, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %16, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @qr, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  %75 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @comp, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %76 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 0
  %77 = extractvalue { ptr, i8 } %75, 0
  store ptr %77, ptr %76, align 8
  %78 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 1
  %79 = extractvalue { ptr, i8 } %75, 1
  store i8 %79, ptr %78, align 8
  %80 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @comp, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %81 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %82 = extractvalue { ptr, i8 } %80, 0
  store ptr %82, ptr %81, align 8
  %83 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %84 = extractvalue { ptr, i8 } %80, 1
  store i8 %84, ptr %83, align 8
  br label %85

85:                                               ; preds = %71
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %13, align 4, !tbaa !5
  br label %66, !llvm.loop !12

88:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %89 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @comp) #7
  %90 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %89, ptr %90, align 8
  br label %91

91:                                               ; preds = %101, %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %92 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @comp) #7
  %93 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %103

96:                                               ; preds = %91
  %97 = load i32, ptr %19, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %19, align 4, !tbaa !5
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %99)
  store i32 %98, ptr %100, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %96
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %91, !llvm.loop !13

103:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %121, %103
  %105 = load i32, ptr %22, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #7
  %108 = icmp ult i64 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %124

110:                                              ; preds = %104
  %111 = load i32, ptr %22, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %112) #7
  %114 = getelementptr inbounds %"struct.std::pair", ptr %113, i32 0, i32 0
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %114)
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr %22, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %118) #7
  %120 = getelementptr inbounds %"struct.std::pair", ptr %119, i32 0, i32 0
  store i32 %116, ptr %120, align 4, !tbaa !14
  br label %121

121:                                              ; preds = %110
  %122 = load i32, ptr %22, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %22, align 4, !tbaa !5
  br label %104, !llvm.loop !17

124:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %155, %124
  %126 = load i32, ptr %23, align 4, !tbaa !5
  %127 = load i32, ptr @q, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

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

130:                                              ; preds = %125
  %131 = load i32, ptr %23, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %132) #7
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 1
  %135 = getelementptr inbounds %"struct.std::pair.7", ptr %134, i32 0, i32 0
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %135)
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = load i32, ptr %23, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %139) #7
  %141 = getelementptr inbounds %"struct.std::pair", ptr %140, i32 0, i32 1
  %142 = getelementptr inbounds %"struct.std::pair.7", ptr %141, i32 0, i32 0
  store i32 %137, ptr %142, align 4, !tbaa !18
  %143 = load i32, ptr %23, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %144) #7
  %146 = getelementptr inbounds %"struct.std::pair", ptr %145, i32 0, i32 1
  %147 = getelementptr inbounds %"struct.std::pair.7", ptr %146, i32 0, i32 1
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %147)
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = load i32, ptr %23, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %151) #7
  %153 = getelementptr inbounds %"struct.std::pair", ptr %152, i32 0, i32 1
  %154 = getelementptr inbounds %"struct.std::pair.7", ptr %153, i32 0, i32 1
  store i32 %149, ptr %154, align 4, !tbaa !19
  br label %155

155:                                              ; preds = %130
  %156 = load i32, ptr %23, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %23, align 4, !tbaa !5
  br label %125, !llvm.loop !20

158:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %208, %158
  %160 = load i32, ptr %24, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #7
  %163 = icmp ult i64 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %211

165:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %166 = load i32, ptr %24, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %167) #7
  %169 = getelementptr inbounds %"struct.std::pair", ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 4, !tbaa !14
  store i32 %170, ptr %25, align 4, !tbaa !5
  store i64 0, ptr @cur, align 8, !tbaa !21
  br label %171

171:                                              ; preds = %186, %165
  %172 = load i32, ptr %24, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #7
  %175 = icmp ult i64 %173, %174
  br i1 %175, label %176, label %184

176:                                              ; preds = %171
  %177 = load i32, ptr %24, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %178) #7
  %180 = getelementptr inbounds %"struct.std::pair", ptr %179, i32 0, i32 0
  %181 = load i32, ptr %180, align 4, !tbaa !14
  %182 = load i32, ptr %25, align 4, !tbaa !5
  %183 = icmp eq i32 %181, %182
  br label %184

184:                                              ; preds = %176, %171
  %185 = phi i1 [ false, %171 ], [ %183, %176 ]
  br i1 %185, label %186, label %201

186:                                              ; preds = %184
  %187 = load i32, ptr %24, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %188) #7
  %190 = getelementptr inbounds %"struct.std::pair", ptr %189, i32 0, i32 1
  %191 = getelementptr inbounds %"struct.std::pair.7", ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 4, !tbaa !18
  %193 = load i32, ptr %24, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %194) #7
  %196 = getelementptr inbounds %"struct.std::pair", ptr %195, i32 0, i32 1
  %197 = getelementptr inbounds %"struct.std::pair.7", ptr %196, i32 0, i32 1
  %198 = load i32, ptr %197, align 4, !tbaa !19
  call void @_Z5mergeii(i32 noundef %192, i32 noundef %198)
  %199 = load i32, ptr %24, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %24, align 4, !tbaa !5
  br label %171, !llvm.loop !23

201:                                              ; preds = %184
  %202 = load i32, ptr %24, align 4, !tbaa !5
  %203 = add nsw i32 %202, -1
  store i32 %203, ptr %24, align 4, !tbaa !5
  %204 = load i64, ptr @cur, align 8, !tbaa !21
  %205 = load i32, ptr %25, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %206
  store i64 %204, ptr %207, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %208

208:                                              ; preds = %201
  %209 = load i32, ptr %24, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %24, align 4, !tbaa !5
  br label %159, !llvm.loop !24

211:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 2, ptr %26, align 4, !tbaa !5
  br label %212

212:                                              ; preds = %227, %211
  %213 = load i32, ptr %26, align 4, !tbaa !5
  %214 = icmp slt i32 %213, 300300
  br i1 %214, label %216, label %215

215:                                              ; preds = %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %230

216:                                              ; preds = %212
  %217 = load i32, ptr %26, align 4, !tbaa !5
  %218 = sub nsw i32 %217, 1
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %219
  %221 = load i64, ptr %220, align 8, !tbaa !21
  %222 = load i32, ptr %26, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %223
  %225 = load i64, ptr %224, align 8, !tbaa !21
  %226 = add nsw i64 %225, %221
  store i64 %226, ptr %224, align 8, !tbaa !21
  br label %227

227:                                              ; preds = %216
  %228 = load i32, ptr %26, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %26, align 4, !tbaa !5
  br label %212, !llvm.loop !25

230:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %258, %230
  %232 = load i32, ptr %27, align 4, !tbaa !5
  %233 = load i32, ptr @q, align 4, !tbaa !5
  %234 = icmp slt i32 %232, %233
  br i1 %234, label %236, label %235

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

236:                                              ; preds = %231
  %237 = load i32, ptr %27, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %238) #7
  %240 = getelementptr inbounds %"struct.std::pair", ptr %239, i32 0, i32 1
  %241 = getelementptr inbounds %"struct.std::pair.7", ptr %240, i32 0, i32 1
  %242 = load i32, ptr %241, align 4, !tbaa !19
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %243
  %245 = load i64, ptr %244, align 8, !tbaa !21
  %246 = load i32, ptr %27, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %247) #7
  %249 = getelementptr inbounds %"struct.std::pair", ptr %248, i32 0, i32 1
  %250 = getelementptr inbounds %"struct.std::pair.7", ptr %249, i32 0, i32 0
  %251 = load i32, ptr %250, align 4, !tbaa !18
  %252 = sub nsw i32 %251, 1
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %253
  %255 = load i64, ptr %254, align 8, !tbaa !21
  %256 = sub nsw i64 %245, %255
  %257 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %256)
  br label %258

258:                                              ; preds = %236
  %259 = load i32, ptr %27, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %27, align 4, !tbaa !5
  br label %231, !llvm.loop !26

261:                                              ; preds = %235
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #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
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr, ptr) #6

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #4

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !16, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = !{!15, !6, i64 4}
!19 = !{!15, !6, i64 8}
!20 = distinct !{!20, !10}
!21 = !{!22, !22, i64 0}
!22 = !{!"long long", !7, i64 0}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type { i32, %"struct.std::pair.7" }
%"struct.std::pair.7" = type { i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@cur = external dso_local local_unnamed_addr global i64, align 8
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@w = external dso_local global %"class.std::vector", align 8
@qr = external dso_local global %"class.std::vector", align 8
@res = external dso_local local_unnamed_addr global [300300 x i64], align 16
@comp = external dso_local global %"class.std::set", align 8
@f = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6createi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5mergeii(i32 noundef, i32 noundef) 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) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.7", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair.7", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @q)
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %.not60 = icmp slt i32 %12, 1
  br i1 %.not60, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  br label %._crit_edge65

._crit_edge:                                      ; preds = %.lr.ph
  %13 = icmp sgt i32 %15, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  br i1 %13, label %.lr.ph64, label %._crit_edge65

.lr.ph64:                                         ; preds = %._crit_edge
  %.sroa.240.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %19

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.04761 = phi i32 [ %14, %.lr.ph ], [ 1, %0 ]
  tail call void @_Z6createi(i32 noundef %.04761)
  %14 = add nuw nsw i32 %.04761, 1
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.04761, %15
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge65:                                    ; preds = %19, %._crit_edge.thread, %._crit_edge
  %16 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  %17 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %16, ptr %17)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  %18 = load i32, ptr @q, align 4, !tbaa !5
  %.not5666 = icmp slt i32 %18, 1
  br i1 %.not5666, label %._crit_edge69, label %.lr.ph68

.lr.ph68:                                         ; preds = %._crit_edge65
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  br label %30

19:                                               ; preds = %.lr.ph64, %19
  %.05262 = phi i32 [ 1, %.lr.ph64 ], [ %24, %19 ]
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %21 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %21, ptr %5, align 8
  %22 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %.fca.0.extract37 = extractvalue { i64, i32 } %22, 0
  %.fca.1.extract38 = extractvalue { i64, i32 } %22, 1
  store i64 %.fca.0.extract37, ptr %4, align 8
  store i32 %.fca.1.extract38, ptr %.sroa.240.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @w, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #6
  %23 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @comp, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %24 = add nuw nsw i32 %.05262, 1
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %19, label %._crit_edge65, !llvm.loop !11

._crit_edge69:                                    ; preds = %30, %._crit_edge65
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %27 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @comp) #6
  store ptr %27, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %28 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @comp) #6
  store ptr %28, ptr %10, align 8
  %29 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %29, label %.lr.ph72, label %._crit_edge73

30:                                               ; preds = %.lr.ph68, %30
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %32 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %32, ptr %8, align 8
  %33 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %.fca.0.extract = extractvalue { i64, i32 } %33, 0
  %.fca.1.extract = extractvalue { i64, i32 } %33, 1
  store i64 %.fca.0.extract, ptr %7, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @qr, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  %34 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @comp, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %35 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @comp, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %6, align 4, !tbaa !5
  %38 = load i32, ptr @q, align 4, !tbaa !5
  %.not56.not = icmp slt i32 %36, %38
  br i1 %.not56.not, label %30, label %._crit_edge69, !llvm.loop !12

._crit_edge73:                                    ; preds = %.lr.ph72, %._crit_edge69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %39 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  %.not = icmp eq i64 %39, 0
  br i1 %.not, label %.preheader59, label %.lr.ph76

.lr.ph72:                                         ; preds = %._crit_edge69, %.lr.ph72
  %.05170 = phi i32 [ %40, %.lr.ph72 ], [ 0, %._crit_edge69 ]
  %40 = add nuw nsw i32 %.05170, 1
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %41)
  store i32 %40, ptr %42, align 4, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %44 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @comp) #6
  store ptr %44, ptr %10, align 8
  %45 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %45, label %.lr.ph72, label %._crit_edge73, !llvm.loop !13

.preheader59:                                     ; preds = %.lr.ph76, %._crit_edge73
  %46 = load i32, ptr @q, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph78, label %.preheader58

.lr.ph76:                                         ; preds = %._crit_edge73, %.lr.ph76
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph76 ], [ 0, %._crit_edge73 ]
  %48 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %indvars.iv) #6
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %48)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %indvars.iv) #6
  store i32 %50, ptr %51, align 4, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %52 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  %53 = icmp ugt i64 %52, %indvars.iv.next
  br i1 %53, label %.lr.ph76, label %.preheader59, !llvm.loop !17

.preheader58:                                     ; preds = %.lr.ph78, %.preheader59
  %54 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  %.not90 = icmp eq i64 %54, 0
  br i1 %.not90, label %.preheader57, label %.lr.ph85

.lr.ph78:                                         ; preds = %.preheader59, %.lr.ph78
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.lr.ph78 ], [ 0, %.preheader59 ]
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv92) #6
  %56 = getelementptr inbounds i8, ptr %55, i64 4
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %56)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv92) #6
  %60 = getelementptr inbounds i8, ptr %59, i64 4
  store i32 %58, ptr %60, align 4, !tbaa !18
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv92) #6
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @f, ptr noundef nonnull align 4 dereferenceable(4) %62)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv92) #6
  %66 = getelementptr inbounds i8, ptr %65, i64 8
  store i32 %64, ptr %66, align 4, !tbaa !19
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %67 = load i32, ptr @q, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next93, %68
  br i1 %69, label %.lr.ph78, label %.preheader58, !llvm.loop !20

.preheader57:                                     ; preds = %.critedge, %.preheader58
  %.pre = load i64, ptr getelementptr inbounds (i8, ptr @res, i64 8), align 8, !tbaa !21
  br label %95

.lr.ph85:                                         ; preds = %.preheader58, %.critedge
  %70 = phi i64 [ %.pre-phi, %.critedge ], [ 0, %.preheader58 ]
  %.04884 = phi i32 [ %.1.lcssa, %.critedge ], [ 0, %.preheader58 ]
  %71 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %70) #6
  %72 = load i32, ptr %71, align 4, !tbaa !14
  store i64 0, ptr @cur, align 8, !tbaa !21
  %73 = sext i32 %.04884 to i64
  %74 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  %75 = icmp ugt i64 %74, %73
  br i1 %75, label %.lr.ph81, label %.critedge

.lr.ph81:                                         ; preds = %.lr.ph85, %79
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %79 ], [ %73, %.lr.ph85 ]
  %76 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %indvars.iv95) #6
  %77 = load i32, ptr %76, align 4, !tbaa !14
  %78 = icmp eq i32 %77, %72
  br i1 %78, label %79, label %.critedge.loopexit

79:                                               ; preds = %.lr.ph81
  %80 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %indvars.iv95) #6
  %81 = getelementptr inbounds i8, ptr %80, i64 4
  %82 = load i32, ptr %81, align 4, !tbaa !18
  %83 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @w, i64 noundef %indvars.iv95) #6
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  %85 = load i32, ptr %84, align 4, !tbaa !19
  call void @_Z5mergeii(i32 noundef %82, i32 noundef %85)
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %86 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  %87 = icmp ugt i64 %86, %indvars.iv.next96
  br i1 %87, label %.lr.ph81, label %.critedge.loopexit, !llvm.loop !23

.critedge.loopexit:                               ; preds = %79, %.lr.ph81
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv95, %.lr.ph81 ], [ %indvars.iv.next96, %79 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  %sext = shl i64 %.1.lcssa.ph.in, 32
  %.pre106 = ashr exact i64 %sext, 32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph85
  %.pre-phi = phi i64 [ %.pre106, %.critedge.loopexit ], [ %73, %.lr.ph85 ]
  %.1.lcssa = phi i32 [ %.1.lcssa.ph, %.critedge.loopexit ], [ %.04884, %.lr.ph85 ]
  %88 = load i64, ptr @cur, align 8, !tbaa !21
  %89 = sext i32 %72 to i64
  %90 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %89
  store i64 %88, ptr %90, align 8, !tbaa !21
  %91 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @w) #6
  %92 = icmp ugt i64 %91, %.pre-phi
  br i1 %92, label %.lr.ph85, label %.preheader57, !llvm.loop !24

.preheader:                                       ; preds = %95
  %93 = load i32, ptr @q, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %.lr.ph88, label %._crit_edge89

95:                                               ; preds = %95, %.preheader57
  %96 = phi i64 [ %.pre, %.preheader57 ], [ %102, %95 ]
  %indvars.iv98 = phi i64 [ 2, %.preheader57 ], [ %indvars.iv.next99.1, %95 ]
  %97 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %indvars.iv98
  %98 = load i64, ptr %97, align 16, !tbaa !21
  %99 = add nsw i64 %98, %96
  store i64 %99, ptr %97, align 16, !tbaa !21
  %indvars.iv.next99 = or disjoint i64 %indvars.iv98, 1
  %100 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %indvars.iv.next99
  %101 = load i64, ptr %100, align 8, !tbaa !21
  %102 = add nsw i64 %101, %99
  store i64 %102, ptr %100, align 8, !tbaa !21
  %indvars.iv.next99.1 = add nuw nsw i64 %indvars.iv98, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next99.1, 300300
  br i1 %exitcond.not.1, label %.preheader, label %95, !llvm.loop !25

._crit_edge89:                                    ; preds = %.lr.ph88, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph88:                                         ; preds = %.preheader, %.lr.ph88
  %indvars.iv102 = phi i64 [ %indvars.iv.next103, %.lr.ph88 ], [ 0, %.preheader ]
  %103 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv102) #6
  %104 = getelementptr inbounds i8, ptr %103, i64 8
  %105 = load i32, ptr %104, align 4, !tbaa !19
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !21
  %109 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv102) #6
  %110 = getelementptr inbounds i8, ptr %109, i64 4
  %111 = load i32, ptr %110, align 4, !tbaa !18
  %112 = add nsw i32 %111, -1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [300300 x i64], ptr @res, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !21
  %116 = sub nsw i64 %108, %115
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %116)
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %118 = load i32, ptr @q, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = icmp slt i64 %indvars.iv.next103, %119
  br i1 %120, label %.lr.ph88, label %._crit_edge89, !llvm.loop !26
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr, ptr) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !16, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = !{!15, !6, i64 4}
!19 = !{!15, !6, i64 8}
!20 = distinct !{!20, !10}
!21 = !{!22, !22, i64 0}
!22 = !{!"long long", !7, i64 0}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}


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