; LLVM IR from tangjz/acm-icpc :: leetcode/extra (tusimple_005-服务器)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, 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.anon = type { ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector.5", [8 x i8] }>
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.10" = type <{ i64, i32, [4 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@__dso_handle = external hidden global i8
@_ZZ4mainE1e = external hidden global [1001 x %"class.std::vector"], align 16
@_ZGVZ4mainE1e = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZZ4mainE3dis = external hidden global [1001 x i64], align 16
@_ZZ4mainE3vis = external hidden global [1001 x i8], align 16
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::unordered_map", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.anon, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::priority_queue", align 8
  %18 = alloca %"struct.std::pair.10", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i64, align 8
  %27 = alloca %"struct.std::pair.10", align 8
  %28 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #0
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #0
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #0
  store i32 0, ptr %4, align 4, !tbaa !5
  %29 = load atomic i8, ptr @_ZGVZ4mainE1e acquire, align 8
  %30 = icmp eq i8 %29, 0
  br i1 %30, label %31, label %41, !prof !9

31:                                               ; preds = %0
  %32 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ4mainE1e) #0
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %41

34:                                               ; preds = %31
  br label %35

35:                                               ; preds = %35, %34
  %36 = phi ptr [ @_ZZ4mainE1e, %34 ], [ %37, %35 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %36) #0
  %37 = getelementptr inbounds %"class.std::vector", ptr %36, i64 1
  %38 = icmp eq ptr %37, getelementptr inbounds (%"class.std::vector", ptr @_ZZ4mainE1e, i64 1001)
  br i1 %38, label %39, label %35

39:                                               ; preds = %35
  %40 = call i32 @__cxa_atexit(ptr @__cxx_global_array_dtor, ptr null, ptr @__dso_handle) #0
  call void @__cxa_guard_release(ptr @_ZGVZ4mainE1e) #0
  br label %41

41:                                               ; preds = %39, %31, %0
  call void @llvm.lifetime.start.p0(i64 56, ptr %5) #0
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #0
  %42 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
          to label %43 unwind label %62

43:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #0
  %44 = getelementptr inbounds %class.anon, ptr %8, i32 0, i32 0
  store ptr %5, ptr %44, align 8, !tbaa !10
  %45 = getelementptr inbounds %class.anon, ptr %8, i32 0, i32 1
  store ptr %4, ptr %45, align 8, !tbaa !10
  br label %46

46:                                               ; preds = %61, %43
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %3, align 4, !tbaa !5
  %49 = icmp ne i32 %47, 0
  br i1 %49, label %50, label %85

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #0
  %51 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %52 unwind label %66

52:                                               ; preds = %50
  store i32 %51, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #0
  %53 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %54 unwind label %70

54:                                               ; preds = %52
  store i32 %53, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #0
  %55 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %11)
          to label %56 unwind label %74

56:                                               ; preds = %54
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @_ZZ4mainE1e, i64 0, i64 %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #0
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %60 unwind label %78

60:                                               ; preds = %56
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %61 unwind label %78

61:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #0
  br label %46, !llvm.loop !12

62:                                               ; preds = %41
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %6, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %7, align 4
  br label %258

66:                                               ; preds = %50
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %6, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %7, align 4
  br label %84

70:                                               ; preds = %52
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %6, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %7, align 4
  br label %83

74:                                               ; preds = %54
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %6, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %7, align 4
  br label %82

78:                                               ; preds = %60, %56
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %6, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #0
  br label %82

82:                                               ; preds = %78, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #0
  br label %83

83:                                               ; preds = %82, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #0
  br label %84

84:                                               ; preds = %83, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #0
  br label %257

85:                                               ; preds = %46
  %86 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %86, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #0
  %87 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %13)
          to label %88 unwind label %108

88:                                               ; preds = %85
  br label %89

89:                                               ; preds = %249, %247, %88
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = add nsw i32 %90, -1
  store i32 %91, ptr %13, align 4, !tbaa !5
  %92 = icmp ne i32 %90, 0
  br i1 %92, label %93, label %254

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #0
  %94 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %95 unwind label %112

95:                                               ; preds = %93
  store i32 %94, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #0
  %96 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %97 unwind label %116

97:                                               ; preds = %95
  store i32 %96, ptr %15, align 4, !tbaa !5
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = icmp sge i32 %98, %99
  br i1 %100, label %105, label %101

101:                                              ; preds = %97
  %102 = load i32, ptr %15, align 4, !tbaa !5
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = icmp sge i32 %102, %103
  br i1 %104, label %105, label %120

105:                                              ; preds = %101, %97
  %106 = invoke i32 @puts(ptr noundef @.str.2)
          to label %107 unwind label %116

107:                                              ; preds = %105
  store i32 4, ptr %16, align 4
  br label %247, !llvm.loop !14

108:                                              ; preds = %85
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %6, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %7, align 4
  br label %256

112:                                              ; preds = %93
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %6, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %7, align 4
  br label %253

116:                                              ; preds = %105, %95
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %6, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %7, align 4
  br label %252

120:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #0
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
          to label %121 unwind label %149

121:                                              ; preds = %120
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = mul i64 %123, 8
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ4mainE3dis, i8 63, i64 %124, i1 false)
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = mul i64 %126, 1
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ4mainE3vis, i8 0, i64 %127, i1 false)
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %129
  store i64 0, ptr %130, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #0
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #0
  store i32 0, ptr %19, align 4, !tbaa !5
  invoke void @_ZNSt4pairIxiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %18, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %131 unwind label %153

131:                                              ; preds = %121
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %17, ptr noundef nonnull align 8 dereferenceable(12) %18)
          to label %132 unwind label %153

132:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #0
  br label %133

133:                                              ; preds = %228, %226, %132
  %134 = invoke noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
          to label %135 unwind label %157

135:                                              ; preds = %133
  %136 = xor i1 %134, true
  br i1 %136, label %137, label %230

137:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #0
  %138 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
          to label %139 unwind label %161

139:                                              ; preds = %137
  %140 = getelementptr inbounds %"struct.std::pair.10", ptr %138, i32 0, i32 1
  %141 = load i32, ptr %140, align 8, !tbaa !17
  store i32 %141, ptr %20, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
          to label %142 unwind label %161

142:                                              ; preds = %139
  %143 = load i32, ptr %20, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %144
  %146 = load i8, ptr %145, align 1, !tbaa !19, !range !21, !noundef !22
  %147 = trunc i8 %146 to i1
  br i1 %147, label %148, label %165

148:                                              ; preds = %142
  store i32 6, ptr %16, align 4
  br label %226, !llvm.loop !23

149:                                              ; preds = %120
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %6, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %7, align 4
  br label %251

153:                                              ; preds = %131, %121
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %6, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #0
  br label %250

157:                                              ; preds = %239, %236, %133
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %6, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %7, align 4
  br label %250

161:                                              ; preds = %139, %137
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %6, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %7, align 4
  br label %229

165:                                              ; preds = %142
  %166 = load i32, ptr %20, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [1001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %167
  store i8 1, ptr %168, align 1, !tbaa !19
  %169 = load i32, ptr %20, align 4, !tbaa !5
  %170 = load i32, ptr %15, align 4, !tbaa !5
  %171 = icmp eq i32 %169, %170
  br i1 %171, label %172, label %173

172:                                              ; preds = %165
  store i32 7, ptr %16, align 4
  br label %226

173:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #0
  %174 = load i32, ptr %20, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @_ZZ4mainE1e, i64 0, i64 %175
  store ptr %176, ptr %21, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #0
  %177 = load ptr, ptr %21, align 8, !tbaa !10
  %178 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %177) #0
  %179 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %178, ptr %179, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #0
  %180 = load ptr, ptr %21, align 8, !tbaa !10
  %181 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %180) #0
  %182 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %181, ptr %182, align 8
  br label %183

183:                                              ; preds = %223, %173
  %184 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #0
  br i1 %184, label %186, label %185

185:                                              ; preds = %183
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #0
  br label %225

186:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #0
  %187 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #0
  store ptr %187, ptr %24, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #0
  %188 = load ptr, ptr %24, align 8, !tbaa !10
  %189 = getelementptr inbounds %"struct.std::pair", ptr %188, i32 0, i32 0
  %190 = load i32, ptr %189, align 4, !tbaa !24
  store i32 %190, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #0
  %191 = load i32, ptr %20, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %192
  %194 = load i64, ptr %193, align 8, !tbaa !15
  %195 = load ptr, ptr %24, align 8, !tbaa !10
  %196 = getelementptr inbounds %"struct.std::pair", ptr %195, i32 0, i32 1
  %197 = load i32, ptr %196, align 4, !tbaa !26
  %198 = sext i32 %197 to i64
  %199 = add nsw i64 %194, %198
  store i64 %199, ptr %26, align 8, !tbaa !15
  %200 = load i32, ptr %25, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %201
  %203 = load i64, ptr %202, align 8, !tbaa !15
  %204 = load i64, ptr %26, align 8, !tbaa !15
  %205 = icmp sgt i64 %203, %204
  br i1 %205, label %206, label %222

206:                                              ; preds = %186
  %207 = load i64, ptr %26, align 8, !tbaa !15
  %208 = load i32, ptr %25, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %209
  store i64 %207, ptr %210, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %27) #0
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #0
  %211 = load i32, ptr %25, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %212
  %214 = load i64, ptr %213, align 8, !tbaa !15
  %215 = sub nsw i64 0, %214
  store i64 %215, ptr %28, align 8, !tbaa !15
  invoke void @_ZNSt4pairIxiEC2IxRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %27, ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %216 unwind label %218

216:                                              ; preds = %206
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %17, ptr noundef nonnull align 8 dereferenceable(12) %27)
          to label %217 unwind label %218

217:                                              ; preds = %216
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #0
  br label %222

218:                                              ; preds = %216, %206
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %6, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %27) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #0
  br label %229

222:                                              ; preds = %217, %186
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #0
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #0
  br label %223

223:                                              ; preds = %222
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #0
  br label %183

225:                                              ; preds = %185
  store i32 0, ptr %16, align 4
  br label %226

226:                                              ; preds = %225, %172, %148
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #0
  %227 = load i32, ptr %16, align 4
  switch i32 %227, label %264 [
    i32 0, label %228
    i32 6, label %133
    i32 7, label %230
  ]

228:                                              ; preds = %226
  br label %133, !llvm.loop !23

229:                                              ; preds = %218, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #0
  br label %250

230:                                              ; preds = %226, %135
  %231 = load i32, ptr %15, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %232
  %234 = load i64, ptr %233, align 8, !tbaa !15
  %235 = icmp eq i64 %234, 4557430888798830399
  br i1 %235, label %236, label %239

236:                                              ; preds = %230
  %237 = invoke i32 @puts(ptr noundef @.str.2)
          to label %238 unwind label %157

238:                                              ; preds = %236
  br label %246

239:                                              ; preds = %230
  %240 = load i32, ptr %15, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %241
  %243 = load i64, ptr %242, align 8, !tbaa !15
  %244 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %243)
          to label %245 unwind label %157

245:                                              ; preds = %239
  br label %246

246:                                              ; preds = %245, %238
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %17) #0
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #0
  store i32 0, ptr %16, align 4
  br label %247

247:                                              ; preds = %246, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #0
  %248 = load i32, ptr %16, align 4
  switch i32 %248, label %264 [
    i32 0, label %249
    i32 4, label %89
  ]

249:                                              ; preds = %247
  br label %89, !llvm.loop !14

250:                                              ; preds = %229, %157, %153
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %17) #0
  br label %251

251:                                              ; preds = %250, %149
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #0
  br label %252

252:                                              ; preds = %251, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #0
  br label %253

253:                                              ; preds = %252, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #0
  br label %256

254:                                              ; preds = %89
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #0
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #0
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #0
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #0
  %255 = load i32, ptr %1, align 4
  ret i32 %255

256:                                              ; preds = %253, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #0
  br label %257

257:                                              ; preds = %256, %84
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #0
  br label %258

258:                                              ; preds = %257, %62
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %5) #0
  call void @llvm.lifetime.end.p0(i64 56, ptr %5) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #0
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #0
  br label %259

259:                                              ; preds = %258
  %260 = load ptr, ptr %6, align 8
  %261 = load i32, ptr %7, align 4
  %262 = insertvalue { ptr, i32 } poison, ptr %260, 0
  %263 = insertvalue { ptr, i32 } %262, i32 %261, 1
  resume { ptr, i32 } %263

264:                                              ; preds = %247, %226
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #0

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

; Function Attrs: uwtable
declare hidden void @__cxx_global_array_dtor(ptr noundef) #4 section ".text.startup"

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #0

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

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

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

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

declare i32 @puts(ptr noundef) #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(12)) #7 align 2

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #9 align 2

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

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

!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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTSSt4pairIxiE", !16, i64 0, !6, i64 8}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !13}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!26 = !{!25, !6, i64 4}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, 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.anon = type { ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"class.std::priority_queue" = type <{ %"class.std::vector.5", [8 x i8] }>
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, int>, std::allocator<std::pair<long long, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.10" = type <{ i64, i32, [4 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@__dso_handle = external hidden global i8
@_ZZ4mainE1e = external hidden global [1001 x %"class.std::vector"], align 16
@_ZGVZ4mainE1e = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZZ4mainE3dis = external hidden local_unnamed_addr global [1001 x i64], align 16
@_ZZ4mainE3vis = external hidden local_unnamed_addr global [1001 x i8], align 16
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::unordered_map", align 8
  %5 = alloca %class.anon, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::priority_queue", align 8
  %12 = alloca %"struct.std::pair.10", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.10", align 8
  %18 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #10
  store i32 0, ptr %3, align 4, !tbaa !5
  %19 = load atomic i8, ptr @_ZGVZ4mainE1e acquire, align 8
  %20 = icmp eq i8 %19, 0
  br i1 %20, label %21, label %26, !prof !9

21:                                               ; preds = %0
  %22 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ4mainE1e) #10
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %26, label %.preheader

.preheader:                                       ; preds = %21, %.preheader
  %.idx = phi i64 [ %.add, %.preheader ], [ 0, %21 ]
  %.ptr = getelementptr inbounds i8, ptr @_ZZ4mainE1e, i64 %.idx
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %.ptr) #10
  %.add = add nuw nsw i64 %.idx, 24
  %23 = icmp eq i64 %.add, 24024
  br i1 %23, label %24, label %.preheader

24:                                               ; preds = %.preheader
  %25 = tail call i32 @__cxa_atexit(ptr nonnull @__cxx_global_array_dtor, ptr null, ptr nonnull @__dso_handle) #10
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZ4mainE1e) #10
  br label %26

26:                                               ; preds = %24, %21, %0
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #10
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #10
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #10
  store ptr %4, ptr %5, align 8, !tbaa !10
  %28 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %3, ptr %28, align 8, !tbaa !10
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr %2, align 4, !tbaa !5
  %.not3247 = icmp eq i32 %29, 0
  br i1 %.not3247, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %26, %38
  %31 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %32 unwind label %41

32:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #10
  %33 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %34 unwind label %43

34:                                               ; preds = %32
  store i32 %33, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #10
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %7)
  %36 = sext i32 %31 to i64
  %37 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @_ZZ4mainE1e, i64 0, i64 %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #10
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %38 unwind label %45

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #10
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %2, align 4, !tbaa !5
  %.not32 = icmp eq i32 %39, 0
  br i1 %.not32, label %._crit_edge, label %.lr.ph, !llvm.loop !12

41:                                               ; preds = %.lr.ph
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %129

43:                                               ; preds = %32
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %47

45:                                               ; preds = %34
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #10
  br label %47

47:                                               ; preds = %45, %43
  %.pn40 = phi { ptr, i32 } [ %46, %45 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #10
  br label %129

._crit_edge:                                      ; preds = %38, %26
  %48 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %48, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #10
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %9)
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %9, align 4, !tbaa !5
  %.not3354 = icmp eq i32 %50, 0
  br i1 %.not3354, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %._crit_edge, %124
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #10
  %52 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %53 unwind label %60

53:                                               ; preds = %.lr.ph56
  store i32 %52, ptr %10, align 4, !tbaa !5
  %54 = invoke noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %55 unwind label %62

55:                                               ; preds = %53
  %56 = load i32, ptr %10, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %.not34 = icmp slt i32 %56, %57
  %.not35 = icmp slt i32 %54, %57
  %or.cond = and i1 %.not34, %.not35
  br i1 %or.cond, label %64, label %58

58:                                               ; preds = %55
  %59 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %124, !llvm.loop !14

60:                                               ; preds = %.lr.ph56
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %128

62:                                               ; preds = %53
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %128

64:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #10
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  %65 = load i32, ptr %1, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = shl nsw i64 %66, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ4mainE3dis, i8 63, i64 %67, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ4mainE3vis, i8 0, i64 %66, i1 false)
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %69
  store i64 0, ptr %70, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #10
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @_ZNSt4pairIxiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %10)
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef nonnull align 8 dereferenceable(12) %12)
          to label %71 unwind label %81

71:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #10
  %72 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  br i1 %72, label %.thread, label %.lr.ph52

.lr.ph52:                                         ; preds = %71, %113
  %73 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = load i32, ptr %74, align 8, !tbaa !17
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
          to label %76 unwind label %83

76:                                               ; preds = %.lr.ph52
  %77 = sext i32 %75 to i64
  %78 = getelementptr inbounds [1001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !19, !range !21, !noundef !22
  %80 = trunc nuw i8 %79 to i1
  br i1 %80, label %113, label %85, !llvm.loop !23

81:                                               ; preds = %64
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #10
  br label %127

83:                                               ; preds = %.lr.ph52
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %127

85:                                               ; preds = %76
  store i8 1, ptr %78, align 1, !tbaa !19
  %86 = icmp eq i32 %75, %54
  br i1 %86, label %.thread, label %87

87:                                               ; preds = %85
  %88 = getelementptr inbounds [1001 x %"class.std::vector"], ptr @_ZZ4mainE1e, i64 0, i64 %77
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #10
  %89 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #10
  store ptr %89, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #10
  %90 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #10
  store ptr %90, ptr %15, align 8
  %91 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #10
  br i1 %91, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %87
  %92 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %77
  br label %93

._crit_edge50:                                    ; preds = %110, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #10
  br label %113

93:                                               ; preds = %.lr.ph49, %110
  %94 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #10
  %95 = load i32, ptr %94, align 4, !tbaa !24
  store i32 %95, ptr %16, align 4, !tbaa !5
  %96 = load i64, ptr %92, align 8, !tbaa !15
  %97 = getelementptr inbounds i8, ptr %94, i64 4
  %98 = load i32, ptr %97, align 4, !tbaa !26
  %99 = sext i32 %98 to i64
  %100 = add nsw i64 %96, %99
  %101 = sext i32 %95 to i64
  %102 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %101
  %103 = load i64, ptr %102, align 8, !tbaa !15
  %104 = icmp sgt i64 %103, %100
  br i1 %104, label %105, label %110

105:                                              ; preds = %93
  store i64 %100, ptr %102, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #10
  %106 = sub nsw i64 0, %100
  store i64 %106, ptr %18, align 8, !tbaa !15
  call void @_ZNSt4pairIxiEC2IxRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(12) %17, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %16)
  invoke void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) %11, ptr noundef nonnull align 8 dereferenceable(12) %17)
          to label %107 unwind label %108

107:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #10
  br label %110

108:                                              ; preds = %105
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #10
  br label %127

110:                                              ; preds = %107, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #10
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #10
  %112 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #10
  br i1 %112, label %93, label %._crit_edge50

113:                                              ; preds = %76, %._crit_edge50
  %114 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  br i1 %114, label %.thread, label %.lr.ph52

.thread:                                          ; preds = %113, %85, %71
  %115 = sext i32 %54 to i64
  %116 = getelementptr inbounds [1001 x i64], ptr @_ZZ4mainE3dis, i64 0, i64 %115
  %117 = load i64, ptr %116, align 8, !tbaa !15
  %118 = icmp eq i64 %117, 4557430888798830399
  br i1 %118, label %119, label %121

119:                                              ; preds = %.thread
  %120 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %123

121:                                              ; preds = %.thread
  %122 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %117)
  br label %123

123:                                              ; preds = %121, %119
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %11) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #10
  br label %124

124:                                              ; preds = %123, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #10
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %9, align 4, !tbaa !5
  %.not33 = icmp eq i32 %125, 0
  br i1 %.not33, label %._crit_edge57, label %.lr.ph56

127:                                              ; preds = %83, %108, %81
  %.pn.pn = phi { ptr, i32 } [ %82, %81 ], [ %109, %108 ], [ %84, %83 ]
  call void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %11) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #10
  br label %128

128:                                              ; preds = %62, %127, %60
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %61, %60 ], [ %.pn.pn, %127 ], [ %63, %62 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #10
  br label %129

._crit_edge57:                                    ; preds = %124, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #10
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  ret i32 0

129:                                              ; preds = %41, %47, %128
  %.pn40.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %128 ], [ %.pn40, %47 ], [ %42, %41 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #10
  call void @_ZNSt13unordered_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEiSt4hashIS5_ESt8equal_toIS5_ESaISt4pairIKS5_iEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  resume { ptr, i32 } %.pn40.pn.pn
}

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #0

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

; Function Attrs: uwtable
declare hidden void @__cxx_global_array_dtor(ptr noundef) #4 section ".text.startup"

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #0

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZ4mainENK3$_0clEv"(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6 align 2

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #7 align 2

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIxiESt6vectorIS1_SaIS1_EESt4lessIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #9 align 2

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

attributes #0 = { nofree nounwind }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { 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 #10 = { 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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTSSt4pairIxiE", !16, i64 0, !6, i64 8}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !13}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!26 = !{!25, !6, i64 4}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass