; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/319 Division 1/Problem D (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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.5" }
%"struct.std::pair.5" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@ok = external dso_local global [200 x i32], align 16
@e = external dso_local global %"class.std::vector", align 8
@g = external dso_local global [200 x %"class.std::vector.0"], align 16
@inf = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7update2i(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3bfsv() #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"struct.std::pair.5", align 4
  %8 = alloca { i64, i32 }, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %27, %0
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %30

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %25 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %25, ptr %7, align 4
  %26 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(8) %7)
  store { i64, i32 } %26, ptr %8, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %8, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %27

27:                                               ; preds = %23
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

30:                                               ; preds = %22
  %31 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #8
  %32 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %9, i32 0, i32 0
  store ptr %31, ptr %32, align 8
  %33 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #8
  %34 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %10, i32 0, i32 0
  store ptr %33, ptr %34, align 8
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %9, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %10, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %36, ptr %38)
  store i32 1, ptr getelementptr inbounds ([200 x i32], ptr @ok, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %52, %30
  %40 = load i32, ptr %11, align 4, !tbaa !5
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %50

43:                                               ; preds = %39
  %44 = load i32, ptr %11, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %45) #8
  %47 = getelementptr inbounds %"struct.std::pair", ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = icmp eq i32 %48, 0
  br label %50

50:                                               ; preds = %43, %39
  %51 = phi i1 [ false, %39 ], [ %49, %43 ]
  br i1 %51, label %52, label %80

52:                                               ; preds = %50
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %54) #8
  %56 = getelementptr inbounds %"struct.std::pair", ptr %55, i32 0, i32 1
  %57 = getelementptr inbounds %"struct.std::pair.5", ptr %56, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !14
  %59 = load i32, ptr %11, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %60) #8
  %62 = getelementptr inbounds %"struct.std::pair", ptr %61, i32 0, i32 1
  %63 = getelementptr inbounds %"struct.std::pair.5", ptr %62, i32 0, i32 1
  %64 = load i32, ptr %63, align 4, !tbaa !15
  call void @_Z6updateiii(i32 noundef %58, i32 noundef %64, i32 noundef 0)
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %66) #8
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds %"struct.std::pair.5", ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 4, !tbaa !14
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [200 x %"class.std::vector.0"], ptr @g, i64 0, i64 %71
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %74) #8
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds %"struct.std::pair.5", ptr %76, i32 0, i32 1
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %72, ptr noundef nonnull align 4 dereferenceable(4) %77)
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %11, align 4, !tbaa !5
  br label %39, !llvm.loop !16

80:                                               ; preds = %50
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %85

83:                                               ; preds = %80
  %84 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  br label %168

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %86 = call noundef i64 @_Z3bfsv()
  store i64 %86, ptr %13, align 8, !tbaa !17
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @inf, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %88 = load i64, ptr %87, align 8, !tbaa !17
  store i64 %88, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %89

89:                                               ; preds = %150, %85
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = load i32, ptr @m, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %93, label %157

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %95) #8
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !11
  store i32 %98, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %101) #8
  %103 = getelementptr inbounds %"struct.std::pair", ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 4, !tbaa !11
  store i32 %104, ptr %15, align 4, !tbaa !5
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = load i32, ptr %15, align 4, !tbaa !5
  %107 = sub nsw i32 %105, %106
  call void @_Z7update2i(i32 noundef %107)
  br label %108

108:                                              ; preds = %122, %93
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %112, label %120

112:                                              ; preds = %108
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %114) #8
  %116 = getelementptr inbounds %"struct.std::pair", ptr %115, i32 0, i32 0
  %117 = load i32, ptr %116, align 4, !tbaa !11
  %118 = load i32, ptr %14, align 4, !tbaa !5
  %119 = icmp eq i32 %117, %118
  br label %120

120:                                              ; preds = %112, %108
  %121 = phi i1 [ false, %108 ], [ %119, %112 ]
  br i1 %121, label %122, label %150

122:                                              ; preds = %120
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %124) #8
  %126 = getelementptr inbounds %"struct.std::pair", ptr %125, i32 0, i32 1
  %127 = getelementptr inbounds %"struct.std::pair.5", ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 4, !tbaa !14
  %129 = load i32, ptr %11, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %130) #8
  %132 = getelementptr inbounds %"struct.std::pair", ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds %"struct.std::pair.5", ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !15
  call void @_Z6updateiii(i32 noundef %128, i32 noundef %134, i32 noundef 0)
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %136) #8
  %138 = getelementptr inbounds %"struct.std::pair", ptr %137, i32 0, i32 1
  %139 = getelementptr inbounds %"struct.std::pair.5", ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 4, !tbaa !14
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [200 x %"class.std::vector.0"], ptr @g, i64 0, i64 %141
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %144) #8
  %146 = getelementptr inbounds %"struct.std::pair", ptr %145, i32 0, i32 1
  %147 = getelementptr inbounds %"struct.std::pair.5", ptr %146, i32 0, i32 1
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %142, ptr noundef nonnull align 4 dereferenceable(4) %147)
  %148 = load i32, ptr %11, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %11, align 4, !tbaa !5
  br label %108, !llvm.loop !19

150:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %151 = call noundef i64 @_Z3bfsv()
  %152 = load i32, ptr %14, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = add nsw i64 %151, %153
  store i64 %154, ptr %16, align 8, !tbaa !17
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %156 = load i64, ptr %155, align 8, !tbaa !17
  store i64 %156, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %89, !llvm.loop !20

157:                                              ; preds = %89
  %158 = load i64, ptr @ans, align 8, !tbaa !17
  %159 = load i64, ptr @inf, align 8, !tbaa !17
  %160 = icmp eq i64 %158, %159
  br i1 %160, label %161, label %163

161:                                              ; preds = %157
  %162 = call i32 @puts(ptr noundef @.str.4)
  br label %167

163:                                              ; preds = %157
  %164 = load i64, ptr @ans, align 8, !tbaa !17
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %164)
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %165, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %167

167:                                              ; preds = %163, %161
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  br label %168

168:                                              ; preds = %167, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  %169 = load i32, ptr %1, align 4
  ret i32 %169
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) #0

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

; 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) #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

declare i32 @puts(ptr noundef) #5

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.5" }
%"struct.std::pair.5" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@ok = external dso_local local_unnamed_addr global [200 x i32], align 16
@e = external dso_local global %"class.std::vector", align 8
@g = external dso_local global [200 x %"class.std::vector.0"], align 16
@inf = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7update2i(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3bfsv() local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.5", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %9 = load i32, ptr @m, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %15

._crit_edge:                                      ; preds = %15, %0
  %11 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #7
  %12 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @e) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %11, ptr %12)
  store i32 1, ptr getelementptr inbounds (i8, ptr @ok, i64 4), align 4, !tbaa !5
  %13 = load i32, ptr @m, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph34, label %.critedge.thread

15:                                               ; preds = %.lr.ph, %15
  %.02931 = phi i32 [ 0, %.lr.ph ], [ %19, %15 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %17 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %17, ptr %5, align 8
  %18 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %.fca.0.extract = extractvalue { i64, i32 } %18, 0
  %.fca.1.extract = extractvalue { i64, i32 } %18, 1
  store i64 %.fca.0.extract, ptr %4, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @e, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %19 = add nuw nsw i32 %.02931, 1
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %15, label %._crit_edge, !llvm.loop !9

.lr.ph34:                                         ; preds = %._crit_edge, %25
  %indvars.iv = phi i64 [ %indvars.iv.next, %25 ], [ 0, %._crit_edge ]
  %22 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv) #7
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %.critedge

25:                                               ; preds = %.lr.ph34
  %26 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv) #7
  %27 = getelementptr inbounds i8, ptr %26, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !14
  %29 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv) #7
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = load i32, ptr %30, align 4, !tbaa !15
  call void @_Z6updateiii(i32 noundef %28, i32 noundef %31, i32 noundef 0)
  %32 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv) #7
  %33 = getelementptr inbounds i8, ptr %32, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !14
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [200 x %"class.std::vector.0"], ptr @g, i64 0, i64 %35
  %37 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv) #7
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 4 dereferenceable(4) %38)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %.lr.ph34, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph34, %25
  %.030.lcssa.ph.in = phi i64 [ %indvars.iv, %.lr.ph34 ], [ %indvars.iv.next, %25 ]
  %.030.lcssa.ph = trunc i64 %.030.lcssa.ph.in to i32
  %42 = icmp eq i32 %.030.lcssa.ph, 0
  br i1 %42, label %.critedge.thread, label %44

.critedge.thread:                                 ; preds = %._crit_edge, %.critedge
  %43 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %95

44:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %45 = call noundef i64 @_Z3bfsv()
  store i64 %45, ptr %6, align 8, !tbaa !17
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @inf, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %47 = load i64, ptr %46, align 8, !tbaa !17
  store i64 %47, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, %.030.lcssa.ph
  br i1 %49, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %44, %.critedge2
  %.143 = phi i32 [ %.2.lcssa, %.critedge2 ], [ %.030.lcssa.ph, %44 ]
  %50 = sext i32 %.143 to i64
  %51 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %50) #7
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = add nsw i32 %.143, -1
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %54) #7
  %56 = load i32, ptr %55, align 4, !tbaa !11
  %57 = sub nsw i32 %52, %56
  call void @_Z7update2i(i32 noundef %57)
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = icmp slt i32 %.143, %58
  br i1 %59, label %.lr.ph39, label %.critedge2

.lr.ph39:                                         ; preds = %.lr.ph45, %63
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %63 ], [ %50, %.lr.ph45 ]
  %60 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv48) #7
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = icmp eq i32 %61, %52
  br i1 %62, label %63, label %.critedge2.loopexit

63:                                               ; preds = %.lr.ph39
  %64 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv48) #7
  %65 = getelementptr inbounds i8, ptr %64, i64 4
  %66 = load i32, ptr %65, align 4, !tbaa !14
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv48) #7
  %68 = getelementptr inbounds i8, ptr %67, i64 8
  %69 = load i32, ptr %68, align 4, !tbaa !15
  call void @_Z6updateiii(i32 noundef %66, i32 noundef %69, i32 noundef 0)
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv48) #7
  %71 = getelementptr inbounds i8, ptr %70, i64 4
  %72 = load i32, ptr %71, align 4, !tbaa !14
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [200 x %"class.std::vector.0"], ptr @g, i64 0, i64 %73
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %indvars.iv48) #7
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %74, ptr noundef nonnull align 4 dereferenceable(4) %76)
  %indvars.iv.next49 = add nsw i64 %indvars.iv48, 1
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next49, %78
  br i1 %79, label %.lr.ph39, label %.critedge2.loopexit, !llvm.loop !19

.critedge2.loopexit:                              ; preds = %63, %.lr.ph39
  %.2.lcssa.ph.in = phi i64 [ %indvars.iv48, %.lr.ph39 ], [ %indvars.iv.next49, %63 ]
  %.2.lcssa.ph = trunc i64 %.2.lcssa.ph.in to i32
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.lr.ph45
  %.2.lcssa = phi i32 [ %.143, %.lr.ph45 ], [ %.2.lcssa.ph, %.critedge2.loopexit ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %80 = call noundef i64 @_Z3bfsv()
  %81 = sext i32 %52 to i64
  %82 = add nsw i64 %80, %81
  store i64 %82, ptr %7, align 8, !tbaa !17
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %84 = load i64, ptr %83, align 8, !tbaa !17
  store i64 %84, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %85 = load i32, ptr @m, align 4, !tbaa !5
  %86 = icmp slt i32 %.2.lcssa, %85
  br i1 %86, label %.lr.ph45, label %._crit_edge46, !llvm.loop !20

._crit_edge46:                                    ; preds = %.critedge2, %44
  %87 = phi i64 [ %47, %44 ], [ %84, %.critedge2 ]
  %88 = load i64, ptr @inf, align 8, !tbaa !17
  %89 = icmp eq i64 %87, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %._crit_edge46
  %91 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %95

92:                                               ; preds = %._crit_edge46
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %87)
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %93, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %95

95:                                               ; preds = %90, %92, %.critedge.thread
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__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 #0

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) 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 #0 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 #0 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)) #6

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

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

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


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