; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/Intel Code Challenge Finals/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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, 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::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.0" = type { %"struct.std::pair.2", i32 }
%"struct.std::pair.2" = type { i32, i32 }
%"struct.std::pair" = 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
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@d1 = external dso_local global [200200 x %"class.std::set"], align 16
@d2 = external dso_local global [200200 x %"class.std::set"], align 16
@ans = external dso_local global [100100 x i64], align 16
@vis = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

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

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

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

61:                                               ; preds = %96, %0
  %62 = load i32, ptr %2, align 4, !tbaa !8
  %63 = load i32, ptr @k, align 4, !tbaa !8
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %99

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %69 = load i32, ptr %4, align 4, !tbaa !8
  %70 = load i32, ptr %3, align 4, !tbaa !8
  %71 = add nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %72
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %74 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %74, ptr %6, align 4
  %75 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store { i64, i32 } %75, ptr %7, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 8 %7, i64 12, i1 false)
  %76 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %73, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %77 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 0
  %78 = extractvalue { ptr, i8 } %76, 0
  store ptr %78, ptr %77, align 8
  %79 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 1
  %80 = extractvalue { ptr, i8 } %76, 1
  store i8 %80, ptr %79, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #9
  %81 = load i32, ptr %4, align 4, !tbaa !8
  %82 = load i32, ptr %3, align 4, !tbaa !8
  %83 = sub nsw i32 %81, %82
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %84
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %86 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %86, ptr %10, align 4
  %87 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store { i64, i32 } %87, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %11, i64 12, i1 false)
  %88 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %85, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %89 = getelementptr inbounds { ptr, i8 }, ptr %12, i32 0, i32 0
  %90 = extractvalue { ptr, i8 } %88, 0
  store ptr %90, ptr %89, align 8
  %91 = getelementptr inbounds { ptr, i8 }, ptr %12, i32 0, i32 1
  %92 = extractvalue { ptr, i8 } %88, 1
  store i8 %92, ptr %91, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #9
  %93 = load i32, ptr %2, align 4, !tbaa !8
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %94
  store i64 -1, ptr %95, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %96

96:                                               ; preds = %66
  %97 = load i32, ptr %2, align 4, !tbaa !8
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %2, align 4, !tbaa !8
  br label %61, !llvm.loop !13

99:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #9
  store i8 1, ptr %13, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 0, ptr %14, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  store i32 0, ptr %15, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 1, ptr %16, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  store i64 0, ptr %17, align 8, !tbaa !11
  br label %100

100:                                              ; preds = %251, %99
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %101 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i64 %101, ptr %19, align 4
  %102 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %16)
  store { i64, i32 } %102, ptr %20, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 8 %20, i64 12, i1 false)
  %103 = call noundef i64 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5countERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @vis, ptr noundef nonnull align 4 dereferenceable(12) %18)
  %104 = icmp ne i64 %103, 0
  %105 = xor i1 %104, true
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #9
  br i1 %105, label %106, label %259

106:                                              ; preds = %100
  %107 = load i32, ptr %14, align 4, !tbaa !8
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %113, label %109

109:                                              ; preds = %106
  %110 = load i32, ptr %14, align 4, !tbaa !8
  %111 = load i32, ptr @n, align 4, !tbaa !8
  %112 = icmp eq i32 %110, %111
  br i1 %112, label %113, label %124

113:                                              ; preds = %109, %106
  %114 = load i32, ptr %15, align 4, !tbaa !8
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %120, label %116

116:                                              ; preds = %113
  %117 = load i32, ptr %15, align 4, !tbaa !8
  %118 = load i32, ptr @m, align 4, !tbaa !8
  %119 = icmp eq i32 %117, %118
  br i1 %119, label %120, label %124

120:                                              ; preds = %116, %113
  %121 = load i8, ptr %13, align 1, !tbaa !15, !range !17, !noundef !18
  %122 = trunc i8 %121 to i1
  br i1 %122, label %124, label %123

123:                                              ; preds = %120
  br label %259

124:                                              ; preds = %120, %116, %109
  store i8 0, ptr %13, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %125 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i64 %125, ptr %22, align 4
  %126 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(4) %16)
  store { i64, i32 } %126, ptr %23, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 8 %23, i64 12, i1 false)
  %127 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @vis, ptr noundef nonnull align 4 dereferenceable(12) %21)
  %128 = getelementptr inbounds { ptr, i8 }, ptr %24, i32 0, i32 0
  %129 = extractvalue { ptr, i8 } %127, 0
  store ptr %129, ptr %128, align 8
  %130 = getelementptr inbounds { ptr, i8 }, ptr %24, i32 0, i32 1
  %131 = extractvalue { ptr, i8 } %127, 1
  store i8 %131, ptr %130, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  %132 = load i32, ptr %16, align 4, !tbaa !8
  %133 = icmp eq i32 %132, 1
  br i1 %133, label %137, label %134

134:                                              ; preds = %124
  %135 = load i32, ptr %16, align 4, !tbaa !8
  %136 = icmp eq i32 %135, 3
  br i1 %136, label %137, label %194

137:                                              ; preds = %134, %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  %138 = load i32, ptr %15, align 4, !tbaa !8
  %139 = load i32, ptr %14, align 4, !tbaa !8
  %140 = sub nsw i32 %138, %139
  store i32 %140, ptr %28, align 4, !tbaa !8
  br label %141

141:                                              ; preds = %147, %137
  %142 = load i32, ptr %28, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %143
  %145 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %144) #9
  %146 = xor i1 %145, true
  br i1 %146, label %147, label %193

147:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %148 = load i32, ptr %28, align 4, !tbaa !8
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %149
  %151 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %150) #9
  %152 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  %153 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %153, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  %154 = getelementptr inbounds %"struct.std::pair.0", ptr %29, i32 0, i32 0
  %155 = getelementptr inbounds %"struct.std::pair.2", ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 4, !tbaa !19
  store i32 %156, ptr %31, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %157 = getelementptr inbounds %"struct.std::pair.0", ptr %29, i32 0, i32 0
  %158 = getelementptr inbounds %"struct.std::pair.2", ptr %157, i32 0, i32 1
  %159 = load i32, ptr %158, align 4, !tbaa !22
  store i32 %159, ptr %32, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %160 = getelementptr inbounds %"struct.std::pair.0", ptr %29, i32 0, i32 1
  %161 = load i32, ptr %160, align 4, !tbaa !23
  store i32 %161, ptr %33, align 4, !tbaa !8
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @__FUNCTION__.main)
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %162, i8 noundef signext 32)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %163, i32 noundef 133)
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %164, ptr noundef @.str)
  call void @_Z5traceIRSt4pairIS0_IiiEiEEvPKcOT_(ptr noundef @.str.5, ptr noundef nonnull align 4 dereferenceable(12) %29)
  %166 = load i32, ptr %28, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %167
  %169 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %168, ptr noundef nonnull align 4 dereferenceable(12) %29)
  %170 = load i32, ptr %32, align 4, !tbaa !8
  %171 = load i32, ptr %31, align 4, !tbaa !8
  %172 = add nsw i32 %170, %171
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %173
  %175 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %174, ptr noundef nonnull align 4 dereferenceable(12) %29)
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #9
  %176 = load i32, ptr %31, align 4, !tbaa !8
  %177 = load i32, ptr %14, align 4, !tbaa !8
  %178 = sub nsw i32 %176, %177
  %179 = call i32 @llvm.abs.i32(i32 %178, i1 true)
  store i32 %179, ptr %35, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #9
  %180 = load i32, ptr %32, align 4, !tbaa !8
  %181 = load i32, ptr %15, align 4, !tbaa !8
  %182 = sub nsw i32 %180, %181
  %183 = call i32 @llvm.abs.i32(i32 %182, i1 true)
  store i32 %183, ptr %36, align 4, !tbaa !8
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %35, ptr noundef nonnull align 4 dereferenceable(4) %36)
  %185 = load i32, ptr %184, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #9
  store i32 %185, ptr %34, align 4, !tbaa !8
  %186 = load i64, ptr %17, align 8, !tbaa !11
  %187 = load i32, ptr %34, align 4, !tbaa !8
  %188 = sext i32 %187 to i64
  %189 = add nsw i64 %186, %188
  %190 = load i32, ptr %33, align 4, !tbaa !8
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %191
  store i64 %189, ptr %192, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #9
  br label %141, !llvm.loop !24

193:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  br label %251

194:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #9
  %195 = load i32, ptr %15, align 4, !tbaa !8
  %196 = load i32, ptr %14, align 4, !tbaa !8
  %197 = add nsw i32 %195, %196
  store i32 %197, ptr %37, align 4, !tbaa !8
  br label %198

198:                                              ; preds = %204, %194
  %199 = load i32, ptr %37, align 4, !tbaa !8
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %200
  %202 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %201) #9
  %203 = xor i1 %202, true
  br i1 %203, label %204, label %250

204:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 12, ptr %38) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #9
  %205 = load i32, ptr %37, align 4, !tbaa !8
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %206
  %208 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %207) #9
  %209 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %39, i32 0, i32 0
  store ptr %208, ptr %209, align 8
  %210 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %210, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #9
  %211 = getelementptr inbounds %"struct.std::pair.0", ptr %38, i32 0, i32 0
  %212 = getelementptr inbounds %"struct.std::pair.2", ptr %211, i32 0, i32 0
  %213 = load i32, ptr %212, align 4, !tbaa !19
  store i32 %213, ptr %40, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #9
  %214 = getelementptr inbounds %"struct.std::pair.0", ptr %38, i32 0, i32 0
  %215 = getelementptr inbounds %"struct.std::pair.2", ptr %214, i32 0, i32 1
  %216 = load i32, ptr %215, align 4, !tbaa !22
  store i32 %216, ptr %41, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #9
  %217 = getelementptr inbounds %"struct.std::pair.0", ptr %38, i32 0, i32 1
  %218 = load i32, ptr %217, align 4, !tbaa !23
  store i32 %218, ptr %42, align 4, !tbaa !8
  %219 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @__FUNCTION__.main)
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %219, i8 noundef signext 32)
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %220, i32 noundef 149)
  %222 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %221, ptr noundef @.str)
  call void @_Z5traceIRSt4pairIS0_IiiEiEEvPKcOT_(ptr noundef @.str.5, ptr noundef nonnull align 4 dereferenceable(12) %38)
  %223 = load i32, ptr %37, align 4, !tbaa !8
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %224
  %226 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %225, ptr noundef nonnull align 4 dereferenceable(12) %38)
  %227 = load i32, ptr %41, align 4, !tbaa !8
  %228 = load i32, ptr %40, align 4, !tbaa !8
  %229 = sub nsw i32 %227, %228
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %230
  %232 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %231, ptr noundef nonnull align 4 dereferenceable(12) %38)
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #9
  %233 = load i32, ptr %40, align 4, !tbaa !8
  %234 = load i32, ptr %14, align 4, !tbaa !8
  %235 = sub nsw i32 %233, %234
  %236 = call i32 @llvm.abs.i32(i32 %235, i1 true)
  store i32 %236, ptr %44, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #9
  %237 = load i32, ptr %41, align 4, !tbaa !8
  %238 = load i32, ptr %15, align 4, !tbaa !8
  %239 = sub nsw i32 %237, %238
  %240 = call i32 @llvm.abs.i32(i32 %239, i1 true)
  store i32 %240, ptr %45, align 4, !tbaa !8
  %241 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %242 = load i32, ptr %241, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #9
  store i32 %242, ptr %43, align 4, !tbaa !8
  %243 = load i64, ptr %17, align 8, !tbaa !11
  %244 = load i32, ptr %43, align 4, !tbaa !8
  %245 = sext i32 %244 to i64
  %246 = add nsw i64 %243, %245
  %247 = load i32, ptr %42, align 4, !tbaa !8
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %248
  store i64 %246, ptr %249, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %38) #9
  br label %198, !llvm.loop !25

250:                                              ; preds = %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #9
  br label %251

251:                                              ; preds = %250, %193
  call void @_Z6updateRiS_S_S_S_S_Rx(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %252 = load i32, ptr %25, align 4, !tbaa !8
  store i32 %252, ptr %14, align 4, !tbaa !8
  %253 = load i32, ptr %26, align 4, !tbaa !8
  store i32 %253, ptr %15, align 4, !tbaa !8
  %254 = load i32, ptr %27, align 4, !tbaa !8
  store i32 %254, ptr %16, align 4, !tbaa !8
  %255 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @__FUNCTION__.main)
  %256 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %255, i8 noundef signext 32)
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %256, i32 noundef 163)
  %258 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %257, ptr noundef @.str)
  call void @_Z5traceIRiJS0_S0_EEvPKcOT_DpOT0_(ptr noundef @.str.6, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %100, !llvm.loop !26

259:                                              ; preds = %123, %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #9
  store i32 0, ptr %46, align 4, !tbaa !8
  br label %260

260:                                              ; preds = %272, %259
  %261 = load i32, ptr %46, align 4, !tbaa !8
  %262 = load i32, ptr @k, align 4, !tbaa !8
  %263 = icmp slt i32 %261, %262
  br i1 %263, label %265, label %264

264:                                              ; preds = %260
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #9
  br label %275

265:                                              ; preds = %260
  %266 = load i32, ptr %46, align 4, !tbaa !8
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %267
  %269 = load i64, ptr %268, align 8, !tbaa !11
  %270 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %269)
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %270, i8 noundef signext 10)
  br label %272

272:                                              ; preds = %265
  %273 = load i32, ptr %46, align 4, !tbaa !8
  %274 = add nsw i32 %273, 1
  store i32 %274, ptr %46, align 4, !tbaa !8
  br label %260, !llvm.loop !27

275:                                              ; preds = %264
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #9
  ret i32 0
}

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #7

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !9, i64 0}
!20 = !{!"_ZTSSt4pairIS_IiiEiE", !21, i64 0, !9, i64 8}
!21 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!22 = !{!20, !9, i64 4}
!23 = !{!20, !9, i64 8}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !14}


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

%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::pair<int, int>, int>, std::pair<std::pair<int, int>, int>, std::_Identity<std::pair<std::pair<int, int>, int>>, std::less<std::pair<std::pair<int, int>, 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::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.0" = type { %"struct.std::pair.2", i32 }
%"struct.std::pair.2" = type { i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@d1 = external dso_local global [200200 x %"class.std::set"], align 16
@d2 = external dso_local global [200200 x %"class.std::set"], align 16
@ans = external dso_local local_unnamed_addr global [100100 x i64], align 16
@vis = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@__FUNCTION__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca %"struct.std::pair.2", align 8
  %6 = alloca %"struct.std::pair.0", align 8
  %7 = alloca %"struct.std::pair.2", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::pair.0", align 8
  %13 = alloca %"struct.std::pair.2", align 8
  %14 = alloca %"struct.std::pair.0", align 8
  %15 = alloca %"struct.std::pair.2", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair.0", align 4
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %"struct.std::pair.0", align 4
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %28 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %29 = getelementptr i8, ptr %28, i64 -24
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %30
  %32 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %31, ptr noundef null)
  %33 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %34 = getelementptr i8, ptr %33, i64 -24
  %35 = load i64, ptr %34, align 8
  %36 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %35
  %37 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %36, ptr noundef null)
  %38 = 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)
  %39 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %40 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  store i32 0, ptr %1, align 4, !tbaa !8
  %41 = load i32, ptr @k, align 4, !tbaa !8
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %.sroa.239.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  %.sroa.233.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  br label %50

._crit_edge:                                      ; preds = %50, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  store i32 0, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #9
  store i32 0, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #9
  store i32 1, ptr %10, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  store i64 0, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %43 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %43, ptr %13, align 8
  %44 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %.fca.0.extract2355 = extractvalue { i64, i32 } %44, 0
  %.fca.1.extract2456 = extractvalue { i64, i32 } %44, 1
  store i64 %.fca.0.extract2355, ptr %12, align 8
  %.sroa.226.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 8
  store i32 %.fca.1.extract2456, ptr %.sroa.226.0..sroa_idx, align 8
  %45 = call noundef i64 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5countERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @vis, ptr noundef nonnull align 4 dereferenceable(12) %12)
  %.not57 = icmp eq i64 %45, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #9
  br i1 %.not57, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %._crit_edge
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  %46 = getelementptr inbounds i8, ptr %23, i64 4
  %47 = getelementptr inbounds i8, ptr %23, i64 8
  %48 = getelementptr inbounds i8, ptr %19, i64 4
  %49 = getelementptr inbounds i8, ptr %19, i64 8
  br label %75

50:                                               ; preds = %.lr.ph, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  %51 = 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)
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %53 = load i32, ptr %3, align 4, !tbaa !8
  %54 = load i32, ptr %2, align 4, !tbaa !8
  %55 = add nsw i32 %54, %53
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %56
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  %58 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %58, ptr %5, align 8
  %59 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract36 = extractvalue { i64, i32 } %59, 0
  %.fca.1.extract37 = extractvalue { i64, i32 } %59, 1
  store i64 %.fca.0.extract36, ptr %4, align 8
  store i32 %.fca.1.extract37, ptr %.sroa.239.0..sroa_idx, align 8
  %60 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %57, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #9
  %61 = load i32, ptr %3, align 4, !tbaa !8
  %62 = load i32, ptr %2, align 4, !tbaa !8
  %63 = sub nsw i32 %61, %62
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %64
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  %66 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %66, ptr %7, align 8
  %67 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract30 = extractvalue { i64, i32 } %67, 0
  %.fca.1.extract31 = extractvalue { i64, i32 } %67, 1
  store i64 %.fca.0.extract30, ptr %6, align 8
  store i32 %.fca.1.extract31, ptr %.sroa.233.0..sroa_idx, align 8
  %68 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) %65, ptr noundef nonnull align 4 dereferenceable(12) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #9
  %69 = load i32, ptr %1, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %70
  store i64 -1, ptr %71, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  %72 = add nsw i32 %69, 1
  store i32 %72, ptr %1, align 4, !tbaa !8
  %73 = load i32, ptr @k, align 4, !tbaa !8
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %50, label %._crit_edge, !llvm.loop !13

75:                                               ; preds = %.lr.ph60, %.loopexit
  %.04058 = phi i1 [ true, %.lr.ph60 ], [ false, %.loopexit ]
  %76 = load i32, ptr %8, align 4, !tbaa !8
  %77 = icmp eq i32 %76, 0
  %78 = load i32, ptr @n, align 4
  %79 = icmp eq i32 %76, %78
  %or.cond44 = select i1 %77, i1 true, i1 %79
  br i1 %or.cond44, label %80, label %85

80:                                               ; preds = %75
  %81 = load i32, ptr %9, align 4, !tbaa !8
  %82 = icmp ne i32 %81, 0
  %83 = load i32, ptr @m, align 4
  %84 = icmp ne i32 %81, %83
  %or.cond46.not49 = select i1 %82, i1 %84, i1 false
  %brmerge = or i1 %.04058, %or.cond46.not49
  br i1 %brmerge, label %85, label %._crit_edge61

85:                                               ; preds = %80, %75
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  %86 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %86, ptr %15, align 8
  %87 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %.fca.0.extract = extractvalue { i64, i32 } %87, 0
  %.fca.1.extract = extractvalue { i64, i32 } %87, 1
  store i64 %.fca.0.extract, ptr %14, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %88 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @vis, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #9
  %89 = load i32, ptr %10, align 4
  %90 = and i32 %89, -3
  %or.cond = icmp eq i32 %90, 1
  %91 = load i32, ptr %9, align 4, !tbaa !8
  %92 = load i32, ptr %8, align 4, !tbaa !8
  br i1 %or.cond, label %93, label %126

93:                                               ; preds = %85
  %94 = sub nsw i32 %91, %92
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %95
  %97 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %96) #9
  br i1 %97, label %.loopexit, label %.lr.ph54

.lr.ph54:                                         ; preds = %93, %.lr.ph54
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #9
  %98 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %96) #9
  store ptr %98, ptr %20, align 8
  %99 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(12) %99, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #9
  %100 = load i32, ptr %19, align 4, !tbaa !15
  %101 = load i32, ptr %48, align 4, !tbaa !18
  %102 = load i32, ptr %49, align 4, !tbaa !19
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @__FUNCTION__.main)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %103, i8 noundef signext 32)
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %104, i32 noundef 133)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef nonnull @.str)
  call void @_Z5traceIRSt4pairIS0_IiiEiEEvPKcOT_(ptr noundef nonnull @.str.5, ptr noundef nonnull align 4 dereferenceable(12) %19)
  %107 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %96, ptr noundef nonnull align 4 dereferenceable(12) %19)
  %108 = add nsw i32 %101, %100
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %109
  %111 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %110, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #9
  %112 = load i32, ptr %8, align 4, !tbaa !8
  %113 = sub nsw i32 %100, %112
  %114 = call i32 @llvm.abs.i32(i32 %113, i1 true)
  store i32 %114, ptr %21, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #9
  %115 = load i32, ptr %9, align 4, !tbaa !8
  %116 = sub nsw i32 %101, %115
  %117 = call i32 @llvm.abs.i32(i32 %116, i1 true)
  store i32 %117, ptr %22, align 4, !tbaa !8
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %119 = load i32, ptr %118, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #9
  %120 = load i64, ptr %11, align 8, !tbaa !11
  %121 = sext i32 %119 to i64
  %122 = add nsw i64 %120, %121
  %123 = sext i32 %102 to i64
  %124 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %123
  store i64 %122, ptr %124, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #9
  %125 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %96) #9
  br i1 %125, label %.loopexit, label %.lr.ph54, !llvm.loop !20

126:                                              ; preds = %85
  %127 = add nsw i32 %92, %91
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d1, i64 0, i64 %128
  %130 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %129) #9
  br i1 %130, label %.loopexit, label %.lr.ph52

.lr.ph52:                                         ; preds = %126, %.lr.ph52
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %23) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #9
  %131 = call ptr @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %129) #9
  store ptr %131, ptr %24, align 8
  %132 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiEiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %132, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #9
  %133 = load i32, ptr %23, align 4, !tbaa !15
  %134 = load i32, ptr %46, align 4, !tbaa !18
  %135 = load i32, ptr %47, align 4, !tbaa !19
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @__FUNCTION__.main)
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %136, i8 noundef signext 32)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %137, i32 noundef 149)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef nonnull @.str)
  call void @_Z5traceIRSt4pairIS0_IiiEiEEvPKcOT_(ptr noundef nonnull @.str.5, ptr noundef nonnull align 4 dereferenceable(12) %23)
  %140 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %129, ptr noundef nonnull align 4 dereferenceable(12) %23)
  %141 = sub nsw i32 %134, %133
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [200200 x %"class.std::set"], ptr @d2, i64 0, i64 %142
  %144 = call noundef i64 @_ZNSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5eraseERKS2_(ptr noundef nonnull align 8 dereferenceable(48) %143, ptr noundef nonnull align 4 dereferenceable(12) %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %25) #9
  %145 = load i32, ptr %8, align 4, !tbaa !8
  %146 = sub nsw i32 %133, %145
  %147 = call i32 @llvm.abs.i32(i32 %146, i1 true)
  store i32 %147, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #9
  %148 = load i32, ptr %9, align 4, !tbaa !8
  %149 = sub nsw i32 %134, %148
  %150 = call i32 @llvm.abs.i32(i32 %149, i1 true)
  store i32 %150, ptr %26, align 4, !tbaa !8
  %151 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %152 = load i32, ptr %151, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %25) #9
  %153 = load i64, ptr %11, align 8, !tbaa !11
  %154 = sext i32 %152 to i64
  %155 = add nsw i64 %153, %154
  %156 = sext i32 %135 to i64
  %157 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %156
  store i64 %155, ptr %157, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %23) #9
  %158 = call noundef zeroext i1 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %129) #9
  br i1 %158, label %.loopexit, label %.lr.ph52, !llvm.loop !21

.loopexit:                                        ; preds = %.lr.ph52, %.lr.ph54, %126, %93
  call void @_Z6updateRiS_S_S_S_S_Rx(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %159 = load i32, ptr %16, align 4, !tbaa !8
  store i32 %159, ptr %8, align 4, !tbaa !8
  %160 = load i32, ptr %17, align 4, !tbaa !8
  store i32 %160, ptr %9, align 4, !tbaa !8
  %161 = load i32, ptr %18, align 4, !tbaa !8
  store i32 %161, ptr %10, align 4, !tbaa !8
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @__FUNCTION__.main)
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %162, i8 noundef signext 32)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %163, i32 noundef 163)
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %164, ptr noundef nonnull @.str)
  call void @_Z5traceIRiJS0_S0_EEvPKcOT_DpOT0_(ptr noundef nonnull @.str.6, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #9
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %166 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %166, ptr %13, align 8
  %167 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %.fca.0.extract23 = extractvalue { i64, i32 } %167, 0
  %.fca.1.extract24 = extractvalue { i64, i32 } %167, 1
  store i64 %.fca.0.extract23, ptr %12, align 8
  store i32 %.fca.1.extract24, ptr %.sroa.226.0..sroa_idx, align 8
  %168 = call noundef i64 @_ZNKSt3setISt4pairIS0_IiiEiESt4lessIS2_ESaIS2_EE5countERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @vis, ptr noundef nonnull align 4 dereferenceable(12) %12)
  %.not = icmp eq i64 %168, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #9
  br i1 %.not, label %75, label %._crit_edge61, !llvm.loop !22

._crit_edge61:                                    ; preds = %.loopexit, %80, %._crit_edge
  %169 = load i32, ptr @k, align 4, !tbaa !8
  %170 = icmp sgt i32 %169, 0
  br i1 %170, label %.lr.ph65, label %._crit_edge66

._crit_edge66:                                    ; preds = %.lr.ph65, %._crit_edge61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  ret i32 0

.lr.ph65:                                         ; preds = %._crit_edge61, %.lr.ph65
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph65 ], [ 0, %._crit_edge61 ]
  %171 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %indvars.iv
  %172 = load i64, ptr %171, align 8, !tbaa !11
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %172)
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %173, i8 noundef signext 10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %175 = load i32, ptr @k, align 4, !tbaa !8
  %176 = sext i32 %175 to i64
  %177 = icmp slt i64 %indvars.iv.next, %176
  br i1 %177, label %.lr.ph65, label %._crit_edge66, !llvm.loop !23
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #5 align 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 #4

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !9, i64 0}
!16 = !{!"_ZTSSt4pairIS_IiiEiE", !17, i64 0, !9, i64 8}
!17 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!18 = !{!16, !9, i64 4}
!19 = !{!16, !9, i64 8}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}


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