; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/296 Division 2/Problem C (C)

; 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<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::pair.4" = type { i64, i64 }

@h = external dso_local global i64, align 8
@w = external dso_local global i64, align 8
@n = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@val1 = external dso_local global i64, align 8
@val2 = external dso_local global i64, align 8
@hor = external dso_local global %"class.std::map", align 8
@ver = external dso_local global %"class.std::map", align 8
@aa = external dso_local global %"struct.std::_Rb_tree_iterator", align 8
@bb = external dso_local global %"struct.std::_Rb_tree_iterator", align 8
@h_cut = external dso_local global %"class.std::set", align 8
@v_cut = external dso_local global %"class.std::set", align 8
@it = external dso_local global %"struct.std::_Rb_tree_const_iterator", align 8
@c = external dso_local global i8, align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", 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 i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca %"struct.std::pair", align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca %"struct.std::pair", align 8
  %36 = alloca i64, align 8
  %37 = alloca i64, align 8
  %38 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %39 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %40 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %41 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 0, ptr %1, align 4
  %42 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %43 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %44 = getelementptr i8, ptr %43, i64 -24
  %45 = load i64, ptr %44, align 8
  %46 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %45
  %47 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %46, ptr noundef null)
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @w)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 8 dereferenceable(8) @h)
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) @h)
  store i64 1, ptr %51, align 8, !tbaa !8
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) @w)
  store i64 1, ptr %52, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  %53 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertEOx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %54 = getelementptr inbounds { ptr, i8 }, ptr %3, i32 0, i32 0
  %55 = extractvalue { ptr, i8 } %53, 0
  store ptr %55, ptr %54, align 8
  %56 = getelementptr inbounds { ptr, i8 }, ptr %3, i32 0, i32 1
  %57 = extractvalue { ptr, i8 } %53, 1
  store i8 %57, ptr %56, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  %58 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertEOx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %59 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 0
  %60 = extractvalue { ptr, i8 } %58, 0
  store ptr %60, ptr %59, align 8
  %61 = getelementptr inbounds { ptr, i8 }, ptr %5, i32 0, i32 1
  %62 = extractvalue { ptr, i8 } %58, 1
  store i8 %62, ptr %61, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %63

63:                                               ; preds = %255, %0
  %64 = load i64, ptr @n, align 8, !tbaa !8
  %65 = add nsw i64 %64, -1
  store i64 %65, ptr @n, align 8, !tbaa !8
  %66 = icmp ne i64 %64, 0
  br i1 %66, label %67, label %273

67:                                               ; preds = %63
  %68 = 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) @c)
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %70 = load i8, ptr @c, align 1, !tbaa !11
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, 72
  br i1 %72, label %73, label %164

73:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %74 = call ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %75 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %6, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @it, ptr align 8 %6, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %76 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @h_cut) #7
  %77 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %7, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) @it, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br i1 %78, label %79, label %121

79:                                               ; preds = %73
  %80 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #7
  %81 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %8, i32 0, i32 0
  store ptr %80, ptr %81, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %82 = load i64, ptr @h, align 8, !tbaa !8
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %84 = load i64, ptr %83, align 8, !tbaa !8
  %85 = sub nsw i64 %82, %84
  store i64 %85, ptr %9, align 8, !tbaa !8
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = add nsw i64 %87, -1
  store i64 %88, ptr %86, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %89 = load i64, ptr @h, align 8, !tbaa !8
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = sub nsw i64 %89, %91
  store i64 %92, ptr %10, align 8, !tbaa !8
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = icmp eq i64 %94, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br i1 %95, label %96, label %102

96:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %97 = load i64, ptr @h, align 8, !tbaa !8
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %99 = load i64, ptr %98, align 8, !tbaa !8
  %100 = sub nsw i64 %97, %99
  store i64 %100, ptr %11, align 8, !tbaa !8
  %101 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %102

102:                                              ; preds = %96, %79
  %103 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %104 = getelementptr inbounds { ptr, i8 }, ptr %12, i32 0, i32 0
  %105 = extractvalue { ptr, i8 } %103, 0
  store ptr %105, ptr %104, align 8
  %106 = getelementptr inbounds { ptr, i8 }, ptr %12, i32 0, i32 1
  %107 = extractvalue { ptr, i8 } %103, 1
  store i8 %107, ptr %106, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %108 = load i64, ptr @h, align 8, !tbaa !8
  %109 = load i64, ptr @x, align 8, !tbaa !8
  %110 = sub nsw i64 %108, %109
  store i64 %110, ptr %13, align 8, !tbaa !8
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %112 = load i64, ptr %111, align 8, !tbaa !8
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %111, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %114 = load i64, ptr @x, align 8, !tbaa !8
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = sub nsw i64 %114, %116
  store i64 %117, ptr %14, align 8, !tbaa !8
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %118, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %163

121:                                              ; preds = %73
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %123 = load i64, ptr %122, align 8, !tbaa !8
  store i64 %123, ptr @val1, align 8, !tbaa !8
  %124 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #7
  %125 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %127 = load i64, ptr %126, align 8, !tbaa !8
  store i64 %127, ptr @val2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %128 = load i64, ptr @val1, align 8, !tbaa !8
  %129 = load i64, ptr @val2, align 8, !tbaa !8
  %130 = sub nsw i64 %128, %129
  store i64 %130, ptr %16, align 8, !tbaa !8
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = add nsw i64 %132, -1
  store i64 %133, ptr %131, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %134 = load i64, ptr @val1, align 8, !tbaa !8
  %135 = load i64, ptr @val2, align 8, !tbaa !8
  %136 = sub nsw i64 %134, %135
  store i64 %136, ptr %17, align 8, !tbaa !8
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %138 = load i64, ptr %137, align 8, !tbaa !8
  %139 = icmp eq i64 %138, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br i1 %139, label %140, label %145

140:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %141 = load i64, ptr @val1, align 8, !tbaa !8
  %142 = load i64, ptr @val2, align 8, !tbaa !8
  %143 = sub nsw i64 %141, %142
  store i64 %143, ptr %18, align 8, !tbaa !8
  %144 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %18)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %145

145:                                              ; preds = %140, %121
  %146 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %147 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %148 = extractvalue { ptr, i8 } %146, 0
  store ptr %148, ptr %147, align 8
  %149 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %150 = extractvalue { ptr, i8 } %146, 1
  store i8 %150, ptr %149, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %151 = load i64, ptr @val1, align 8, !tbaa !8
  %152 = load i64, ptr @x, align 8, !tbaa !8
  %153 = sub nsw i64 %151, %152
  store i64 %153, ptr %20, align 8, !tbaa !8
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = add nsw i64 %155, 1
  store i64 %156, ptr %154, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %157 = load i64, ptr @x, align 8, !tbaa !8
  %158 = load i64, ptr @val2, align 8, !tbaa !8
  %159 = sub nsw i64 %157, %158
  store i64 %159, ptr %21, align 8, !tbaa !8
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %161 = load i64, ptr %160, align 8, !tbaa !8
  %162 = add nsw i64 %161, 1
  store i64 %162, ptr %160, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %163

163:                                              ; preds = %145, %102
  br label %255

164:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %165 = call ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %166 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %22, i32 0, i32 0
  store ptr %165, ptr %166, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @it, ptr align 8 %22, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %167 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @v_cut) #7
  %168 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %23, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  %169 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) @it, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br i1 %169, label %170, label %212

170:                                              ; preds = %164
  %171 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #7
  %172 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %171, ptr %172, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %173 = load i64, ptr @w, align 8, !tbaa !8
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %175 = load i64, ptr %174, align 8, !tbaa !8
  %176 = sub nsw i64 %173, %175
  store i64 %176, ptr %25, align 8, !tbaa !8
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %178 = load i64, ptr %177, align 8, !tbaa !8
  %179 = add nsw i64 %178, -1
  store i64 %179, ptr %177, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %180 = load i64, ptr @w, align 8, !tbaa !8
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %182 = load i64, ptr %181, align 8, !tbaa !8
  %183 = sub nsw i64 %180, %182
  store i64 %183, ptr %26, align 8, !tbaa !8
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %185 = load i64, ptr %184, align 8, !tbaa !8
  %186 = icmp eq i64 %185, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br i1 %186, label %187, label %193

187:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %188 = load i64, ptr @w, align 8, !tbaa !8
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %190 = load i64, ptr %189, align 8, !tbaa !8
  %191 = sub nsw i64 %188, %190
  store i64 %191, ptr %27, align 8, !tbaa !8
  %192 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %27)
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %193

193:                                              ; preds = %187, %170
  %194 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %195 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 0
  %196 = extractvalue { ptr, i8 } %194, 0
  store ptr %196, ptr %195, align 8
  %197 = getelementptr inbounds { ptr, i8 }, ptr %28, i32 0, i32 1
  %198 = extractvalue { ptr, i8 } %194, 1
  store i8 %198, ptr %197, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %199 = load i64, ptr @w, align 8, !tbaa !8
  %200 = load i64, ptr @x, align 8, !tbaa !8
  %201 = sub nsw i64 %199, %200
  store i64 %201, ptr %29, align 8, !tbaa !8
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %203 = load i64, ptr %202, align 8, !tbaa !8
  %204 = add nsw i64 %203, 1
  store i64 %204, ptr %202, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %205 = load i64, ptr @x, align 8, !tbaa !8
  %206 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %207 = load i64, ptr %206, align 8, !tbaa !8
  %208 = sub nsw i64 %205, %207
  store i64 %208, ptr %30, align 8, !tbaa !8
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %210 = load i64, ptr %209, align 8, !tbaa !8
  %211 = add nsw i64 %210, 1
  store i64 %211, ptr %209, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %254

212:                                              ; preds = %164
  %213 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %214 = load i64, ptr %213, align 8, !tbaa !8
  store i64 %214, ptr @val1, align 8, !tbaa !8
  %215 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #7
  %216 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %215, ptr %216, align 8
  %217 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #7
  %218 = load i64, ptr %217, align 8, !tbaa !8
  store i64 %218, ptr @val2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %219 = load i64, ptr @val1, align 8, !tbaa !8
  %220 = load i64, ptr @val2, align 8, !tbaa !8
  %221 = sub nsw i64 %219, %220
  store i64 %221, ptr %32, align 8, !tbaa !8
  %222 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %32)
  %223 = load i64, ptr %222, align 8, !tbaa !8
  %224 = add nsw i64 %223, -1
  store i64 %224, ptr %222, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %225 = load i64, ptr @val1, align 8, !tbaa !8
  %226 = load i64, ptr @val2, align 8, !tbaa !8
  %227 = sub nsw i64 %225, %226
  store i64 %227, ptr %33, align 8, !tbaa !8
  %228 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %33)
  %229 = load i64, ptr %228, align 8, !tbaa !8
  %230 = icmp eq i64 %229, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br i1 %230, label %231, label %236

231:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %232 = load i64, ptr @val1, align 8, !tbaa !8
  %233 = load i64, ptr @val2, align 8, !tbaa !8
  %234 = sub nsw i64 %232, %233
  store i64 %234, ptr %34, align 8, !tbaa !8
  %235 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %34)
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  br label %236

236:                                              ; preds = %231, %212
  %237 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %238 = getelementptr inbounds { ptr, i8 }, ptr %35, i32 0, i32 0
  %239 = extractvalue { ptr, i8 } %237, 0
  store ptr %239, ptr %238, align 8
  %240 = getelementptr inbounds { ptr, i8 }, ptr %35, i32 0, i32 1
  %241 = extractvalue { ptr, i8 } %237, 1
  store i8 %241, ptr %240, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #7
  %242 = load i64, ptr @val1, align 8, !tbaa !8
  %243 = load i64, ptr @x, align 8, !tbaa !8
  %244 = sub nsw i64 %242, %243
  store i64 %244, ptr %36, align 8, !tbaa !8
  %245 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %36)
  %246 = load i64, ptr %245, align 8, !tbaa !8
  %247 = add nsw i64 %246, 1
  store i64 %247, ptr %245, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  %248 = load i64, ptr @x, align 8, !tbaa !8
  %249 = load i64, ptr @val2, align 8, !tbaa !8
  %250 = sub nsw i64 %248, %249
  store i64 %250, ptr %37, align 8, !tbaa !8
  %251 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %37)
  %252 = load i64, ptr %251, align 8, !tbaa !8
  %253 = add nsw i64 %252, 1
  store i64 %253, ptr %251, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  br label %254

254:                                              ; preds = %236, %193
  br label %255

255:                                              ; preds = %254, %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %256 = call ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @hor) #7
  %257 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %38, i32 0, i32 0
  store ptr %256, ptr %257, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @aa, ptr align 8 %38, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  %258 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxxEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @aa, i32 noundef 0) #7
  %259 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %39, i32 0, i32 0
  store ptr %258, ptr %259, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  %260 = call ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @ver) #7
  %261 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %40, i32 0, i32 0
  store ptr %260, ptr %261, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @bb, ptr align 8 %40, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  %262 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxxEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @bb, i32 noundef 0) #7
  %263 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %41, i32 0, i32 0
  store ptr %262, ptr %263, align 8
  %264 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) @aa) #7
  %265 = getelementptr inbounds %"struct.std::pair.4", ptr %264, i32 0, i32 0
  %266 = load i64, ptr %265, align 8, !tbaa !15
  %267 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) @bb) #7
  %268 = getelementptr inbounds %"struct.std::pair.4", ptr %267, i32 0, i32 0
  %269 = load i64, ptr %268, align 8, !tbaa !15
  %270 = mul nsw i64 %266, %269
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %270)
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %271, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %63, !llvm.loop !17

273:                                              ; preds = %63
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

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

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)) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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

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

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


; 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<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, long long>, std::_Select1st<std::pair<const long long, long long>>, std::less<long long>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.0" }
%"class.std::_Rb_tree.0" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@h = external dso_local global i64, align 8
@w = external dso_local global i64, align 8
@n = external dso_local global i64, align 8
@x = external dso_local global i64, align 8
@val1 = external dso_local local_unnamed_addr global i64, align 8
@val2 = external dso_local local_unnamed_addr global i64, align 8
@hor = external dso_local global %"class.std::map", align 8
@ver = external dso_local global %"class.std::map", align 8
@aa = external dso_local global %"struct.std::_Rb_tree_iterator", align 8
@bb = external dso_local global %"struct.std::_Rb_tree_iterator", align 8
@h_cut = external dso_local global %"class.std::set", align 8
@v_cut = external dso_local global %"class.std::set", align 8
@it = external dso_local global %"struct.std::_Rb_tree_const_iterator", align 8
@c = external dso_local global i8, align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %26 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %27 = getelementptr i8, ptr %26, i64 -24
  %28 = load i64, ptr %27, align 8
  %29 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %28
  %30 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %29, ptr noundef null)
  %31 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @w)
  %32 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) @h)
  %33 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) @h)
  store i64 1, ptr %34, align 8, !tbaa !8
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) @w)
  store i64 1, ptr %35, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8, !tbaa !8
  %36 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertEOx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  %37 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertEOx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %38 = load i64, ptr @n, align 8, !tbaa !8
  %39 = add nsw i64 %38, -1
  store i64 %39, ptr @n, align 8, !tbaa !8
  %.not21 = icmp eq i64 %38, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %198
  %40 = 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) @c)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(8) @x)
  %42 = load i8, ptr @c, align 1, !tbaa !11
  %43 = icmp eq i8 %42, 72
  br i1 %43, label %44, label %121

44:                                               ; preds = %.lr.ph
  %45 = call ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  store ptr %45, ptr @it, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %46 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @h_cut) #6
  store ptr %46, ptr %3, align 8
  %47 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) @it, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br i1 %47, label %48, label %85

48:                                               ; preds = %44
  %49 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %50 = load i64, ptr @h, align 8, !tbaa !8
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = sub nsw i64 %50, %52
  store i64 %53, ptr %4, align 8, !tbaa !8
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = add nsw i64 %55, -1
  store i64 %56, ptr %54, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %57 = load i64, ptr @h, align 8, !tbaa !8
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %59 = load i64, ptr %58, align 8, !tbaa !8
  %60 = sub nsw i64 %57, %59
  store i64 %60, ptr %5, align 8, !tbaa !8
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %63 = icmp eq i64 %62, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br i1 %63, label %64, label %70

64:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %65 = load i64, ptr @h, align 8, !tbaa !8
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = sub nsw i64 %65, %67
  store i64 %68, ptr %6, align 8, !tbaa !8
  %69 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %70

70:                                               ; preds = %64, %48
  %71 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %72 = load i64, ptr @h, align 8, !tbaa !8
  %73 = load i64, ptr @x, align 8, !tbaa !8
  %74 = sub nsw i64 %72, %73
  store i64 %74, ptr %7, align 8, !tbaa !8
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %75, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %78 = load i64, ptr @x, align 8, !tbaa !8
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %80 = load i64, ptr %79, align 8, !tbaa !8
  %81 = sub nsw i64 %78, %80
  store i64 %81, ptr %8, align 8, !tbaa !8
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = add nsw i64 %83, 1
  store i64 %84, ptr %82, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %198

85:                                               ; preds = %44
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %87 = load i64, ptr %86, align 8, !tbaa !8
  store i64 %87, ptr @val1, align 8, !tbaa !8
  %88 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #6
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %90 = load i64, ptr %89, align 8, !tbaa !8
  store i64 %90, ptr @val2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %91 = load i64, ptr @val1, align 8, !tbaa !8
  %92 = sub nsw i64 %91, %90
  store i64 %92, ptr %9, align 8, !tbaa !8
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = add nsw i64 %94, -1
  store i64 %95, ptr %93, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %96 = load i64, ptr @val1, align 8, !tbaa !8
  %97 = load i64, ptr @val2, align 8, !tbaa !8
  %98 = sub nsw i64 %96, %97
  store i64 %98, ptr %10, align 8, !tbaa !8
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = icmp eq i64 %100, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %101, label %102, label %107

102:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %103 = load i64, ptr @val1, align 8, !tbaa !8
  %104 = load i64, ptr @val2, align 8, !tbaa !8
  %105 = sub nsw i64 %103, %104
  store i64 %105, ptr %11, align 8, !tbaa !8
  %106 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  br label %107

107:                                              ; preds = %102, %85
  %108 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @h_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %109 = load i64, ptr @val1, align 8, !tbaa !8
  %110 = load i64, ptr @x, align 8, !tbaa !8
  %111 = sub nsw i64 %109, %110
  store i64 %111, ptr %12, align 8, !tbaa !8
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = add nsw i64 %113, 1
  store i64 %114, ptr %112, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %115 = load i64, ptr @x, align 8, !tbaa !8
  %116 = load i64, ptr @val2, align 8, !tbaa !8
  %117 = sub nsw i64 %115, %116
  store i64 %117, ptr %13, align 8, !tbaa !8
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @hor, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = add nsw i64 %119, 1
  store i64 %120, ptr %118, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br label %198

121:                                              ; preds = %.lr.ph
  %122 = call ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  store ptr %122, ptr @it, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  %123 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @v_cut) #6
  store ptr %123, ptr %14, align 8
  %124 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) @it, ptr noundef nonnull align 8 dereferenceable(8) %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  br i1 %124, label %125, label %162

125:                                              ; preds = %121
  %126 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  %127 = load i64, ptr @w, align 8, !tbaa !8
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %130 = sub nsw i64 %127, %129
  store i64 %130, ptr %15, align 8, !tbaa !8
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = add nsw i64 %132, -1
  store i64 %133, ptr %131, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #6
  %134 = load i64, ptr @w, align 8, !tbaa !8
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %136 = load i64, ptr %135, align 8, !tbaa !8
  %137 = sub nsw i64 %134, %136
  store i64 %137, ptr %16, align 8, !tbaa !8
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %139 = load i64, ptr %138, align 8, !tbaa !8
  %140 = icmp eq i64 %139, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #6
  br i1 %140, label %141, label %147

141:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #6
  %142 = load i64, ptr @w, align 8, !tbaa !8
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %145 = sub nsw i64 %142, %144
  store i64 %145, ptr %17, align 8, !tbaa !8
  %146 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #6
  br label %147

147:                                              ; preds = %141, %125
  %148 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #6
  %149 = load i64, ptr @w, align 8, !tbaa !8
  %150 = load i64, ptr @x, align 8, !tbaa !8
  %151 = sub nsw i64 %149, %150
  store i64 %151, ptr %18, align 8, !tbaa !8
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %153 = load i64, ptr %152, align 8, !tbaa !8
  %154 = add nsw i64 %153, 1
  store i64 %154, ptr %152, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #6
  %155 = load i64, ptr @x, align 8, !tbaa !8
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %157 = load i64, ptr %156, align 8, !tbaa !8
  %158 = sub nsw i64 %155, %157
  store i64 %158, ptr %19, align 8, !tbaa !8
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %160 = load i64, ptr %159, align 8, !tbaa !8
  %161 = add nsw i64 %160, 1
  store i64 %161, ptr %159, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #6
  br label %198

162:                                              ; preds = %121
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %164 = load i64, ptr %163, align 8, !tbaa !8
  store i64 %164, ptr @val1, align 8, !tbaa !8
  %165 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @it, i32 noundef 0) #6
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @it) #6
  %167 = load i64, ptr %166, align 8, !tbaa !8
  store i64 %167, ptr @val2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #6
  %168 = load i64, ptr @val1, align 8, !tbaa !8
  %169 = sub nsw i64 %168, %167
  store i64 %169, ptr %20, align 8, !tbaa !8
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %171 = load i64, ptr %170, align 8, !tbaa !8
  %172 = add nsw i64 %171, -1
  store i64 %172, ptr %170, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %21) #6
  %173 = load i64, ptr @val1, align 8, !tbaa !8
  %174 = load i64, ptr @val2, align 8, !tbaa !8
  %175 = sub nsw i64 %173, %174
  store i64 %175, ptr %21, align 8, !tbaa !8
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %178 = icmp eq i64 %177, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %21) #6
  br i1 %178, label %179, label %184

179:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %22) #6
  %180 = load i64, ptr @val1, align 8, !tbaa !8
  %181 = load i64, ptr @val2, align 8, !tbaa !8
  %182 = sub nsw i64 %180, %181
  store i64 %182, ptr %22, align 8, !tbaa !8
  %183 = call noundef i64 @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %22)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %22) #6
  br label %184

184:                                              ; preds = %179, %162
  %185 = call { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) @v_cut, ptr noundef nonnull align 8 dereferenceable(8) @x)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #6
  %186 = load i64, ptr @val1, align 8, !tbaa !8
  %187 = load i64, ptr @x, align 8, !tbaa !8
  %188 = sub nsw i64 %186, %187
  store i64 %188, ptr %23, align 8, !tbaa !8
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %190 = load i64, ptr %189, align 8, !tbaa !8
  %191 = add nsw i64 %190, 1
  store i64 %191, ptr %189, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #6
  %192 = load i64, ptr @x, align 8, !tbaa !8
  %193 = load i64, ptr @val2, align 8, !tbaa !8
  %194 = sub nsw i64 %192, %193
  store i64 %194, ptr %24, align 8, !tbaa !8
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) @ver, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %196 = load i64, ptr %195, align 8, !tbaa !8
  %197 = add nsw i64 %196, 1
  store i64 %197, ptr %195, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #6
  br label %198

198:                                              ; preds = %147, %184, %70, %107
  %199 = call ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @hor) #6
  store ptr %199, ptr @aa, align 8, !tbaa !12
  %200 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxxEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @aa, i32 noundef 0) #6
  %201 = call ptr @_ZNSt3mapIxxSt4lessIxESaISt4pairIKxxEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @ver) #6
  store ptr %201, ptr @bb, align 8, !tbaa !12
  %202 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxxEEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @bb, i32 noundef 0) #6
  %203 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) @aa) #6
  %204 = load i64, ptr %203, align 8, !tbaa !14
  %205 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxxEEptEv(ptr noundef nonnull align 8 dereferenceable(8) @bb) #6
  %206 = load i64, ptr %205, align 8, !tbaa !14
  %207 = mul nsw i64 %206, %204
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %207)
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %208, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %210 = load i64, ptr @n, align 8, !tbaa !8
  %211 = add nsw i64 %210, -1
  store i64 %211, ptr @n, align 8, !tbaa !8
  %.not = icmp eq i64 %210, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %198, %0
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

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

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 #1

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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


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