; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf510_D.ll (Z5solvev)

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

%"class.std::basic_ostream" = type { ptr, %"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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@a = external dso_local global [200010 x i32], align 16
@root = external dso_local global [200010 x i32], align 16
@b = external dso_local global [200010 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::unordered_map", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %16 = call noundef i32 @_Z4readv()
  store i32 %16, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %2) #5
  call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %35, %0
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %42

22:                                               ; preds = %17
  %23 = invoke noundef i32 @_Z4readv()
          to label %24 unwind label %38

24:                                               ; preds = %22
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %26
  store i32 %23, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [200010 x i32], ptr @b, i64 0, i64 %33
  store i32 %31, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %24
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !9

38:                                               ; preds = %22
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %5, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %266

42:                                               ; preds = %21
  %43 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %43, ptr %44, align 8
  %45 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %48, ptr %50)
          to label %51 unwind label %62

51:                                               ; preds = %42
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr @b, i64 %53
  %55 = getelementptr inbounds i32, ptr %54, i64 1
  invoke void @_ZSt4sortIPiEvT_S1_(ptr noundef getelementptr inbounds (i32, ptr @b, i64 1), ptr noundef %55)
          to label %56 unwind label %62

56:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %87, %56
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr %1, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %66, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %90

62:                                               ; preds = %51, %42
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %5, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %6, align 4
  br label %266

66:                                               ; preds = %57
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200010 x i32], ptr @b, i64 0, i64 %68
  %70 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %69)
          to label %71 unwind label %82

71:                                               ; preds = %66
  %72 = load i32, ptr %70, align 4, !tbaa !5
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %86, label %74

74:                                               ; preds = %71
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %9, align 4, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200010 x i32], ptr @b, i64 0, i64 %78
  %80 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %79)
          to label %81 unwind label %82

81:                                               ; preds = %74
  store i32 %75, ptr %80, align 4, !tbaa !5
  br label %86

82:                                               ; preds = %74, %66
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %5, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %265

86:                                               ; preds = %81, %71
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %10, align 4, !tbaa !5
  br label %57, !llvm.loop !11

90:                                               ; preds = %61
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = sub nsw i32 %91, 1
  %93 = invoke noundef i32 @_Z5buildii(i32 noundef 0, i32 noundef %92)
          to label %94 unwind label %100

94:                                               ; preds = %90
  store i32 %93, ptr @root, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %123, %94
  %96 = load i32, ptr %11, align 4, !tbaa !5
  %97 = load i32, ptr %1, align 4, !tbaa !5
  %98 = icmp sle i32 %96, %97
  br i1 %98, label %104, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %130

100:                                              ; preds = %90
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %5, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %6, align 4
  br label %265

104:                                              ; preds = %95
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = sub nsw i32 %110, 1
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %113
  %115 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %114)
          to label %116 unwind label %126

116:                                              ; preds = %104
  %117 = load i32, ptr %115, align 4, !tbaa !5
  %118 = invoke noundef i32 @_Z6insertiiii(i32 noundef %109, i32 noundef 0, i32 noundef %111, i32 noundef %117)
          to label %119 unwind label %126

119:                                              ; preds = %116
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %121
  store i32 %118, ptr %122, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %119
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %11, align 4, !tbaa !5
  br label %95, !llvm.loop !12

126:                                              ; preds = %116, %104
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %5, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %265

130:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %256, %130
  %132 = load i32, ptr %12, align 4, !tbaa !5
  %133 = load i32, ptr %1, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = icmp sle i32 %132, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %131
  store i32 11, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %264

137:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %246, %137
  %139 = load i32, ptr %15, align 4, !tbaa !5
  %140 = load i32, ptr %1, align 4, !tbaa !5
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = sdiv i32 %140, %141
  %143 = add nsw i32 %142, 1
  %144 = icmp sle i32 %139, %143
  br i1 %144, label %146, label %145

145:                                              ; preds = %138
  store i32 14, ptr %13, align 4
  br label %249

146:                                              ; preds = %138
  %147 = load i32, ptr %12, align 4, !tbaa !5
  %148 = load i32, ptr %15, align 4, !tbaa !5
  %149 = sub nsw i32 %148, 1
  %150 = mul nsw i32 %147, %149
  %151 = add nsw i32 %150, 2
  %152 = load i32, ptr %1, align 4, !tbaa !5
  %153 = icmp sgt i32 %151, %152
  br i1 %153, label %154, label %155

154:                                              ; preds = %146
  store i32 14, ptr %13, align 4
  br label %249

155:                                              ; preds = %146
  %156 = load i32, ptr %12, align 4, !tbaa !5
  %157 = load i32, ptr %15, align 4, !tbaa !5
  %158 = mul nsw i32 %156, %157
  %159 = add nsw i32 %158, 1
  %160 = load i32, ptr %1, align 4, !tbaa !5
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %162, label %207

162:                                              ; preds = %155
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = load i32, ptr %15, align 4, !tbaa !5
  %165 = mul nsw i32 %163, %164
  %166 = add nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = load i32, ptr %9, align 4, !tbaa !5
  %171 = sub nsw i32 %170, 1
  %172 = load i32, ptr %15, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %173
  %175 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %174)
          to label %176 unwind label %203

176:                                              ; preds = %162
  %177 = load i32, ptr %175, align 4, !tbaa !5
  %178 = sub nsw i32 %177, 1
  %179 = invoke noundef i64 @_Z5queryiiii(i32 noundef %169, i32 noundef 0, i32 noundef %171, i32 noundef %178)
          to label %180 unwind label %203

180:                                              ; preds = %176
  %181 = load i32, ptr %12, align 4, !tbaa !5
  %182 = load i32, ptr %15, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 1
  %184 = mul nsw i32 %181, %183
  %185 = add nsw i32 %184, 1
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = load i32, ptr %9, align 4, !tbaa !5
  %190 = sub nsw i32 %189, 1
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %192
  %194 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %193)
          to label %195 unwind label %203

195:                                              ; preds = %180
  %196 = load i32, ptr %194, align 4, !tbaa !5
  %197 = sub nsw i32 %196, 1
  %198 = invoke noundef i64 @_Z5queryiiii(i32 noundef %188, i32 noundef 0, i32 noundef %190, i32 noundef %197)
          to label %199 unwind label %203

199:                                              ; preds = %195
  %200 = sub nsw i64 %179, %198
  %201 = load i64, ptr %14, align 8, !tbaa !13
  %202 = add nsw i64 %201, %200
  store i64 %202, ptr %14, align 8, !tbaa !13
  br label %245

203:                                              ; preds = %237, %222, %218, %207, %195, %180, %176, %162
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %5, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %263

207:                                              ; preds = %155
  %208 = load i32, ptr %1, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = load i32, ptr %9, align 4, !tbaa !5
  %213 = sub nsw i32 %212, 1
  %214 = load i32, ptr %15, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %215
  %217 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %216)
          to label %218 unwind label %203

218:                                              ; preds = %207
  %219 = load i32, ptr %217, align 4, !tbaa !5
  %220 = sub nsw i32 %219, 1
  %221 = invoke noundef i64 @_Z5queryiiii(i32 noundef %211, i32 noundef 0, i32 noundef %213, i32 noundef %220)
          to label %222 unwind label %203

222:                                              ; preds = %218
  %223 = load i32, ptr %12, align 4, !tbaa !5
  %224 = load i32, ptr %15, align 4, !tbaa !5
  %225 = sub nsw i32 %224, 1
  %226 = mul nsw i32 %223, %225
  %227 = add nsw i32 %226, 1
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = load i32, ptr %9, align 4, !tbaa !5
  %232 = sub nsw i32 %231, 1
  %233 = load i32, ptr %15, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %234
  %236 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 4 dereferenceable(4) %235)
          to label %237 unwind label %203

237:                                              ; preds = %222
  %238 = load i32, ptr %236, align 4, !tbaa !5
  %239 = sub nsw i32 %238, 1
  %240 = invoke noundef i64 @_Z5queryiiii(i32 noundef %230, i32 noundef 0, i32 noundef %232, i32 noundef %239)
          to label %241 unwind label %203

241:                                              ; preds = %237
  %242 = sub nsw i64 %221, %240
  %243 = load i64, ptr %14, align 8, !tbaa !13
  %244 = add nsw i64 %243, %242
  store i64 %244, ptr %14, align 8, !tbaa !13
  br label %245

245:                                              ; preds = %241, %199
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %15, align 4, !tbaa !5
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %15, align 4, !tbaa !5
  br label %138, !llvm.loop !15

249:                                              ; preds = %154, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %250

250:                                              ; preds = %249
  %251 = load i64, ptr %14, align 8, !tbaa !13
  %252 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %251)
          to label %253 unwind label %259

253:                                              ; preds = %250
  %254 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %252, i8 noundef signext 32)
          to label %255 unwind label %259

255:                                              ; preds = %253
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %256

256:                                              ; preds = %255
  %257 = load i32, ptr %12, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %12, align 4, !tbaa !5
  br label %131, !llvm.loop !16

259:                                              ; preds = %253, %250
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %5, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %6, align 4
  br label %263

263:                                              ; preds = %259, %203
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %265

264:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void

265:                                              ; preds = %263, %126, %100, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %266

266:                                              ; preds = %265, %62, %38
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %2) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %267

267:                                              ; preds = %266
  %268 = load ptr, ptr %5, align 8
  %269 = load i32, ptr %6, align 4
  %270 = insertvalue { ptr, i32 } poison, ptr %268, 0
  %271 = insertvalue { ptr, i32 } %270, i32 %269, 1
  resume { ptr, i32 } %271
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z4readv() #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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


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

%"class.std::basic_ostream" = type { ptr, %"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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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 }

@a = external dso_local global [200010 x i32], align 16
@root = external dso_local local_unnamed_addr global [200010 x i32], align 16
@b = external dso_local global [200010 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::unordered_map", align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = tail call noundef i32 @_Z4readv()
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %1) #5
  call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %.not83 = icmp slt i32 %3, 1
  br i1 %.not83, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %4 = add nuw i32 %3, 1
  %wide.trip.count = zext i32 %4 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %8, %0
  %5 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %6 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %5, ptr %6)
          to label %13 unwind label %20

.lr.ph:                                           ; preds = %.lr.ph.preheader, %8
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %8 ]
  %7 = invoke noundef i32 @_Z4readv()
          to label %8 unwind label %11

8:                                                ; preds = %.lr.ph
  %9 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv
  store i32 %7, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds [200010 x i32], ptr @b, i64 0, i64 %indvars.iv
  store i32 %7, ptr %10, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

11:                                               ; preds = %.lr.ph
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %106

13:                                               ; preds = %._crit_edge
  %14 = sext i32 %3 to i64
  %15 = getelementptr inbounds i32, ptr @b, i64 %14
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  invoke void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @b, i64 4), ptr noundef nonnull %16)
          to label %.preheader80 unwind label %20

.preheader80:                                     ; preds = %13
  br i1 %.not83, label %._crit_edge89, label %.lr.ph88.preheader

.lr.ph88.preheader:                               ; preds = %.preheader80
  %17 = add nuw i32 %3, 1
  %wide.trip.count109 = zext i32 %17 to i64
  br label %.lr.ph88

._crit_edge89.loopexit:                           ; preds = %32
  %18 = add nsw i32 %.159, -1
  br label %._crit_edge89

._crit_edge89:                                    ; preds = %._crit_edge89.loopexit, %.preheader80
  %.058.lcssa = phi i32 [ -1, %.preheader80 ], [ %18, %._crit_edge89.loopexit ]
  %19 = invoke noundef i32 @_Z5buildii(i32 noundef 0, i32 noundef %.058.lcssa)
          to label %33 unwind label %36

20:                                               ; preds = %13, %._crit_edge
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %106

.lr.ph88:                                         ; preds = %.lr.ph88.preheader, %32
  %indvars.iv106 = phi i64 [ 1, %.lr.ph88.preheader ], [ %indvars.iv.next107, %32 ]
  %.05886 = phi i32 [ 0, %.lr.ph88.preheader ], [ %.159, %32 ]
  %22 = getelementptr inbounds [200010 x i32], ptr @b, i64 0, i64 %indvars.iv106
  %23 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %24 unwind label %30

24:                                               ; preds = %.lr.ph88
  %25 = load i32, ptr %23, align 4, !tbaa !5
  %.not74 = icmp eq i32 %25, 0
  br i1 %.not74, label %26, label %32

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %28 unwind label %30

28:                                               ; preds = %26
  %29 = add nsw i32 %.05886, 1
  store i32 %.05886, ptr %27, align 4, !tbaa !5
  br label %32

30:                                               ; preds = %26, %.lr.ph88
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %106

32:                                               ; preds = %24, %28
  %.159 = phi i32 [ %.05886, %24 ], [ %29, %28 ]
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109
  br i1 %exitcond110.not, label %._crit_edge89.loopexit, label %.lr.ph88, !llvm.loop !11

33:                                               ; preds = %._crit_edge89
  store i32 %19, ptr @root, align 16, !tbaa !5
  br i1 %.not83, label %._crit_edge104, label %.lr.ph93.preheader

.lr.ph93.preheader:                               ; preds = %33
  %34 = add nuw i32 %3, 1
  %wide.trip.count114 = zext i32 %34 to i64
  br label %.lr.ph93

.preheader79:                                     ; preds = %44
  %.not70.not102.not = icmp eq i32 %3, 1
  br i1 %.not70.not102.not, label %._crit_edge104, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader79
  %35 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %14
  %wide.trip.count124 = zext nneg i32 %3 to i64
  %invariant.op = add nsw i64 %14, -2
  br label %.lr.ph97.preheader

36:                                               ; preds = %._crit_edge89
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %106

.lr.ph93:                                         ; preds = %.lr.ph93.preheader, %44
  %38 = phi i32 [ %19, %.lr.ph93.preheader ], [ %43, %44 ]
  %indvars.iv111 = phi i64 [ 1, %.lr.ph93.preheader ], [ %indvars.iv.next112, %44 ]
  %39 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv111
  %40 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %39)
          to label %41 unwind label %46

41:                                               ; preds = %.lr.ph93
  %42 = load i32, ptr %40, align 4, !tbaa !5
  %43 = invoke noundef i32 @_Z6insertiiii(i32 noundef %38, i32 noundef 0, i32 noundef %.058.lcssa, i32 noundef %42)
          to label %44 unwind label %46

44:                                               ; preds = %41
  %45 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %indvars.iv111
  store i32 %43, ptr %45, align 4, !tbaa !5
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
  br i1 %exitcond115.not, label %.preheader79, label %.lr.ph93, !llvm.loop !12

46:                                               ; preds = %41, %.lr.ph93
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %106

.lr.ph97.preheader:                               ; preds = %103, %.preheader.lr.ph
  %indvars.iv121 = phi i64 [ 1, %.preheader.lr.ph ], [ %indvars.iv.next122, %103 ]
  %48 = trunc nuw nsw i64 %indvars.iv121 to i32
  %49 = udiv i32 %3, %48
  %50 = add nuw i32 %49, 2
  %wide.trip.count119 = zext i32 %50 to i64
  br label %.lr.ph97

._crit_edge104:                                   ; preds = %103, %33, %.preheader79
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #5
  ret void

.lr.ph97:                                         ; preds = %.lr.ph97.preheader, %99
  %indvars.iv116 = phi i64 [ 1, %.lr.ph97.preheader ], [ %indvars.iv.next117, %99 ]
  %.05495 = phi i64 [ 0, %.lr.ph97.preheader ], [ %.1, %99 ]
  %51 = add nsw i64 %indvars.iv116, -1
  %52 = mul nuw nsw i64 %51, %indvars.iv121
  %53 = icmp sgt i64 %52, %invariant.op
  br i1 %53, label %._crit_edge98, label %54

54:                                               ; preds = %.lr.ph97
  %55 = mul nuw nsw i64 %indvars.iv116, %indvars.iv121
  %56 = add nuw nsw i64 %55, 1
  %57 = icmp slt i64 %56, %14
  br i1 %57, label %58, label %80

58:                                               ; preds = %54
  %59 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %56
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv116
  %62 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %61)
          to label %63 unwind label %78

63:                                               ; preds = %58
  %64 = load i32, ptr %62, align 4, !tbaa !5
  %65 = add nsw i32 %64, -1
  %66 = invoke noundef i64 @_Z5queryiiii(i32 noundef %60, i32 noundef 0, i32 noundef %.058.lcssa, i32 noundef %65)
          to label %67 unwind label %78

67:                                               ; preds = %63
  %68 = add nuw nsw i64 %52, 1
  %69 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %61)
          to label %72 unwind label %78

72:                                               ; preds = %67
  %73 = load i32, ptr %71, align 4, !tbaa !5
  %74 = add nsw i32 %73, -1
  %75 = invoke noundef i64 @_Z5queryiiii(i32 noundef %70, i32 noundef 0, i32 noundef %.058.lcssa, i32 noundef %74)
          to label %76 unwind label %78

76:                                               ; preds = %72
  %77 = sub nsw i64 %66, %75
  br label %99

78:                                               ; preds = %93, %88, %84, %80, %72, %67, %63, %58
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %106

80:                                               ; preds = %54
  %81 = load i32, ptr %35, align 4, !tbaa !5
  %82 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv116
  %83 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %82)
          to label %84 unwind label %78

84:                                               ; preds = %80
  %85 = load i32, ptr %83, align 4, !tbaa !5
  %86 = add nsw i32 %85, -1
  %87 = invoke noundef i64 @_Z5queryiiii(i32 noundef %81, i32 noundef 0, i32 noundef %.058.lcssa, i32 noundef %86)
          to label %88 unwind label %78

88:                                               ; preds = %84
  %89 = add nuw nsw i64 %52, 1
  %90 = getelementptr inbounds [200010 x i32], ptr @root, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) %1, ptr noundef nonnull align 4 dereferenceable(4) %82)
          to label %93 unwind label %78

93:                                               ; preds = %88
  %94 = load i32, ptr %92, align 4, !tbaa !5
  %95 = add nsw i32 %94, -1
  %96 = invoke noundef i64 @_Z5queryiiii(i32 noundef %91, i32 noundef 0, i32 noundef %.058.lcssa, i32 noundef %95)
          to label %97 unwind label %78

97:                                               ; preds = %93
  %98 = sub nsw i64 %87, %96
  br label %99

99:                                               ; preds = %76, %97
  %.pn = phi i64 [ %77, %76 ], [ %98, %97 ]
  %.1 = add nsw i64 %.pn, %.05495
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond120 = icmp eq i64 %indvars.iv.next117, %wide.trip.count119
  br i1 %exitcond120, label %._crit_edge98, label %.lr.ph97, !llvm.loop !13

._crit_edge98:                                    ; preds = %99, %.lr.ph97
  %.054.lcssa.ph = phi i64 [ %.1, %99 ], [ %.05495, %.lr.ph97 ]
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.054.lcssa.ph)
          to label %101 unwind label %104

101:                                              ; preds = %._crit_edge98
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %100, i8 noundef signext 32)
          to label %103 unwind label %104

103:                                              ; preds = %101
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124
  br i1 %exitcond125.not, label %._crit_edge104, label %.lr.ph97.preheader, !llvm.loop !14

104:                                              ; preds = %101, %._crit_edge98
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %106

106:                                              ; preds = %30, %36, %46, %104, %78, %20, %11
  %.pn77 = phi { ptr, i32 } [ %12, %11 ], [ %21, %20 ], [ %31, %30 ], [ %47, %46 ], [ %37, %36 ], [ %105, %104 ], [ %79, %78 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn77
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z4readv() local_unnamed_addr #3

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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


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