; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/SHORT/COOK54/ANUAHR (test)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@removed = external dso_local global [100010 x i32], align 16
@cnt = external dso_local global i32, align 4
@p1 = external dso_local global { i64, { i64, i32 } }, align 8
@p2 = external dso_local global { i64, { i64, i32 } }, align 8
@v1 = external dso_local global %"class.std::vector", align 8
@v2 = external dso_local global %"class.std::vector", align 8
@l = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@_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 %"struct.std::pair.0", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca { i64, i32 }, align 8
  %6 = alloca %"struct.std::pair.0", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca { i64, i32 }, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %19

19:                                               ; preds = %197, %0
  %20 = load i32, ptr @t, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @t, align 4, !tbaa !5
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %211

23:                                               ; preds = %19
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @n, ptr noundef @m)
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @v1) #7
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @v2) #7
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %36, %23
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

30:                                               ; preds = %25
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @l, ptr noundef @b)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #7
  %32 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) @b, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store { i64, i32 } %32, ptr %5, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %5, i64 12, i1 false)
  call void @_ZSt9make_pairIRxSt4pairIxiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind writable sret(%"struct.std::pair.0") align 8 %3, ptr noundef nonnull align 8 dereferenceable(8) @l, ptr noundef nonnull align 8 dereferenceable(12) %4)
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIxS_IxiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @p1, ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %34 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) @l, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store { i64, i32 } %34, ptr %8, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %8, i64 12, i1 false)
  call void @_ZSt9make_pairIRxSt4pairIxiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind writable sret(%"struct.std::pair.0") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) @b, ptr noundef nonnull align 8 dereferenceable(12) %7)
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIxS_IxiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @p2, ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) @v1, ptr noundef nonnull align 8 dereferenceable(24) @p1)
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) @v2, ptr noundef nonnull align 8 dereferenceable(24) @p2)
  br label %36

36:                                               ; preds = %30
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !9

39:                                               ; preds = %29
  %40 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v1) #7
  %41 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  %42 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v1) #7
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IxiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %45, ptr %47)
  %48 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v2) #7
  %49 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  %50 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v2) #7
  %51 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IxiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %53, ptr %55)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %65, %39
  %57 = load i32, ptr %13, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %68

61:                                               ; preds = %56
  %62 = load i32, ptr %13, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %63
  store i32 0, ptr %64, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %61
  %66 = load i32, ptr %13, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %13, align 4, !tbaa !5
  br label %56, !llvm.loop !11

68:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %196, %127, %110, %96, %68
  %70 = load i32, ptr %14, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 1
  %73 = icmp ne i32 %70, %72
  br i1 %73, label %74, label %83

74:                                               ; preds = %69
  %75 = load i32, ptr %15, align 4, !tbaa !5
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = icmp ne i32 %75, %77
  br i1 %78, label %79, label %83

79:                                               ; preds = %74
  %80 = load i32, ptr @cnt, align 4, !tbaa !5
  %81 = load i32, ptr @m, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br label %83

83:                                               ; preds = %79, %74, %69
  %84 = phi i1 [ false, %74 ], [ false, %69 ], [ %82, %79 ]
  br i1 %84, label %85, label %197

85:                                               ; preds = %83
  %86 = load i32, ptr %14, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %87) #7
  %89 = getelementptr inbounds %"struct.std::pair.0", ptr %88, i32 0, i32 1
  %90 = getelementptr inbounds %"struct.std::pair", ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !12
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %99

96:                                               ; preds = %85
  %97 = load i32, ptr %14, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %14, align 4, !tbaa !5
  br label %69, !llvm.loop !16

99:                                               ; preds = %85
  %100 = load i32, ptr %15, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %101) #7
  %103 = getelementptr inbounds %"struct.std::pair.0", ptr %102, i32 0, i32 1
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 8, !tbaa !12
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp eq i32 %108, 1
  br i1 %109, label %110, label %113

110:                                              ; preds = %99
  %111 = load i32, ptr %15, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %15, align 4, !tbaa !5
  br label %69, !llvm.loop !16

113:                                              ; preds = %99
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %115) #7
  %117 = getelementptr inbounds %"struct.std::pair.0", ptr %116, i32 0, i32 1
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 8, !tbaa !12
  %120 = load i32, ptr %15, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %121) #7
  %123 = getelementptr inbounds %"struct.std::pair.0", ptr %122, i32 0, i32 1
  %124 = getelementptr inbounds %"struct.std::pair", ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 8, !tbaa !12
  %126 = icmp eq i32 %119, %125
  br i1 %126, label %127, label %142

127:                                              ; preds = %113
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %129) #7
  %131 = getelementptr inbounds %"struct.std::pair.0", ptr %130, i32 0, i32 1
  %132 = getelementptr inbounds %"struct.std::pair", ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 8, !tbaa !12
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %134
  store i32 1, ptr %135, align 4, !tbaa !5
  %136 = load i32, ptr @cnt, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr @cnt, align 4, !tbaa !5
  %138 = load i32, ptr %14, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %14, align 4, !tbaa !5
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %15, align 4, !tbaa !5
  br label %69, !llvm.loop !16

142:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %144) #7
  %146 = getelementptr inbounds %"struct.std::pair.0", ptr %145, i32 0, i32 0
  %147 = load i64, ptr %146, align 8, !tbaa !17
  %148 = load i32, ptr %15, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %150) #7
  %152 = getelementptr inbounds %"struct.std::pair.0", ptr %151, i32 0, i32 0
  %153 = load i64, ptr %152, align 8, !tbaa !17
  %154 = mul nsw i64 %147, %153
  store i64 %154, ptr %16, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %155 = load i32, ptr %15, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %156) #7
  %158 = getelementptr inbounds %"struct.std::pair.0", ptr %157, i32 0, i32 0
  %159 = load i64, ptr %158, align 8, !tbaa !17
  %160 = load i32, ptr %14, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  %162 = sext i32 %161 to i64
  %163 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %162) #7
  %164 = getelementptr inbounds %"struct.std::pair.0", ptr %163, i32 0, i32 0
  %165 = load i64, ptr %164, align 8, !tbaa !17
  %166 = mul nsw i64 %159, %165
  store i64 %166, ptr %17, align 8, !tbaa !18
  %167 = load i64, ptr %16, align 8, !tbaa !18
  %168 = load i64, ptr %17, align 8, !tbaa !18
  %169 = icmp sgt i64 %167, %168
  br i1 %169, label %170, label %183

170:                                              ; preds = %142
  %171 = load i32, ptr %15, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %172) #7
  %174 = getelementptr inbounds %"struct.std::pair.0", ptr %173, i32 0, i32 1
  %175 = getelementptr inbounds %"struct.std::pair", ptr %174, i32 0, i32 1
  %176 = load i32, ptr %175, align 8, !tbaa !12
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %177
  store i32 1, ptr %178, align 4, !tbaa !5
  %179 = load i32, ptr %15, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %15, align 4, !tbaa !5
  %181 = load i32, ptr @cnt, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr @cnt, align 4, !tbaa !5
  br label %196

183:                                              ; preds = %142
  %184 = load i32, ptr %14, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %185) #7
  %187 = getelementptr inbounds %"struct.std::pair.0", ptr %186, i32 0, i32 1
  %188 = getelementptr inbounds %"struct.std::pair", ptr %187, i32 0, i32 1
  %189 = load i32, ptr %188, align 8, !tbaa !12
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %190
  store i32 1, ptr %191, align 4, !tbaa !5
  %192 = load i32, ptr %14, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %14, align 4, !tbaa !5
  %194 = load i32, ptr @cnt, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr @cnt, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %183, %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %69, !llvm.loop !16

197:                                              ; preds = %83
  %198 = load i32, ptr %14, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %199) #7
  %201 = getelementptr inbounds %"struct.std::pair.0", ptr %200, i32 0, i32 0
  %202 = load i64, ptr %201, align 8, !tbaa !17
  %203 = load i32, ptr %15, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %204) #7
  %206 = getelementptr inbounds %"struct.std::pair.0", ptr %205, i32 0, i32 0
  %207 = load i64, ptr %206, align 8, !tbaa !17
  %208 = mul nsw i64 %202, %207
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %208)
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %209, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %19, !llvm.loop !19

211:                                              ; preds = %19
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRxSt4pairIxiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.0") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(12)) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIxS_IxiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #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: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!11, !10}
!12 = !{!13, !6, i64 16}
!13 = !{!"_ZTSSt4pairIxS_IxiEE", !14, i64 0, !15, i64 8}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"_ZTSSt4pairIxiE", !14, i64 0, !6, i64 8}
!16 = distinct !{!16, !10}
!17 = !{!13, !14, i64 0}
!18 = !{!14, !14, i64 0}
!19 = distinct !{!19, !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<long long, std::pair<long long, int>>, std::allocator<std::pair<long long, std::pair<long long, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<long long, int>>, std::allocator<std::pair<long long, std::pair<long long, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, std::pair<long long, int>>, std::allocator<std::pair<long long, std::pair<long long, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, std::pair<long long, int>>, std::allocator<std::pair<long long, std::pair<long long, 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.0" = type { i64, %"struct.std::pair" }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@removed = external dso_local local_unnamed_addr global [100010 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@p1 = external dso_local global { i64, { i64, i32 } }, align 8
@p2 = external dso_local global { i64, { i64, i32 } }, align 8
@v1 = external dso_local global %"class.std::vector", align 8
@v2 = external dso_local global %"class.std::vector", align 8
@l = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@_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 %"struct.std::pair.0", align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %7 = load i32, ptr @t, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr @t, align 4, !tbaa !5
  %.not62 = icmp eq i32 %7, 0
  br i1 %.not62, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %0
  %.sroa.233.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  br label %9

9:                                                ; preds = %.lr.ph64, %.critedge
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m)
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @v1) #7
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @v2) #7
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %13 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v1) #7
  %14 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v1) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IxiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %13, ptr %14)
  %15 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v2) #7
  %16 = call ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v2) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxS2_IxiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %15, ptr %16)
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.preheader, label %.lr.ph49.preheader

.lr.ph:                                           ; preds = %9, %.lr.ph
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @l, ptr noundef nonnull @b)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %20 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) @b, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract30 = extractvalue { i64, i32 } %20, 0
  %.fca.1.extract31 = extractvalue { i64, i32 } %20, 1
  store i64 %.fca.0.extract30, ptr %3, align 8
  store i32 %.fca.1.extract31, ptr %.sroa.233.0..sroa_idx, align 8
  call void @_ZSt9make_pairIRxSt4pairIxiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.0") align 8 %2, ptr noundef nonnull align 8 dereferenceable(8) @l, ptr noundef nonnull align 8 dereferenceable(12) %3)
  %21 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIxS_IxiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @p1, ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %22 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) @l, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract = extractvalue { i64, i32 } %22, 0
  %.fca.1.extract = extractvalue { i64, i32 } %22, 1
  store i64 %.fca.0.extract, ptr %5, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZSt9make_pairIRxSt4pairIxiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.0") align 8 %4, ptr noundef nonnull align 8 dereferenceable(8) @b, ptr noundef nonnull align 8 dereferenceable(12) %5)
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIxS_IxiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @p2, ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) @v1, ptr noundef nonnull align 8 dereferenceable(24) @p1)
  call void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) @v2, ptr noundef nonnull align 8 dereferenceable(24) @p2)
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %1, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %._crit_edge
  %28 = zext nneg i32 %17 to i64
  %29 = shl nuw nsw i64 %28, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @removed, i8 0, i64 %29, i1 false), !tbaa !5
  %.not394657 = icmp eq i32 %17, 1
  br i1 %.not394657, label %.critedge, label %.lr.ph49.preheader

.lr.ph49.preheader:                               ; preds = %._crit_edge, %.preheader
  br label %.lr.ph49

30:                                               ; preds = %.lr.ph49, %42
  %indvars.iv = phi i64 [ %59, %.lr.ph49 ], [ %indvars.iv.next, %42 ]
  %31 = load i32, ptr @cnt, align 4, !tbaa !5
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %.critedge.loopexit.split.loop.exit76

34:                                               ; preds = %30
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %indvars.iv) #7
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %45

42:                                               ; preds = %34
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %indvars = trunc i64 %indvars.iv.next to i32
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = add nsw i32 %43, -1
  %.not38 = icmp eq i32 %44, %indvars
  %.not39 = icmp eq i32 %.035.ph58, %44
  %or.cond = select i1 %.not38, i1 true, i1 %.not39
  br i1 %or.cond, label %.critedge, label %30, !llvm.loop !15

45:                                               ; preds = %34
  %46 = trunc nsw i64 %indvars.iv to i32
  %47 = sext i32 %.035.ph58 to i64
  %48 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %47) #7
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load i32, ptr %49, align 8, !tbaa !11
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp eq i32 %53, 1
  br i1 %54, label %55, label %60

55:                                               ; preds = %45
  %56 = add nsw i32 %.035.ph58, 1
  br label %.outer.backedge

.outer.backedge:                                  ; preds = %55, %70, %96
  %.035.ph.be = phi i32 [ %.136, %96 ], [ %77, %70 ], [ %56, %55 ]
  %.034.ph.be = phi i32 [ %.1, %96 ], [ %69, %70 ], [ %46, %55 ]
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  %.not3845 = icmp eq i32 %.034.ph.be, %58
  %.not3946 = icmp eq i32 %.035.ph.be, %58
  %or.cond47 = select i1 %.not3845, i1 true, i1 %.not3946
  br i1 %or.cond47, label %.critedge, label %.lr.ph49, !llvm.loop !15

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.outer.backedge
  %.034.ph59 = phi i32 [ %.034.ph.be, %.outer.backedge ], [ 0, %.lr.ph49.preheader ]
  %.035.ph58 = phi i32 [ %.035.ph.be, %.outer.backedge ], [ 0, %.lr.ph49.preheader ]
  %59 = sext i32 %.034.ph59 to i64
  br label %30

60:                                               ; preds = %45
  %61 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %indvars.iv) #7
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %63 = load i32, ptr %62, align 8, !tbaa !11
  %64 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %47) #7
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %66 = load i32, ptr %65, align 8, !tbaa !11
  %67 = icmp eq i32 %63, %66
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %indvars.iv) #7
  %69 = add nsw i32 %46, 1
  br i1 %67, label %70, label %78

70:                                               ; preds = %60
  %71 = getelementptr inbounds i8, ptr %68, i64 16
  %72 = load i32, ptr %71, align 8, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %73
  store i32 1, ptr %74, align 4, !tbaa !5
  %75 = load i32, ptr @cnt, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @cnt, align 4, !tbaa !5
  %77 = add nsw i32 %.035.ph58, 1
  br label %.outer.backedge

78:                                               ; preds = %60
  %79 = load i64, ptr %68, align 8, !tbaa !16
  %80 = add nsw i32 %.035.ph58, 1
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %81) #7
  %83 = load i64, ptr %82, align 8, !tbaa !16
  %84 = mul nsw i64 %83, %79
  %85 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %47) #7
  %86 = load i64, ptr %85, align 8, !tbaa !16
  %87 = sext i32 %69 to i64
  %88 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %87) #7
  %89 = load i64, ptr %88, align 8, !tbaa !16
  %90 = mul nsw i64 %89, %86
  %91 = icmp sgt i64 %84, %90
  br i1 %91, label %92, label %94

92:                                               ; preds = %78
  %93 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %47) #7
  br label %96

94:                                               ; preds = %78
  %95 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %indvars.iv) #7
  br label %96

96:                                               ; preds = %94, %92
  %.sink = phi ptr [ %95, %94 ], [ %93, %92 ]
  %.136 = phi i32 [ %.035.ph58, %94 ], [ %80, %92 ]
  %.1 = phi i32 [ %69, %94 ], [ %46, %92 ]
  %97 = getelementptr inbounds i8, ptr %.sink, i64 16
  %98 = load i32, ptr %97, align 8, !tbaa !11
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100010 x i32], ptr @removed, i64 0, i64 %99
  store i32 1, ptr %100, align 4, !tbaa !5
  %storemerge40.in = load i32, ptr @cnt, align 4, !tbaa !5
  %storemerge40 = add nsw i32 %storemerge40.in, 1
  store i32 %storemerge40, ptr @cnt, align 4, !tbaa !5
  br label %.outer.backedge

.critedge.loopexit.split.loop.exit76:             ; preds = %30
  %101 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %.outer.backedge, %42, %.critedge.loopexit.split.loop.exit76, %.preheader
  %.035.ph.lcssa = phi i32 [ 0, %.preheader ], [ %.035.ph58, %.critedge.loopexit.split.loop.exit76 ], [ %.035.ph58, %42 ], [ %.035.ph.be, %.outer.backedge ]
  %.034.lcssa = phi i32 [ 0, %.preheader ], [ %101, %.critedge.loopexit.split.loop.exit76 ], [ %indvars, %42 ], [ %.034.ph.be, %.outer.backedge ]
  %102 = sext i32 %.034.lcssa to i64
  %103 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v1, i64 noundef %102) #7
  %104 = load i64, ptr %103, align 8, !tbaa !16
  %105 = sext i32 %.035.ph.lcssa to i64
  %106 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v2, i64 noundef %105) #7
  %107 = load i64, ptr %106, align 8, !tbaa !16
  %108 = mul nsw i64 %107, %104
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %111 = load i32, ptr @t, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %111, 0
  br i1 %.not, label %._crit_edge65, label %9, !llvm.loop !17

._crit_edge65:                                    ; preds = %.critedge, %0
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) 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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRxSt4pairIxiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.0") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIxS_IxiEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_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 uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_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 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxS0_IxiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 16}
!12 = !{!"_ZTSSt4pairIxS_IxiEE", !13, i64 0, !14, i64 8}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_ZTSSt4pairIxiE", !13, i64 0, !6, i64 8}
!15 = distinct !{!15, !10}
!16 = !{!12, !13, i64 0}
!17 = distinct !{!17, !10}


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