; LLVM IR from ShahjalalShohag/code-library :: Data Structures (MOs on tree)

; 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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.query = type { i32, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = 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::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@g = external dso_local global [300009 x %"class.std::vector"], align 16
@st = external dso_local global [300009 x i32], align 16
@en = external dso_local global [300009 x i32], align 16
@T = external dso_local global i32, align 4
@par = external dso_local global [300009 x [20 x i32]], align 16
@id = external dso_local global [600018 x i32], align 16
@cnt = external dso_local global [300009 x i32], align 16
@a = external dso_local global [300009 x i32], align 16
@ans = external dso_local global i32, align 4
@vis = external dso_local global [300009 x i8], align 16
@Q = external dso_local global [300009 x %struct.query], align 16
@res = external dso_local global [300009 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::map", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %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
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %30 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %31 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %32 = getelementptr i8, ptr %31, i64 -24
  %33 = load i64, ptr %32, align 8
  %34 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %33
  %35 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %34, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  br label %36

36:                                               ; preds = %448, %0
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr i8, ptr %39, i64 -24
  %41 = load i64, ptr %40, align 8
  %42 = getelementptr inbounds i8, ptr %38, i64 %41
  %43 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %42)
  br i1 %43, label %44, label %451

44:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %45

45:                                               ; preds = %55, %44
  %46 = load i32, ptr %4, align 4, !tbaa !8
  %47 = load i32, ptr %2, align 4, !tbaa !8
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  %51 = load i32, ptr %4, align 4, !tbaa !8
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %52
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %53)
  br label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %4, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %4, align 4, !tbaa !8
  br label %45, !llvm.loop !11

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 48, ptr %5) #7
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %59

59:                                               ; preds = %105, %58
  %60 = load i32, ptr %6, align 4, !tbaa !8
  %61 = load i32, ptr %2, align 4, !tbaa !8
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %65 = load i32, ptr %6, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %66
  %68 = invoke ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %67)
          to label %69 unwind label %87

69:                                               ; preds = %64
  %70 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %7, i32 0, i32 0
  store ptr %68, ptr %70, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %71 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  %72 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %10, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  %73 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br i1 %73, label %74, label %95

74:                                               ; preds = %69
  %75 = load i32, ptr %6, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %76
  %78 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %77)
          to label %79 unwind label %91

79:                                               ; preds = %74
  %80 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  %81 = trunc i64 %80 to i32
  %82 = load i32, ptr %6, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %83
  %85 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %84)
          to label %86 unwind label %91

86:                                               ; preds = %79
  store i32 %81, ptr %85, align 4, !tbaa !8
  br label %95

87:                                               ; preds = %64
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %8, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %108

91:                                               ; preds = %95, %79, %74
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %8, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %9, align 4
  br label %108

95:                                               ; preds = %86, %69
  %96 = load i32, ptr %6, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %97
  %99 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %98)
          to label %100 unwind label %91

100:                                              ; preds = %95
  %101 = load i32, ptr %99, align 4, !tbaa !8
  %102 = load i32, ptr %6, align 4, !tbaa !8
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %103
  store i32 %101, ptr %104, align 4, !tbaa !8
  br label %105

105:                                              ; preds = %100
  %106 = load i32, ptr %6, align 4, !tbaa !8
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %6, align 4, !tbaa !8
  br label %59, !llvm.loop !13

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

109:                                              ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !8
  br label %110

110:                                              ; preds = %128, %109
  %111 = load i32, ptr %11, align 4, !tbaa !8
  %112 = load i32, ptr %2, align 4, !tbaa !8
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %135

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %116 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %117 unwind label %131

117:                                              ; preds = %115
  %118 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %116, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %119 unwind label %131

119:                                              ; preds = %117
  %120 = load i32, ptr %12, align 4, !tbaa !8
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @g, i64 0, i64 %121
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %122, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %123 unwind label %131

123:                                              ; preds = %119
  %124 = load i32, ptr %13, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @g, i64 0, i64 %125
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %126, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %127 unwind label %131

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

128:                                              ; preds = %127
  %129 = load i32, ptr %11, align 4, !tbaa !8
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %11, align 4, !tbaa !8
  br label %110, !llvm.loop !14

131:                                              ; preds = %123, %119, %117, %115
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %8, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %450

135:                                              ; preds = %114
  store i32 0, ptr @T, align 4, !tbaa !8
  invoke void @_Z3dfsii(i32 noundef 1, i32 noundef 0)
          to label %136 unwind label %142

136:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !8
  br label %137

137:                                              ; preds = %212, %136
  %138 = load i32, ptr %14, align 4, !tbaa !8
  %139 = load i32, ptr %3, align 4, !tbaa !8
  %140 = icmp sle i32 %138, %139
  br i1 %140, label %146, label %141

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

142:                                              ; preds = %215, %135
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %8, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %9, align 4
  br label %450

146:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %147 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %148 unwind label %161

148:                                              ; preds = %146
  %149 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %147, ptr noundef nonnull align 4 dereferenceable(4) %16)
          to label %150 unwind label %161

150:                                              ; preds = %148
  %151 = load i32, ptr %15, align 4, !tbaa !8
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !8
  %155 = load i32, ptr %16, align 4, !tbaa !8
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !8
  %159 = icmp sgt i32 %154, %158
  br i1 %159, label %160, label %165

160:                                              ; preds = %150
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16) #7
  br label %165

161:                                              ; preds = %148, %146
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %8, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %450

165:                                              ; preds = %160, %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %166 = load i32, ptr %15, align 4, !tbaa !8
  %167 = load i32, ptr %16, align 4, !tbaa !8
  %168 = call noundef i32 @_Z3lcaii(i32 noundef %166, i32 noundef %167)
  store i32 %168, ptr %17, align 4, !tbaa !8
  %169 = load i32, ptr %17, align 4, !tbaa !8
  %170 = load i32, ptr %15, align 4, !tbaa !8
  %171 = icmp eq i32 %169, %170
  br i1 %171, label %172, label %189

172:                                              ; preds = %165
  %173 = load i32, ptr %15, align 4, !tbaa !8
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !8
  %177 = load i32, ptr %14, align 4, !tbaa !8
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %178
  %180 = getelementptr inbounds %struct.query, ptr %179, i32 0, i32 0
  store i32 %176, ptr %180, align 4, !tbaa !15
  %181 = load i32, ptr %16, align 4, !tbaa !8
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !8
  %185 = load i32, ptr %14, align 4, !tbaa !8
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %186
  %188 = getelementptr inbounds %struct.query, ptr %187, i32 0, i32 1
  store i32 %184, ptr %188, align 4, !tbaa !17
  br label %206

189:                                              ; preds = %165
  %190 = load i32, ptr %15, align 4, !tbaa !8
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [300009 x i32], ptr @en, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !8
  %194 = load i32, ptr %14, align 4, !tbaa !8
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %195
  %197 = getelementptr inbounds %struct.query, ptr %196, i32 0, i32 0
  store i32 %193, ptr %197, align 4, !tbaa !15
  %198 = load i32, ptr %16, align 4, !tbaa !8
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !8
  %202 = load i32, ptr %14, align 4, !tbaa !8
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %203
  %205 = getelementptr inbounds %struct.query, ptr %204, i32 0, i32 1
  store i32 %201, ptr %205, align 4, !tbaa !17
  br label %206

206:                                              ; preds = %189, %172
  %207 = load i32, ptr %14, align 4, !tbaa !8
  %208 = load i32, ptr %14, align 4, !tbaa !8
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %209
  %211 = getelementptr inbounds %struct.query, ptr %210, i32 0, i32 2
  store i32 %207, ptr %211, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %212

212:                                              ; preds = %206
  %213 = load i32, ptr %14, align 4, !tbaa !8
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %14, align 4, !tbaa !8
  br label %137, !llvm.loop !19

215:                                              ; preds = %141
  %216 = load i32, ptr %3, align 4, !tbaa !8
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds %struct.query, ptr @Q, i64 %217
  %219 = getelementptr inbounds %struct.query, ptr %218, i64 1
  invoke void @_ZSt4sortIP5queryEvT_S2_(ptr noundef getelementptr inbounds (%struct.query, ptr @Q, i64 1), ptr noundef %219)
          to label %220 unwind label %142

220:                                              ; preds = %215
  store i32 0, ptr @ans, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 1, ptr %18, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 1, ptr %20, align 4, !tbaa !8
  br label %221

221:                                              ; preds = %388, %220
  %222 = load i32, ptr %20, align 4, !tbaa !8
  %223 = load i32, ptr %3, align 4, !tbaa !8
  %224 = icmp sle i32 %222, %223
  br i1 %224, label %226, label %225

225:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %392

226:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %227 = load i32, ptr %20, align 4, !tbaa !8
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %228
  %230 = getelementptr inbounds %struct.query, ptr %229, i32 0, i32 0
  %231 = load i32, ptr %230, align 4, !tbaa !15
  store i32 %231, ptr %21, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %232 = load i32, ptr %20, align 4, !tbaa !8
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %233
  %235 = getelementptr inbounds %struct.query, ptr %234, i32 0, i32 1
  %236 = load i32, ptr %235, align 4, !tbaa !17
  store i32 %236, ptr %22, align 4, !tbaa !8
  %237 = load i32, ptr %22, align 4, !tbaa !8
  %238 = load i32, ptr %18, align 4, !tbaa !8
  %239 = icmp slt i32 %237, %238
  br i1 %239, label %240, label %293

240:                                              ; preds = %226
  br label %241

241:                                              ; preds = %251, %240
  %242 = load i32, ptr %18, align 4, !tbaa !8
  %243 = load i32, ptr %21, align 4, !tbaa !8
  %244 = icmp sgt i32 %242, %243
  br i1 %244, label %245, label %256

245:                                              ; preds = %241
  %246 = load i32, ptr %18, align 4, !tbaa !8
  %247 = add nsw i32 %246, -1
  store i32 %247, ptr %18, align 4, !tbaa !8
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %250)
          to label %251 unwind label %252

251:                                              ; preds = %245
  br label %241, !llvm.loop !20

252:                                              ; preds = %334, %322, %310, %298, %285, %273, %261, %245
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %8, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %9, align 4
  br label %391

256:                                              ; preds = %241
  br label %257

257:                                              ; preds = %267, %256
  %258 = load i32, ptr %18, align 4, !tbaa !8
  %259 = load i32, ptr %21, align 4, !tbaa !8
  %260 = icmp slt i32 %258, %259
  br i1 %260, label %261, label %268

261:                                              ; preds = %257
  %262 = load i32, ptr %18, align 4, !tbaa !8
  %263 = add nsw i32 %262, 1
  store i32 %263, ptr %18, align 4, !tbaa !8
  %264 = sext i32 %262 to i64
  %265 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %266)
          to label %267 unwind label %252

267:                                              ; preds = %261
  br label %257, !llvm.loop !21

268:                                              ; preds = %257
  br label %269

269:                                              ; preds = %279, %268
  %270 = load i32, ptr %19, align 4, !tbaa !8
  %271 = load i32, ptr %22, align 4, !tbaa !8
  %272 = icmp slt i32 %270, %271
  br i1 %272, label %273, label %280

273:                                              ; preds = %269
  %274 = load i32, ptr %19, align 4, !tbaa !8
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %19, align 4, !tbaa !8
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %278)
          to label %279 unwind label %252

279:                                              ; preds = %273
  br label %269, !llvm.loop !22

280:                                              ; preds = %269
  br label %281

281:                                              ; preds = %291, %280
  %282 = load i32, ptr %19, align 4, !tbaa !8
  %283 = load i32, ptr %22, align 4, !tbaa !8
  %284 = icmp sgt i32 %282, %283
  br i1 %284, label %285, label %292

285:                                              ; preds = %281
  %286 = load i32, ptr %19, align 4, !tbaa !8
  %287 = add nsw i32 %286, -1
  store i32 %287, ptr %19, align 4, !tbaa !8
  %288 = sext i32 %286 to i64
  %289 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %290)
          to label %291 unwind label %252

291:                                              ; preds = %285
  br label %281, !llvm.loop !23

292:                                              ; preds = %281
  br label %342

293:                                              ; preds = %226
  br label %294

294:                                              ; preds = %304, %293
  %295 = load i32, ptr %19, align 4, !tbaa !8
  %296 = load i32, ptr %22, align 4, !tbaa !8
  %297 = icmp slt i32 %295, %296
  br i1 %297, label %298, label %305

298:                                              ; preds = %294
  %299 = load i32, ptr %19, align 4, !tbaa !8
  %300 = add nsw i32 %299, 1
  store i32 %300, ptr %19, align 4, !tbaa !8
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %301
  %303 = load i32, ptr %302, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %303)
          to label %304 unwind label %252

304:                                              ; preds = %298
  br label %294, !llvm.loop !24

305:                                              ; preds = %294
  br label %306

306:                                              ; preds = %316, %305
  %307 = load i32, ptr %19, align 4, !tbaa !8
  %308 = load i32, ptr %22, align 4, !tbaa !8
  %309 = icmp sgt i32 %307, %308
  br i1 %309, label %310, label %317

310:                                              ; preds = %306
  %311 = load i32, ptr %19, align 4, !tbaa !8
  %312 = add nsw i32 %311, -1
  store i32 %312, ptr %19, align 4, !tbaa !8
  %313 = sext i32 %311 to i64
  %314 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %313
  %315 = load i32, ptr %314, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %315)
          to label %316 unwind label %252

316:                                              ; preds = %310
  br label %306, !llvm.loop !25

317:                                              ; preds = %306
  br label %318

318:                                              ; preds = %328, %317
  %319 = load i32, ptr %18, align 4, !tbaa !8
  %320 = load i32, ptr %21, align 4, !tbaa !8
  %321 = icmp sgt i32 %319, %320
  br i1 %321, label %322, label %329

322:                                              ; preds = %318
  %323 = load i32, ptr %18, align 4, !tbaa !8
  %324 = add nsw i32 %323, -1
  store i32 %324, ptr %18, align 4, !tbaa !8
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %325
  %327 = load i32, ptr %326, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %327)
          to label %328 unwind label %252

328:                                              ; preds = %322
  br label %318, !llvm.loop !26

329:                                              ; preds = %318
  br label %330

330:                                              ; preds = %340, %329
  %331 = load i32, ptr %18, align 4, !tbaa !8
  %332 = load i32, ptr %21, align 4, !tbaa !8
  %333 = icmp slt i32 %331, %332
  br i1 %333, label %334, label %341

334:                                              ; preds = %330
  %335 = load i32, ptr %18, align 4, !tbaa !8
  %336 = add nsw i32 %335, 1
  store i32 %336, ptr %18, align 4, !tbaa !8
  %337 = sext i32 %335 to i64
  %338 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %337
  %339 = load i32, ptr %338, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %339)
          to label %340 unwind label %252

340:                                              ; preds = %334
  br label %330, !llvm.loop !27

341:                                              ; preds = %330
  br label %342

342:                                              ; preds = %341, %292
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %343 = load i32, ptr %18, align 4, !tbaa !8
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %344
  %346 = load i32, ptr %345, align 4, !tbaa !8
  store i32 %346, ptr %23, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %347 = load i32, ptr %19, align 4, !tbaa !8
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %348
  %350 = load i32, ptr %349, align 4, !tbaa !8
  store i32 %350, ptr %24, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %351 = load i32, ptr %23, align 4, !tbaa !8
  %352 = load i32, ptr %24, align 4, !tbaa !8
  %353 = call noundef i32 @_Z3lcaii(i32 noundef %351, i32 noundef %352)
  store i32 %353, ptr %25, align 4, !tbaa !8
  %354 = load i32, ptr %25, align 4, !tbaa !8
  %355 = load i32, ptr %23, align 4, !tbaa !8
  %356 = icmp ne i32 %354, %355
  br i1 %356, label %357, label %368

357:                                              ; preds = %342
  %358 = load i32, ptr %25, align 4, !tbaa !8
  %359 = load i32, ptr %24, align 4, !tbaa !8
  %360 = icmp ne i32 %358, %359
  br i1 %360, label %361, label %368

361:                                              ; preds = %357
  %362 = load i32, ptr %25, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %362)
          to label %363 unwind label %364

363:                                              ; preds = %361
  br label %368

364:                                              ; preds = %384, %361
  %365 = landingpad { ptr, i32 }
          cleanup
  %366 = extractvalue { ptr, i32 } %365, 0
  store ptr %366, ptr %8, align 8
  %367 = extractvalue { ptr, i32 } %365, 1
  store i32 %367, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %391

368:                                              ; preds = %363, %357, %342
  %369 = load i32, ptr @ans, align 4, !tbaa !8
  %370 = load i32, ptr %20, align 4, !tbaa !8
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %371
  %373 = getelementptr inbounds %struct.query, ptr %372, i32 0, i32 2
  %374 = load i32, ptr %373, align 4, !tbaa !18
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [300009 x i32], ptr @res, i64 0, i64 %375
  store i32 %369, ptr %376, align 4, !tbaa !8
  %377 = load i32, ptr %25, align 4, !tbaa !8
  %378 = load i32, ptr %23, align 4, !tbaa !8
  %379 = icmp ne i32 %377, %378
  br i1 %379, label %380, label %387

380:                                              ; preds = %368
  %381 = load i32, ptr %25, align 4, !tbaa !8
  %382 = load i32, ptr %24, align 4, !tbaa !8
  %383 = icmp ne i32 %381, %382
  br i1 %383, label %384, label %387

384:                                              ; preds = %380
  %385 = load i32, ptr %25, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %385)
          to label %386 unwind label %364

386:                                              ; preds = %384
  br label %387

387:                                              ; preds = %386, %380, %368
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %388

388:                                              ; preds = %387
  %389 = load i32, ptr %20, align 4, !tbaa !8
  %390 = add nsw i32 %389, 1
  store i32 %390, ptr %20, align 4, !tbaa !8
  br label %221, !llvm.loop !28

391:                                              ; preds = %364, %252
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %449

392:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 1, ptr %26, align 4, !tbaa !8
  br label %393

393:                                              ; preds = %407, %392
  %394 = load i32, ptr %26, align 4, !tbaa !8
  %395 = load i32, ptr %3, align 4, !tbaa !8
  %396 = icmp sle i32 %394, %395
  br i1 %396, label %398, label %397

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

398:                                              ; preds = %393
  %399 = load i32, ptr %26, align 4, !tbaa !8
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [300009 x i32], ptr @res, i64 0, i64 %400
  %402 = load i32, ptr %401, align 4, !tbaa !8
  %403 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %402)
          to label %404 unwind label %410

404:                                              ; preds = %398
  %405 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %403, i8 noundef signext 10)
          to label %406 unwind label %410

406:                                              ; preds = %404
  br label %407

407:                                              ; preds = %406
  %408 = load i32, ptr %26, align 4, !tbaa !8
  %409 = add nsw i32 %408, 1
  store i32 %409, ptr %26, align 4, !tbaa !8
  br label %393, !llvm.loop !29

410:                                              ; preds = %404, %398
  %411 = landingpad { ptr, i32 }
          cleanup
  %412 = extractvalue { ptr, i32 } %411, 0
  store ptr %412, ptr %8, align 8
  %413 = extractvalue { ptr, i32 } %411, 1
  store i32 %413, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %449

414:                                              ; preds = %397
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !8
  br label %415

415:                                              ; preds = %445, %414
  %416 = load i32, ptr %27, align 4, !tbaa !8
  %417 = load i32, ptr %2, align 4, !tbaa !8
  %418 = icmp sle i32 %416, %417
  br i1 %418, label %420, label %419

419:                                              ; preds = %415
  store i32 38, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %448

420:                                              ; preds = %415
  %421 = load i32, ptr %27, align 4, !tbaa !8
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @g, i64 0, i64 %422
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %423) #7
  %424 = load i32, ptr %27, align 4, !tbaa !8
  %425 = sext i32 %424 to i64
  %426 = getelementptr inbounds [300009 x i32], ptr @cnt, i64 0, i64 %425
  store i32 0, ptr %426, align 4, !tbaa !8
  %427 = load i32, ptr %27, align 4, !tbaa !8
  %428 = sext i32 %427 to i64
  %429 = getelementptr inbounds [300009 x i8], ptr @vis, i64 0, i64 %428
  store i8 0, ptr %429, align 1, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !8
  br label %430

430:                                              ; preds = %441, %420
  %431 = load i32, ptr %29, align 4, !tbaa !8
  %432 = icmp slt i32 %431, 20
  br i1 %432, label %434, label %433

433:                                              ; preds = %430
  store i32 41, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %444

434:                                              ; preds = %430
  %435 = load i32, ptr %27, align 4, !tbaa !8
  %436 = sext i32 %435 to i64
  %437 = getelementptr inbounds [300009 x [20 x i32]], ptr @par, i64 0, i64 %436
  %438 = load i32, ptr %29, align 4, !tbaa !8
  %439 = sext i32 %438 to i64
  %440 = getelementptr inbounds [20 x i32], ptr %437, i64 0, i64 %439
  store i32 0, ptr %440, align 4, !tbaa !8
  br label %441

441:                                              ; preds = %434
  %442 = load i32, ptr %29, align 4, !tbaa !8
  %443 = add nsw i32 %442, 1
  store i32 %443, ptr %29, align 4, !tbaa !8
  br label %430, !llvm.loop !32

444:                                              ; preds = %433
  br label %445

445:                                              ; preds = %444
  %446 = load i32, ptr %27, align 4, !tbaa !8
  %447 = add nsw i32 %446, 1
  store i32 %447, ptr %27, align 4, !tbaa !8
  br label %415, !llvm.loop !33

448:                                              ; preds = %419
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #7
  br label %36, !llvm.loop !34

449:                                              ; preds = %410, %391
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %450

450:                                              ; preds = %449, %161, %142, %131, %108
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %453

451:                                              ; preds = %36
  store i32 0, ptr %1, align 4
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %452 = load i32, ptr %1, align 4
  ret i32 %452

453:                                              ; preds = %450
  %454 = load ptr, ptr %8, align 8
  %455 = load i32, ptr %9, align 4
  %456 = insertvalue { ptr, i32 } poison, ptr %454, 0
  %457 = insertvalue { ptr, i32 } %456, i32 %455, 1
  resume { ptr, i32 } %457
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #0 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 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)) #0 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z2yoi(i32 noundef) #6

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !9, i64 0}
!16 = !{!"_ZTS5query", !9, i64 0, !9, i64 4, !9, i64 8}
!17 = !{!16, !9, i64 4}
!18 = !{!16, !9, i64 8}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = !{!31, !31, i64 0}
!31 = !{!"bool", !10, i64 0}
!32 = distinct !{!32, !12}
!33 = distinct !{!33, !12}
!34 = distinct !{!34, !12}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.query = type { i32, i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = 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::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@g = external dso_local global [300009 x %"class.std::vector"], align 16
@st = external dso_local local_unnamed_addr global [300009 x i32], align 16
@en = external dso_local local_unnamed_addr global [300009 x i32], align 16
@T = external dso_local local_unnamed_addr global i32, align 4
@par = external dso_local local_unnamed_addr global [300009 x [20 x i32]], align 16
@id = external dso_local local_unnamed_addr global [600018 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [300009 x i32], align 16
@a = external dso_local global [300009 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [300009 x i8], align 16
@Q = external dso_local global [300009 x %struct.query], align 16
@res = external dso_local local_unnamed_addr global [300009 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

.preheader149:                                    ; preds = %0, %._crit_edge185
  %23 = load i32, ptr %1, align 4, !tbaa !8
  %.not159 = icmp slt i32 %23, 1
  br i1 %.not159, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.preheader149
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #9
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  %24 = load i32, ptr %1, align 4, !tbaa !8
  %.not107161 = icmp slt i32 %24, 1
  br i1 %.not107161, label %._crit_edge167, label %.lr.ph164

.lr.ph:                                           ; preds = %.preheader149, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader149 ]
  %25 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %indvars.iv
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr %1, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %.not.not = icmp slt i64 %indvars.iv, %28
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader148:                                    ; preds = %48
  %29 = icmp sgt i32 %50, 1
  br i1 %29, label %.lr.ph166, label %._crit_edge167

.lr.ph164:                                        ; preds = %._crit_edge, %48
  %indvars.iv198 = phi i64 [ %indvars.iv.next199, %48 ], [ 1, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %30 = getelementptr inbounds [300009 x i32], ptr @a, i64 0, i64 %indvars.iv198
  %31 = invoke ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %32 unwind label %42

32:                                               ; preds = %.lr.ph164
  store ptr %31, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %33 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  store ptr %33, ptr %5, align 8
  %34 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br i1 %34, label %35, label %46

35:                                               ; preds = %32
  %36 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %37 unwind label %44

37:                                               ; preds = %35
  %38 = call noundef i64 @_ZNKSt3mapIiiSt4lessIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  %39 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %40 unwind label %44

40:                                               ; preds = %37
  %41 = trunc i64 %38 to i32
  store i32 %41, ptr %39, align 4, !tbaa !8
  br label %46

42:                                               ; preds = %.lr.ph164
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  br label %.loopexit.split-lp

44:                                               ; preds = %46, %37, %35
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

46:                                               ; preds = %40, %32
  %47 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 4 dereferenceable(4) %30)
          to label %48 unwind label %44

48:                                               ; preds = %46
  %49 = load i32, ptr %47, align 4, !tbaa !8
  store i32 %49, ptr %30, align 4, !tbaa !8
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %50 = load i32, ptr %1, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %.not107.not = icmp slt i64 %indvars.iv198, %51
  br i1 %.not107.not, label %.lr.ph164, label %.preheader148, !llvm.loop !13

._crit_edge167:                                   ; preds = %64, %._crit_edge, %.preheader148
  store i32 0, ptr @T, align 4, !tbaa !8
  invoke void @_Z3dfsii(i32 noundef 1, i32 noundef 0)
          to label %.preheader147 unwind label %70

.preheader147:                                    ; preds = %._crit_edge167
  %52 = load i32, ptr %2, align 4, !tbaa !8
  %.not108168 = icmp slt i32 %52, 1
  br i1 %.not108168, label %.preheader147.._crit_edge171_crit_edge, label %.lr.ph170

.preheader147.._crit_edge171_crit_edge:           ; preds = %.preheader147
  %.pre247 = sext i32 %52 to i64
  br label %._crit_edge171

.lr.ph166:                                        ; preds = %.preheader148, %64
  %.0100165 = phi i32 [ %65, %64 ], [ 1, %.preheader148 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  %53 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %54 unwind label %68

54:                                               ; preds = %.lr.ph166
  %55 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %56 unwind label %68

56:                                               ; preds = %54
  %57 = load i32, ptr %6, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @g, i64 0, i64 %58
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %60 unwind label %68

60:                                               ; preds = %56
  %61 = load i32, ptr %7, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @g, i64 0, i64 %62
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %64 unwind label %68

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  %65 = add nuw nsw i32 %.0100165, 1
  %66 = load i32, ptr %1, align 4, !tbaa !8
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %.lr.ph166, label %._crit_edge167, !llvm.loop !14

68:                                               ; preds = %60, %56, %54, %.lr.ph166
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  br label %.loopexit.split-lp

._crit_edge171:                                   ; preds = %88, %.preheader147.._crit_edge171_crit_edge
  %.pre-phi248 = phi i64 [ %.pre247, %.preheader147.._crit_edge171_crit_edge ], [ %104, %88 ]
  %gep = getelementptr %struct.query, ptr getelementptr inbounds (i8, ptr @Q, i64 12), i64 %.pre-phi248
  invoke void @_ZSt4sortIP5queryEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @Q, i64 12), ptr noundef nonnull %gep)
          to label %105 unwind label %70

70:                                               ; preds = %._crit_edge171, %._crit_edge167
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.lr.ph170:                                        ; preds = %.preheader147, %88
  %indvars.iv201 = phi i64 [ %indvars.iv.next202, %88 ], [ 1, %.preheader147 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  %72 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %73 unwind label %86

73:                                               ; preds = %.lr.ph170
  %74 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %75 unwind label %86

75:                                               ; preds = %73
  %76 = load i32, ptr %8, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !8
  %80 = load i32, ptr %9, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = icmp sgt i32 %79, %83
  br i1 %84, label %85, label %88

85:                                               ; preds = %75
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9) #9
  %.pre = load i32, ptr %8, align 4, !tbaa !8
  %.pre246 = load i32, ptr %9, align 4, !tbaa !8
  br label %88

86:                                               ; preds = %73, %.lr.ph170
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  br label %.loopexit.split-lp

88:                                               ; preds = %85, %75
  %89 = phi i32 [ %.pre246, %85 ], [ %80, %75 ]
  %90 = phi i32 [ %.pre, %85 ], [ %76, %75 ]
  %91 = call noundef i32 @_Z3lcaii(i32 noundef %90, i32 noundef %89)
  %92 = load i32, ptr %8, align 4, !tbaa !8
  %93 = icmp eq i32 %91, %92
  %94 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %indvars.iv201
  %95 = getelementptr inbounds i8, ptr %94, i64 4
  %st.en = select i1 %93, ptr @st, ptr @en
  %96 = sext i32 %92 to i64
  %97 = getelementptr inbounds [300009 x i32], ptr %st.en, i64 0, i64 %96
  %storemerge = load i32, ptr %97, align 4, !tbaa !8
  store i32 %storemerge, ptr %94, align 4, !tbaa !15
  %.sink259 = load i32, ptr %9, align 4, !tbaa !8
  %98 = sext i32 %.sink259 to i64
  %99 = getelementptr inbounds [300009 x i32], ptr @st, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !8
  store i32 %100, ptr %95, align 4, !tbaa !17
  %101 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %indvars.iv201, i32 2
  %102 = trunc nuw nsw i64 %indvars.iv201 to i32
  store i32 %102, ptr %101, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  %indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1
  %103 = load i32, ptr %2, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %.not108.not = icmp slt i64 %indvars.iv201, %104
  br i1 %.not108.not, label %.lr.ph170, label %._crit_edge171, !llvm.loop !19

105:                                              ; preds = %._crit_edge171
  store i32 0, ptr @ans, align 4, !tbaa !8
  %106 = load i32, ptr %2, align 4, !tbaa !8
  %.not109172 = icmp slt i32 %106, 1
  br i1 %.not109172, label %.preheader145, label %.lr.ph177

.preheader146:                                    ; preds = %171
  %.not110178 = icmp slt i32 %172, 1
  br i1 %.not110178, label %.preheader145, label %.lr.ph180

.lr.ph177:                                        ; preds = %105, %171
  %indvars.iv236 = phi i64 [ %indvars.iv.next237, %171 ], [ 1, %105 ]
  %.090174 = phi i32 [ %.5, %171 ], [ 0, %105 ]
  %.094173 = phi i32 [ %108, %171 ], [ 1, %105 ]
  %107 = getelementptr inbounds [300009 x %struct.query], ptr @Q, i64 0, i64 %indvars.iv236
  %108 = load i32, ptr %107, align 4, !tbaa !15
  %109 = getelementptr inbounds i8, ptr %107, i64 4
  %110 = load i32, ptr %109, align 4, !tbaa !17
  %111 = icmp slt i32 %110, %.094173
  br i1 %111, label %.preheader129.preheader, label %.preheader144.preheader

.preheader144.preheader:                          ; preds = %.lr.ph177
  %112 = sext i32 %.090174 to i64
  %smax = call i32 @llvm.smax.i32(i32 %.090174, i32 %110)
  %wide.trip.count = sext i32 %smax to i64
  br label %.preheader144

.preheader129.preheader:                          ; preds = %.lr.ph177
  %113 = sext i32 %.094173 to i64
  %114 = sext i32 %108 to i64
  br label %.preheader129

.preheader129:                                    ; preds = %.preheader129.preheader, %116
  %indvars.iv220 = phi i64 [ %113, %.preheader129.preheader ], [ %indvars.iv.next221, %116 ]
  %115 = icmp sgt i64 %indvars.iv220, %114
  br i1 %115, label %116, label %.preheader126

116:                                              ; preds = %.preheader129
  %indvars.iv.next221 = add nsw i64 %indvars.iv220, -1
  %117 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv.next221
  %118 = load i32, ptr %117, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %118)
          to label %.preheader129 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, !llvm.loop !20

.loopexit121:                                     ; preds = %130
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %126
  %lpad.loopexit123 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit:    ; preds = %121
  %lpad.loopexit127 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit: ; preds = %116
  %lpad.loopexit130 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit: ; preds = %148
  %lpad.loopexit135 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit: ; preds = %145
  %lpad.loopexit138 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit: ; preds = %140
  %lpad.loopexit142 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp: ; preds = %134
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.preheader126:                                    ; preds = %.preheader129, %121
  %indvars.iv224 = phi i64 [ %indvars.iv.next225, %121 ], [ %indvars.iv220, %.preheader129 ]
  %exitcond228.not = icmp eq i64 %indvars.iv224, %114
  br i1 %exitcond228.not, label %.preheader122, label %121

.preheader122:                                    ; preds = %.preheader126
  %119 = sext i32 %.090174 to i64
  %120 = sext i32 %110 to i64
  br label %124

121:                                              ; preds = %.preheader126
  %indvars.iv.next225 = add nsw i64 %indvars.iv224, 1
  %122 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv224
  %123 = load i32, ptr %122, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %123)
          to label %.preheader126 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit, !llvm.loop !21

124:                                              ; preds = %.preheader122, %126
  %indvars.iv229 = phi i64 [ %119, %.preheader122 ], [ %indvars.iv.next230, %126 ]
  %125 = icmp slt i64 %indvars.iv229, %120
  br i1 %125, label %126, label %.preheader

126:                                              ; preds = %124
  %indvars.iv.next230 = add nsw i64 %indvars.iv229, 1
  %127 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv.next230
  %128 = load i32, ptr %127, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %128)
          to label %124 unwind label %.loopexit.split-lp.loopexit, !llvm.loop !22

.preheader:                                       ; preds = %124, %130
  %indvars.iv233 = phi i64 [ %indvars.iv.next234, %130 ], [ %indvars.iv229, %124 ]
  %129 = icmp sgt i64 %indvars.iv233, %120
  br i1 %129, label %130, label %.loopexit

130:                                              ; preds = %.preheader
  %indvars.iv.next234 = add nsw i64 %indvars.iv233, -1
  %131 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv233
  %132 = load i32, ptr %131, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %132)
          to label %.preheader unwind label %.loopexit121, !llvm.loop !23

.preheader144:                                    ; preds = %.preheader144.preheader, %134
  %indvars.iv204 = phi i64 [ %112, %.preheader144.preheader ], [ %indvars.iv.next205, %134 ]
  %exitcond.not = icmp eq i64 %indvars.iv204, %wide.trip.count
  br i1 %exitcond.not, label %.preheader141.preheader, label %134

.preheader141.preheader:                          ; preds = %.preheader144
  %133 = sext i32 %110 to i64
  br label %.preheader141

134:                                              ; preds = %.preheader144
  %indvars.iv.next205 = add nsw i64 %indvars.iv204, 1
  %135 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv.next205
  %136 = load i32, ptr %135, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %136)
          to label %.preheader144 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp, !llvm.loop !24

.preheader141:                                    ; preds = %.preheader141.preheader, %140
  %indvars.iv208 = phi i64 [ %wide.trip.count, %.preheader141.preheader ], [ %indvars.iv.next209, %140 ]
  %137 = icmp sgt i64 %indvars.iv208, %133
  br i1 %137, label %140, label %.preheader137

.preheader137:                                    ; preds = %.preheader141
  %138 = sext i32 %.094173 to i64
  %139 = sext i32 %108 to i64
  br label %143

140:                                              ; preds = %.preheader141
  %indvars.iv.next209 = add nsw i64 %indvars.iv208, -1
  %141 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv208
  %142 = load i32, ptr %141, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %142)
          to label %.preheader141 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, !llvm.loop !25

143:                                              ; preds = %.preheader137, %145
  %indvars.iv211 = phi i64 [ %138, %.preheader137 ], [ %indvars.iv.next212, %145 ]
  %144 = icmp sgt i64 %indvars.iv211, %139
  br i1 %144, label %145, label %.preheader133

145:                                              ; preds = %143
  %indvars.iv.next212 = add nsw i64 %indvars.iv211, -1
  %146 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv.next212
  %147 = load i32, ptr %146, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %147)
          to label %143 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, !llvm.loop !26

.preheader133:                                    ; preds = %143, %148
  %indvars.iv215 = phi i64 [ %indvars.iv.next216, %148 ], [ %indvars.iv211, %143 ]
  %exitcond219.not = icmp eq i64 %indvars.iv215, %139
  br i1 %exitcond219.not, label %.loopexit, label %148

148:                                              ; preds = %.preheader133
  %indvars.iv.next216 = add nsw i64 %indvars.iv215, 1
  %149 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %indvars.iv215
  %150 = load i32, ptr %149, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %150)
          to label %.preheader133 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, !llvm.loop !27

.loopexit:                                        ; preds = %.preheader133, %.preheader
  %.pre-phi = phi i64 [ %114, %.preheader ], [ %139, %.preheader133 ]
  %.5.in = phi i64 [ %indvars.iv233, %.preheader ], [ %indvars.iv208, %.preheader133 ]
  %.5 = trunc i64 %.5.in to i32
  %151 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %.pre-phi
  %152 = load i32, ptr %151, align 4, !tbaa !8
  %sext = shl i64 %.5.in, 32
  %153 = ashr exact i64 %sext, 32
  %154 = getelementptr inbounds [600018 x i32], ptr @id, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !8
  %156 = call noundef i32 @_Z3lcaii(i32 noundef %152, i32 noundef %155)
  %.not112 = icmp eq i32 %156, %152
  %.not113 = icmp eq i32 %156, %155
  %or.cond = or i1 %.not112, %.not113
  br i1 %or.cond, label %.thread, label %162

.thread:                                          ; preds = %.loopexit
  %157 = load i32, ptr @ans, align 4, !tbaa !8
  %158 = getelementptr inbounds i8, ptr %107, i64 8
  %159 = load i32, ptr %158, align 4, !tbaa !18
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [300009 x i32], ptr @res, i64 0, i64 %160
  store i32 %157, ptr %161, align 4, !tbaa !8
  br label %171

162:                                              ; preds = %.loopexit
  invoke void @_Z2yoi(i32 noundef %156)
          to label %165 unwind label %163

163:                                              ; preds = %165, %162
  %164 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

165:                                              ; preds = %162
  %166 = load i32, ptr @ans, align 4, !tbaa !8
  %167 = getelementptr inbounds i8, ptr %107, i64 8
  %168 = load i32, ptr %167, align 4, !tbaa !18
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [300009 x i32], ptr @res, i64 0, i64 %169
  store i32 %166, ptr %170, align 4, !tbaa !8
  invoke void @_Z2yoi(i32 noundef %156)
          to label %171 unwind label %163

171:                                              ; preds = %.thread, %165
  %indvars.iv.next237 = add nuw nsw i64 %indvars.iv236, 1
  %172 = load i32, ptr %2, align 4, !tbaa !8
  %173 = sext i32 %172 to i64
  %.not109.not = icmp slt i64 %indvars.iv236, %173
  br i1 %.not109.not, label %.lr.ph177, label %.preheader146, !llvm.loop !28

.preheader145:                                    ; preds = %180, %105, %.preheader146
  %174 = load i32, ptr %1, align 4, !tbaa !8
  %.not111182 = icmp slt i32 %174, 0
  br i1 %.not111182, label %._crit_edge185, label %.lr.ph184

.lr.ph180:                                        ; preds = %.preheader146, %180
  %indvars.iv239 = phi i64 [ %indvars.iv.next240, %180 ], [ 1, %.preheader146 ]
  %175 = getelementptr inbounds [300009 x i32], ptr @res, i64 0, i64 %indvars.iv239
  %176 = load i32, ptr %175, align 4, !tbaa !8
  %177 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %176)
          to label %178 unwind label %183

178:                                              ; preds = %.lr.ph180
  %179 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %177, i8 noundef signext 10)
          to label %180 unwind label %183

180:                                              ; preds = %178
  %indvars.iv.next240 = add nuw nsw i64 %indvars.iv239, 1
  %181 = load i32, ptr %2, align 4, !tbaa !8
  %182 = sext i32 %181 to i64
  %.not110.not = icmp slt i64 %indvars.iv239, %182
  br i1 %.not110.not, label %.lr.ph180, label %.preheader145, !llvm.loop !29

183:                                              ; preds = %178, %.lr.ph180
  %184 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

._crit_edge185:                                   ; preds = %.lr.ph184, %.preheader145
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #9
  %185 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %186 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %185, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = getelementptr i8, ptr %187, i64 -24
  %189 = load i64, ptr %188, align 8
  %190 = getelementptr inbounds i8, ptr %186, i64 %189
  %191 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %190)
  br i1 %191, label %.preheader149, label %._crit_edge186, !llvm.loop !30

.lr.ph184:                                        ; preds = %.preheader145, %.lr.ph184
  %indvar = phi i64 [ %indvar.next, %.lr.ph184 ], [ 0, %.preheader145 ]
  %192 = mul nuw nsw i64 %indvar, 80
  %scevgep = getelementptr i8, ptr @par, i64 %192
  %193 = getelementptr inbounds [300009 x %"class.std::vector"], ptr @g, i64 0, i64 %indvar
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %193) #9
  %194 = getelementptr inbounds [300009 x i32], ptr @cnt, i64 0, i64 %indvar
  store i32 0, ptr %194, align 4, !tbaa !8
  %195 = getelementptr inbounds [300009 x i8], ptr @vis, i64 0, i64 %indvar
  store i8 0, ptr %195, align 1, !tbaa !31
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80) %scevgep, i8 0, i64 80, i1 false), !tbaa !8
  %indvar.next = add nuw nsw i64 %indvar, 1
  %196 = load i32, ptr %1, align 4, !tbaa !8
  %197 = sext i32 %196 to i64
  %.not111.not = icmp slt i64 %indvar, %197
  br i1 %.not111.not, label %.lr.ph184, label %._crit_edge185, !llvm.loop !33

.loopexit.split-lp:                               ; preds = %.loopexit121, %.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit, %183, %163, %42, %44, %86, %70, %68
  %.pn117.pn = phi { ptr, i32 } [ %69, %68 ], [ %87, %86 ], [ %71, %70 ], [ %45, %44 ], [ %43, %42 ], [ %184, %183 ], [ %164, %163 ], [ %lpad.loopexit, %.loopexit121 ], [ %lpad.loopexit123, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit127, %.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit130, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit135, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit138, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit142, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn117.pn

._crit_edge186:                                   ; preds = %._crit_edge185, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #0 align 2

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 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 #0 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z2yoi(i32 noundef) local_unnamed_addr #6

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !9, i64 0}
!16 = !{!"_ZTS5query", !9, i64 0, !9, i64 4, !9, i64 8}
!17 = !{!16, !9, i64 4}
!18 = !{!16, !9, i64 8}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !12}
!31 = !{!32, !32, i64 0}
!32 = !{!"bool", !10, i64 0}
!33 = distinct !{!33, !12}


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