; LLVM IR from eyangch/competitive-programming :: USACOcontests/platinum/2018.02 (slingshot)

; 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"

%struct.ps = type { i32, i32, i32 }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%struct.segt = type { [800000 x i64], [800000 x i32], [800000 x i32] }
%"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" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%class.anon = type { i8 }
%class.anon.5 = type { i8 }
%"class.std::initializer_list" = type { ptr, i64 }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@second = external dso_local global [100000 x %struct.ps], align 16
@p = external dso_local global [100000 x %struct.ps], align 16
@cy = external dso_local global %"class.std::unordered_map", align 8
@s1 = external dso_local global %struct.segt, align 8
@s2 = external dso_local global %struct.segt, align 8
@s3 = external dso_local global %struct.segt, align 8
@s4 = external dso_local global %struct.segt, align 8
@ans = external dso_local global [100000 x i64], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::set", align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca i32, align 4
  %13 = alloca %class.anon, align 1
  %14 = alloca %class.anon.5, align 1
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca %"class.std::initializer_list", align 8
  %30 = alloca [5 x i64], align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  %35 = alloca i64, align 8
  %36 = alloca %"class.std::initializer_list", align 8
  %37 = alloca [4 x i64], align 8
  %38 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %39 = load ptr, ptr @stdin, align 8, !tbaa !5
  %40 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.2, ptr noundef %39)
  %41 = load ptr, ptr @stdout, align 8, !tbaa !5
  %42 = call ptr @freopen(ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef %41)
  %43 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %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 zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %49 = 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)
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %49, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %51 = load i32, ptr @N, align 4, !tbaa !11
  %52 = load i32, ptr @M, align 4, !tbaa !11
  %53 = add nsw i32 %51, %52
  call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s1, i32 noundef 0, i32 noundef %53, i32 noundef 1)
  %54 = load i32, ptr @N, align 4, !tbaa !11
  %55 = load i32, ptr @M, align 4, !tbaa !11
  %56 = add nsw i32 %54, %55
  call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s2, i32 noundef 0, i32 noundef %56, i32 noundef 1)
  %57 = load i32, ptr @N, align 4, !tbaa !11
  %58 = load i32, ptr @M, align 4, !tbaa !11
  %59 = add nsw i32 %57, %58
  call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef 0, i32 noundef %59, i32 noundef 1)
  %60 = load i32, ptr @N, align 4, !tbaa !11
  %61 = load i32, ptr @M, align 4, !tbaa !11
  %62 = add nsw i32 %60, %61
  call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %62, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %97, %0
  %64 = load i32, ptr %3, align 4, !tbaa !11
  %65 = load i32, ptr @N, align 4, !tbaa !11
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %104

68:                                               ; preds = %63
  %69 = load i32, ptr %3, align 4, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %70
  %72 = getelementptr inbounds %struct.ps, ptr %71, i32 0, i32 0
  %73 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %72)
          to label %74 unwind label %100

74:                                               ; preds = %68
  %75 = load i32, ptr %3, align 4, !tbaa !11
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.ps, ptr %77, i32 0, i32 1
  %79 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 4 dereferenceable(4) %78)
          to label %80 unwind label %100

80:                                               ; preds = %74
  %81 = load i32, ptr %3, align 4, !tbaa !11
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.ps, ptr %83, i32 0, i32 2
  %85 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %79, ptr noundef nonnull align 4 dereferenceable(4) %84)
          to label %86 unwind label %100

86:                                               ; preds = %80
  %87 = load i32, ptr %3, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.ps, ptr %89, i32 0, i32 1
  %91 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %90)
          to label %92 unwind label %100

92:                                               ; preds = %86
  %93 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 0
  %94 = extractvalue { ptr, i8 } %91, 0
  store ptr %94, ptr %93, align 8
  %95 = getelementptr inbounds { ptr, i8 }, ptr %6, i32 0, i32 1
  %96 = extractvalue { ptr, i8 } %91, 1
  store i8 %96, ptr %95, align 8
  br label %97

97:                                               ; preds = %92
  %98 = load i32, ptr %3, align 4, !tbaa !11
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %3, align 4, !tbaa !11
  br label %63, !llvm.loop !13

100:                                              ; preds = %86, %80, %74, %68
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %4, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %777

104:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %138, %104
  %106 = load i32, ptr %7, align 4, !tbaa !11
  %107 = load i32, ptr @M, align 4, !tbaa !11
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %145

110:                                              ; preds = %105
  %111 = load i32, ptr %7, align 4, !tbaa !11
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.ps, ptr %113, i32 0, i32 0
  %115 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %114)
          to label %116 unwind label %141

116:                                              ; preds = %110
  %117 = load i32, ptr %7, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %118
  %120 = getelementptr inbounds %struct.ps, ptr %119, i32 0, i32 1
  %121 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %115, ptr noundef nonnull align 4 dereferenceable(4) %120)
          to label %122 unwind label %141

122:                                              ; preds = %116
  %123 = load i32, ptr %7, align 4, !tbaa !11
  %124 = load i32, ptr %7, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.ps, ptr %126, i32 0, i32 2
  store i32 %123, ptr %127, align 4, !tbaa !15
  %128 = load i32, ptr %7, align 4, !tbaa !11
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %129
  %131 = getelementptr inbounds %struct.ps, ptr %130, i32 0, i32 1
  %132 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 4 dereferenceable(4) %131)
          to label %133 unwind label %141

133:                                              ; preds = %122
  %134 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 0
  %135 = extractvalue { ptr, i8 } %132, 0
  store ptr %135, ptr %134, align 8
  %136 = getelementptr inbounds { ptr, i8 }, ptr %8, i32 0, i32 1
  %137 = extractvalue { ptr, i8 } %132, 1
  store i8 %137, ptr %136, align 8
  br label %138

138:                                              ; preds = %133
  %139 = load i32, ptr %7, align 4, !tbaa !11
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %7, align 4, !tbaa !11
  br label %105, !llvm.loop !17

141:                                              ; preds = %122, %116, %110
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %4, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %777

145:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store ptr %2, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %146) #8
  %148 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %10, i32 0, i32 0
  store ptr %147, ptr %148, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %149) #8
  %151 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %11, i32 0, i32 0
  store ptr %150, ptr %151, align 8
  br label %152

152:                                              ; preds = %162, %145
  %153 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br i1 %153, label %155, label %154

154:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %168

155:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %157 = load i32, ptr %156, align 4, !tbaa !11
  store i32 %157, ptr %12, align 4, !tbaa !11
  %158 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %159 = trunc i64 %158 to i32
  %160 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %161 unwind label %164

161:                                              ; preds = %155
  store i32 %159, ptr %160, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %162

162:                                              ; preds = %161
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  br label %152

164:                                              ; preds = %155
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %4, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %777

168:                                              ; preds = %154
  %169 = load i32, ptr @N, align 4, !tbaa !11
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %struct.ps, ptr @second, i64 %170
  invoke void @"_ZSt4sortIP2psZ4mainE3$_0EvT_S3_T0_"(ptr noundef @second, ptr noundef %171)
          to label %172 unwind label %182

172:                                              ; preds = %168
  %173 = load i32, ptr @M, align 4, !tbaa !11
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds %struct.ps, ptr @p, i64 %174
  invoke void @"_ZSt4sortIP2psZ4mainE3$_1EvT_S3_T0_"(ptr noundef @p, ptr noundef %175)
          to label %176 unwind label %182

176:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %177

177:                                              ; preds = %236, %176
  %178 = load i32, ptr %15, align 4, !tbaa !11
  %179 = load i32, ptr @N, align 4, !tbaa !11
  %180 = icmp slt i32 %178, %179
  br i1 %180, label %186, label %181

181:                                              ; preds = %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %248

182:                                              ; preds = %172, %168
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %4, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %5, align 4
  br label %777

186:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %187 = load i32, ptr %15, align 4, !tbaa !11
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %188
  %190 = getelementptr inbounds %struct.ps, ptr %189, i32 0, i32 1
  %191 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %190)
          to label %192 unwind label %239

192:                                              ; preds = %186
  %193 = load i32, ptr %191, align 4, !tbaa !11
  store i32 %193, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %194 = load i32, ptr %15, align 4, !tbaa !11
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %195
  %197 = getelementptr inbounds %struct.ps, ptr %196, i32 0, i32 2
  %198 = load i32, ptr %197, align 4, !tbaa !15
  %199 = load i32, ptr %15, align 4, !tbaa !11
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %200
  %202 = getelementptr inbounds %struct.ps, ptr %201, i32 0, i32 0
  %203 = load i32, ptr %202, align 4, !tbaa !18
  %204 = add nsw i32 %198, %203
  %205 = load i32, ptr %15, align 4, !tbaa !11
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %206
  %208 = getelementptr inbounds %struct.ps, ptr %207, i32 0, i32 1
  %209 = load i32, ptr %208, align 4, !tbaa !19
  %210 = add nsw i32 %204, %209
  %211 = sext i32 %210 to i64
  store i64 %211, ptr %17, align 8, !tbaa !20
  %212 = load i32, ptr %16, align 4, !tbaa !11
  %213 = load i64, ptr %17, align 8, !tbaa !20
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %212, i32 noundef 1, i64 noundef %213)
          to label %214 unwind label %243

214:                                              ; preds = %192
  %215 = load i32, ptr %15, align 4, !tbaa !11
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %216
  %218 = getelementptr inbounds %struct.ps, ptr %217, i32 0, i32 2
  %219 = load i32, ptr %218, align 4, !tbaa !15
  %220 = load i32, ptr %15, align 4, !tbaa !11
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %221
  %223 = getelementptr inbounds %struct.ps, ptr %222, i32 0, i32 0
  %224 = load i32, ptr %223, align 4, !tbaa !18
  %225 = add nsw i32 %219, %224
  %226 = load i32, ptr %15, align 4, !tbaa !11
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %227
  %229 = getelementptr inbounds %struct.ps, ptr %228, i32 0, i32 1
  %230 = load i32, ptr %229, align 4, !tbaa !19
  %231 = sub nsw i32 %225, %230
  %232 = sext i32 %231 to i64
  store i64 %232, ptr %17, align 8, !tbaa !20
  %233 = load i32, ptr %16, align 4, !tbaa !11
  %234 = load i64, ptr %17, align 8, !tbaa !20
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef %233, i32 noundef 1, i64 noundef %234)
          to label %235 unwind label %243

235:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %236

236:                                              ; preds = %235
  %237 = load i32, ptr %15, align 4, !tbaa !11
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %15, align 4, !tbaa !11
  br label %177, !llvm.loop !22

239:                                              ; preds = %186
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %4, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %5, align 4
  br label %247

243:                                              ; preds = %214, %192
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %4, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %247

247:                                              ; preds = %243, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %777

248:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !11
  br label %249

249:                                              ; preds = %511, %248
  %250 = load i32, ptr %21, align 4, !tbaa !11
  %251 = load i32, ptr @M, align 4, !tbaa !11
  %252 = icmp slt i32 %250, %251
  br i1 %252, label %254, label %253

253:                                              ; preds = %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %539

254:                                              ; preds = %249
  br label %255

255:                                              ; preds = %337, %254
  %256 = load i32, ptr %18, align 4, !tbaa !11
  %257 = load i32, ptr @N, align 4, !tbaa !11
  %258 = icmp slt i32 %256, %257
  br i1 %258, label %259, label %271

259:                                              ; preds = %255
  %260 = load i32, ptr %18, align 4, !tbaa !11
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %261
  %263 = getelementptr inbounds %struct.ps, ptr %262, i32 0, i32 0
  %264 = load i32, ptr %263, align 4, !tbaa !18
  %265 = load i32, ptr %21, align 4, !tbaa !11
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %266
  %268 = getelementptr inbounds %struct.ps, ptr %267, i32 0, i32 0
  %269 = load i32, ptr %268, align 4, !tbaa !18
  %270 = icmp sle i32 %264, %269
  br label %271

271:                                              ; preds = %259, %255
  %272 = phi i1 [ false, %255 ], [ %270, %259 ]
  br i1 %272, label %273, label %341

273:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %274 = load i32, ptr %18, align 4, !tbaa !11
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %275
  %277 = getelementptr inbounds %struct.ps, ptr %276, i32 0, i32 1
  %278 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %277)
          to label %279 unwind label %308

279:                                              ; preds = %273
  %280 = load i32, ptr %278, align 4, !tbaa !11
  store i32 %280, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %281 = load i32, ptr %18, align 4, !tbaa !11
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %282
  %284 = getelementptr inbounds %struct.ps, ptr %283, i32 0, i32 2
  %285 = load i32, ptr %284, align 4, !tbaa !15
  %286 = load i32, ptr %18, align 4, !tbaa !11
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %287
  %289 = getelementptr inbounds %struct.ps, ptr %288, i32 0, i32 0
  %290 = load i32, ptr %289, align 4, !tbaa !18
  %291 = sub nsw i32 %285, %290
  %292 = load i32, ptr %18, align 4, !tbaa !11
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %293
  %295 = getelementptr inbounds %struct.ps, ptr %294, i32 0, i32 1
  %296 = load i32, ptr %295, align 4, !tbaa !19
  %297 = add nsw i32 %291, %296
  %298 = sext i32 %297 to i64
  store i64 %298, ptr %23, align 8, !tbaa !20
  %299 = load i32, ptr %22, align 4, !tbaa !11
  %300 = load i64, ptr %23, align 8, !tbaa !20
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s1, i32 noundef %299, i32 noundef 1, i64 noundef %300)
          to label %301 unwind label %312

301:                                              ; preds = %279
  %302 = load i64, ptr %23, align 8, !tbaa !20
  %303 = icmp slt i64 %302, 0
  br i1 %303, label %304, label %316

304:                                              ; preds = %301
  %305 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %22)
          to label %306 unwind label %312

306:                                              ; preds = %304
  %307 = load i32, ptr %305, align 4, !tbaa !11
  store i32 %307, ptr %20, align 4, !tbaa !11
  br label %316

308:                                              ; preds = %273
  %309 = landingpad { ptr, i32 }
          cleanup
  %310 = extractvalue { ptr, i32 } %309, 0
  store ptr %310, ptr %4, align 8
  %311 = extractvalue { ptr, i32 } %309, 1
  store i32 %311, ptr %5, align 4
  br label %340

312:                                              ; preds = %316, %304, %279
  %313 = landingpad { ptr, i32 }
          cleanup
  %314 = extractvalue { ptr, i32 } %313, 0
  store ptr %314, ptr %4, align 8
  %315 = extractvalue { ptr, i32 } %313, 1
  store i32 %315, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  br label %340

316:                                              ; preds = %306, %301
  %317 = load i32, ptr %18, align 4, !tbaa !11
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %318
  %320 = getelementptr inbounds %struct.ps, ptr %319, i32 0, i32 2
  %321 = load i32, ptr %320, align 4, !tbaa !15
  %322 = load i32, ptr %18, align 4, !tbaa !11
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %323
  %325 = getelementptr inbounds %struct.ps, ptr %324, i32 0, i32 0
  %326 = load i32, ptr %325, align 4, !tbaa !18
  %327 = sub nsw i32 %321, %326
  %328 = load i32, ptr %18, align 4, !tbaa !11
  %329 = sext i32 %328 to i64
  %330 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %329
  %331 = getelementptr inbounds %struct.ps, ptr %330, i32 0, i32 1
  %332 = load i32, ptr %331, align 4, !tbaa !19
  %333 = sub nsw i32 %327, %332
  %334 = sext i32 %333 to i64
  store i64 %334, ptr %23, align 8, !tbaa !20
  %335 = load i32, ptr %22, align 4, !tbaa !11
  %336 = load i64, ptr %23, align 8, !tbaa !20
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s2, i32 noundef %335, i32 noundef 1, i64 noundef %336)
          to label %337 unwind label %312

337:                                              ; preds = %316
  %338 = load i32, ptr %18, align 4, !tbaa !11
  %339 = add nsw i32 %338, 1
  store i32 %339, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %255, !llvm.loop !23

340:                                              ; preds = %312, %308
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %538

341:                                              ; preds = %271
  br label %342

342:                                              ; preds = %371, %341
  %343 = load i32, ptr %19, align 4, !tbaa !11
  %344 = load i32, ptr @N, align 4, !tbaa !11
  %345 = icmp slt i32 %343, %344
  br i1 %345, label %346, label %358

346:                                              ; preds = %342
  %347 = load i32, ptr %19, align 4, !tbaa !11
  %348 = sext i32 %347 to i64
  %349 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %348
  %350 = getelementptr inbounds %struct.ps, ptr %349, i32 0, i32 0
  %351 = load i32, ptr %350, align 4, !tbaa !18
  %352 = load i32, ptr %21, align 4, !tbaa !11
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %353
  %355 = getelementptr inbounds %struct.ps, ptr %354, i32 0, i32 0
  %356 = load i32, ptr %355, align 4, !tbaa !18
  %357 = icmp slt i32 %351, %356
  br label %358

358:                                              ; preds = %346, %342
  %359 = phi i1 [ false, %342 ], [ %357, %346 ]
  br i1 %359, label %360, label %378

360:                                              ; preds = %358
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %361 = load i32, ptr %19, align 4, !tbaa !11
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %362
  %364 = getelementptr inbounds %struct.ps, ptr %363, i32 0, i32 1
  %365 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %364)
          to label %366 unwind label %374

366:                                              ; preds = %360
  %367 = load i32, ptr %365, align 4, !tbaa !11
  store i32 %367, ptr %24, align 4, !tbaa !11
  %368 = load i32, ptr %24, align 4, !tbaa !11
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %368, i32 noundef 1, i64 noundef 100000000000000000)
          to label %369 unwind label %374

369:                                              ; preds = %366
  %370 = load i32, ptr %24, align 4, !tbaa !11
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef %370, i32 noundef 1, i64 noundef 100000000000000000)
          to label %371 unwind label %374

371:                                              ; preds = %369
  %372 = load i32, ptr %19, align 4, !tbaa !11
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %342, !llvm.loop !24

374:                                              ; preds = %369, %366, %360
  %375 = landingpad { ptr, i32 }
          cleanup
  %376 = extractvalue { ptr, i32 } %375, 0
  store ptr %376, ptr %4, align 8
  %377 = extractvalue { ptr, i32 } %375, 1
  store i32 %377, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  br label %538

378:                                              ; preds = %358
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %379 = load i32, ptr %21, align 4, !tbaa !11
  %380 = sext i32 %379 to i64
  %381 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %380
  %382 = getelementptr inbounds %struct.ps, ptr %381, i32 0, i32 1
  %383 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %382)
          to label %384 unwind label %514

384:                                              ; preds = %378
  %385 = load i32, ptr %383, align 4, !tbaa !11
  %386 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %387 = trunc i64 %386 to i32
  %388 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s1, i32 noundef %385, i32 noundef %387, i32 noundef 1)
          to label %389 unwind label %514

389:                                              ; preds = %384
  %390 = load i32, ptr %21, align 4, !tbaa !11
  %391 = sext i32 %390 to i64
  %392 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %391
  %393 = getelementptr inbounds %struct.ps, ptr %392, i32 0, i32 0
  %394 = load i32, ptr %393, align 4, !tbaa !18
  %395 = sext i32 %394 to i64
  %396 = add nsw i64 %388, %395
  %397 = load i32, ptr %21, align 4, !tbaa !11
  %398 = sext i32 %397 to i64
  %399 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %398
  %400 = getelementptr inbounds %struct.ps, ptr %399, i32 0, i32 1
  %401 = load i32, ptr %400, align 4, !tbaa !19
  %402 = sext i32 %401 to i64
  %403 = sub nsw i64 %396, %402
  store i64 %403, ptr %25, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %404 = load i32, ptr %21, align 4, !tbaa !11
  %405 = sext i32 %404 to i64
  %406 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %405
  %407 = getelementptr inbounds %struct.ps, ptr %406, i32 0, i32 1
  %408 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %407)
          to label %409 unwind label %518

409:                                              ; preds = %389
  %410 = load i32, ptr %408, align 4, !tbaa !11
  %411 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s2, i32 noundef 0, i32 noundef %410, i32 noundef 1)
          to label %412 unwind label %518

412:                                              ; preds = %409
  %413 = load i32, ptr %21, align 4, !tbaa !11
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %414
  %416 = getelementptr inbounds %struct.ps, ptr %415, i32 0, i32 0
  %417 = load i32, ptr %416, align 4, !tbaa !18
  %418 = sext i32 %417 to i64
  %419 = add nsw i64 %411, %418
  %420 = load i32, ptr %21, align 4, !tbaa !11
  %421 = sext i32 %420 to i64
  %422 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %421
  %423 = getelementptr inbounds %struct.ps, ptr %422, i32 0, i32 1
  %424 = load i32, ptr %423, align 4, !tbaa !19
  %425 = sext i32 %424 to i64
  %426 = add nsw i64 %419, %425
  store i64 %426, ptr %26, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %427 = load i32, ptr %21, align 4, !tbaa !11
  %428 = sext i32 %427 to i64
  %429 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %428
  %430 = getelementptr inbounds %struct.ps, ptr %429, i32 0, i32 1
  %431 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %430)
          to label %432 unwind label %522

432:                                              ; preds = %412
  %433 = load i32, ptr %431, align 4, !tbaa !11
  %434 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %435 = trunc i64 %434 to i32
  %436 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %433, i32 noundef %435, i32 noundef 1)
          to label %437 unwind label %522

437:                                              ; preds = %432
  %438 = load i32, ptr %21, align 4, !tbaa !11
  %439 = sext i32 %438 to i64
  %440 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %439
  %441 = getelementptr inbounds %struct.ps, ptr %440, i32 0, i32 0
  %442 = load i32, ptr %441, align 4, !tbaa !18
  %443 = sext i32 %442 to i64
  %444 = sub nsw i64 %436, %443
  %445 = load i32, ptr %21, align 4, !tbaa !11
  %446 = sext i32 %445 to i64
  %447 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %446
  %448 = getelementptr inbounds %struct.ps, ptr %447, i32 0, i32 1
  %449 = load i32, ptr %448, align 4, !tbaa !19
  %450 = sext i32 %449 to i64
  %451 = sub nsw i64 %444, %450
  store i64 %451, ptr %27, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %452 = load i32, ptr %21, align 4, !tbaa !11
  %453 = sext i32 %452 to i64
  %454 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %453
  %455 = getelementptr inbounds %struct.ps, ptr %454, i32 0, i32 1
  %456 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %455)
          to label %457 unwind label %526

457:                                              ; preds = %437
  %458 = load i32, ptr %456, align 4, !tbaa !11
  %459 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %458, i32 noundef 1)
          to label %460 unwind label %526

460:                                              ; preds = %457
  %461 = load i32, ptr %21, align 4, !tbaa !11
  %462 = sext i32 %461 to i64
  %463 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %462
  %464 = getelementptr inbounds %struct.ps, ptr %463, i32 0, i32 0
  %465 = load i32, ptr %464, align 4, !tbaa !18
  %466 = sext i32 %465 to i64
  %467 = sub nsw i64 %459, %466
  %468 = load i32, ptr %21, align 4, !tbaa !11
  %469 = sext i32 %468 to i64
  %470 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %469
  %471 = getelementptr inbounds %struct.ps, ptr %470, i32 0, i32 1
  %472 = load i32, ptr %471, align 4, !tbaa !19
  %473 = sext i32 %472 to i64
  %474 = add nsw i64 %467, %473
  store i64 %474, ptr %28, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 40, ptr %30) #8
  %475 = load i32, ptr %21, align 4, !tbaa !11
  %476 = sext i32 %475 to i64
  %477 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %476
  %478 = getelementptr inbounds %struct.ps, ptr %477, i32 0, i32 1
  %479 = load i32, ptr %478, align 4, !tbaa !19
  %480 = load i32, ptr %21, align 4, !tbaa !11
  %481 = sext i32 %480 to i64
  %482 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %481
  %483 = getelementptr inbounds %struct.ps, ptr %482, i32 0, i32 0
  %484 = load i32, ptr %483, align 4, !tbaa !18
  %485 = sub nsw i32 %479, %484
  %486 = call i32 @llvm.abs.i32(i32 %485, i1 true)
  %487 = sext i32 %486 to i64
  store i64 %487, ptr %30, align 8, !tbaa !20
  %488 = getelementptr inbounds i64, ptr %30, i64 1
  %489 = load i64, ptr %25, align 8, !tbaa !20
  store i64 %489, ptr %488, align 8, !tbaa !20
  %490 = getelementptr inbounds i64, ptr %30, i64 2
  %491 = load i64, ptr %26, align 8, !tbaa !20
  store i64 %491, ptr %490, align 8, !tbaa !20
  %492 = getelementptr inbounds i64, ptr %30, i64 3
  %493 = load i64, ptr %27, align 8, !tbaa !20
  store i64 %493, ptr %492, align 8, !tbaa !20
  %494 = getelementptr inbounds i64, ptr %30, i64 4
  %495 = load i64, ptr %28, align 8, !tbaa !20
  store i64 %495, ptr %494, align 8, !tbaa !20
  %496 = getelementptr inbounds %"class.std::initializer_list", ptr %29, i32 0, i32 0
  store ptr %30, ptr %496, align 8, !tbaa !25
  %497 = getelementptr inbounds %"class.std::initializer_list", ptr %29, i32 0, i32 1
  store i64 5, ptr %497, align 8, !tbaa !28
  %498 = getelementptr inbounds { ptr, i64 }, ptr %29, i32 0, i32 0
  %499 = load ptr, ptr %498, align 8
  %500 = getelementptr inbounds { ptr, i64 }, ptr %29, i32 0, i32 1
  %501 = load i64, ptr %500, align 8
  %502 = invoke noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr %499, i64 %501)
          to label %503 unwind label %530

503:                                              ; preds = %460
  %504 = load i32, ptr %21, align 4, !tbaa !11
  %505 = sext i32 %504 to i64
  %506 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %505
  %507 = getelementptr inbounds %struct.ps, ptr %506, i32 0, i32 2
  %508 = load i32, ptr %507, align 4, !tbaa !15
  %509 = sext i32 %508 to i64
  %510 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %509
  store i64 %502, ptr %510, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 40, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %511

511:                                              ; preds = %503
  %512 = load i32, ptr %21, align 4, !tbaa !11
  %513 = add nsw i32 %512, 1
  store i32 %513, ptr %21, align 4, !tbaa !11
  br label %249, !llvm.loop !29

514:                                              ; preds = %384, %378
  %515 = landingpad { ptr, i32 }
          cleanup
  %516 = extractvalue { ptr, i32 } %515, 0
  store ptr %516, ptr %4, align 8
  %517 = extractvalue { ptr, i32 } %515, 1
  store i32 %517, ptr %5, align 4
  br label %537

518:                                              ; preds = %409, %389
  %519 = landingpad { ptr, i32 }
          cleanup
  %520 = extractvalue { ptr, i32 } %519, 0
  store ptr %520, ptr %4, align 8
  %521 = extractvalue { ptr, i32 } %519, 1
  store i32 %521, ptr %5, align 4
  br label %536

522:                                              ; preds = %432, %412
  %523 = landingpad { ptr, i32 }
          cleanup
  %524 = extractvalue { ptr, i32 } %523, 0
  store ptr %524, ptr %4, align 8
  %525 = extractvalue { ptr, i32 } %523, 1
  store i32 %525, ptr %5, align 4
  br label %535

526:                                              ; preds = %457, %437
  %527 = landingpad { ptr, i32 }
          cleanup
  %528 = extractvalue { ptr, i32 } %527, 0
  store ptr %528, ptr %4, align 8
  %529 = extractvalue { ptr, i32 } %527, 1
  store i32 %529, ptr %5, align 4
  br label %534

530:                                              ; preds = %460
  %531 = landingpad { ptr, i32 }
          cleanup
  %532 = extractvalue { ptr, i32 } %531, 0
  store ptr %532, ptr %4, align 8
  %533 = extractvalue { ptr, i32 } %531, 1
  store i32 %533, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 40, ptr %30) #8
  br label %534

534:                                              ; preds = %530, %526
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  br label %535

535:                                              ; preds = %534, %522
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  br label %536

536:                                              ; preds = %535, %518
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  br label %537

537:                                              ; preds = %536, %514
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  br label %538

538:                                              ; preds = %537, %374, %340
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %776

539:                                              ; preds = %253
  %540 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %541 = trunc i64 %540 to i32
  invoke void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef 0, i32 noundef %541, i32 noundef 1)
          to label %542 unwind label %554

542:                                              ; preds = %539
  %543 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %544 = trunc i64 %543 to i32
  invoke void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %544, i32 noundef 1)
          to label %545 unwind label %554

545:                                              ; preds = %542
  %546 = load i32, ptr @M, align 4, !tbaa !11
  %547 = sub nsw i32 %546, 1
  store i32 %547, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  %548 = load i32, ptr @M, align 4, !tbaa !11
  %549 = sub nsw i32 %548, 1
  store i32 %549, ptr %31, align 4, !tbaa !11
  br label %550

550:                                              ; preds = %734, %545
  %551 = load i32, ptr %31, align 4, !tbaa !11
  %552 = icmp sge i32 %551, 0
  br i1 %552, label %558, label %553

553:                                              ; preds = %550
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %752

554:                                              ; preds = %542, %539
  %555 = landingpad { ptr, i32 }
          cleanup
  %556 = extractvalue { ptr, i32 } %555, 0
  store ptr %556, ptr %4, align 8
  %557 = extractvalue { ptr, i32 } %555, 1
  store i32 %557, ptr %5, align 4
  br label %776

558:                                              ; preds = %550
  br label %559

559:                                              ; preds = %640, %558
  %560 = load i32, ptr %18, align 4, !tbaa !11
  %561 = icmp sge i32 %560, 0
  br i1 %561, label %562, label %574

562:                                              ; preds = %559
  %563 = load i32, ptr %18, align 4, !tbaa !11
  %564 = sext i32 %563 to i64
  %565 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %564
  %566 = getelementptr inbounds %struct.ps, ptr %565, i32 0, i32 0
  %567 = load i32, ptr %566, align 4, !tbaa !18
  %568 = load i32, ptr %31, align 4, !tbaa !11
  %569 = sext i32 %568 to i64
  %570 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %569
  %571 = getelementptr inbounds %struct.ps, ptr %570, i32 0, i32 0
  %572 = load i32, ptr %571, align 4, !tbaa !18
  %573 = icmp sge i32 %567, %572
  br label %574

574:                                              ; preds = %562, %559
  %575 = phi i1 [ false, %559 ], [ %573, %562 ]
  br i1 %575, label %576, label %644

576:                                              ; preds = %574
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  %577 = load i32, ptr %18, align 4, !tbaa !11
  %578 = sext i32 %577 to i64
  %579 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %578
  %580 = getelementptr inbounds %struct.ps, ptr %579, i32 0, i32 1
  %581 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %580)
          to label %582 unwind label %611

582:                                              ; preds = %576
  %583 = load i32, ptr %581, align 4, !tbaa !11
  store i32 %583, ptr %32, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %584 = load i32, ptr %18, align 4, !tbaa !11
  %585 = sext i32 %584 to i64
  %586 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %585
  %587 = getelementptr inbounds %struct.ps, ptr %586, i32 0, i32 2
  %588 = load i32, ptr %587, align 4, !tbaa !15
  %589 = load i32, ptr %18, align 4, !tbaa !11
  %590 = sext i32 %589 to i64
  %591 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %590
  %592 = getelementptr inbounds %struct.ps, ptr %591, i32 0, i32 0
  %593 = load i32, ptr %592, align 4, !tbaa !18
  %594 = add nsw i32 %588, %593
  %595 = load i32, ptr %18, align 4, !tbaa !11
  %596 = sext i32 %595 to i64
  %597 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %596
  %598 = getelementptr inbounds %struct.ps, ptr %597, i32 0, i32 1
  %599 = load i32, ptr %598, align 4, !tbaa !19
  %600 = add nsw i32 %594, %599
  %601 = sext i32 %600 to i64
  store i64 %601, ptr %33, align 8, !tbaa !20
  %602 = load i32, ptr %32, align 4, !tbaa !11
  %603 = load i64, ptr %33, align 8, !tbaa !20
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %602, i32 noundef 1, i64 noundef %603)
          to label %604 unwind label %615

604:                                              ; preds = %582
  %605 = load i64, ptr %33, align 8, !tbaa !20
  %606 = icmp slt i64 %605, 0
  br i1 %606, label %607, label %619

607:                                              ; preds = %604
  %608 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %32)
          to label %609 unwind label %615

609:                                              ; preds = %607
  %610 = load i32, ptr %608, align 4, !tbaa !11
  store i32 %610, ptr %20, align 4, !tbaa !11
  br label %619

611:                                              ; preds = %576
  %612 = landingpad { ptr, i32 }
          cleanup
  %613 = extractvalue { ptr, i32 } %612, 0
  store ptr %613, ptr %4, align 8
  %614 = extractvalue { ptr, i32 } %612, 1
  store i32 %614, ptr %5, align 4
  br label %643

615:                                              ; preds = %619, %607, %582
  %616 = landingpad { ptr, i32 }
          cleanup
  %617 = extractvalue { ptr, i32 } %616, 0
  store ptr %617, ptr %4, align 8
  %618 = extractvalue { ptr, i32 } %616, 1
  store i32 %618, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %643

619:                                              ; preds = %609, %604
  %620 = load i32, ptr %18, align 4, !tbaa !11
  %621 = sext i32 %620 to i64
  %622 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %621
  %623 = getelementptr inbounds %struct.ps, ptr %622, i32 0, i32 2
  %624 = load i32, ptr %623, align 4, !tbaa !15
  %625 = load i32, ptr %18, align 4, !tbaa !11
  %626 = sext i32 %625 to i64
  %627 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %626
  %628 = getelementptr inbounds %struct.ps, ptr %627, i32 0, i32 0
  %629 = load i32, ptr %628, align 4, !tbaa !18
  %630 = add nsw i32 %624, %629
  %631 = load i32, ptr %18, align 4, !tbaa !11
  %632 = sext i32 %631 to i64
  %633 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %632
  %634 = getelementptr inbounds %struct.ps, ptr %633, i32 0, i32 1
  %635 = load i32, ptr %634, align 4, !tbaa !19
  %636 = sub nsw i32 %630, %635
  %637 = sext i32 %636 to i64
  store i64 %637, ptr %33, align 8, !tbaa !20
  %638 = load i32, ptr %32, align 4, !tbaa !11
  %639 = load i64, ptr %33, align 8, !tbaa !20
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef %638, i32 noundef 1, i64 noundef %639)
          to label %640 unwind label %615

640:                                              ; preds = %619
  %641 = load i32, ptr %18, align 4, !tbaa !11
  %642 = add nsw i32 %641, -1
  store i32 %642, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %559, !llvm.loop !30

643:                                              ; preds = %615, %611
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %751

644:                                              ; preds = %574
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %645 = load i32, ptr %31, align 4, !tbaa !11
  %646 = sext i32 %645 to i64
  %647 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %646
  %648 = getelementptr inbounds %struct.ps, ptr %647, i32 0, i32 1
  %649 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %648)
          to label %650 unwind label %737

650:                                              ; preds = %644
  %651 = load i32, ptr %649, align 4, !tbaa !11
  %652 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %653 = trunc i64 %652 to i32
  %654 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %651, i32 noundef %653, i32 noundef 1)
          to label %655 unwind label %737

655:                                              ; preds = %650
  %656 = load i32, ptr %31, align 4, !tbaa !11
  %657 = sext i32 %656 to i64
  %658 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %657
  %659 = getelementptr inbounds %struct.ps, ptr %658, i32 0, i32 0
  %660 = load i32, ptr %659, align 4, !tbaa !18
  %661 = sext i32 %660 to i64
  %662 = sub nsw i64 %654, %661
  %663 = load i32, ptr %31, align 4, !tbaa !11
  %664 = sext i32 %663 to i64
  %665 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %664
  %666 = getelementptr inbounds %struct.ps, ptr %665, i32 0, i32 1
  %667 = load i32, ptr %666, align 4, !tbaa !19
  %668 = sext i32 %667 to i64
  %669 = sub nsw i64 %662, %668
  store i64 %669, ptr %34, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %670 = load i32, ptr %31, align 4, !tbaa !11
  %671 = sext i32 %670 to i64
  %672 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %671
  %673 = getelementptr inbounds %struct.ps, ptr %672, i32 0, i32 1
  %674 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %673)
          to label %675 unwind label %741

675:                                              ; preds = %655
  %676 = load i32, ptr %674, align 4, !tbaa !11
  %677 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %676, i32 noundef 1)
          to label %678 unwind label %741

678:                                              ; preds = %675
  %679 = load i32, ptr %31, align 4, !tbaa !11
  %680 = sext i32 %679 to i64
  %681 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %680
  %682 = getelementptr inbounds %struct.ps, ptr %681, i32 0, i32 0
  %683 = load i32, ptr %682, align 4, !tbaa !18
  %684 = sext i32 %683 to i64
  %685 = sub nsw i64 %677, %684
  %686 = load i32, ptr %31, align 4, !tbaa !11
  %687 = sext i32 %686 to i64
  %688 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %687
  %689 = getelementptr inbounds %struct.ps, ptr %688, i32 0, i32 1
  %690 = load i32, ptr %689, align 4, !tbaa !19
  %691 = sext i32 %690 to i64
  %692 = add nsw i64 %685, %691
  store i64 %692, ptr %35, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 32, ptr %37) #8
  %693 = load i32, ptr %31, align 4, !tbaa !11
  %694 = sext i32 %693 to i64
  %695 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %694
  %696 = getelementptr inbounds %struct.ps, ptr %695, i32 0, i32 2
  %697 = load i32, ptr %696, align 4, !tbaa !15
  %698 = sext i32 %697 to i64
  %699 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %698
  %700 = load i64, ptr %699, align 8, !tbaa !20
  store i64 %700, ptr %37, align 8, !tbaa !20
  %701 = getelementptr inbounds i64, ptr %37, i64 1
  %702 = load i32, ptr %31, align 4, !tbaa !11
  %703 = sext i32 %702 to i64
  %704 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %703
  %705 = getelementptr inbounds %struct.ps, ptr %704, i32 0, i32 1
  %706 = load i32, ptr %705, align 4, !tbaa !19
  %707 = load i32, ptr %31, align 4, !tbaa !11
  %708 = sext i32 %707 to i64
  %709 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %708
  %710 = getelementptr inbounds %struct.ps, ptr %709, i32 0, i32 0
  %711 = load i32, ptr %710, align 4, !tbaa !18
  %712 = sub nsw i32 %706, %711
  %713 = call i32 @llvm.abs.i32(i32 %712, i1 true)
  %714 = sext i32 %713 to i64
  store i64 %714, ptr %701, align 8, !tbaa !20
  %715 = getelementptr inbounds i64, ptr %37, i64 2
  %716 = load i64, ptr %34, align 8, !tbaa !20
  store i64 %716, ptr %715, align 8, !tbaa !20
  %717 = getelementptr inbounds i64, ptr %37, i64 3
  %718 = load i64, ptr %35, align 8, !tbaa !20
  store i64 %718, ptr %717, align 8, !tbaa !20
  %719 = getelementptr inbounds %"class.std::initializer_list", ptr %36, i32 0, i32 0
  store ptr %37, ptr %719, align 8, !tbaa !25
  %720 = getelementptr inbounds %"class.std::initializer_list", ptr %36, i32 0, i32 1
  store i64 4, ptr %720, align 8, !tbaa !28
  %721 = getelementptr inbounds { ptr, i64 }, ptr %36, i32 0, i32 0
  %722 = load ptr, ptr %721, align 8
  %723 = getelementptr inbounds { ptr, i64 }, ptr %36, i32 0, i32 1
  %724 = load i64, ptr %723, align 8
  %725 = invoke noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr %722, i64 %724)
          to label %726 unwind label %745

726:                                              ; preds = %678
  %727 = load i32, ptr %31, align 4, !tbaa !11
  %728 = sext i32 %727 to i64
  %729 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %728
  %730 = getelementptr inbounds %struct.ps, ptr %729, i32 0, i32 2
  %731 = load i32, ptr %730, align 4, !tbaa !15
  %732 = sext i32 %731 to i64
  %733 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %732
  store i64 %725, ptr %733, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  br label %734

734:                                              ; preds = %726
  %735 = load i32, ptr %31, align 4, !tbaa !11
  %736 = add nsw i32 %735, -1
  store i32 %736, ptr %31, align 4, !tbaa !11
  br label %550, !llvm.loop !31

737:                                              ; preds = %650, %644
  %738 = landingpad { ptr, i32 }
          cleanup
  %739 = extractvalue { ptr, i32 } %738, 0
  store ptr %739, ptr %4, align 8
  %740 = extractvalue { ptr, i32 } %738, 1
  store i32 %740, ptr %5, align 4
  br label %750

741:                                              ; preds = %675, %655
  %742 = landingpad { ptr, i32 }
          cleanup
  %743 = extractvalue { ptr, i32 } %742, 0
  store ptr %743, ptr %4, align 8
  %744 = extractvalue { ptr, i32 } %742, 1
  store i32 %744, ptr %5, align 4
  br label %749

745:                                              ; preds = %678
  %746 = landingpad { ptr, i32 }
          cleanup
  %747 = extractvalue { ptr, i32 } %746, 0
  store ptr %747, ptr %4, align 8
  %748 = extractvalue { ptr, i32 } %746, 1
  store i32 %748, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #8
  br label %749

749:                                              ; preds = %745, %741
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  br label %750

750:                                              ; preds = %749, %737
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  br label %751

751:                                              ; preds = %750, %643
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  br label %776

752:                                              ; preds = %553
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #8
  store i32 0, ptr %38, align 4, !tbaa !11
  br label %753

753:                                              ; preds = %767, %752
  %754 = load i32, ptr %38, align 4, !tbaa !11
  %755 = load i32, ptr @M, align 4, !tbaa !11
  %756 = icmp slt i32 %754, %755
  br i1 %756, label %758, label %757

757:                                              ; preds = %753
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %774

758:                                              ; preds = %753
  %759 = load i32, ptr %38, align 4, !tbaa !11
  %760 = sext i32 %759 to i64
  %761 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %760
  %762 = load i64, ptr %761, align 8, !tbaa !20
  %763 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %762)
          to label %764 unwind label %770

764:                                              ; preds = %758
  %765 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %763, i8 noundef signext 10)
          to label %766 unwind label %770

766:                                              ; preds = %764
  br label %767

767:                                              ; preds = %766
  %768 = load i32, ptr %38, align 4, !tbaa !11
  %769 = add nsw i32 %768, 1
  store i32 %769, ptr %38, align 4, !tbaa !11
  br label %753, !llvm.loop !32

770:                                              ; preds = %764, %758
  %771 = landingpad { ptr, i32 }
          cleanup
  %772 = extractvalue { ptr, i32 } %771, 0
  store ptr %772, ptr %4, align 8
  %773 = extractvalue { ptr, i32 } %771, 1
  store i32 %773, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #8
  br label %776

774:                                              ; preds = %757
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #8
  %775 = load i32, ptr %1, align 4
  ret i32 %775

776:                                              ; preds = %770, %751, %554, %538
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %777

777:                                              ; preds = %776, %247, %182, %164, %141, %100
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #8
  br label %778

778:                                              ; preds = %777
  %779 = load ptr, ptr %4, align 8
  %780 = load i32, ptr %5, align 4
  %781 = insertvalue { ptr, i32 } poison, ptr %779, 0
  %782 = insertvalue { ptr, i32 } %781, i32 %780, 1
  resume { ptr, i32 } %782
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000), i32 noundef, i32 noundef, i32 noundef) #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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP2psZ4mainE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP2psZ4mainE3$_1EvT_S3_T0_"(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000), i32 noundef, i32 noundef, i64 noundef) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr, i64) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #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) #5

; 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 void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !12, i64 8}
!16 = !{!"_ZTS2ps", !12, i64 0, !12, i64 4, !12, i64 8}
!17 = distinct !{!17, !14}
!18 = !{!16, !12, i64 0}
!19 = !{!16, !12, i64 4}
!20 = !{!21, !21, i64 0}
!21 = !{!"long long", !7, i64 0}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = !{!26, !6, i64 0}
!26 = !{!"_ZTSSt16initializer_listIxE", !6, i64 0, !27, i64 8}
!27 = !{!"long", !7, i64 0}
!28 = !{!26, !27, i64 8}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14}
!31 = distinct !{!31, !14}
!32 = distinct !{!32, !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"

%struct.ps = type { i32, i32, i32 }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%struct.segt = type { [800000 x i64], [800000 x i32], [800000 x i32] }
%"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" }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@second = external dso_local global [100000 x %struct.ps], align 16
@p = external dso_local global [100000 x %struct.ps], align 16
@cy = external dso_local global %"class.std::unordered_map", align 8
@s1 = external dso_local global %struct.segt, align 8
@s2 = external dso_local global %struct.segt, align 8
@s3 = external dso_local global %struct.segt, align 8
@s4 = external dso_local global %struct.segt, align 8
@ans = external dso_local local_unnamed_addr global [100000 x i64], align 16
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::set", align 8
  %2 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %3 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [5 x i64], align 8
  %8 = alloca i32, align 4
  %9 = alloca [4 x i64], align 8
  %10 = load ptr, ptr @stdin, align 8, !tbaa !5
  %11 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2, ptr noundef %10)
  %12 = load ptr, ptr @stdout, align 8, !tbaa !5
  %13 = tail call ptr @freopen(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef %12)
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %22 = load i32, ptr @N, align 4, !tbaa !11
  %23 = load i32, ptr @M, align 4, !tbaa !11
  %24 = add nsw i32 %23, %22
  tail call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s1, i32 noundef 0, i32 noundef %24, i32 noundef 1)
  %25 = load i32, ptr @N, align 4, !tbaa !11
  %26 = load i32, ptr @M, align 4, !tbaa !11
  %27 = add nsw i32 %26, %25
  tail call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s2, i32 noundef 0, i32 noundef %27, i32 noundef 1)
  %28 = load i32, ptr @N, align 4, !tbaa !11
  %29 = load i32, ptr @M, align 4, !tbaa !11
  %30 = add nsw i32 %29, %28
  tail call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef 0, i32 noundef %30, i32 noundef 1)
  %31 = load i32, ptr @N, align 4, !tbaa !11
  %32 = load i32, ptr @M, align 4, !tbaa !11
  %33 = add nsw i32 %32, %31
  tail call void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %33, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  %34 = load i32, ptr @N, align 4, !tbaa !11
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph, label %.preheader172

.preheader172:                                    ; preds = %48, %0
  %36 = load i32, ptr @M, align 4, !tbaa !11
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph180, label %._crit_edge

.lr.ph:                                           ; preds = %0, %48
  %indvars.iv = phi i64 [ %indvars.iv.next, %48 ], [ 0, %0 ]
  %38 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %indvars.iv
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %38)
          to label %40 unwind label %52

40:                                               ; preds = %.lr.ph
  %41 = getelementptr inbounds i8, ptr %38, i64 4
  %42 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) %41)
          to label %43 unwind label %52

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %38, i64 8
  %45 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 4 dereferenceable(4) %44)
          to label %46 unwind label %52

46:                                               ; preds = %43
  %47 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %41)
          to label %48 unwind label %52

48:                                               ; preds = %46
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = load i32, ptr @N, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next, %50
  br i1 %51, label %.lr.ph, label %.preheader172, !llvm.loop !13

52:                                               ; preds = %46, %43, %40, %.lr.ph
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %379

._crit_edge:                                      ; preds = %66, %.preheader172
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %54 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  store ptr %54, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %55 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  store ptr %55, ptr %3, align 8
  %56 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  br i1 %56, label %.lr.ph182, label %._crit_edge183

.lr.ph180:                                        ; preds = %.preheader172, %66
  %indvars.iv211 = phi i64 [ %indvars.iv.next212, %66 ], [ 0, %.preheader172 ]
  %57 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %indvars.iv211
  %58 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %57)
          to label %59 unwind label %70

59:                                               ; preds = %.lr.ph180
  %60 = getelementptr inbounds i8, ptr %57, i64 4
  %61 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %58, ptr noundef nonnull align 4 dereferenceable(4) %60)
          to label %62 unwind label %70

62:                                               ; preds = %59
  %63 = getelementptr inbounds i8, ptr %57, i64 8
  %64 = trunc nuw nsw i64 %indvars.iv211 to i32
  store i32 %64, ptr %63, align 4, !tbaa !15
  %65 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(4) %60)
          to label %66 unwind label %70

66:                                               ; preds = %62
  %indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
  %67 = load i32, ptr @M, align 4, !tbaa !11
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next212, %68
  br i1 %69, label %.lr.ph180, label %._crit_edge, !llvm.loop !17

70:                                               ; preds = %62, %59, %.lr.ph180
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %379

._crit_edge183:                                   ; preds = %79, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %72 = load i32, ptr @N, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.ps, ptr @second, i64 %73
  invoke void @"_ZSt4sortIP2psZ4mainE3$_0EvT_S3_T0_"(ptr noundef nonnull @second, ptr noundef nonnull %74)
          to label %85 unwind label %97

.lr.ph182:                                        ; preds = %._crit_edge, %79
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  %76 = load i32, ptr %75, align 4, !tbaa !11
  store i32 %76, ptr %4, align 4, !tbaa !11
  %77 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %78 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %79 unwind label %83

79:                                               ; preds = %.lr.ph182
  %80 = trunc i64 %77 to i32
  store i32 %80, ptr %78, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  %82 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  br i1 %82, label %.lr.ph182, label %._crit_edge183

83:                                               ; preds = %.lr.ph182
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  br label %379

85:                                               ; preds = %._crit_edge183
  %86 = load i32, ptr @M, align 4, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.ps, ptr @p, i64 %87
  invoke void @"_ZSt4sortIP2psZ4mainE3$_1EvT_S3_T0_"(ptr noundef nonnull @p, ptr noundef nonnull %88)
          to label %.preheader171 unwind label %97

.preheader171:                                    ; preds = %85
  %89 = load i32, ptr @N, align 4, !tbaa !11
  %90 = icmp sgt i32 %89, 0
  br i1 %90, label %.lr.ph185, label %._crit_edge186

._crit_edge186:                                   ; preds = %118, %.preheader171
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 0, ptr %5, align 4, !tbaa !11
  %91 = load i32, ptr @M, align 4, !tbaa !11
  %92 = icmp sgt i32 %91, 0
  br i1 %92, label %.preheader170.lr.ph, label %._crit_edge199

.preheader170.lr.ph:                              ; preds = %._crit_edge186
  %93 = getelementptr inbounds i8, ptr %7, i64 8
  %94 = getelementptr inbounds i8, ptr %7, i64 16
  %95 = getelementptr inbounds i8, ptr %7, i64 24
  %96 = getelementptr inbounds i8, ptr %7, i64 32
  br label %.preheader170

97:                                               ; preds = %85, %._crit_edge183
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %379

.lr.ph185:                                        ; preds = %.preheader171, %118
  %indvars.iv214 = phi i64 [ %indvars.iv.next215, %118 ], [ 0, %.preheader171 ]
  %99 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %indvars.iv214
  %100 = getelementptr inbounds i8, ptr %99, i64 4
  %101 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %100)
          to label %102 unwind label %122

102:                                              ; preds = %.lr.ph185
  %103 = load i32, ptr %101, align 4, !tbaa !11
  %104 = getelementptr inbounds i8, ptr %99, i64 8
  %105 = load i32, ptr %104, align 4, !tbaa !15
  %106 = load i32, ptr %99, align 4, !tbaa !18
  %107 = add nsw i32 %106, %105
  %108 = load i32, ptr %100, align 4, !tbaa !19
  %109 = add nsw i32 %107, %108
  %110 = sext i32 %109 to i64
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %103, i32 noundef 1, i64 noundef %110)
          to label %111 unwind label %124

111:                                              ; preds = %102
  %112 = load i32, ptr %104, align 4, !tbaa !15
  %113 = load i32, ptr %99, align 4, !tbaa !18
  %114 = add nsw i32 %113, %112
  %115 = load i32, ptr %100, align 4, !tbaa !19
  %116 = sub i32 %114, %115
  %117 = sext i32 %116 to i64
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef %103, i32 noundef 1, i64 noundef %117)
          to label %118 unwind label %124

118:                                              ; preds = %111
  %indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
  %119 = load i32, ptr @N, align 4, !tbaa !11
  %120 = sext i32 %119 to i64
  %121 = icmp slt i64 %indvars.iv.next215, %120
  br i1 %121, label %.lr.ph185, label %._crit_edge186, !llvm.loop !20

122:                                              ; preds = %.lr.ph185
  %123 = landingpad { ptr, i32 }
          cleanup
  br label %379

124:                                              ; preds = %111, %102
  %125 = landingpad { ptr, i32 }
          cleanup
  br label %379

.preheader170:                                    ; preds = %.preheader170.lr.ph, %249
  %indvars.iv224 = phi i64 [ 0, %.preheader170.lr.ph ], [ %indvars.iv.next225, %249 ]
  %.0130198 = phi i32 [ 0, %.preheader170.lr.ph ], [ %.1131.lcssa, %249 ]
  %.0134197 = phi i32 [ 0, %.preheader170.lr.ph ], [ %.1135.lcssa, %249 ]
  %126 = load i32, ptr @N, align 4, !tbaa !11
  %127 = icmp slt i32 %.0130198, %126
  br i1 %127, label %.lr.ph188, label %.critedge

.lr.ph188:                                        ; preds = %.preheader170
  %128 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %indvars.iv224
  %129 = sext i32 %.0130198 to i64
  %130 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !18
  %132 = load i32, ptr %128, align 4, !tbaa !18
  %.not142236 = icmp sgt i32 %131, %132
  br i1 %.not142236, label %.critedge.loopexit, label %.lr.ph238

._crit_edge199:                                   ; preds = %249, %._crit_edge186
  %133 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %134 = trunc i64 %133 to i32
  invoke void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef 0, i32 noundef %134, i32 noundef 1)
          to label %267 unwind label %281

135:                                              ; preds = %168
  %136 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %indvars.iv.next218
  %137 = load i32, ptr %136, align 4, !tbaa !18
  %138 = load i32, ptr %128, align 4, !tbaa !18
  %.not142 = icmp sgt i32 %137, %138
  br i1 %.not142, label %.critedge.loopexit, label %.lr.ph238, !llvm.loop !21

.lr.ph238:                                        ; preds = %.lr.ph188, %135
  %139 = phi ptr [ %136, %135 ], [ %130, %.lr.ph188 ]
  %indvars.iv217237 = phi i64 [ %indvars.iv.next218, %135 ], [ %129, %.lr.ph188 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %140 = getelementptr inbounds i8, ptr %139, i64 4
  %141 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %140)
          to label %142 unwind label %156

142:                                              ; preds = %.lr.ph238
  %143 = load i32, ptr %141, align 4, !tbaa !11
  store i32 %143, ptr %6, align 4, !tbaa !11
  %144 = getelementptr inbounds i8, ptr %139, i64 8
  %145 = load i32, ptr %144, align 4, !tbaa !15
  %146 = load i32, ptr %139, align 4, !tbaa !18
  %147 = sub nsw i32 %145, %146
  %148 = load i32, ptr %140, align 4, !tbaa !19
  %149 = add nsw i32 %147, %148
  %150 = sext i32 %149 to i64
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s1, i32 noundef %143, i32 noundef 1, i64 noundef %150)
          to label %151 unwind label %158

151:                                              ; preds = %142
  %152 = icmp slt i32 %149, 0
  br i1 %152, label %153, label %160

153:                                              ; preds = %151
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %155 = load i32, ptr %154, align 4, !tbaa !11
  store i32 %155, ptr %5, align 4, !tbaa !11
  br label %160

156:                                              ; preds = %.lr.ph238
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %172

158:                                              ; preds = %160, %142
  %159 = landingpad { ptr, i32 }
          cleanup
  br label %172

160:                                              ; preds = %153, %151
  %161 = load i32, ptr %144, align 4, !tbaa !15
  %162 = load i32, ptr %139, align 4, !tbaa !18
  %163 = load i32, ptr %140, align 4, !tbaa !19
  %164 = add i32 %162, %163
  %165 = sub i32 %161, %164
  %166 = sext i32 %165 to i64
  %167 = load i32, ptr %6, align 4, !tbaa !11
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s2, i32 noundef %167, i32 noundef 1, i64 noundef %166)
          to label %168 unwind label %158

168:                                              ; preds = %160
  %indvars.iv.next218 = add nsw i64 %indvars.iv217237, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  %169 = load i32, ptr @N, align 4, !tbaa !11
  %170 = sext i32 %169 to i64
  %171 = icmp slt i64 %indvars.iv.next218, %170
  br i1 %171, label %135, label %.critedge.loopexit, !llvm.loop !21

172:                                              ; preds = %158, %156
  %.pn148 = phi { ptr, i32 } [ %159, %158 ], [ %157, %156 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  br label %378

.critedge.loopexit:                               ; preds = %135, %168, %.lr.ph188
  %173 = phi i32 [ %126, %.lr.ph188 ], [ %169, %168 ], [ %169, %135 ]
  %.1131.lcssa.ph.in = phi i64 [ %129, %.lr.ph188 ], [ %indvars.iv.next218, %168 ], [ %indvars.iv.next218, %135 ]
  %.1131.lcssa.ph = trunc i64 %.1131.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader170
  %174 = phi i32 [ %126, %.preheader170 ], [ %173, %.critedge.loopexit ]
  %.1131.lcssa = phi i32 [ %.0130198, %.preheader170 ], [ %.1131.lcssa.ph, %.critedge.loopexit ]
  %175 = icmp slt i32 %.0134197, %174
  br i1 %175, label %.lr.ph192, label %.critedge2

.lr.ph192:                                        ; preds = %.critedge
  %176 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %indvars.iv224
  %177 = sext i32 %.0134197 to i64
  br label %178

178:                                              ; preds = %.lr.ph192, %189
  %indvars.iv220 = phi i64 [ %177, %.lr.ph192 ], [ %indvars.iv.next221, %189 ]
  %179 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %indvars.iv220
  %180 = load i32, ptr %179, align 4, !tbaa !18
  %181 = load i32, ptr %176, align 4, !tbaa !18
  %182 = icmp slt i32 %180, %181
  br i1 %182, label %183, label %.critedge2.loopexit

183:                                              ; preds = %178
  %184 = getelementptr inbounds i8, ptr %179, i64 4
  %185 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %184)
          to label %186 unwind label %193

186:                                              ; preds = %183
  %187 = load i32, ptr %185, align 4, !tbaa !11
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %187, i32 noundef 1, i64 noundef 100000000000000000)
          to label %188 unwind label %193

188:                                              ; preds = %186
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef %187, i32 noundef 1, i64 noundef 100000000000000000)
          to label %189 unwind label %193

189:                                              ; preds = %188
  %indvars.iv.next221 = add nsw i64 %indvars.iv220, 1
  %190 = load i32, ptr @N, align 4, !tbaa !11
  %191 = sext i32 %190 to i64
  %192 = icmp slt i64 %indvars.iv.next221, %191
  br i1 %192, label %178, label %.critedge2.loopexit, !llvm.loop !22

193:                                              ; preds = %188, %186, %183
  %194 = landingpad { ptr, i32 }
          cleanup
  br label %378

.critedge2.loopexit:                              ; preds = %189, %178
  %.1135.lcssa.ph.in = phi i64 [ %indvars.iv220, %178 ], [ %indvars.iv.next221, %189 ]
  %.1135.lcssa.ph = trunc i64 %.1135.lcssa.ph.in to i32
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.critedge
  %.1135.lcssa = phi i32 [ %.0134197, %.critedge ], [ %.1135.lcssa.ph, %.critedge2.loopexit ]
  %195 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %indvars.iv224
  %196 = getelementptr inbounds i8, ptr %195, i64 4
  %197 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %196)
          to label %198 unwind label %257

198:                                              ; preds = %.critedge2
  %199 = load i32, ptr %197, align 4, !tbaa !11
  %200 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %201 = trunc i64 %200 to i32
  %202 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s1, i32 noundef %199, i32 noundef %201, i32 noundef 1)
          to label %203 unwind label %257

203:                                              ; preds = %198
  %204 = load i32, ptr %195, align 4, !tbaa !18
  %205 = sext i32 %204 to i64
  %206 = add nsw i64 %202, %205
  %207 = load i32, ptr %196, align 4, !tbaa !19
  %208 = sext i32 %207 to i64
  %209 = sub i64 %206, %208
  %210 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %196)
          to label %211 unwind label %259

211:                                              ; preds = %203
  %212 = load i32, ptr %210, align 4, !tbaa !11
  %213 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s2, i32 noundef 0, i32 noundef %212, i32 noundef 1)
          to label %214 unwind label %259

214:                                              ; preds = %211
  %215 = load i32, ptr %195, align 4, !tbaa !18
  %216 = sext i32 %215 to i64
  %217 = add nsw i64 %213, %216
  %218 = load i32, ptr %196, align 4, !tbaa !19
  %219 = sext i32 %218 to i64
  %220 = add nsw i64 %217, %219
  %221 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %196)
          to label %222 unwind label %261

222:                                              ; preds = %214
  %223 = load i32, ptr %221, align 4, !tbaa !11
  %224 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %225 = trunc i64 %224 to i32
  %226 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %223, i32 noundef %225, i32 noundef 1)
          to label %227 unwind label %261

227:                                              ; preds = %222
  %228 = load i32, ptr %195, align 4, !tbaa !18
  %229 = sext i32 %228 to i64
  %230 = load i32, ptr %196, align 4, !tbaa !19
  %231 = sext i32 %230 to i64
  %232 = add nsw i64 %229, %231
  %233 = sub i64 %226, %232
  %234 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %196)
          to label %235 unwind label %263

235:                                              ; preds = %227
  %236 = load i32, ptr %234, align 4, !tbaa !11
  %237 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %236, i32 noundef 1)
          to label %238 unwind label %263

238:                                              ; preds = %235
  %239 = load i32, ptr %195, align 4, !tbaa !18
  %240 = sext i32 %239 to i64
  %241 = sub i64 %237, %240
  %242 = load i32, ptr %196, align 4, !tbaa !19
  %243 = sext i32 %242 to i64
  %244 = add nsw i64 %241, %243
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #8
  %245 = sub nsw i32 %242, %239
  %246 = call i32 @llvm.abs.i32(i32 %245, i1 true)
  %247 = zext nneg i32 %246 to i64
  store i64 %247, ptr %7, align 8, !tbaa !23
  store i64 %209, ptr %93, align 8, !tbaa !23
  store i64 %220, ptr %94, align 8, !tbaa !23
  store i64 %233, ptr %95, align 8, !tbaa !23
  store i64 %244, ptr %96, align 8, !tbaa !23
  %248 = invoke noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr nonnull %7, i64 5)
          to label %249 unwind label %265

249:                                              ; preds = %238
  %250 = getelementptr inbounds i8, ptr %195, i64 8
  %251 = load i32, ptr %250, align 4, !tbaa !15
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %252
  store i64 %248, ptr %253, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #8
  %indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1
  %254 = load i32, ptr @M, align 4, !tbaa !11
  %255 = sext i32 %254 to i64
  %256 = icmp slt i64 %indvars.iv.next225, %255
  br i1 %256, label %.preheader170, label %._crit_edge199, !llvm.loop !25

257:                                              ; preds = %198, %.critedge2
  %258 = landingpad { ptr, i32 }
          cleanup
  br label %378

259:                                              ; preds = %211, %203
  %260 = landingpad { ptr, i32 }
          cleanup
  br label %378

261:                                              ; preds = %222, %214
  %262 = landingpad { ptr, i32 }
          cleanup
  br label %378

263:                                              ; preds = %235, %227
  %264 = landingpad { ptr, i32 }
          cleanup
  br label %378

265:                                              ; preds = %238
  %266 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #8
  br label %378

267:                                              ; preds = %._crit_edge199
  %268 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %269 = trunc i64 %268 to i32
  invoke void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %269, i32 noundef 1)
          to label %270 unwind label %281

270:                                              ; preds = %267
  %271 = load i32, ptr @M, align 4, !tbaa !11
  %272 = icmp sgt i32 %271, 0
  br i1 %272, label %.preheader169.lr.ph, label %._crit_edge209

.preheader169.lr.ph:                              ; preds = %270
  %273 = add nsw i32 %271, -1
  %274 = getelementptr inbounds i8, ptr %9, i64 8
  %275 = getelementptr inbounds i8, ptr %9, i64 16
  %276 = getelementptr inbounds i8, ptr %9, i64 24
  %277 = zext nneg i32 %273 to i64
  br label %.preheader169

.preheader169:                                    ; preds = %.preheader169.lr.ph, %356
  %indvars.iv228 = phi i64 [ %277, %.preheader169.lr.ph ], [ %indvars.iv.next229, %356 ]
  %.2132205 = phi i32 [ %273, %.preheader169.lr.ph ], [ %.3133.lcssa, %356 ]
  %278 = icmp sgt i32 %.2132205, -1
  br i1 %278, label %.lr.ph201, label %.critedge4

.lr.ph201:                                        ; preds = %.preheader169
  %279 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %indvars.iv228
  br label %283

.preheader:                                       ; preds = %356
  %.pre = load i32, ptr @M, align 4, !tbaa !11
  %280 = icmp sgt i32 %.pre, 0
  br i1 %280, label %.lr.ph208, label %._crit_edge209

281:                                              ; preds = %267, %._crit_edge199
  %282 = landingpad { ptr, i32 }
          cleanup
  br label %378

283:                                              ; preds = %.lr.ph201, %317
  %.3133200 = phi i32 [ %.2132205, %.lr.ph201 ], [ %318, %317 ]
  %284 = zext nneg i32 %.3133200 to i64
  %285 = getelementptr inbounds [100000 x %struct.ps], ptr @second, i64 0, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !18
  %287 = load i32, ptr %279, align 4, !tbaa !18
  %.not = icmp slt i32 %286, %287
  br i1 %.not, label %.critedge4, label %288

288:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %289 = getelementptr inbounds i8, ptr %285, i64 4
  %290 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %289)
          to label %291 unwind label %305

291:                                              ; preds = %288
  %292 = load i32, ptr %290, align 4, !tbaa !11
  store i32 %292, ptr %8, align 4, !tbaa !11
  %293 = getelementptr inbounds i8, ptr %285, i64 8
  %294 = load i32, ptr %293, align 4, !tbaa !15
  %295 = load i32, ptr %285, align 4, !tbaa !18
  %296 = add nsw i32 %295, %294
  %297 = load i32, ptr %289, align 4, !tbaa !19
  %298 = add nsw i32 %296, %297
  %299 = sext i32 %298 to i64
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %292, i32 noundef 1, i64 noundef %299)
          to label %300 unwind label %307

300:                                              ; preds = %291
  %301 = icmp slt i32 %298, 0
  br i1 %301, label %302, label %309

302:                                              ; preds = %300
  %303 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %304 = load i32, ptr %303, align 4, !tbaa !11
  store i32 %304, ptr %5, align 4, !tbaa !11
  br label %309

305:                                              ; preds = %288
  %306 = landingpad { ptr, i32 }
          cleanup
  br label %320

307:                                              ; preds = %309, %291
  %308 = landingpad { ptr, i32 }
          cleanup
  br label %320

309:                                              ; preds = %302, %300
  %310 = load i32, ptr %293, align 4, !tbaa !15
  %311 = load i32, ptr %285, align 4, !tbaa !18
  %312 = add nsw i32 %311, %310
  %313 = load i32, ptr %289, align 4, !tbaa !19
  %314 = sub i32 %312, %313
  %315 = sext i32 %314 to i64
  %316 = load i32, ptr %8, align 4, !tbaa !11
  invoke void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef %316, i32 noundef 1, i64 noundef %315)
          to label %317 unwind label %307

317:                                              ; preds = %309
  %318 = add nsw i32 %.3133200, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  %319 = icmp sgt i32 %.3133200, 0
  br i1 %319, label %283, label %.critedge4, !llvm.loop !26

320:                                              ; preds = %307, %305
  %.pn139 = phi { ptr, i32 } [ %308, %307 ], [ %306, %305 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  br label %378

.critedge4:                                       ; preds = %283, %317, %.preheader169
  %.3133.lcssa = phi i32 [ %.2132205, %.preheader169 ], [ -1, %317 ], [ %.3133200, %283 ]
  %321 = getelementptr inbounds [100000 x %struct.ps], ptr @p, i64 0, i64 %indvars.iv228
  %322 = getelementptr inbounds i8, ptr %321, i64 4
  %323 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %322)
          to label %324 unwind label %361

324:                                              ; preds = %.critedge4
  %325 = load i32, ptr %323, align 4, !tbaa !11
  %326 = call noundef i64 @_ZNKSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(56) @cy) #8
  %327 = trunc i64 %326 to i32
  %328 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s3, i32 noundef %325, i32 noundef %327, i32 noundef 1)
          to label %329 unwind label %361

329:                                              ; preds = %324
  %330 = load i32, ptr %321, align 4, !tbaa !18
  %331 = sext i32 %330 to i64
  %332 = load i32, ptr %322, align 4, !tbaa !19
  %333 = sext i32 %332 to i64
  %334 = add nsw i64 %331, %333
  %335 = sub i64 %328, %334
  %336 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIiiSt4hashIiESt8equal_toIiESaISt4pairIKiiEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @cy, ptr noundef nonnull align 4 dereferenceable(4) %322)
          to label %337 unwind label %363

337:                                              ; preds = %329
  %338 = load i32, ptr %336, align 4, !tbaa !11
  %339 = invoke noundef i64 @_ZN4segt3qryEiii(ptr noundef nonnull align 8 dereferenceable(12800000) @s4, i32 noundef 0, i32 noundef %338, i32 noundef 1)
          to label %340 unwind label %363

340:                                              ; preds = %337
  %341 = load i32, ptr %321, align 4, !tbaa !18
  %342 = sext i32 %341 to i64
  %343 = sub i64 %339, %342
  %344 = load i32, ptr %322, align 4, !tbaa !19
  %345 = sext i32 %344 to i64
  %346 = add nsw i64 %343, %345
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #8
  %347 = getelementptr inbounds i8, ptr %321, i64 8
  %348 = load i32, ptr %347, align 4, !tbaa !15
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %349
  %351 = load i64, ptr %350, align 8, !tbaa !23
  store i64 %351, ptr %9, align 8, !tbaa !23
  %352 = sub nsw i32 %344, %341
  %353 = call i32 @llvm.abs.i32(i32 %352, i1 true)
  %354 = zext nneg i32 %353 to i64
  store i64 %354, ptr %274, align 8, !tbaa !23
  store i64 %335, ptr %275, align 8, !tbaa !23
  store i64 %346, ptr %276, align 8, !tbaa !23
  %355 = invoke noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr nonnull %9, i64 4)
          to label %356 unwind label %365

356:                                              ; preds = %340
  %357 = load i32, ptr %347, align 4, !tbaa !15
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %358
  store i64 %355, ptr %359, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  %indvars.iv.next229 = add nsw i64 %indvars.iv228, -1
  %360 = icmp sgt i64 %indvars.iv228, 0
  br i1 %360, label %.preheader169, label %.preheader, !llvm.loop !27

361:                                              ; preds = %324, %.critedge4
  %362 = landingpad { ptr, i32 }
          cleanup
  br label %378

363:                                              ; preds = %337, %329
  %364 = landingpad { ptr, i32 }
          cleanup
  br label %378

365:                                              ; preds = %340
  %366 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #8
  br label %378

._crit_edge209:                                   ; preds = %372, %270, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  ret i32 0

.lr.ph208:                                        ; preds = %.preheader, %372
  %indvars.iv232 = phi i64 [ %indvars.iv.next233, %372 ], [ 0, %.preheader ]
  %367 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %indvars.iv232
  %368 = load i64, ptr %367, align 8, !tbaa !23
  %369 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %368)
          to label %370 unwind label %376

370:                                              ; preds = %.lr.ph208
  %371 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %369, i8 noundef signext 10)
          to label %372 unwind label %376

372:                                              ; preds = %370
  %indvars.iv.next233 = add nuw nsw i64 %indvars.iv232, 1
  %373 = load i32, ptr @M, align 4, !tbaa !11
  %374 = sext i32 %373 to i64
  %375 = icmp slt i64 %indvars.iv.next233, %374
  br i1 %375, label %.lr.ph208, label %._crit_edge209, !llvm.loop !28

376:                                              ; preds = %370, %.lr.ph208
  %377 = landingpad { ptr, i32 }
          cleanup
  br label %378

378:                                              ; preds = %320, %363, %365, %361, %172, %193, %259, %263, %265, %261, %257, %376, %281
  %.pn148.pn.pn = phi { ptr, i32 } [ %377, %376 ], [ %282, %281 ], [ %.pn148, %172 ], [ %194, %193 ], [ %258, %257 ], [ %260, %259 ], [ %262, %261 ], [ %266, %265 ], [ %264, %263 ], [ %.pn139, %320 ], [ %362, %361 ], [ %366, %365 ], [ %364, %363 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  br label %379

379:                                              ; preds = %122, %124, %378, %97, %83, %70, %52
  %.pn154 = phi { ptr, i32 } [ %53, %52 ], [ %71, %70 ], [ %84, %83 ], [ %.pn148.pn.pn, %378 ], [ %98, %97 ], [ %125, %124 ], [ %123, %122 ]
  call void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn154
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) 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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt4initEiii(ptr noundef nonnull align 8 dereferenceable(12800000), i32 noundef, i32 noundef, i32 noundef) 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 nounwind uwtable
declare dso_local void @_ZNSt3setIiSt4lessIiESaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP2psZ4mainE3$_0EvT_S3_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIP2psZ4mainE3$_1EvT_S3_T0_"(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updEiix(ptr noundef nonnull align 8 dereferenceable(12800000), i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZSt3minIxET_St16initializer_listIS0_E(ptr, i64) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #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 #5

; 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 void @_ZNSt3setIiSt4lessIiESaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

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

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

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


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