; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2013-14/Open 2014/14 Open G2.ll (Z4initv)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = 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" }
%"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<std::pair<int, char>, std::pair<int, char>, std::_Identity<std::pair<int, char>>, std::less<std::pair<int, char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, char>, std::pair<int, char>, std::_Identity<std::pair<int, char>>, std::less<std::pair<int, char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair.22" = type <{ %"struct.std::pair.13", i8, [3 x i8] }>
%"struct.std::pair.13" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.24" = type { i32, i32 }
%"struct.std::pair.29" = type <{ i32, i8, [3 x i8] }>
%"struct.std::pair.26" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@Bx = external dso_local global i32, align 4
@By = external dso_local global i32, align 4
@cx = external dso_local global i32, align 4
@cy = external dso_local global i32, align 4
@xval = external dso_local global %"class.std::map", align 8
@yval = external dso_local global %"class.std::map", align 8
@pairs = external dso_local global %"class.std::vector", align 8
@v = external dso_local global [131072 x %"class.std::set"], align 16
@h = external dso_local global [131072 x %"class.std::set"], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4initv() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca %"struct.std::pair.22", align 4
  %6 = alloca %"struct.std::pair.13", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::pair.24", align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca %"struct.std::pair.24", align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair.29", align 4
  %19 = alloca %"struct.std::pair.26", align 8
  %20 = alloca %"struct.std::pair.29", align 4
  %21 = alloca %"struct.std::pair.26", align 8
  %22 = load ptr, ptr @stdin, align 8, !tbaa !5
  %23 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.8, ptr noundef %22)
  %24 = load ptr, ptr @stdout, align 8, !tbaa !5
  %25 = call ptr @freopen(ptr noundef @.str.9, ptr noundef @.str.10, ptr noundef %24)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) @Bx)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) @By)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %40, %0
  %30 = load i32, ptr %1, align 4, !tbaa !9
  %31 = load i32, ptr @N, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %43

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @_ZNSt4pairIS_IiiEcEC2IS0_cTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS0_RKc(ptr noundef nonnull align 4 dereferenceable(9) %5, ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @pairs, ptr noundef nonnull align 4 dereferenceable(9) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i32 1, ptr %38, align 4, !tbaa !9
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i32 1, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %40

40:                                               ; preds = %34
  %41 = load i32, ptr %1, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %1, align 4, !tbaa !9
  br label %29, !llvm.loop !11

43:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i32 1, ptr %44, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i32 1, ptr %45, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) @By)
  store i32 1, ptr %46, align 4, !tbaa !9
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) @Bx)
  store i32 1, ptr %47, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr @xval, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %48 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @xval) #5
  %49 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %10, i32 0, i32 0
  store ptr %48, ptr %49, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %50 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @xval) #5
  %51 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %11, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  br label %52

52:                                               ; preds = %61, %43
  %53 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %53, label %55, label %54

54:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %63

55:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %56 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %56, i64 8, i1 false)
  %57 = load i32, ptr @cx, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @cx, align 4, !tbaa !9
  %59 = getelementptr inbounds %"struct.std::pair.24", ptr %12, i32 0, i32 0
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %59)
  store i32 %58, ptr %60, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %61

61:                                               ; preds = %55
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br label %52

63:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store ptr @yval, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %64 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @yval) #5
  %65 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  store ptr %64, ptr %65, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %66 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @yval) #5
  %67 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %15, i32 0, i32 0
  store ptr %66, ptr %67, align 8
  br label %68

68:                                               ; preds = %77, %63
  %69 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %69, label %71, label %70

70:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %79

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %72 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %72, i64 8, i1 false)
  %73 = load i32, ptr @cy, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @cy, align 4, !tbaa !9
  %75 = getelementptr inbounds %"struct.std::pair.24", ptr %16, i32 0, i32 0
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %75)
  store i32 %74, ptr %76, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %77

77:                                               ; preds = %71
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %68

79:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %155, %79
  %81 = load i32, ptr %17, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = call noundef i64 @_ZNKSt6vectorISt4pairIS0_IiiEcESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pairs) #5
  %84 = icmp ult i64 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %158

86:                                               ; preds = %80
  %87 = load i32, ptr %17, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %88) #5
  %90 = getelementptr inbounds %"struct.std::pair.22", ptr %89, i32 0, i32 0
  %91 = getelementptr inbounds %"struct.std::pair.13", ptr %90, i32 0, i32 0
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %91)
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %95) #5
  %97 = getelementptr inbounds %"struct.std::pair.22", ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds %"struct.std::pair.13", ptr %97, i32 0, i32 0
  store i32 %93, ptr %98, align 4, !tbaa !13
  %99 = load i32, ptr %17, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %100) #5
  %102 = getelementptr inbounds %"struct.std::pair.22", ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds %"struct.std::pair.13", ptr %102, i32 0, i32 1
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %103)
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %107) #5
  %109 = getelementptr inbounds %"struct.std::pair.22", ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds %"struct.std::pair.13", ptr %109, i32 0, i32 1
  store i32 %105, ptr %110, align 4, !tbaa !16
  %111 = load i32, ptr %17, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %112) #5
  %114 = getelementptr inbounds %"struct.std::pair.22", ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %"struct.std::pair.13", ptr %114, i32 0, i32 0
  %116 = load i32, ptr %115, align 4, !tbaa !13
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [131072 x %"class.std::set"], ptr @v, i64 0, i64 %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %119 = load i32, ptr %17, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %120) #5
  %122 = getelementptr inbounds %"struct.std::pair.22", ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %"struct.std::pair.13", ptr %122, i32 0, i32 1
  %124 = load i32, ptr %17, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %125) #5
  %127 = getelementptr inbounds %"struct.std::pair.22", ptr %126, i32 0, i32 1
  call void @_ZNSt4pairIicEC2IRiRcTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(5) %18, ptr noundef nonnull align 4 dereferenceable(4) %123, ptr noundef nonnull align 1 dereferenceable(1) %127)
  %128 = call { ptr, i8 } @_ZNSt3setISt4pairIicESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %118, ptr noundef nonnull align 4 dereferenceable(5) %18)
  %129 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %130 = extractvalue { ptr, i8 } %128, 0
  store ptr %130, ptr %129, align 8
  %131 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %132 = extractvalue { ptr, i8 } %128, 1
  store i8 %132, ptr %131, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %134) #5
  %136 = getelementptr inbounds %"struct.std::pair.22", ptr %135, i32 0, i32 0
  %137 = getelementptr inbounds %"struct.std::pair.13", ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !16
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [131072 x %"class.std::set"], ptr @h, i64 0, i64 %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %142) #5
  %144 = getelementptr inbounds %"struct.std::pair.22", ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds %"struct.std::pair.13", ptr %144, i32 0, i32 0
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %147) #5
  %149 = getelementptr inbounds %"struct.std::pair.22", ptr %148, i32 0, i32 1
  call void @_ZNSt4pairIicEC2IRiRcTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(5) %20, ptr noundef nonnull align 4 dereferenceable(4) %145, ptr noundef nonnull align 1 dereferenceable(1) %149)
  %150 = call { ptr, i8 } @_ZNSt3setISt4pairIicESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %140, ptr noundef nonnull align 4 dereferenceable(5) %20)
  %151 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 0
  %152 = extractvalue { ptr, i8 } %150, 0
  store ptr %152, ptr %151, align 8
  %153 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 1
  %154 = extractvalue { ptr, i8 } %150, 1
  store i8 %154, ptr %153, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %155

155:                                              ; preds = %86
  %156 = load i32, ptr %17, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %17, align 4, !tbaa !9
  br label %80, !llvm.loop !17

158:                                              ; preds = %85
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) @Bx)
  %160 = load i32, ptr %159, align 4, !tbaa !9
  store i32 %160, ptr @Bx, align 4, !tbaa !9
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) @By)
  %162 = load i32, ptr %161, align 4, !tbaa !9
  store i32 %162, ptr @By, align 4, !tbaa !9
  ret void
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #3

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #3

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #4 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)) #4

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIicEC2IRiRcTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(5), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { "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 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 #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSSt4pairIS_IiiEcE", !15, i64 0, !7, i64 8}
!15 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!16 = !{!14, !10, i64 4}
!17 = distinct !{!17, !12}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = 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" }
%"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, char>, std::allocator<std::pair<std::pair<int, int>, char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<std::pair<int, char>, std::pair<int, char>, std::_Identity<std::pair<int, char>>, std::less<std::pair<int, char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, char>, std::pair<int, char>, std::_Identity<std::pair<int, char>>, std::less<std::pair<int, char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.std::pair.22" = type <{ %"struct.std::pair.13", i8, [3 x i8] }>
%"struct.std::pair.13" = type { i32, i32 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.24" = type { i32, i32 }
%"struct.std::pair.29" = type <{ i32, i8, [3 x i8] }>

@N = external dso_local global i32, align 4
@Bx = external dso_local global i32, align 4
@By = external dso_local global i32, align 4
@cx = external dso_local local_unnamed_addr global i32, align 4
@cy = external dso_local local_unnamed_addr global i32, align 4
@xval = external dso_local global %"class.std::map", align 8
@yval = external dso_local global %"class.std::map", align 8
@pairs = external dso_local global %"class.std::vector", align 8
@v = external dso_local global [131072 x %"class.std::set"], align 16
@h = external dso_local global [131072 x %"class.std::set"], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4initv() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca %"struct.std::pair.22", align 4
  %5 = alloca %"struct.std::pair.13", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::pair.24", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::pair.24", align 8
  %14 = alloca %"struct.std::pair.29", align 4
  %15 = alloca %"struct.std::pair.29", align 4
  %16 = load ptr, ptr @stdin, align 8, !tbaa !5
  %17 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.8, ptr noundef %16)
  %18 = load ptr, ptr @stdout, align 8, !tbaa !5
  %19 = tail call ptr @freopen(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10, ptr noundef %18)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @Bx)
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) @By)
  %23 = load i32, ptr @N, align 4, !tbaa !9
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 1, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i32 1, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) @By)
  store i32 1, ptr %27, align 4, !tbaa !9
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) @Bx)
  store i32 1, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %29 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @xval) #4
  store ptr %29, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %30 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @xval) #4
  store ptr %30, ptr %9, align 8
  %31 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br i1 %31, label %.lr.ph20, label %._crit_edge21

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.018 = phi i32 [ %37, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #4
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @_ZNSt4pairIS_IiiEcEC2IS0_cTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS0_RKc(ptr noundef nonnull align 4 dereferenceable(9) %4, ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @pairs, ptr noundef nonnull align 4 dereferenceable(9) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #4
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i32 1, ptr %35, align 4, !tbaa !9
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i32 1, ptr %36, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %37 = add nuw nsw i32 %.018, 1
  %38 = load i32, ptr @N, align 4, !tbaa !9
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge21:                                    ; preds = %.lr.ph20, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  %40 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @yval) #4
  store ptr %40, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %41 = call ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @yval) #4
  store ptr %41, ptr %12, align 8
  %42 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  br i1 %42, label %.lr.ph23, label %._crit_edge24

.lr.ph20:                                         ; preds = %._crit_edge, %.lr.ph20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  %43 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %44 = load i64, ptr %43, align 4
  store i64 %44, ptr %10, align 8
  %45 = load i32, ptr @cx, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr @cx, align 4, !tbaa !9
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i32 %46, ptr %47, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %49 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br i1 %49, label %.lr.ph20, label %._crit_edge21

._crit_edge24:                                    ; preds = %.lr.ph23, %._crit_edge21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  %50 = call noundef i64 @_ZNKSt6vectorISt4pairIS0_IiiEcESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pairs) #4
  %.not = icmp eq i64 %50, 0
  br i1 %.not, label %._crit_edge28, label %.lr.ph27

.lr.ph23:                                         ; preds = %._crit_edge21, %.lr.ph23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #4
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKiiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %52 = load i64, ptr %51, align 4
  store i64 %52, ptr %13, align 8
  %53 = load i32, ptr @cy, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr @cy, align 4, !tbaa !9
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i32 %54, ptr %55, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #4
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKiiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %57 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKiiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  br i1 %57, label %.lr.ph23, label %._crit_edge24

._crit_edge28:                                    ; preds = %.lr.ph27, %._crit_edge24
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) @Bx)
  %59 = load i32, ptr %58, align 4, !tbaa !9
  store i32 %59, ptr @Bx, align 4, !tbaa !9
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) @By)
  %61 = load i32, ptr %60, align 4, !tbaa !9
  store i32 %61, ptr @By, align 4, !tbaa !9
  ret void

.lr.ph27:                                         ; preds = %._crit_edge24, %.lr.ph27
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph27 ], [ 0, %._crit_edge24 ]
  %62 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @xval, ptr noundef nonnull align 4 dereferenceable(4) %62)
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  store i32 %64, ptr %65, align 4, !tbaa !13
  %66 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @yval, ptr noundef nonnull align 4 dereferenceable(4) %67)
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %71 = getelementptr inbounds i8, ptr %70, i64 4
  store i32 %69, ptr %71, align 4, !tbaa !16
  %72 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %73 = load i32, ptr %72, align 4, !tbaa !13
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [131072 x %"class.std::set"], ptr @v, i64 0, i64 %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %76 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %77 = getelementptr inbounds i8, ptr %76, i64 4
  %78 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %79 = getelementptr inbounds i8, ptr %78, i64 8
  call void @_ZNSt4pairIicEC2IRiRcTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(5) %14, ptr noundef nonnull align 4 dereferenceable(4) %77, ptr noundef nonnull align 1 dereferenceable(1) %79)
  %80 = call { ptr, i8 } @_ZNSt3setISt4pairIicESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %75, ptr noundef nonnull align 4 dereferenceable(5) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  %81 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %82 = getelementptr inbounds i8, ptr %81, i64 4
  %83 = load i32, ptr %82, align 4, !tbaa !16
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [131072 x %"class.std::set"], ptr @h, i64 0, i64 %84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #4
  %86 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %87 = call noundef nonnull align 4 dereferenceable(9) ptr @_ZNSt6vectorISt4pairIS0_IiiEcESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pairs, i64 noundef %indvars.iv) #4
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  call void @_ZNSt4pairIicEC2IRiRcTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(5) %15, ptr noundef nonnull align 4 dereferenceable(4) %86, ptr noundef nonnull align 1 dereferenceable(1) %88)
  %89 = call { ptr, i8 } @_ZNSt3setISt4pairIicESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %85, ptr noundef nonnull align 4 dereferenceable(5) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %90 = call noundef i64 @_ZNKSt6vectorISt4pairIS0_IiiEcESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pairs) #4
  %91 = icmp ugt i64 %90, %indvars.iv.next
  br i1 %91, label %.lr.ph27, label %._crit_edge28, !llvm.loop !17
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIS_IiiEcEC2IS0_cTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKS0_RKc(ptr noundef nonnull align 4 dereferenceable(9), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 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 #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 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 #3

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIicEC2IRiRcTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS5_S6_EEEbE4typeELb1EEEOS5_OS6_(ptr noundef nonnull align 4 dereferenceable(5), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSSt4pairIS_IiiEcE", !15, i64 0, !7, i64 8}
!15 = !{!"_ZTSSt4pairIiiE", !10, i64 0, !10, i64 4}
!16 = !{!14, !10, i64 4}
!17 = distinct !{!17, !12}


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