; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/KNPSK (A)

; 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::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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }

@k1 = external dso_local global %"class.std::priority_queue", align 8
@k2 = external dso_local global %"class.std::priority_queue", align 8
@w1 = external dso_local global %"class.std::priority_queue", align 8
@w2 = external dso_local global %"class.std::priority_queue", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

35:                                               ; preds = %56, %0
  %36 = load i32, ptr %4, align 4, !tbaa !11
  %37 = load i32, ptr %2, align 4, !tbaa !11
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %43 = load i32, ptr %5, align 4, !tbaa !11
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %48

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %46 = load i32, ptr %6, align 4, !tbaa !11
  %47 = sext i32 %46 to i64
  store i64 %47, ptr %7, align 8, !tbaa !8
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @w1, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %51

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %49 = load i32, ptr %6, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  store i64 %50, ptr %8, align 8, !tbaa !8
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @w2, ptr noundef nonnull align 8 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %51

51:                                               ; preds = %48, %45
  %52 = load i32, ptr %5, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = load i64, ptr %3, align 8, !tbaa !8
  %55 = add nsw i64 %54, %53
  store i64 %55, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %56

56:                                               ; preds = %51
  %57 = load i32, ptr %4, align 4, !tbaa !11
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %4, align 4, !tbaa !11
  br label %35, !llvm.loop !13

59:                                               ; preds = %39
  %60 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  br i1 %60, label %61, label %86

61:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !11
  br label %62

62:                                               ; preds = %81, %61
  %63 = load i32, ptr %10, align 4, !tbaa !11
  %64 = sext i32 %63 to i64
  %65 = load i64, ptr %3, align 8, !tbaa !8
  %66 = icmp sle i64 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %84

68:                                               ; preds = %62
  %69 = load i32, ptr %10, align 4, !tbaa !11
  %70 = srem i32 %69, 2
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %77

72:                                               ; preds = %68
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  %74 = load i64, ptr %73, align 8, !tbaa !8
  %75 = load i64, ptr %9, align 8, !tbaa !8
  %76 = add nsw i64 %75, %74
  store i64 %76, ptr %9, align 8, !tbaa !8
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  br label %77

77:                                               ; preds = %72, %68
  %78 = load i64, ptr %9, align 8, !tbaa !8
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %78)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %79, i8 noundef signext 32)
  br label %81

81:                                               ; preds = %77
  %82 = load i32, ptr %10, align 4, !tbaa !11
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %10, align 4, !tbaa !11
  br label %62, !llvm.loop !15

84:                                               ; preds = %67
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %186

86:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  %88 = load i64, ptr %87, align 8, !tbaa !8
  store i64 %88, ptr %12, align 8, !tbaa !8
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %89 = load i64, ptr %12, align 8, !tbaa !8
  %90 = sub nsw i64 0, %89
  store i64 %90, ptr %13, align 8, !tbaa !8
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @k1, ptr noundef nonnull align 8 dereferenceable(8) %13)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !11
  %91 = load i64, ptr %12, align 8, !tbaa !8
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %91)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %92, i8 noundef signext 32)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1000000000, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 2, ptr %16, align 4, !tbaa !11
  br label %94

94:                                               ; preds = %181, %86
  %95 = load i32, ptr %16, align 4, !tbaa !11
  %96 = sext i32 %95 to i64
  %97 = load i64, ptr %3, align 8, !tbaa !8
  %98 = icmp sle i64 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %94
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %184

100:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !11
  %101 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  br i1 %101, label %106, label %102

102:                                              ; preds = %100
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr %17, align 4, !tbaa !11
  br label %106

106:                                              ; preds = %102, %100
  %107 = load i32, ptr %16, align 4, !tbaa !11
  %108 = load i32, ptr %14, align 4, !tbaa !11
  %109 = sub nsw i32 %107, %108
  %110 = icmp eq i32 %109, 1
  br i1 %110, label %111, label %127

111:                                              ; preds = %106
  %112 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  br i1 %112, label %126, label %113

113:                                              ; preds = %111
  %114 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @k1)
  br i1 %114, label %126, label %115

115:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @k1)
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %118 = sub nsw i64 0, %117
  %119 = trunc i64 %118 to i32
  store i32 %119, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  %121 = load i64, ptr %120, align 8, !tbaa !8
  %122 = trunc i64 %121 to i32
  store i32 %122, ptr %20, align 4, !tbaa !11
  %123 = load i32, ptr %20, align 4, !tbaa !11
  %124 = load i32, ptr %19, align 4, !tbaa !11
  %125 = sub nsw i32 %123, %124
  store i32 %125, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %126

126:                                              ; preds = %115, %113, %111
  br label %134

127:                                              ; preds = %106
  %128 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  br i1 %128, label %133, label %129

129:                                              ; preds = %127
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  %131 = load i64, ptr %130, align 8, !tbaa !8
  %132 = trunc i64 %131 to i32
  store i32 %132, ptr %18, align 4, !tbaa !11
  br label %133

133:                                              ; preds = %129, %127
  br label %134

134:                                              ; preds = %133, %126
  %135 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %136 = load i32, ptr %135, align 4, !tbaa !11
  %137 = icmp sle i32 %136, 0
  br i1 %137, label %138, label %142

138:                                              ; preds = %134
  %139 = load i64, ptr %12, align 8, !tbaa !8
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %140, i8 noundef signext 32)
  store i32 10, ptr %11, align 4
  br label %178

142:                                              ; preds = %134
  %143 = load i32, ptr %17, align 4, !tbaa !11
  %144 = load i32, ptr %18, align 4, !tbaa !11
  %145 = icmp sge i32 %143, %144
  br i1 %145, label %146, label %152

146:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  %148 = load i64, ptr %147, align 8, !tbaa !8
  %149 = sub nsw i64 0, %148
  store i64 %149, ptr %21, align 8, !tbaa !8
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @k1, ptr noundef nonnull align 8 dereferenceable(8) %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  %150 = load i32, ptr %14, align 4, !tbaa !11
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %14, align 4, !tbaa !11
  br label %169

152:                                              ; preds = %142
  %153 = load i32, ptr %16, align 4, !tbaa !11
  %154 = load i32, ptr %14, align 4, !tbaa !11
  %155 = sub nsw i32 %153, %154
  %156 = icmp eq i32 %155, 1
  br i1 %156, label %157, label %164

157:                                              ; preds = %152
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25) @k2, ptr noundef nonnull align 8 dereferenceable(8) %158)
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @k1)
  %160 = load i64, ptr %159, align 8, !tbaa !8
  %161 = sub nsw i64 0, %160
  store i64 %161, ptr %22, align 8, !tbaa !8
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @w1, ptr noundef nonnull align 8 dereferenceable(8) %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @k1)
  %162 = load i32, ptr %14, align 4, !tbaa !11
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %14, align 4, !tbaa !11
  br label %168

164:                                              ; preds = %152
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25) @k2, ptr noundef nonnull align 8 dereferenceable(8) %165)
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  %166 = load i32, ptr %14, align 4, !tbaa !11
  %167 = add nsw i32 %166, 2
  store i32 %167, ptr %14, align 4, !tbaa !11
  br label %168

168:                                              ; preds = %164, %157
  br label %169

169:                                              ; preds = %168, %146
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %171 = load i32, ptr %170, align 4, !tbaa !11
  %172 = sext i32 %171 to i64
  %173 = load i64, ptr %12, align 8, !tbaa !8
  %174 = add nsw i64 %173, %172
  store i64 %174, ptr %12, align 8, !tbaa !8
  %175 = load i64, ptr %12, align 8, !tbaa !8
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %175)
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %176, i8 noundef signext 32)
  store i32 0, ptr %11, align 4
  br label %178

178:                                              ; preds = %169, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  %179 = load i32, ptr %11, align 4
  switch i32 %179, label %188 [
    i32 0, label %180
    i32 10, label %181
  ]

180:                                              ; preds = %178
  br label %181

181:                                              ; preds = %180, %178
  %182 = load i32, ptr %16, align 4, !tbaa !11
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %16, align 4, !tbaa !11
  br label %94, !llvm.loop !16

184:                                              ; preds = %99
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %186

186:                                              ; preds = %184, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %187 = load i32, ptr %1, align 4
  ret i32 %187

188:                                              ; preds = %178
  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: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) #4 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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)) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) #4 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 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind }

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

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


; 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::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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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" }

@k1 = external dso_local global %"class.std::priority_queue", align 8
@k2 = external dso_local global %"class.std::priority_queue", align 8
@w1 = external dso_local global %"class.std::priority_queue", align 8
@w2 = external dso_local global %"class.std::priority_queue", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %19
  %21 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %22 = 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)
  %23 = load i32, ptr %1, align 4, !tbaa !8
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %37
  %25 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  br i1 %25, label %.preheader, label %53

._crit_edge.thread:                               ; preds = %0
  %26 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  br i1 %26, label %._crit_edge51, label %53

.preheader:                                       ; preds = %._crit_edge
  %.not3747 = icmp slt i64 %40, 1
  br i1 %.not3747, label %._crit_edge51, label %.lr.ph50

.lr.ph:                                           ; preds = %0, %37
  %.02739 = phi i64 [ %40, %37 ], [ 0, %0 ]
  %.02938 = phi i32 [ %41, %37 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %27 = 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)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %34

31:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %32 = load i32, ptr %3, align 4, !tbaa !8
  %33 = sext i32 %32 to i64
  store i64 %33, ptr %4, align 8, !tbaa !11
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @w1, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %37

34:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %35 = load i32, ptr %3, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  store i64 %36, ptr %5, align 8, !tbaa !11
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @w2, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %37

37:                                               ; preds = %34, %31
  %38 = load i32, ptr %2, align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = add nsw i64 %.02739, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %41 = add nuw nsw i32 %.02938, 1
  %42 = load i32, ptr %1, align 4, !tbaa !8
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.lr.ph50:                                         ; preds = %.preheader, %50
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %50 ], [ 1, %.preheader ]
  %.03448 = phi i64 [ %.135, %50 ], [ 0, %.preheader ]
  %44 = and i64 %indvars.iv53, 1
  %45 = icmp eq i64 %44, 0
  br i1 %45, label %46, label %50

46:                                               ; preds = %.lr.ph50
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  %48 = load i64, ptr %47, align 8, !tbaa !11
  %49 = add nsw i64 %48, %.03448
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  br label %50

50:                                               ; preds = %46, %.lr.ph50
  %.135 = phi i64 [ %49, %46 ], [ %.03448, %.lr.ph50 ]
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.135)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %51, i8 noundef signext 32)
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %.not37.not = icmp sgt i64 %40, %indvars.iv53
  br i1 %.not37.not, label %.lr.ph50, label %._crit_edge51, !llvm.loop !15

53:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %.027.lcssa57 = phi i64 [ 0, %._crit_edge.thread ], [ %40, %._crit_edge ]
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  %55 = load i64, ptr %54, align 8, !tbaa !11
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %56 = sub nsw i64 0, %55
  store i64 %56, ptr %6, align 8, !tbaa !11
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @k1, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %55)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %57, i8 noundef signext 32)
  %.not40 = icmp slt i64 %.027.lcssa57, 2
  br i1 %.not40, label %._crit_edge51, label %.lr.ph45

.lr.ph45:                                         ; preds = %53, %107
  %indvars.iv = phi i64 [ %indvars.iv.next, %107 ], [ 2, %53 ]
  %.03042 = phi i32 [ %.2, %107 ], [ 1, %53 ]
  %.03141 = phi i64 [ %.sink62, %107 ], [ %55, %53 ]
  %indvars52 = trunc i64 %indvars.iv to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !8
  %59 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  br i1 %59, label %64, label %60

60:                                               ; preds = %.lr.ph45
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %63 = trunc i64 %62 to i32
  store i32 %63, ptr %7, align 4, !tbaa !8
  br label %64

64:                                               ; preds = %60, %.lr.ph45
  %65 = sub nsw i32 %indvars52, %.03042
  %66 = icmp eq i32 %65, 1
  %67 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  br i1 %66, label %68, label %79

68:                                               ; preds = %64
  br i1 %67, label %84, label %69

69:                                               ; preds = %68
  %70 = call noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @k1)
  br i1 %70, label %84, label %71

71:                                               ; preds = %69
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @k1)
  %73 = load i64, ptr %72, align 8, !tbaa !11
  %74 = trunc i64 %73 to i32
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = trunc i64 %76 to i32
  %78 = add i32 %77, %74
  store i32 %78, ptr %8, align 4, !tbaa !8
  br label %84

79:                                               ; preds = %64
  br i1 %67, label %84, label %80

80:                                               ; preds = %79
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  %82 = load i64, ptr %81, align 8, !tbaa !11
  %83 = trunc i64 %82 to i32
  store i32 %83, ptr %8, align 4, !tbaa !8
  br label %84

84:                                               ; preds = %79, %80, %68, %69, %71
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %86 = load i32, ptr %85, align 4, !tbaa !8
  %87 = icmp slt i32 %86, 1
  br i1 %87, label %107, label %88

88:                                               ; preds = %84
  %89 = load i32, ptr %7, align 4, !tbaa !8
  %90 = load i32, ptr %8, align 4, !tbaa !8
  %.not36 = icmp slt i32 %89, %90
  br i1 %.not36, label %95, label %91

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w1)
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = sub nsw i64 0, %93
  store i64 %94, ptr %9, align 8, !tbaa !11
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @k1, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %.sink.split

95:                                               ; preds = %88
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25) @k2, ptr noundef nonnull align 8 dereferenceable(8) %96)
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @w2)
  br i1 %66, label %97, label %101

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @k1)
  %99 = load i64, ptr %98, align 8, !tbaa !11
  %100 = sub nsw i64 0, %99
  store i64 %100, ptr %10, align 8, !tbaa !11
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25) @w1, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br label %.sink.split

.sink.split:                                      ; preds = %91, %97
  %k1.sink = phi ptr [ @k1, %97 ], [ @w1, %91 ]
  call void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %k1.sink)
  br label %101

101:                                              ; preds = %.sink.split, %95
  %.sink = phi i32 [ 2, %95 ], [ 1, %.sink.split ]
  %102 = add nsw i32 %.03042, %.sink
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %104 = load i32, ptr %103, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = add nsw i64 %.03141, %105
  br label %107

107:                                              ; preds = %84, %101
  %.sink62 = phi i64 [ %106, %101 ], [ %.03141, %84 ]
  %.2 = phi i32 [ %102, %101 ], [ %.03042, %84 ]
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.sink62)
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %108, i8 noundef signext 32)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not.not = icmp sgt i64 %.027.lcssa57, %indvars.iv
  br i1 %.not.not, label %.lr.ph45, label %._crit_edge51, !llvm.loop !16

._crit_edge51:                                    ; preds = %107, %50, %53, %.preheader, %._crit_edge.thread
  %110 = call 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_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  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 uwtable
declare dso_local void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushEOx(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIxSt6vectorIxSaIxEESt4lessIxEE4pushERKx(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 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 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 = { 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 #6 = { 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 #7 = { nounwind }

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

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


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