; LLVM IR from reyadussalahin/problem-solving :: hashing/string_hashing/codeforces/F752D (Solution)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>, std::_Select1st<std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>>, std::less<std::pair<long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>, std::_Select1st<std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>>, std::less<std::pair<long long, long long>>>::_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::pair" = type { i64, i64 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.3" = type { %"struct.std::pair", %"class.std::priority_queue" }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"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 [100010 x i32], align 16
@g = external dso_local global [100010 x i8], align 16
@hmp = external dso_local global %"class.std::map", align 8
@rhmp = external dso_local global %"class.std::map", align 8
@pmp = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %127, %0
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %130

37:                                               ; preds = %32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %39
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @g, ptr noundef %40)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 647, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 2797, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %106, %37
  %43 = load i32, ptr %12, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %109

47:                                               ; preds = %42
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = load i64, ptr %10, align 8, !tbaa !9
  %50 = mul nsw i64 %48, %49
  %51 = load i32, ptr %12, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100010 x i8], ptr @g, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !11
  %55 = sext i8 %54 to i32
  %56 = sub nsw i32 %55, 97
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = add nsw i64 %50, %58
  %60 = srem i64 %59, 1000000007
  store i64 %60, ptr %6, align 8, !tbaa !9
  %61 = load i64, ptr %7, align 8, !tbaa !9
  %62 = load i64, ptr %11, align 8, !tbaa !9
  %63 = mul nsw i64 %61, %62
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x i8], ptr @g, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !11
  %68 = sext i8 %67 to i32
  %69 = sub nsw i32 %68, 97
  %70 = add nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = add nsw i64 %63, %71
  %73 = srem i64 %72, 1000000009
  store i64 %73, ptr %7, align 8, !tbaa !9
  %74 = load i64, ptr %8, align 8, !tbaa !9
  %75 = load i64, ptr %10, align 8, !tbaa !9
  %76 = mul nsw i64 %74, %75
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = sub nsw i32 %77, %78
  %80 = sub nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100010 x i8], ptr @g, i64 0, i64 %81
  %83 = load i8, ptr %82, align 1, !tbaa !11
  %84 = sext i8 %83 to i32
  %85 = sub nsw i32 %84, 97
  %86 = add nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = add nsw i64 %76, %87
  %89 = srem i64 %88, 1000000007
  store i64 %89, ptr %8, align 8, !tbaa !9
  %90 = load i64, ptr %9, align 8, !tbaa !9
  %91 = load i64, ptr %11, align 8, !tbaa !9
  %92 = mul nsw i64 %90, %91
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = load i32, ptr %12, align 4, !tbaa !5
  %95 = sub nsw i32 %93, %94
  %96 = sub nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x i8], ptr @g, i64 0, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !11
  %100 = sext i8 %99 to i32
  %101 = sub nsw i32 %100, 97
  %102 = add nsw i32 %101, 1
  %103 = sext i32 %102 to i64
  %104 = add nsw i64 %92, %103
  %105 = srem i64 %104, 1000000009
  store i64 %105, ptr %9, align 8, !tbaa !9
  br label %106

106:                                              ; preds = %47
  %107 = load i32, ptr %12, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %12, align 4, !tbaa !5
  br label %42, !llvm.loop !12

109:                                              ; preds = %46
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %110 = call { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %111 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %112 = extractvalue { i64, i64 } %110, 0
  store i64 %112, ptr %111, align 8
  %113 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %114 = extractvalue { i64, i64 } %110, 1
  store i64 %114, ptr %113, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %115 = call { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %116 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %117 = extractvalue { i64, i64 } %115, 0
  store i64 %117, ptr %116, align 8
  %118 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %119 = extractvalue { i64, i64 } %115, 1
  store i64 %119, ptr %118, align 8
  %120 = call noundef zeroext i1 @_ZSteqIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %14)
  br i1 %120, label %121, label %123

121:                                              ; preds = %109
  %122 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48) @pmp, ptr noundef nonnull align 8 dereferenceable(16) %13)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %122, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %126

123:                                              ; preds = %109
  %124 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48) @hmp, ptr noundef nonnull align 8 dereferenceable(16) %13)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %124, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %125 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48) @rhmp, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %125, ptr noundef nonnull align 4 dereferenceable(4) %4)
  br label %126

126:                                              ; preds = %123, %121
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %4, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %4, align 4, !tbaa !5
  br label %32, !llvm.loop !14

130:                                              ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %131 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @hmp) #6
  %132 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %131, ptr %132, align 8
  br label %133

133:                                              ; preds = %199, %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %134 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @hmp) #6
  %135 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %134, ptr %135, align 8
  %136 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %202

138:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %139 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %140 = getelementptr inbounds %"struct.std::pair.3", ptr %139, i32 0, i32 0
  %141 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48) @rhmp, ptr noundef nonnull align 8 dereferenceable(16) %140)
  %142 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %18, i32 0, i32 0
  store ptr %141, ptr %142, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %143 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @rhmp) #6
  %144 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %19, i32 0, i32 0
  store ptr %143, ptr %144, align 8
  %145 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br i1 %145, label %146, label %147

146:                                              ; preds = %138
  store i32 10, ptr %5, align 4
  br label %196

147:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %148 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  %149 = getelementptr inbounds %"struct.std::pair.3", ptr %148, i32 0, i32 1
  store ptr %149, ptr %20, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %150 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #6
  %151 = getelementptr inbounds %"struct.std::pair.3", ptr %150, i32 0, i32 1
  store ptr %151, ptr %21, align 8, !tbaa !15
  br label %152

152:                                              ; preds = %175, %147
  %153 = load ptr, ptr %20, align 8, !tbaa !15
  %154 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %153)
  br i1 %154, label %173, label %155

155:                                              ; preds = %152
  %156 = load ptr, ptr %21, align 8, !tbaa !15
  %157 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %156)
  br i1 %157, label %173, label %158

158:                                              ; preds = %155
  %159 = load ptr, ptr %20, align 8, !tbaa !15
  %160 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %159)
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load ptr, ptr %21, align 8, !tbaa !15
  %166 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %165)
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = add nsw i32 %164, %170
  %172 = icmp sgt i32 %171, 0
  br label %173

173:                                              ; preds = %158, %155, %152
  %174 = phi i1 [ false, %155 ], [ false, %152 ], [ %172, %158 ]
  br i1 %174, label %175, label %195

175:                                              ; preds = %173
  %176 = load i64, ptr %15, align 8, !tbaa !9
  %177 = load ptr, ptr %20, align 8, !tbaa !15
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %177)
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = add nsw i64 %176, %183
  %185 = load ptr, ptr %21, align 8, !tbaa !15
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %185)
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = add nsw i64 %184, %191
  store i64 %192, ptr %15, align 8, !tbaa !9
  %193 = load ptr, ptr %20, align 8, !tbaa !15
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %193)
  %194 = load ptr, ptr %21, align 8, !tbaa !15
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %194)
  br label %152, !llvm.loop !17

195:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  store i32 0, ptr %5, align 4
  br label %196

196:                                              ; preds = %195, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %197 = load i32, ptr %5, align 4
  switch i32 %197, label %297 [
    i32 0, label %198
    i32 10, label %199
  ]

198:                                              ; preds = %196
  br label %199

199:                                              ; preds = %198, %196
  %200 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 0) #6
  %201 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %22, i32 0, i32 0
  store ptr %200, ptr %201, align 8
  br label %133, !llvm.loop !18

202:                                              ; preds = %137
  %203 = load i64, ptr %15, align 8, !tbaa !9
  %204 = sdiv i64 %203, 2
  store i64 %204, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %205 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @pmp) #6
  %206 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %24, i32 0, i32 0
  store ptr %205, ptr %206, align 8
  br label %207

207:                                              ; preds = %286, %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %208 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @pmp) #6
  %209 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  store ptr %208, ptr %209, align 8
  %210 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br i1 %210, label %212, label %211

211:                                              ; preds = %207
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %289

212:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %213 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #6
  %214 = getelementptr inbounds %"struct.std::pair.3", ptr %213, i32 0, i32 1
  store ptr %214, ptr %26, align 8, !tbaa !15
  br label %215

215:                                              ; preds = %273, %212
  %216 = load ptr, ptr %26, align 8, !tbaa !15
  %217 = call noundef i64 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %216)
  %218 = icmp uge i64 %217, 2
  br i1 %218, label %219, label %274

219:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %220 = load ptr, ptr %26, align 8, !tbaa !15
  %221 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %220)
  %222 = load i32, ptr %221, align 4, !tbaa !5
  store i32 %222, ptr %27, align 4, !tbaa !5
  %223 = load ptr, ptr %26, align 8, !tbaa !15
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %223)
  %224 = load i32, ptr %27, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = load ptr, ptr %26, align 8, !tbaa !15
  %229 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %228)
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = add nsw i32 %227, %233
  %235 = icmp sgt i32 %234, 0
  br i1 %235, label %236, label %268

236:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  %237 = load ptr, ptr %26, align 8, !tbaa !15
  %238 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %237)
  %239 = load i32, ptr %238, align 4, !tbaa !5
  store i32 %239, ptr %28, align 4, !tbaa !5
  %240 = load ptr, ptr %26, align 8, !tbaa !15
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %240)
  %241 = load i64, ptr %15, align 8, !tbaa !9
  %242 = load i32, ptr %27, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = add nsw i64 %241, %246
  %248 = load i32, ptr %28, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = add nsw i64 %247, %252
  store i64 %253, ptr %15, align 8, !tbaa !9
  %254 = load i32, ptr %28, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = icmp slt i32 %257, 0
  br i1 %258, label %259, label %267

259:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  %260 = load i32, ptr %28, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %261
  %263 = load i32, ptr %262, align 4, !tbaa !5
  %264 = sub nsw i32 0, %263
  store i32 %264, ptr %29, align 4, !tbaa !5
  %265 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %266 = load i32, ptr %265, align 4, !tbaa !5
  store i32 %266, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  br label %267

267:                                              ; preds = %259, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  br label %270

268:                                              ; preds = %219
  %269 = load ptr, ptr %26, align 8, !tbaa !15
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %269, ptr noundef nonnull align 4 dereferenceable(4) %27)
  store i32 17, ptr %5, align 4
  br label %271

270:                                              ; preds = %267
  store i32 0, ptr %5, align 4
  br label %271

271:                                              ; preds = %270, %268
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  %272 = load i32, ptr %5, align 4
  switch i32 %272, label %297 [
    i32 0, label %273
    i32 17, label %274
  ]

273:                                              ; preds = %271
  br label %215, !llvm.loop !19

274:                                              ; preds = %271, %215
  %275 = load ptr, ptr %26, align 8, !tbaa !15
  %276 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %275)
  br i1 %276, label %285, label %277

277:                                              ; preds = %274
  %278 = load ptr, ptr %26, align 8, !tbaa !15
  %279 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %278)
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %281
  %283 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %282)
  %284 = load i32, ptr %283, align 4, !tbaa !5
  store i32 %284, ptr %23, align 4, !tbaa !5
  br label %285

285:                                              ; preds = %277, %274
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %286

286:                                              ; preds = %285
  %287 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef 0) #6
  %288 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  store ptr %287, ptr %288, align 8
  br label %207, !llvm.loop !20

289:                                              ; preds = %211
  %290 = load i64, ptr %15, align 8, !tbaa !9
  %291 = load i32, ptr %23, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = add nsw i64 %290, %292
  store i64 %293, ptr %15, align 8, !tbaa !9
  %294 = load i64, ptr %15, align 8, !tbaa !9
  %295 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %294)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %296 = load i32, ptr %1, align 4
  ret i32 %296

297:                                              ; preds = %271, %196
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>, std::_Select1st<std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>>, std::less<std::pair<long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long long, long long>, std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>, std::_Select1st<std::pair<const std::pair<long long, long long>, std::priority_queue<int, std::vector<int>, Compare>>>, std::less<std::pair<long long, long long>>>::_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::pair" = type { i64, i64 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@a = external dso_local global [100010 x i32], align 16
@g = external dso_local global [100010 x i8], align 16
@hmp = external dso_local global %"class.std::map", align 8
@rhmp = external dso_local global %"class.std::map", align 8
@pmp = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph54, label %._crit_edge55

.lr.ph54:                                         ; preds = %0
  %22 = getelementptr inbounds i8, ptr %8, i64 8
  %23 = getelementptr inbounds i8, ptr %9, i64 8
  br label %27

._crit_edge55:                                    ; preds = %73, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %24 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @hmp) #6
  store ptr %24, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %25 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @hmp) #6
  store ptr %25, ptr %11, align 8
  %26 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br i1 %26, label %.lr.ph65, label %._crit_edge66

27:                                               ; preds = %.lr.ph54, %73
  %storemerge52 = phi i32 [ 0, %.lr.ph54 ], [ %75, %73 ]
  %28 = sext i32 %storemerge52 to i64
  %29 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %28
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @g, ptr noundef nonnull %29)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store i64 0, ptr %7, align 8, !tbaa !9
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph.preheader, label %34

.lr.ph.preheader:                                 ; preds = %27
  %33 = zext nneg i32 %31 to i64
  %wide.trip.count = zext nneg i32 %31 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  store i64 %52, ptr %4, align 8, !tbaa !9
  store i64 %55, ptr %5, align 8, !tbaa !9
  store i64 %64, ptr %6, align 8, !tbaa !9
  store i64 %67, ptr %7, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %._crit_edge, %27
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %35 = call { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %36 = extractvalue { i64, i64 } %35, 0
  store i64 %36, ptr %8, align 8
  %37 = extractvalue { i64, i64 } %35, 1
  store i64 %37, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  %38 = call { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %39 = extractvalue { i64, i64 } %38, 0
  store i64 %39, ptr %9, align 8
  %40 = extractvalue { i64, i64 } %38, 1
  store i64 %40, ptr %23, align 8
  %41 = call noundef zeroext i1 @_ZSteqIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  br i1 %41, label %68, label %70

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %42 = phi i64 [ 0, %.lr.ph.preheader ], [ %52, %.lr.ph ]
  %43 = phi i64 [ 0, %.lr.ph.preheader ], [ %55, %.lr.ph ]
  %44 = phi i64 [ 0, %.lr.ph.preheader ], [ %64, %.lr.ph ]
  %45 = phi i64 [ 0, %.lr.ph.preheader ], [ %67, %.lr.ph ]
  %46 = mul nsw i64 %42, 647
  %47 = getelementptr inbounds [100010 x i8], ptr @g, i64 0, i64 %indvars.iv
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = sext i8 %48 to i64
  %50 = add nsw i64 %49, -96
  %51 = add nsw i64 %50, %46
  %52 = srem i64 %51, 1000000007
  %53 = mul nsw i64 %43, 2797
  %54 = add nsw i64 %53, %50
  %55 = srem i64 %54, 1000000009
  %56 = mul nsw i64 %44, 647
  %57 = xor i64 %indvars.iv, -1
  %58 = add nsw i64 %33, %57
  %59 = getelementptr inbounds [100010 x i8], ptr @g, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = sext i8 %60 to i64
  %62 = add nsw i64 %61, -96
  %63 = add nsw i64 %62, %56
  %64 = srem i64 %63, 1000000007
  %65 = mul nsw i64 %45, 2797
  %66 = add nsw i64 %65, %62
  %67 = srem i64 %66, 1000000009
  %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 !12

68:                                               ; preds = %34
  %69 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48) @pmp, ptr noundef nonnull align 8 dereferenceable(16) %8)
  br label %73

70:                                               ; preds = %34
  %71 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48) @hmp, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %71, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %72 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48) @rhmp, ptr noundef nonnull align 8 dereferenceable(16) %9)
  br label %73

73:                                               ; preds = %70, %68
  %.sink = phi ptr [ %72, %70 ], [ %69, %68 ]
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %.sink, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %3, align 4, !tbaa !5
  %76 = load i32, ptr %1, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %27, label %._crit_edge55, !llvm.loop !14

._crit_edge66.loopexit:                           ; preds = %.critedge
  %78 = sdiv i64 %.2, 2
  br label %._crit_edge66

._crit_edge66:                                    ; preds = %._crit_edge66.loopexit, %._crit_edge55
  %.038.lcssa = phi i64 [ 0, %._crit_edge55 ], [ %78, %._crit_edge66.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %79 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @pmp) #6
  store ptr %79, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %80 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @pmp) #6
  store ptr %80, ptr %16, align 8
  %81 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  br i1 %81, label %.lr.ph74, label %._crit_edge75

.lr.ph65:                                         ; preds = %._crit_edge55, %.critedge
  %.03863 = phi i64 [ %.2, %.critedge ], [ 0, %._crit_edge55 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %82 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %83 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48) @rhmp, ptr noundef nonnull align 8 dereferenceable(16) %82)
  store ptr %83, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %84 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @rhmp) #6
  store ptr %84, ptr %13, align 8
  %85 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br i1 %85, label %.critedge, label %86

86:                                               ; preds = %.lr.ph65
  %87 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  %88 = getelementptr inbounds i8, ptr %87, i64 16
  %89 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %90 = getelementptr inbounds i8, ptr %89, i64 16
  %91 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %88)
  br i1 %91, label %.critedge, label %.lr.ph58

.lr.ph58:                                         ; preds = %86, %106
  %.156 = phi i64 [ %120, %106 ], [ %.03863, %86 ]
  %92 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %90)
  br i1 %92, label %.critedge, label %93

93:                                               ; preds = %.lr.ph58
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %88)
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %90)
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = add nsw i32 %103, %98
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %106, label %.critedge

106:                                              ; preds = %93
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %88)
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = add nsw i64 %.156, %112
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %90)
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = add nsw i64 %113, %119
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %88)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %90)
  %121 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %88)
  br i1 %121, label %.critedge, label %.lr.ph58, !llvm.loop !15

.critedge:                                        ; preds = %.lr.ph58, %106, %93, %86, %.lr.ph65
  %.2 = phi i64 [ %.03863, %.lr.ph65 ], [ %.03863, %86 ], [ %.156, %.lr.ph58 ], [ %120, %106 ], [ %.156, %93 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %122 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %123 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @hmp) #6
  store ptr %123, ptr %11, align 8
  %124 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br i1 %124, label %.lr.ph65, label %._crit_edge66.loopexit, !llvm.loop !16

._crit_edge75.loopexit:                           ; preds = %176
  %.pre = load i32, ptr %14, align 4, !tbaa !5
  %125 = sext i32 %.pre to i64
  br label %._crit_edge75

._crit_edge75:                                    ; preds = %._crit_edge75.loopexit, %._crit_edge66
  %126 = phi i64 [ 0, %._crit_edge66 ], [ %125, %._crit_edge75.loopexit ]
  %.3.lcssa = phi i64 [ %.038.lcssa, %._crit_edge66 ], [ %.444, %._crit_edge75.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  %127 = add nsw i64 %.3.lcssa, %126
  %128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %127)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph74:                                         ; preds = %._crit_edge66, %176
  %.372 = phi i64 [ %.444, %176 ], [ %.038.lcssa, %._crit_edge66 ]
  %129 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %130 = getelementptr inbounds i8, ptr %129, i64 16
  %131 = call noundef i64 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %132 = icmp ugt i64 %131, 1
  br i1 %132, label %.lr.ph70, label %.loopexit

.lr.ph70:                                         ; preds = %.lr.ph74, %165
  %.468 = phi i64 [ %159, %165 ], [ %.372, %.lr.ph74 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #6
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %134 = load i32, ptr %133, align 4, !tbaa !5
  store i32 %134, ptr %17, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %135 = load i32, ptr %17, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = add nsw i32 %143, %138
  %145 = icmp sgt i32 %144, 0
  br i1 %145, label %146, label %.thread

146:                                              ; preds = %.lr.ph70
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %148 = load i32, ptr %147, align 4, !tbaa !5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = add nsw i64 %.468, %153
  %155 = sext i32 %148 to i64
  %156 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = add nsw i64 %154, %158
  %160 = icmp slt i32 %157, 0
  br i1 %160, label %161, label %165

161:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #6
  %162 = sub nsw i32 0, %157
  store i32 %162, ptr %18, align 4, !tbaa !5
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %164 = load i32, ptr %163, align 4, !tbaa !5
  store i32 %164, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #6
  br label %165

.thread:                                          ; preds = %.lr.ph70
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %130, ptr noundef nonnull align 4 dereferenceable(4) %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  br label %.loopexit

165:                                              ; preds = %146, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #6
  %166 = call noundef i64 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %167 = icmp ugt i64 %166, 1
  br i1 %167, label %.lr.ph70, label %.loopexit

.loopexit:                                        ; preds = %165, %.lr.ph74, %.thread
  %.444 = phi i64 [ %.468, %.thread ], [ %.372, %.lr.ph74 ], [ %159, %165 ]
  %168 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  br i1 %168, label %176, label %169

169:                                              ; preds = %.loopexit
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %130)
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %172
  %174 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %173)
  %175 = load i32, ptr %174, align 4, !tbaa !5
  store i32 %175, ptr %14, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %169, %.loopexit
  %177 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %178 = call ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @pmp) #6
  store ptr %178, ptr %16, align 8
  %179 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEESC_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  br i1 %179, label %.lr.ph74, label %._crit_edge75.loopexit, !llvm.loop !17
}

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

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

; 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 uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIxxEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(25) ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEEixERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapISt4pairIxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareESt4lessIS1_ESaIS0_IKS1_S7_EEE4findERSA_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEE7CompareE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKS0_IxxESt14priority_queueIiSt6vectorIiSaIiEE7CompareEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #5 align 2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


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