; LLVM IR from eyangch/competitive-programming :: Codeforces/1353 (d)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%class.anon = type { i8 }
%"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<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 }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

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

33:                                               ; preds = %153, %0
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr %2, align 4, !tbaa !8
  %36 = icmp ne i32 %34, 0
  br i1 %36, label %37, label %157

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #10
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #10
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #10
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #10
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0EC2ERKS5_OS4_"(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %39 unwind label %64

39:                                               ; preds = %37
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #10
  %40 = load i32, ptr %3, align 4, !tbaa !8
  %41 = zext i32 %40 to i64
  %42 = call ptr @llvm.stacksave.p0()
  store ptr %42, ptr %9, align 8
  %43 = alloca i32, i64 %41, align 16
  store i64 %41, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  store i32 1, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  store i32 0, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = sub nsw i32 %44, 1
  store i32 %45, ptr %14, align 4, !tbaa !8
  %46 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %47 unwind label %68

47:                                               ; preds = %39
  store i64 %46, ptr %12, align 4
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %48 unwind label %68

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %49

49:                                               ; preds = %122, %48
  %50 = invoke noundef zeroext i1 @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E5emptyEv"(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %51 unwind label %72

51:                                               ; preds = %49
  %52 = xor i1 %50, true
  br i1 %52, label %53, label %125

53:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %54 = invoke noundef nonnull align 4 dereferenceable(8) ptr @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3topEv"(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %55 unwind label %76

55:                                               ; preds = %53
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %54, i64 8, i1 false)
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3popEv"(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %56 unwind label %76

56:                                               ; preds = %55
  %57 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !11
  %59 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !13
  %61 = sub nsw i32 %58, %60
  %62 = icmp slt i32 %61, 0
  br i1 %62, label %63, label %80

63:                                               ; preds = %56
  store i32 5, ptr %16, align 4
  br label %120

64:                                               ; preds = %37
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %7, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %8, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #10
  br label %156

68:                                               ; preds = %47, %39
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %7, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %155

72:                                               ; preds = %151, %49
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %7, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %8, align 4
  br label %155

76:                                               ; preds = %55, %53
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %7, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %8, align 4
  br label %124

80:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  %81 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !11
  %85 = add nsw i32 %82, %84
  %86 = sdiv i32 %85, 2
  store i32 %86, ptr %17, align 4, !tbaa !8
  %87 = load i32, ptr %11, align 4, !tbaa !8
  %88 = load i32, ptr %17, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %43, i64 %89
  store i32 %87, ptr %90, align 4, !tbaa !8
  %91 = load i32, ptr %11, align 4, !tbaa !8
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %11, align 4, !tbaa !8
  %93 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  %94 = load i32, ptr %93, align 4, !tbaa !13
  %95 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = icmp ne i32 %94, %96
  br i1 %97, label %98, label %119

98:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #10
  %99 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #10
  %100 = load i32, ptr %17, align 4, !tbaa !8
  %101 = sub nsw i32 %100, 1
  store i32 %101, ptr %19, align 4, !tbaa !8
  %102 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %99, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %103 unwind label %111

103:                                              ; preds = %98
  store i64 %102, ptr %18, align 4
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %104 unwind label %111

104:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #10
  %105 = load i32, ptr %17, align 4, !tbaa !8
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %21, align 4, !tbaa !8
  %107 = getelementptr inbounds %"struct.std::pair", ptr %15, i32 0, i32 1
  %108 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %107)
          to label %109 unwind label %115

109:                                              ; preds = %104
  store i64 %108, ptr %20, align 4
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(8) %20)
          to label %110 unwind label %115

110:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #10
  br label %119

111:                                              ; preds = %103, %98
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %7, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  br label %123

115:                                              ; preds = %109, %104
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %7, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #10
  br label %123

119:                                              ; preds = %110, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  store i32 0, ptr %16, align 4
  br label %120

120:                                              ; preds = %119, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  %121 = load i32, ptr %16, align 4
  switch i32 %121, label %164 [
    i32 0, label %122
    i32 5, label %125
  ]

122:                                              ; preds = %120
  br label %49, !llvm.loop !14

123:                                              ; preds = %115, %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  br label %124

124:                                              ; preds = %123, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  br label %155

125:                                              ; preds = %120, %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  store ptr %43, ptr %22, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %126 = load ptr, ptr %22, align 8, !tbaa !16
  store ptr %126, ptr %23, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  %127 = load ptr, ptr %22, align 8, !tbaa !16
  %128 = mul nuw i64 4, %41
  %129 = udiv i64 %128, 4
  %130 = getelementptr inbounds i32, ptr %127, i64 %129
  store ptr %130, ptr %24, align 8, !tbaa !16
  br label %131

131:                                              ; preds = %144, %125
  %132 = load ptr, ptr %23, align 8, !tbaa !16
  %133 = load ptr, ptr %24, align 8, !tbaa !16
  %134 = icmp ne ptr %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 6, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %151

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  %137 = load ptr, ptr %23, align 8, !tbaa !16
  %138 = load i32, ptr %137, align 4, !tbaa !8
  store i32 %138, ptr %25, align 4, !tbaa !8
  %139 = load i32, ptr %25, align 4, !tbaa !8
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %139)
          to label %141 unwind label %147

141:                                              ; preds = %136
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @.str)
          to label %143 unwind label %147

143:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  br label %144

144:                                              ; preds = %143
  %145 = load ptr, ptr %23, align 8, !tbaa !16
  %146 = getelementptr inbounds i32, ptr %145, i32 1
  store ptr %146, ptr %23, align 8, !tbaa !16
  br label %131

147:                                              ; preds = %141, %136
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %7, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %155

151:                                              ; preds = %135
  %152 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %153 unwind label %72

153:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  %154 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %154)
  call void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %5) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  br label %33, !llvm.loop !18

155:                                              ; preds = %147, %124, %72, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  call void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %5) #10
  br label %156

156:                                              ; preds = %155, %64
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  br label %159

157:                                              ; preds = %33
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  %158 = load i32, ptr %1, align 4
  ret i32 %158

159:                                              ; preds = %156
  %160 = load ptr, ptr %7, align 8
  %161 = load i32, ptr %8, align 4
  %162 = insertvalue { ptr, i32 } poison, ptr %160, 0
  %163 = insertvalue { ptr, i32 } %162, i32 %161, 1
  resume { ptr, i32 } %163

164:                                              ; preds = %120
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0EC2ERKS5_OS4_"(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E5emptyEv"(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3topEv"(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3popEv"(ptr noundef nonnull align 8 dereferenceable(25)) #5 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #8

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #8

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #9 align 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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind willreturn }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !9, i64 4}
!12 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!13 = !{!12, !9, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !10, i64 0}
!18 = distinct !{!18, !15}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%class.anon = type { i8 }
%"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<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 }
%"struct.std::pair" = type { i32, i32 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

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

.lr.ph40:                                         ; preds = %0
  %23 = getelementptr inbounds i8, ptr %9, i64 4
  br label %24

24:                                               ; preds = %.lr.ph40, %83
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0EC2ERKS5_OS4_"(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %26 unwind label %43

26:                                               ; preds = %24
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = zext i32 %27 to i64
  %29 = call ptr @llvm.stacksave.p0()
  %30 = alloca i32, i64 %28, align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  store i32 0, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  %31 = load i32, ptr %2, align 4, !tbaa !8
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %8, align 4, !tbaa !8
  %33 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %34 unwind label %45

34:                                               ; preds = %26
  store i64 %33, ptr %6, align 8
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %35 unwind label %45

35:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %36 = call noundef zeroext i1 @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E5emptyEv"(ptr noundef nonnull align 8 dereferenceable(25) %4)
  br i1 %36, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %35, %70
  %.02134 = phi i32 [ %56, %70 ], [ 1, %35 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %37 = call noundef nonnull align 4 dereferenceable(8) ptr @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3topEv"(ptr noundef nonnull align 8 dereferenceable(25) %4)
  %38 = load i64, ptr %37, align 4
  store i64 %38, ptr %9, align 8
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3popEv"(ptr noundef nonnull align 8 dereferenceable(25) %4)
          to label %39 unwind label %49

39:                                               ; preds = %.lr.ph
  %40 = load i32, ptr %23, align 4, !tbaa !11
  %41 = load i32, ptr %9, align 8, !tbaa !13
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %.thread, label %51

.thread:                                          ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %.loopexit

43:                                               ; preds = %24
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %87

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

47:                                               ; preds = %._crit_edge
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %86

49:                                               ; preds = %.lr.ph
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %72

51:                                               ; preds = %39
  %52 = add nsw i32 %41, %40
  %53 = sdiv i32 %52, 2
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i32, ptr %30, i64 %54
  store i32 %.02134, ptr %55, align 4, !tbaa !8
  %56 = add nuw nsw i32 %.02134, 1
  %.not24 = icmp eq i32 %41, %40
  br i1 %.not24, label %70, label %57

57:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #9
  %58 = add nsw i32 %53, -1
  store i32 %58, ptr %11, align 4, !tbaa !8
  %59 = invoke i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %60 unwind label %66

60:                                               ; preds = %57
  store i64 %59, ptr %10, align 8
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %61 unwind label %66

61:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #9
  %62 = add nsw i32 %53, 1
  store i32 %62, ptr %13, align 4, !tbaa !8
  %63 = invoke i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %64 unwind label %68

64:                                               ; preds = %61
  store i64 %63, ptr %12, align 8
  invoke void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25) %4, ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %65 unwind label %68

65:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %70

66:                                               ; preds = %60, %57
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  br label %72

68:                                               ; preds = %64, %61
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  br label %72

70:                                               ; preds = %51, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  %71 = call noundef zeroext i1 @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E5emptyEv"(ptr noundef nonnull align 8 dereferenceable(25) %4)
  br i1 %71, label %.loopexit, label %.lr.ph

72:                                               ; preds = %66, %68, %49
  %.pn.pn = phi { ptr, i32 } [ %50, %49 ], [ %69, %68 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %86

.loopexit:                                        ; preds = %70, %35, %.thread
  %73 = getelementptr inbounds i32, ptr %30, i64 %28
  %.not2735 = icmp eq i32 %27, 0
  br i1 %.not2735, label %._crit_edge, label %.lr.ph37

._crit_edge:                                      ; preds = %79, %.loopexit
  %74 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %83 unwind label %47

.lr.ph37:                                         ; preds = %.loopexit, %79
  %.01636 = phi ptr [ %80, %79 ], [ %30, %.loopexit ]
  %75 = load i32, ptr %.01636, align 4, !tbaa !8
  %76 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %75)
          to label %77 unwind label %81

77:                                               ; preds = %.lr.ph37
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str)
          to label %79 unwind label %81

79:                                               ; preds = %77
  %80 = getelementptr inbounds i8, ptr %.01636, i64 4
  %.not27 = icmp eq ptr %80, %73
  br i1 %.not27, label %._crit_edge, label %.lr.ph37

81:                                               ; preds = %77, %.lr.ph37
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %86

83:                                               ; preds = %._crit_edge
  call void @llvm.stackrestore.p0(ptr %29)
  call void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %4) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  %84 = load i32, ptr %1, align 4, !tbaa !8
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr %1, align 4, !tbaa !8
  %.not = icmp eq i32 %84, 0
  br i1 %.not, label %._crit_edge41, label %24, !llvm.loop !14

86:                                               ; preds = %81, %72, %47, %45
  %.pn28 = phi { ptr, i32 } [ %82, %81 ], [ %48, %47 ], [ %.pn.pn, %72 ], [ %46, %45 ]
  call void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25) %4) #9
  br label %87

87:                                               ; preds = %86, %43
  %.pn28.pn = phi { ptr, i32 } [ %.pn28, %86 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn28.pn

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

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0EC2ERKS5_OS4_"(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E4pushEOS1_"(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E5emptyEv"(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef nonnull align 4 dereferenceable(8) ptr @"_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3topEv"(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0E3popEv"(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #7

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #7

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EEZ4mainE3$_0ED2Ev"(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #8 align 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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { 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 #8 = { 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 #9 = { nounwind }

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

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


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