; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Random/Starfleet (A)

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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"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.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = 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 }
%"struct.std::pair.14" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.12" }
%"struct.std::pair.12" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.18" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator" }
%"struct.std::pair.16" = type { i32, i32 }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@yu = external dso_local global i32, align 4
@yd = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@fr = external dso_local global i32, align 4
@cnt1 = external dso_local global i32, align 4
@cnt2 = external dso_local global i32, align 4
@cy = external dso_local global %"class.std::set", align 8
@cf = external dso_local global %"class.std::set", align 8
@fy = external dso_local global %"class.std::map", align 8
@ff = external dso_local global %"class.std::map", align 8
@qr = external dso_local global %"class.std::vector", align 8
@fighters = external dso_local global %"class.std::vector", align 8
@f = external dso_local global [200100 x %"class.std::vector.7"], align 16
@root = external dso_local global i32, align 4
@counter = external dso_local global [200100 x i32], align 16
@res = external dso_local global [35000 x i32], align 16
@gett = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4compSt4pairIiS_IiiEES1_(i64, i32, i64, i32) #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) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addi(i32 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6removei(i32 noundef) #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 %"struct.std::pair.14", align 8
  %4 = alloca %"struct.std::pair.14", align 8
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca %"struct.std::pair.12", align 4
  %7 = alloca { i64, i32 }, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca %"struct.std::pair.12", align 4
  %13 = alloca { i64, i32 }, align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %26 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %27 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator.18", align 8
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %31 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %32 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca %"class.std::reverse_iterator", align 8
  %40 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @q, ptr noundef @v)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %61, %0
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

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

47:                                               ; preds = %42
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @x, ptr noundef @y, ptr noundef @fr)
  %49 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @cy, ptr noundef nonnull align 4 dereferenceable(4) @y)
  %50 = getelementptr inbounds { ptr, i8 }, ptr %3, i32 0, i32 0
  %51 = extractvalue { ptr, i8 } %49, 0
  store ptr %51, ptr %50, align 8
  %52 = getelementptr inbounds { ptr, i8 }, ptr %3, i32 0, i32 1
  %53 = extractvalue { ptr, i8 } %49, 1
  store i8 %53, ptr %52, align 8
  %54 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @cf, ptr noundef nonnull align 4 dereferenceable(4) @fr)
  %55 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 0
  %56 = extractvalue { ptr, i8 } %54, 0
  store ptr %56, ptr %55, align 8
  %57 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 1
  %58 = extractvalue { ptr, i8 } %54, 1
  store i8 %58, ptr %57, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %59 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @y, ptr noundef nonnull align 4 dereferenceable(4) @fr)
  store i64 %59, ptr %6, align 4
  %60 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) @x, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store { i64, i32 } %60, ptr %7, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 8 %7, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @fighters, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #8
  br label %61

61:                                               ; preds = %47
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %42, !llvm.loop !9

64:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1000000000, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 -1000000000, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %74, %64
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = load i32, ptr @q, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %77

70:                                               ; preds = %65
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @yu, ptr noundef @yd, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %72 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @yu, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i64 %72, ptr %12, align 4
  %73 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) @yd, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store { i64, i32 } %73, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 8 %13, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @qr, ptr noundef nonnull align 4 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #8
  br label %74

74:                                               ; preds = %70
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %10, align 4, !tbaa !5
  br label %65, !llvm.loop !11

77:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %78 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @cy) #8
  %79 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %78, ptr %79, align 8
  br label %80

80:                                               ; preds = %90, %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %81 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cy) #8
  %82 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %81, ptr %82, align 8
  %83 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %93

85:                                               ; preds = %80
  %86 = load i32, ptr @cnt1, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr @cnt1, align 4, !tbaa !5
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %88)
  store i32 %86, ptr %89, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %85
  %91 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #8
  %92 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %91, ptr %92, align 8
  br label %80, !llvm.loop !12

93:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %94 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @cf) #8
  %95 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %17, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  br label %96

96:                                               ; preds = %106, %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %97 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cf) #8
  %98 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  %99 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %109

101:                                              ; preds = %96
  %102 = load i32, ptr @cnt2, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr @cnt2, align 4, !tbaa !5
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ff, ptr noundef nonnull align 4 dereferenceable(4) %104)
  store i32 %102, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %101
  %107 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef 0) #8
  %108 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %107, ptr %108, align 8
  br label %96, !llvm.loop !13

109:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %163, %109
  %111 = load i32, ptr %20, align 4, !tbaa !5
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %115, label %114

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

115:                                              ; preds = %110
  %116 = load i32, ptr %20, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %117) #8
  %119 = getelementptr inbounds %"struct.std::pair", ptr %118, i32 0, i32 1
  %120 = getelementptr inbounds %"struct.std::pair.12", ptr %119, i32 0, i32 0
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %120)
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %20, 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) @fighters, i64 noundef %124) #8
  %126 = getelementptr inbounds %"struct.std::pair", ptr %125, i32 0, i32 1
  %127 = getelementptr inbounds %"struct.std::pair.12", ptr %126, i32 0, i32 0
  store i32 %122, ptr %127, align 4, !tbaa !14
  %128 = load i32, ptr %20, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %129) #8
  %131 = getelementptr inbounds %"struct.std::pair", ptr %130, i32 0, i32 1
  %132 = getelementptr inbounds %"struct.std::pair.12", ptr %131, i32 0, i32 1
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ff, ptr noundef nonnull align 4 dereferenceable(4) %132)
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = load i32, ptr %20, 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) @fighters, i64 noundef %136) #8
  %138 = getelementptr inbounds %"struct.std::pair", ptr %137, i32 0, i32 1
  %139 = getelementptr inbounds %"struct.std::pair.12", ptr %138, i32 0, i32 1
  store i32 %134, ptr %139, align 4, !tbaa !17
  %140 = load i32, ptr %20, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %141) #8
  %143 = getelementptr inbounds %"struct.std::pair", ptr %142, i32 0, i32 1
  %144 = getelementptr inbounds %"struct.std::pair.12", ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 4, !tbaa !17
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [200100 x i32], ptr @counter, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %147, align 4, !tbaa !5
  %150 = load i32, ptr %20, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %151) #8
  %153 = getelementptr inbounds %"struct.std::pair", ptr %152, i32 0, i32 1
  %154 = getelementptr inbounds %"struct.std::pair.12", ptr %153, i32 0, i32 0
  %155 = load i32, ptr %154, align 4, !tbaa !14
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [200100 x %"class.std::vector.7"], ptr @f, i64 0, i64 %156
  %158 = load i32, ptr %20, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %159) #8
  %161 = getelementptr inbounds %"struct.std::pair", ptr %160, i32 0, i32 1
  %162 = getelementptr inbounds %"struct.std::pair.12", ptr %161, i32 0, i32 1
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %157, ptr noundef nonnull align 4 dereferenceable(4) %162)
  br label %163

163:                                              ; preds = %115
  %164 = load i32, ptr %20, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %20, align 4, !tbaa !5
  br label %110, !llvm.loop !18

166:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  call void @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %167 = load i32, ptr @cnt1, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1000
  store i32 %168, ptr %22, align 4, !tbaa !5
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @cy) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @cf) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %216, %166
  %170 = load i32, ptr %23, align 4, !tbaa !5
  %171 = load i32, ptr @q, align 4, !tbaa !5
  %172 = icmp slt i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %219

174:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %175 = load i32, ptr %23, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %176) #8
  %178 = getelementptr inbounds %"struct.std::pair", ptr %177, i32 0, i32 0
  %179 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %178)
  %180 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %24, i32 0, i32 0
  store ptr %179, ptr %180, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %24, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %181 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @fy) #8
  %182 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  store ptr %181, ptr %182, align 8
  %183 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br i1 %183, label %184, label %190

184:                                              ; preds = %174
  %185 = load i32, ptr %22, align 4, !tbaa !5
  %186 = load i32, ptr %23, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %187) #8
  %189 = getelementptr inbounds %"struct.std::pair", ptr %188, i32 0, i32 0
  store i32 %185, ptr %189, align 4, !tbaa !22
  br label %198

190:                                              ; preds = %174
  %191 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  %192 = getelementptr inbounds %"struct.std::pair.16", ptr %191, i32 0, i32 1
  %193 = load i32, ptr %192, align 4, !tbaa !23
  %194 = load i32, ptr %23, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %195) #8
  %197 = getelementptr inbounds %"struct.std::pair", ptr %196, i32 0, i32 0
  store i32 %193, ptr %197, align 4, !tbaa !22
  br label %198

198:                                              ; preds = %190, %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %199 = load i32, ptr %23, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %200) #8
  %202 = getelementptr inbounds %"struct.std::pair", ptr %201, i32 0, i32 1
  %203 = getelementptr inbounds %"struct.std::pair.12", ptr %202, i32 0, i32 0
  %204 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11upper_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %203)
  %205 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %26, i32 0, i32 0
  store ptr %204, ptr %205, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %26, i64 8, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  %206 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 0) #8
  %207 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %27, i32 0, i32 0
  store ptr %206, ptr %207, align 8
  %208 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %21) #8
  %209 = getelementptr inbounds %"struct.std::pair.16", ptr %208, i32 0, i32 1
  %210 = load i32, ptr %209, align 4, !tbaa !23
  %211 = load i32, ptr %23, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %212) #8
  %214 = getelementptr inbounds %"struct.std::pair", ptr %213, i32 0, i32 1
  %215 = getelementptr inbounds %"struct.std::pair.12", ptr %214, i32 0, i32 0
  store i32 %210, ptr %215, align 4, !tbaa !14
  br label %216

216:                                              ; preds = %198
  %217 = load i32, ptr %23, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %23, align 4, !tbaa !5
  br label %169, !llvm.loop !25

219:                                              ; preds = %173
  %220 = load i32, ptr @cnt1, align 4, !tbaa !5
  %221 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %220)
  %222 = fptosi double %221 to i32
  store i32 %222, ptr @root, align 4, !tbaa !5
  %223 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @qr) #8
  %224 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %28, i32 0, i32 0
  store ptr %223, ptr %224, align 8
  %225 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @qr) #8
  %226 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %29, i32 0, i32 0
  store ptr %225, ptr %226, align 8
  %227 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %28, i32 0, i32 0
  %228 = load ptr, ptr %227, align 8
  %229 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.18", ptr %29, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %228, ptr %230, ptr noundef @_Z4compSt4pairIiS_IiiEES1_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %231 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @ff) #8
  %232 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  store ptr %231, ptr %232, align 8
  br label %233

233:                                              ; preds = %247, %219
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %234 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @ff) #8
  %235 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %31, i32 0, i32 0
  store ptr %234, ptr %235, align 8
  %236 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  br i1 %236, label %238, label %237

237:                                              ; preds = %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br label %250

238:                                              ; preds = %233
  %239 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #8
  %240 = getelementptr inbounds %"struct.std::pair.16", ptr %239, i32 0, i32 1
  %241 = load i32, ptr %240, align 4, !tbaa !23
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [200100 x i32], ptr @counter, i64 0, i64 %242
  %244 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @gett, ptr noundef nonnull align 4 dereferenceable(4) %243)
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %244, align 4, !tbaa !5
  br label %247

247:                                              ; preds = %238
  %248 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %30, i32 noundef 0) #8
  %249 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %32, i32 0, i32 0
  store ptr %248, ptr %249, align 8
  br label %233, !llvm.loop !26

250:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  store i32 0, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #8
  %251 = load i32, ptr @cnt1, align 4, !tbaa !5
  %252 = sub nsw i32 %251, 1
  store i32 %252, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #8
  store i32 0, ptr %35, align 4, !tbaa !5
  br label %253

253:                                              ; preds = %329, %250
  %254 = load i32, ptr %35, align 4, !tbaa !5
  %255 = load i32, ptr @q, align 4, !tbaa !5
  %256 = icmp slt i32 %254, %255
  br i1 %256, label %258, label %257

257:                                              ; preds = %253
  store i32 23, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #8
  br label %332

258:                                              ; preds = %253
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #8
  %259 = load i32, ptr %35, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %260) #8
  %262 = getelementptr inbounds %"struct.std::pair", ptr %261, i32 0, i32 0
  %263 = load i32, ptr %262, align 4, !tbaa !22
  store i32 %263, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  %264 = load i32, ptr %35, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %265) #8
  %267 = getelementptr inbounds %"struct.std::pair", ptr %266, i32 0, i32 1
  %268 = getelementptr inbounds %"struct.std::pair.12", ptr %267, i32 0, i32 0
  %269 = load i32, ptr %268, align 4, !tbaa !14
  store i32 %269, ptr %38, align 4, !tbaa !5
  %270 = load i32, ptr %37, align 4, !tbaa !5
  %271 = load i32, ptr %38, align 4, !tbaa !5
  %272 = icmp sgt i32 %270, %271
  br i1 %272, label %273, label %282

273:                                              ; preds = %258
  %274 = load i32, ptr %35, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %275) #8
  %277 = getelementptr inbounds %"struct.std::pair", ptr %276, i32 0, i32 1
  %278 = getelementptr inbounds %"struct.std::pair.12", ptr %277, i32 0, i32 1
  %279 = load i32, ptr %278, align 4, !tbaa !17
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [35000 x i32], ptr @res, i64 0, i64 %280
  store i32 0, ptr %281, align 4, !tbaa !5
  store i32 25, ptr %36, align 4
  br label %326

282:                                              ; preds = %258
  br label %283

283:                                              ; preds = %287, %282
  %284 = load i32, ptr %33, align 4, !tbaa !5
  %285 = load i32, ptr %37, align 4, !tbaa !5
  %286 = icmp slt i32 %284, %285
  br i1 %286, label %287, label %290

287:                                              ; preds = %283
  %288 = load i32, ptr %33, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr %33, align 4, !tbaa !5
  call void @_Z6removei(i32 noundef %288)
  br label %283, !llvm.loop !27

290:                                              ; preds = %283
  br label %291

291:                                              ; preds = %295, %290
  %292 = load i32, ptr %33, align 4, !tbaa !5
  %293 = load i32, ptr %37, align 4, !tbaa !5
  %294 = icmp sgt i32 %292, %293
  br i1 %294, label %295, label %298

295:                                              ; preds = %291
  %296 = load i32, ptr %33, align 4, !tbaa !5
  %297 = add nsw i32 %296, -1
  store i32 %297, ptr %33, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %297)
  br label %291, !llvm.loop !28

298:                                              ; preds = %291
  br label %299

299:                                              ; preds = %303, %298
  %300 = load i32, ptr %34, align 4, !tbaa !5
  %301 = load i32, ptr %38, align 4, !tbaa !5
  %302 = icmp slt i32 %300, %301
  br i1 %302, label %303, label %306

303:                                              ; preds = %299
  %304 = load i32, ptr %34, align 4, !tbaa !5
  %305 = add nsw i32 %304, 1
  store i32 %305, ptr %34, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %305)
  br label %299, !llvm.loop !29

306:                                              ; preds = %299
  br label %307

307:                                              ; preds = %311, %306
  %308 = load i32, ptr %34, align 4, !tbaa !5
  %309 = load i32, ptr %38, align 4, !tbaa !5
  %310 = icmp sgt i32 %308, %309
  br i1 %310, label %311, label %314

311:                                              ; preds = %307
  %312 = load i32, ptr %34, align 4, !tbaa !5
  %313 = add nsw i32 %312, -1
  store i32 %313, ptr %34, align 4, !tbaa !5
  call void @_Z6removei(i32 noundef %312)
  br label %307, !llvm.loop !30

314:                                              ; preds = %307
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE6rbeginEv(ptr dead_on_unwind writable sret(%"class.std::reverse_iterator") align 8 %39, ptr noundef nonnull align 8 dereferenceable(48) @gett) #8
  %315 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %39)
  %316 = getelementptr inbounds %"struct.std::pair.16", ptr %315, i32 0, i32 0
  %317 = load i32, ptr %316, align 4, !tbaa !31
  %318 = load i32, ptr %35, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %319) #8
  %321 = getelementptr inbounds %"struct.std::pair", ptr %320, i32 0, i32 1
  %322 = getelementptr inbounds %"struct.std::pair.12", ptr %321, i32 0, i32 1
  %323 = load i32, ptr %322, align 4, !tbaa !17
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [35000 x i32], ptr @res, i64 0, i64 %324
  store i32 %317, ptr %325, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  store i32 0, ptr %36, align 4
  br label %326

326:                                              ; preds = %314, %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #8
  %327 = load i32, ptr %36, align 4
  switch i32 %327, label %349 [
    i32 0, label %328
    i32 25, label %329
  ]

328:                                              ; preds = %326
  br label %329

329:                                              ; preds = %328, %326
  %330 = load i32, ptr %35, align 4, !tbaa !5
  %331 = add nsw i32 %330, 1
  store i32 %331, ptr %35, align 4, !tbaa !5
  br label %253, !llvm.loop !32

332:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #8
  store i32 0, ptr %40, align 4, !tbaa !5
  br label %333

333:                                              ; preds = %344, %332
  %334 = load i32, ptr %40, align 4, !tbaa !5
  %335 = load i32, ptr @q, align 4, !tbaa !5
  %336 = icmp slt i32 %334, %335
  br i1 %336, label %338, label %337

337:                                              ; preds = %333
  store i32 34, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #8
  br label %347

338:                                              ; preds = %333
  %339 = load i32, ptr %40, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [35000 x i32], ptr @res, i64 0, i64 %340
  %342 = load i32, ptr %341, align 4, !tbaa !5
  %343 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %342)
  br label %344

344:                                              ; preds = %338
  %345 = load i32, ptr %40, align 4, !tbaa !5
  %346 = add nsw i32 %345, 1
  store i32 %346, ptr %40, align 4, !tbaa !5
  br label %333, !llvm.loop !33

347:                                              ; preds = %337
  store i32 0, ptr %1, align 4
  store i32 1, ptr %36, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  %348 = load i32, ptr %1, align 4
  ret i32 %348

349:                                              ; preds = %326
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0 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) #0 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)) #3 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #6

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

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

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !16, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!15, !6, i64 8}
!18 = distinct !{!18, !10}
!19 = !{i64 0, i64 8, !20}
!20 = !{!21, !21, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = !{!15, !6, i64 0}
!23 = !{!24, !6, i64 4}
!24 = !{!"_ZTSSt4pairIKiiE", !6, i64 0, !6, i64 4}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}
!31 = !{!24, !6, i64 0}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"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.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = 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 }
%"struct.std::pair" = type { i32, %"struct.std::pair.12" }
%"struct.std::pair.12" = type { i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::reverse_iterator" = type { %"struct.std::_Rb_tree_iterator" }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@yu = external dso_local global i32, align 4
@yd = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@fr = external dso_local global i32, align 4
@cnt1 = external dso_local local_unnamed_addr global i32, align 4
@cnt2 = external dso_local local_unnamed_addr global i32, align 4
@cy = external dso_local global %"class.std::set", align 8
@cf = external dso_local global %"class.std::set", align 8
@fy = external dso_local global %"class.std::map", align 8
@ff = external dso_local global %"class.std::map", align 8
@qr = external dso_local global %"class.std::vector", align 8
@fighters = external dso_local global %"class.std::vector", align 8
@f = external dso_local global [200100 x %"class.std::vector.7"], align 16
@root = external dso_local local_unnamed_addr global i32, align 4
@counter = external dso_local global [200100 x i32], align 16
@res = external dso_local local_unnamed_addr global [35000 x i32], align 16
@gett = external dso_local global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4compSt4pairIiS_IiiEES1_(i64, i32, i64, i32) #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 uwtable
declare dso_local void @_Z3addi(i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca %"struct.std::pair.12", align 8
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.12", align 8
  %6 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"class.std::reverse_iterator", align 8
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @q, ptr noundef nonnull @v)
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %.sroa.251.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  br label %20

._crit_edge:                                      ; preds = %20, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr @q, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph73, label %._crit_edge74

.lr.ph73:                                         ; preds = %._crit_edge
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %32

20:                                               ; preds = %.lr.ph, %20
  %.05871 = phi i32 [ 0, %.lr.ph ], [ %26, %20 ]
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @fr)
  %22 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @cy, ptr noundef nonnull align 4 dereferenceable(4) @y)
  %23 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) @cf, ptr noundef nonnull align 4 dereferenceable(4) @fr)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %24 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @y, ptr noundef nonnull align 4 dereferenceable(4) @fr)
  store i64 %24, ptr %2, align 8
  %25 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) @x, ptr noundef nonnull align 4 dereferenceable(8) %2)
  %.fca.0.extract48 = extractvalue { i64, i32 } %25, 0
  %.fca.1.extract49 = extractvalue { i64, i32 } %25, 1
  store i64 %.fca.0.extract48, ptr %1, align 8
  store i32 %.fca.1.extract49, ptr %.sroa.251.0..sroa_idx, align 8
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @fighters, ptr noundef nonnull align 4 dereferenceable(12) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #7
  %26 = add nuw nsw i32 %.05871, 1
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %20, label %._crit_edge, !llvm.loop !9

._crit_edge74:                                    ; preds = %32, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %29 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @cy) #7
  store ptr %29, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %30 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cy) #7
  store ptr %30, ptr %7, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %31, label %.lr.ph76, label %._crit_edge77

32:                                               ; preds = %.lr.ph73, %32
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @yu, ptr noundef nonnull @yd, ptr noundef nonnull @t)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %34 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @yu, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %34, ptr %5, align 8
  %35 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) @yd, ptr noundef nonnull align 4 dereferenceable(8) %5)
  %.fca.0.extract = extractvalue { i64, i32 } %35, 0
  %.fca.1.extract = extractvalue { i64, i32 } %35, 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) @qr, 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
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @q, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %32, label %._crit_edge74, !llvm.loop !11

._crit_edge77:                                    ; preds = %.lr.ph76, %._crit_edge74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %40 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @cf) #7
  store ptr %40, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %41 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cf) #7
  store ptr %41, ptr %9, align 8
  %42 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br i1 %42, label %.lr.ph79, label %._crit_edge80

.lr.ph76:                                         ; preds = %._crit_edge74, %.lr.ph76
  %43 = load i32, ptr @cnt1, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr @cnt1, align 4, !tbaa !5
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %45)
  store i32 %43, ptr %46, align 4, !tbaa !5
  %47 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %48 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cy) #7
  store ptr %48, ptr %7, align 8
  %49 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br i1 %49, label %.lr.ph76, label %._crit_edge77, !llvm.loop !12

._crit_edge80:                                    ; preds = %.lr.ph79, %._crit_edge77
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph83, label %._crit_edge84

.lr.ph79:                                         ; preds = %._crit_edge77, %.lr.ph79
  %52 = load i32, ptr @cnt2, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @cnt2, align 4, !tbaa !5
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ff, ptr noundef nonnull align 4 dereferenceable(4) %54)
  store i32 %52, ptr %55, align 4, !tbaa !5
  %56 = call ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %57 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @cf) #7
  store ptr %57, ptr %9, align 8
  %58 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br i1 %58, label %.lr.ph79, label %._crit_edge80, !llvm.loop !13

._crit_edge84:                                    ; preds = %.lr.ph83, %._crit_edge80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %59 = load i32, ptr @cnt1, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1000
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @cy) #7
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @cf) #7
  %61 = load i32, ptr @q, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.lr.ph87, label %._crit_edge88

.lr.ph83:                                         ; preds = %._crit_edge80, %.lr.ph83
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph83 ], [ 0, %._crit_edge80 ]
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %indvars.iv) #7
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %64)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %indvars.iv) #7
  %68 = getelementptr inbounds i8, ptr %67, i64 4
  store i32 %66, ptr %68, align 4, !tbaa !14
  %69 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %indvars.iv) #7
  %70 = getelementptr inbounds i8, ptr %69, i64 8
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ff, ptr noundef nonnull align 4 dereferenceable(4) %70)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %indvars.iv) #7
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  store i32 %72, ptr %74, align 4, !tbaa !17
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %indvars.iv) #7
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = load i32, ptr %76, align 4, !tbaa !17
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200100 x i32], ptr @counter, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %79, align 4, !tbaa !5
  %82 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %indvars.iv) #7
  %83 = getelementptr inbounds i8, ptr %82, i64 4
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [200100 x %"class.std::vector.7"], ptr @f, i64 0, i64 %85
  %87 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @fighters, i64 noundef %indvars.iv) #7
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %86, ptr noundef nonnull align 4 dereferenceable(4) %88)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %indvars.iv.next, %90
  br i1 %91, label %.lr.ph83, label %._crit_edge84, !llvm.loop !18

._crit_edge88:                                    ; preds = %108, %._crit_edge84
  %92 = load i32, ptr @cnt1, align 4, !tbaa !5
  %93 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %92)
  %94 = fptosi double %93 to i32
  store i32 %94, ptr @root, align 4, !tbaa !5
  %95 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @qr) #7
  %96 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @qr) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %95, ptr %96, ptr noundef nonnull @_Z4compSt4pairIiS_IiiEES1_)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %97 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @ff) #7
  store ptr %97, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %98 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @ff) #7
  store ptr %98, ptr %13, align 8
  %99 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br i1 %99, label %.lr.ph90, label %._crit_edge91

.lr.ph87:                                         ; preds = %._crit_edge84, %108
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %108 ], [ 0, %._crit_edge84 ]
  %100 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv116) #7
  %101 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11lower_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %100)
  store ptr %101, ptr %10, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %102 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @fy) #7
  store ptr %102, ptr %11, align 8
  %103 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br i1 %103, label %108, label %104

104:                                              ; preds = %.lr.ph87
  %105 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %106 = getelementptr inbounds i8, ptr %105, i64 4
  %107 = load i32, ptr %106, align 4, !tbaa !21
  br label %108

108:                                              ; preds = %.lr.ph87, %104
  %.sink = phi i32 [ %107, %104 ], [ %60, %.lr.ph87 ]
  %109 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv116) #7
  store i32 %.sink, ptr %109, align 4, !tbaa !23
  %110 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv116) #7
  %111 = getelementptr inbounds i8, ptr %110, i64 4
  %112 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE11upper_boundERS3_(ptr noundef nonnull align 8 dereferenceable(48) @fy, ptr noundef nonnull align 4 dereferenceable(4) %111)
  store ptr %112, ptr %10, align 8, !tbaa !19
  %113 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #7
  %114 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %115 = getelementptr inbounds i8, ptr %114, i64 4
  %116 = load i32, ptr %115, align 4, !tbaa !21
  %117 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv116) #7
  %118 = getelementptr inbounds i8, ptr %117, i64 4
  store i32 %116, ptr %118, align 4, !tbaa !14
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %119 = load i32, ptr @q, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = icmp slt i64 %indvars.iv.next117, %120
  br i1 %121, label %.lr.ph87, label %._crit_edge88, !llvm.loop !24

._crit_edge91:                                    ; preds = %.lr.ph90, %._crit_edge88
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %122 = load i32, ptr @q, align 4, !tbaa !5
  %123 = icmp sgt i32 %122, 0
  br i1 %123, label %.lr.ph108.preheader, label %._crit_edge111

.lr.ph108.preheader:                              ; preds = %._crit_edge91
  %124 = load i32, ptr @cnt1, align 4, !tbaa !5
  %125 = add nsw i32 %124, -1
  br label %.lr.ph108

.lr.ph90:                                         ; preds = %._crit_edge88, %.lr.ph90
  %126 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %127 = getelementptr inbounds i8, ptr %126, i64 4
  %128 = load i32, ptr %127, align 4, !tbaa !21
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [200100 x i32], ptr @counter, i64 0, i64 %129
  %131 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @gett, ptr noundef nonnull align 4 dereferenceable(4) %130)
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %131, align 4, !tbaa !5
  %134 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %135 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @ff) #7
  store ptr %135, ptr %13, align 8
  %136 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br i1 %136, label %.lr.ph90, label %._crit_edge91, !llvm.loop !25

.preheader:                                       ; preds = %167
  %137 = icmp sgt i32 %168, 0
  br i1 %137, label %.lr.ph110, label %._crit_edge111

.lr.ph108:                                        ; preds = %.lr.ph108.preheader, %167
  %indvars.iv120 = phi i64 [ 0, %.lr.ph108.preheader ], [ %indvars.iv.next121, %167 ]
  %.060105 = phi i32 [ %125, %.lr.ph108.preheader ], [ %.3, %167 ]
  %.061104 = phi i32 [ 0, %.lr.ph108.preheader ], [ %.364, %167 ]
  %138 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv120) #7
  %139 = load i32, ptr %138, align 4, !tbaa !23
  %140 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv120) #7
  %141 = getelementptr inbounds i8, ptr %140, i64 4
  %142 = load i32, ptr %141, align 4, !tbaa !14
  %143 = icmp sgt i32 %139, %142
  br i1 %143, label %145, label %.preheader70

.preheader70:                                     ; preds = %.lr.ph108
  %144 = icmp slt i32 %.061104, %139
  br i1 %144, label %.lr.ph93, label %.preheader69

145:                                              ; preds = %.lr.ph108
  %146 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv120) #7
  %147 = getelementptr inbounds i8, ptr %146, i64 8
  %148 = load i32, ptr %147, align 4, !tbaa !17
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [35000 x i32], ptr @res, i64 0, i64 %149
  store i32 0, ptr %150, align 4, !tbaa !5
  br label %167

.preheader69:                                     ; preds = %.preheader70
  %151 = icmp sgt i32 %.061104, %139
  br i1 %151, label %.lr.ph95, label %.preheader68

.lr.ph93:                                         ; preds = %.preheader70, %.lr.ph93
  %.16292 = phi i32 [ %152, %.lr.ph93 ], [ %.061104, %.preheader70 ]
  %152 = add i32 %.16292, 1
  call void @_Z6removei(i32 noundef %.16292)
  %exitcond.not = icmp eq i32 %152, %139
  br i1 %exitcond.not, label %.preheader68, label %.lr.ph93, !llvm.loop !26

.preheader68:                                     ; preds = %.lr.ph95, %.lr.ph93, %.preheader69
  %.263.lcssa = phi i32 [ %.061104, %.preheader69 ], [ %139, %.lr.ph93 ], [ %139, %.lr.ph95 ]
  %153 = icmp slt i32 %.060105, %142
  br i1 %153, label %.lr.ph98, label %.preheader67

.lr.ph95:                                         ; preds = %.preheader69, %.lr.ph95
  %.26394 = phi i32 [ %154, %.lr.ph95 ], [ %.061104, %.preheader69 ]
  %154 = add nsw i32 %.26394, -1
  call void @_Z3addi(i32 noundef %154)
  %155 = icmp sgt i32 %154, %139
  br i1 %155, label %.lr.ph95, label %.preheader68, !llvm.loop !27

.preheader67:                                     ; preds = %.preheader68
  %156 = icmp sgt i32 %.060105, %142
  br i1 %156, label %.lr.ph101, label %._crit_edge102

.lr.ph98:                                         ; preds = %.preheader68, %.lr.ph98
  %.197 = phi i32 [ %157, %.lr.ph98 ], [ %.060105, %.preheader68 ]
  %157 = add nsw i32 %.197, 1
  call void @_Z3addi(i32 noundef %157)
  %exitcond119.not = icmp eq i32 %157, %142
  br i1 %exitcond119.not, label %._crit_edge102, label %.lr.ph98, !llvm.loop !28

.lr.ph101:                                        ; preds = %.preheader67, %.lr.ph101
  %.2100 = phi i32 [ %158, %.lr.ph101 ], [ %.060105, %.preheader67 ]
  %158 = add nsw i32 %.2100, -1
  call void @_Z6removei(i32 noundef %.2100)
  %159 = icmp sgt i32 %158, %142
  br i1 %159, label %.lr.ph101, label %._crit_edge102, !llvm.loop !29

._crit_edge102:                                   ; preds = %.lr.ph101, %.lr.ph98, %.preheader67
  %.2.lcssa = phi i32 [ %.060105, %.preheader67 ], [ %142, %.lr.ph98 ], [ %142, %.lr.ph101 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE6rbeginEv(ptr dead_on_unwind nonnull writable sret(%"class.std::reverse_iterator") align 8 %14, ptr noundef nonnull align 8 dereferenceable(48) @gett) #7
  %160 = call noundef ptr @_ZNKSt16reverse_iteratorISt17_Rb_tree_iteratorISt4pairIKiiEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
  %161 = load i32, ptr %160, align 4, !tbaa !30
  %162 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @qr, i64 noundef %indvars.iv120) #7
  %163 = getelementptr inbounds i8, ptr %162, i64 8
  %164 = load i32, ptr %163, align 4, !tbaa !17
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [35000 x i32], ptr @res, i64 0, i64 %165
  store i32 %161, ptr %166, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  br label %167

167:                                              ; preds = %._crit_edge102, %145
  %.364 = phi i32 [ %.061104, %145 ], [ %.263.lcssa, %._crit_edge102 ]
  %.3 = phi i32 [ %.060105, %145 ], [ %.2.lcssa, %._crit_edge102 ]
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %168 = load i32, ptr @q, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = icmp slt i64 %indvars.iv.next121, %169
  br i1 %170, label %.lr.ph108, label %.preheader, !llvm.loop !31

._crit_edge111:                                   ; preds = %.lr.ph110, %._crit_edge91, %.preheader
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  ret i32 0

.lr.ph110:                                        ; preds = %.preheader, %.lr.ph110
  %indvars.iv123 = phi i64 [ %indvars.iv.next124, %.lr.ph110 ], [ 0, %.preheader ]
  %171 = getelementptr inbounds [35000 x i32], ptr @res, i64 0, i64 %indvars.iv123
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %172)
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %174 = load i32, ptr @q, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = icmp slt i64 %indvars.iv.next124, %175
  br i1 %176, label %.lr.ph110, label %._crit_edge111, !llvm.loop !32
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; 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 #2 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 #2

; 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 #2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr, ptr, ptr noundef) 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 #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE6rbeginEv(ptr dead_on_unwind noalias writable sret(%"class.std::reverse_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #5 = { 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 #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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !16, i64 4}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!15, !6, i64 8}
!18 = distinct !{!18, !10}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!22, !6, i64 4}
!22 = !{!"_ZTSSt4pairIKiiE", !6, i64 0, !6, i64 4}
!23 = !{!15, !6, i64 0}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = !{!22, !6, i64 0}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}


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