; LLVM IR from eyangch/competitive-programming :: Codeforces/1712 (e)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.segment_tree = type { [1600040 x i64] }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@L = external dso_local global [100000 x i64], align 16
@R = external dso_local global [100000 x i64], align 16
@ans = external dso_local global [100000 x i64], align 16
@F = external dso_local global [400010 x %"class.std::vector"], align 16
@I = external dso_local global [200010 x %"class.std::vector"], align 16
@nF = external dso_local global [400010 x i64], align 16
@S = external dso_local global %struct.segment_tree, 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 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %29 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %30 = getelementptr i8, ptr %29, i64 -24
  %31 = load i64, ptr %30, align 8
  %32 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %31
  %33 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %32, ptr noundef null)
  %34 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %36

36:                                               ; preds = %52, %0
  %37 = load i64, ptr %2, align 8, !tbaa !8
  %38 = load i64, ptr @T, align 8, !tbaa !8
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %55

41:                                               ; preds = %36
  %42 = load i64, ptr %2, align 8, !tbaa !8
  %43 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %42
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %43)
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %45
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(8) %46)
  %48 = load i64, ptr %2, align 8, !tbaa !8
  %49 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @I, i64 0, i64 %50
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 8 dereferenceable(8) %2)
  br label %52

52:                                               ; preds = %41
  %53 = load i64, ptr %2, align 8, !tbaa !8
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr %2, align 8, !tbaa !8
  br label %36, !llvm.loop !11

55:                                               ; preds = %40
  call void @_ZN12segment_tree4initEv(ptr noundef nonnull align 8 dereferenceable(12800320) @S)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 200004, ptr %3, align 8, !tbaa !8
  br label %56

56:                                               ; preds = %125, %55
  %57 = load i64, ptr %3, align 8, !tbaa !8
  %58 = icmp sgt i64 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %128

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %61 = load i64, ptr %3, align 8, !tbaa !8
  %62 = mul nsw i64 2, %61
  store i64 %62, ptr %5, align 8, !tbaa !8
  br label %63

63:                                               ; preds = %78, %60
  %64 = load i64, ptr %5, align 8, !tbaa !8
  %65 = icmp slt i64 %64, 200005
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %82

67:                                               ; preds = %63
  %68 = load i64, ptr %5, align 8, !tbaa !8
  %69 = getelementptr inbounds [400010 x %"class.std::vector"], ptr @F, i64 0, i64 %68
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %70 = load i64, ptr %5, align 8, !tbaa !8
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = getelementptr inbounds [400010 x i64], ptr @nF, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %70, i64 noundef %73, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  %74 = load i64, ptr %5, align 8, !tbaa !8
  %75 = getelementptr inbounds [400010 x i64], ptr @nF, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %75, align 8, !tbaa !8
  br label %78

78:                                               ; preds = %67
  %79 = load i64, ptr %3, align 8, !tbaa !8
  %80 = load i64, ptr %5, align 8, !tbaa !8
  %81 = add nsw i64 %80, %79
  store i64 %81, ptr %5, align 8, !tbaa !8
  br label %63, !llvm.loop !13

82:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %83 = load i64, ptr %3, align 8, !tbaa !8
  %84 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @I, i64 0, i64 %83
  store ptr %84, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %85 = load ptr, ptr %6, align 8, !tbaa !14
  %86 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %85) #7
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %86, ptr %87, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %88 = load ptr, ptr %6, align 8, !tbaa !14
  %89 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #7
  %90 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %89, ptr %90, align 8
  br label %91

91:                                               ; preds = %122, %82
  %92 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br i1 %92, label %94, label %93

93:                                               ; preds = %91
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %124

94:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %96 = load i64, ptr %95, align 8, !tbaa !8
  store i64 %96, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %97 = load i64, ptr %9, align 8, !tbaa !8
  %98 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !8
  store i64 %99, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %100 = load i64, ptr %9, align 8, !tbaa !8
  %101 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !8
  store i64 %102, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %103 = load i64, ptr %11, align 8, !tbaa !8
  %104 = load i64, ptr %10, align 8, !tbaa !8
  %105 = sub nsw i64 %103, %104
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %107 = load i64, ptr %12, align 8, !tbaa !8
  %108 = load i64, ptr %12, align 8, !tbaa !8
  %109 = sub nsw i64 %108, 1
  %110 = mul nsw i64 %107, %109
  %111 = load i64, ptr %12, align 8, !tbaa !8
  %112 = sub nsw i64 %111, 2
  %113 = mul nsw i64 %110, %112
  %114 = sdiv i64 %113, 6
  store i64 %114, ptr %13, align 8, !tbaa !8
  %115 = load i64, ptr %11, align 8, !tbaa !8
  %116 = call noundef i64 @_ZN12segment_tree3qryExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %115, i64 noundef 0, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  %117 = load i64, ptr %13, align 8, !tbaa !8
  %118 = sub nsw i64 %117, %116
  store i64 %118, ptr %13, align 8, !tbaa !8
  %119 = load i64, ptr %13, align 8, !tbaa !8
  %120 = load i64, ptr %9, align 8, !tbaa !8
  %121 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %120
  store i64 %119, ptr %121, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %122

122:                                              ; preds = %94
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br label %91

124:                                              ; preds = %93
  br label %125

125:                                              ; preds = %124
  %126 = load i64, ptr %3, align 8, !tbaa !8
  %127 = add nsw i64 %126, -1
  store i64 %127, ptr %3, align 8, !tbaa !8
  br label %56, !llvm.loop !16

128:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %129

129:                                              ; preds = %138, %128
  %130 = load i64, ptr %14, align 8, !tbaa !8
  %131 = icmp slt i64 %130, 200005
  br i1 %131, label %133, label %132

132:                                              ; preds = %129
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %141

133:                                              ; preds = %129
  %134 = load i64, ptr %14, align 8, !tbaa !8
  %135 = getelementptr inbounds [400010 x %"class.std::vector"], ptr @F, i64 0, i64 %134
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %135) #7
  %136 = load i64, ptr %14, align 8, !tbaa !8
  %137 = getelementptr inbounds [400010 x i64], ptr @nF, i64 0, i64 %136
  store i64 0, ptr %137, align 8, !tbaa !8
  br label %138

138:                                              ; preds = %133
  %139 = load i64, ptr %14, align 8, !tbaa !8
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr %14, align 8, !tbaa !8
  br label %129, !llvm.loop !17

141:                                              ; preds = %132
  call void @_ZN12segment_tree4initEv(ptr noundef nonnull align 8 dereferenceable(12800320) @S)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 200004, ptr %15, align 8, !tbaa !8
  br label %142

142:                                              ; preds = %235, %141
  %143 = load i64, ptr %15, align 8, !tbaa !8
  %144 = icmp sgt i64 %143, 0
  br i1 %144, label %146, label %145

145:                                              ; preds = %142
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %238

146:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %147 = load i64, ptr %15, align 8, !tbaa !8
  %148 = mul nsw i64 3, %147
  store i64 %148, ptr %16, align 8, !tbaa !8
  br label %149

149:                                              ; preds = %197, %146
  %150 = load i64, ptr %16, align 8, !tbaa !8
  %151 = icmp slt i64 %150, 400010
  br i1 %151, label %153, label %152

152:                                              ; preds = %149
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %201

153:                                              ; preds = %149
  %154 = load i64, ptr %16, align 8, !tbaa !8
  %155 = srem i64 %154, 2
  %156 = icmp eq i64 %155, 1
  br i1 %156, label %157, label %158

157:                                              ; preds = %153
  br label %197

158:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %159 = load i64, ptr %16, align 8, !tbaa !8
  %160 = getelementptr inbounds [400010 x %"class.std::vector"], ptr @F, i64 0, i64 %159
  store ptr %160, ptr %17, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %161 = load ptr, ptr %17, align 8, !tbaa !14
  %162 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %161) #7
  %163 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %162, ptr %163, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %164 = load ptr, ptr %17, align 8, !tbaa !14
  %165 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %164) #7
  %166 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %165, ptr %166, align 8
  br label %167

167:                                              ; preds = %192, %158
  %168 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br i1 %168, label %170, label %169

169:                                              ; preds = %167
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %194

170:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %172 = load i64, ptr %171, align 8, !tbaa !8
  store i64 %172, ptr %20, align 8, !tbaa !8
  %173 = load i64, ptr %15, align 8, !tbaa !8
  %174 = load i64, ptr %20, align 8, !tbaa !8
  %175 = add nsw i64 %173, %174
  %176 = load i64, ptr %16, align 8, !tbaa !8
  %177 = sdiv i64 %176, 2
  %178 = icmp sgt i64 %175, %177
  br i1 %178, label %179, label %191

179:                                              ; preds = %170
  %180 = load i64, ptr %16, align 8, !tbaa !8
  %181 = sdiv i64 %180, 2
  %182 = load i64, ptr %15, align 8, !tbaa !8
  %183 = load i64, ptr %20, align 8, !tbaa !8
  %184 = call noundef i64 @_ZSt3lcmIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef %182, i64 noundef %183) #7
  %185 = call noundef i64 @_ZSt3lcmIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef %181, i64 noundef %184) #7
  %186 = load i64, ptr %16, align 8, !tbaa !8
  %187 = icmp eq i64 %185, %186
  br i1 %187, label %188, label %191

188:                                              ; preds = %179
  %189 = load i64, ptr %16, align 8, !tbaa !8
  %190 = sdiv i64 %189, 2
  call void @_ZN12segment_tree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %190, i64 noundef 1, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  br label %191

191:                                              ; preds = %188, %179, %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %192

192:                                              ; preds = %191
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %167

194:                                              ; preds = %169
  %195 = load i64, ptr %16, align 8, !tbaa !8
  %196 = getelementptr inbounds [400010 x %"class.std::vector"], ptr @F, i64 0, i64 %195
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %196, ptr noundef nonnull align 8 dereferenceable(8) %15)
  br label %197

197:                                              ; preds = %194, %157
  %198 = load i64, ptr %15, align 8, !tbaa !8
  %199 = load i64, ptr %16, align 8, !tbaa !8
  %200 = add nsw i64 %199, %198
  store i64 %200, ptr %16, align 8, !tbaa !8
  br label %149, !llvm.loop !18

201:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %202 = load i64, ptr %15, align 8, !tbaa !8
  %203 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @I, i64 0, i64 %202
  store ptr %203, ptr %21, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %204 = load ptr, ptr %21, align 8, !tbaa !14
  %205 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %204) #7
  %206 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %205, ptr %206, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %207 = load ptr, ptr %21, align 8, !tbaa !14
  %208 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %207) #7
  %209 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %208, ptr %209, align 8
  br label %210

210:                                              ; preds = %232, %201
  %211 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #7
  br i1 %211, label %213, label %212

212:                                              ; preds = %210
  store i32 24, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %234

213:                                              ; preds = %210
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  %215 = load i64, ptr %214, align 8, !tbaa !8
  store i64 %215, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %216 = load i64, ptr %24, align 8, !tbaa !8
  %217 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %216
  %218 = load i64, ptr %217, align 8, !tbaa !8
  store i64 %218, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %219 = load i64, ptr %24, align 8, !tbaa !8
  %220 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %219
  %221 = load i64, ptr %220, align 8, !tbaa !8
  store i64 %221, ptr %26, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %222 = load i64, ptr %26, align 8, !tbaa !8
  %223 = load i64, ptr %25, align 8, !tbaa !8
  %224 = sub nsw i64 %222, %223
  %225 = add nsw i64 %224, 1
  store i64 %225, ptr %27, align 8, !tbaa !8
  %226 = load i64, ptr %26, align 8, !tbaa !8
  %227 = call noundef i64 @_ZN12segment_tree3qryExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %226, i64 noundef 0, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  %228 = load i64, ptr %24, align 8, !tbaa !8
  %229 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %228
  %230 = load i64, ptr %229, align 8, !tbaa !8
  %231 = sub nsw i64 %230, %227
  store i64 %231, ptr %229, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %232

232:                                              ; preds = %213
  %233 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  br label %210

234:                                              ; preds = %212
  br label %235

235:                                              ; preds = %234
  %236 = load i64, ptr %15, align 8, !tbaa !8
  %237 = add nsw i64 %236, -1
  store i64 %237, ptr %15, align 8, !tbaa !8
  br label %142, !llvm.loop !19

238:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  store i64 0, ptr %28, align 8, !tbaa !8
  br label %239

239:                                              ; preds = %250, %238
  %240 = load i64, ptr %28, align 8, !tbaa !8
  %241 = load i64, ptr @T, align 8, !tbaa !8
  %242 = icmp slt i64 %240, %241
  br i1 %242, label %244, label %243

243:                                              ; preds = %239
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %253

244:                                              ; preds = %239
  %245 = load i64, ptr %28, align 8, !tbaa !8
  %246 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %245
  %247 = load i64, ptr %246, align 8, !tbaa !8
  %248 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %247)
  %249 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %248, i8 noundef signext 10)
  br label %250

250:                                              ; preds = %244
  %251 = load i64, ptr %28, align 8, !tbaa !8
  %252 = add nsw i64 %251, 1
  store i64 %252, ptr %28, align 8, !tbaa !8
  br label %239, !llvm.loop !20

253:                                              ; preds = %243
  %254 = load i32, ptr %1, align 4
  ret i32 %254
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #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 uwtable
declare dso_local void @_ZN12segment_tree4initEv(ptr noundef nonnull align 8 dereferenceable(12800320)) #3 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3lcmIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef, i64 noundef) #1

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

; 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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.segment_tree = type { [1600040 x i64] }
%"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.__gnu_cxx::__normal_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@L = external dso_local global [100000 x i64], align 16
@R = external dso_local global [100000 x i64], align 16
@ans = external dso_local local_unnamed_addr global [100000 x i64], align 16
@F = external dso_local global [400010 x %"class.std::vector"], align 16
@I = external dso_local global [200010 x %"class.std::vector"], align 16
@nF = external dso_local local_unnamed_addr global [400010 x i64], align 16
@S = external dso_local global %struct.segment_tree, 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 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !8
  %17 = load i64, ptr @T, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  call void @_ZN12segment_tree4initEv(ptr noundef nonnull align 8 dereferenceable(12800320) @S)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 200004, ptr %2, align 8, !tbaa !8
  br label %33

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge56 = phi i64 [ %29, %.lr.ph ], [ 0, %0 ]
  %19 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %storemerge56
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %21 = load i64, ptr %1, align 8, !tbaa !8
  %22 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %21
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %24 = load i64, ptr %1, align 8, !tbaa !8
  %25 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !8
  %27 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @I, i64 0, i64 %26
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %27, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %28 = load i64, ptr %1, align 8, !tbaa !8
  %29 = add nsw i64 %28, 1
  store i64 %29, ptr %1, align 8, !tbaa !8
  %30 = load i64, ptr @T, align 8, !tbaa !8
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !11

32:                                               ; preds = %._crit_edge63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %70

33:                                               ; preds = %._crit_edge, %._crit_edge63
  %storemerge5464 = phi i64 [ 200004, %._crit_edge ], [ %50, %._crit_edge63 ]
  %34 = icmp ult i64 %storemerge5464, 100003
  br i1 %34, label %.lr.ph59.preheader, label %._crit_edge60

.lr.ph59.preheader:                               ; preds = %33
  %35 = shl nuw nsw i64 %storemerge5464, 1
  br label %.lr.ph59

._crit_edge60:                                    ; preds = %.lr.ph59, %33
  %36 = phi i64 [ %storemerge5464, %33 ], [ %46, %.lr.ph59 ]
  %37 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @I, i64 0, i64 %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %38 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  store ptr %38, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %39 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  store ptr %39, ptr %4, align 8
  %40 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %40, label %.lr.ph62, label %._crit_edge63

.lr.ph59:                                         ; preds = %.lr.ph59.preheader, %.lr.ph59
  %.04757 = phi i64 [ %47, %.lr.ph59 ], [ %35, %.lr.ph59.preheader ]
  %41 = getelementptr inbounds [400010 x %"class.std::vector"], ptr @F, i64 0, i64 %.04757
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %42 = getelementptr inbounds [400010 x i64], ptr @nF, i64 0, i64 %.04757
  %43 = load i64, ptr %42, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %.04757, i64 noundef %43, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  %44 = load i64, ptr %42, align 8, !tbaa !8
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %42, align 8, !tbaa !8
  %46 = load i64, ptr %2, align 8, !tbaa !8
  %47 = add nsw i64 %46, %.04757
  %48 = icmp slt i64 %47, 200005
  br i1 %48, label %.lr.ph59, label %._crit_edge60, !llvm.loop !13

._crit_edge63:                                    ; preds = %.lr.ph62, %._crit_edge60
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %49 = load i64, ptr %2, align 8, !tbaa !8
  %50 = add nsw i64 %49, -1
  store i64 %50, ptr %2, align 8, !tbaa !8
  %51 = icmp sgt i64 %49, 1
  br i1 %51, label %33, label %32, !llvm.loop !14

.lr.ph62:                                         ; preds = %._crit_edge60, %.lr.ph62
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = getelementptr inbounds [100000 x i64], ptr @L, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %53
  %57 = load i64, ptr %56, align 8, !tbaa !8
  %58 = sub nsw i64 %57, %55
  %59 = add nsw i64 %58, 1
  %60 = mul nsw i64 %59, %58
  %61 = add nsw i64 %58, -1
  %62 = mul nsw i64 %60, %61
  %63 = sdiv i64 %62, 6
  %64 = call noundef i64 @_ZN12segment_tree3qryExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %57, i64 noundef 0, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  %65 = sub nsw i64 %63, %64
  %66 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %53
  store i64 %65, ptr %66, align 8, !tbaa !8
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %68 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %68, label %.lr.ph62, label %._crit_edge63

69:                                               ; preds = %70
  call void @_ZN12segment_tree4initEv(ptr noundef nonnull align 8 dereferenceable(12800320) @S)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store i64 200004, ptr %5, align 8, !tbaa !8
  br label %77

70:                                               ; preds = %32, %70
  %.04865 = phi i64 [ 0, %32 ], [ %73, %70 ]
  %71 = getelementptr inbounds [400010 x %"class.std::vector"], ptr @F, i64 0, i64 %.04865
  call void @_ZNSt6vectorIxSaIxEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  %72 = getelementptr inbounds [400010 x i64], ptr @nF, i64 0, i64 %.04865
  store i64 0, ptr %72, align 8, !tbaa !8
  %73 = add nuw nsw i64 %.04865, 1
  %exitcond.not = icmp eq i64 %73, 200005
  br i1 %exitcond.not, label %69, label %70, !llvm.loop !15

74:                                               ; preds = %._crit_edge75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %75 = load i64, ptr @T, align 8, !tbaa !8
  %76 = icmp sgt i64 %75, 0
  br i1 %76, label %.lr.ph79, label %._crit_edge80

77:                                               ; preds = %69, %._crit_edge75
  %storemerge5576 = phi i64 [ 200004, %69 ], [ %113, %._crit_edge75 ]
  %78 = icmp ult i64 %storemerge5576, 133337
  br i1 %78, label %.lr.ph71.preheader, label %._crit_edge72

.lr.ph71.preheader:                               ; preds = %77
  %79 = mul nuw nsw i64 %storemerge5576, 3
  br label %.lr.ph71

._crit_edge72:                                    ; preds = %108, %77
  %80 = phi i64 [ %storemerge5576, %77 ], [ %109, %108 ]
  %81 = getelementptr inbounds [200010 x %"class.std::vector"], ptr @I, i64 0, i64 %80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %82 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #7
  store ptr %82, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %83 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #7
  store ptr %83, ptr %9, align 8
  %84 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %84, label %.lr.ph74, label %._crit_edge75

.lr.ph71:                                         ; preds = %.lr.ph71.preheader, %108
  %85 = phi i64 [ %109, %108 ], [ %storemerge5576, %.lr.ph71.preheader ]
  %.04969 = phi i64 [ %110, %108 ], [ %79, %.lr.ph71.preheader ]
  %86 = and i64 %.04969, -9223372036854775807
  %87 = icmp eq i64 %86, 1
  br i1 %87, label %108, label %88

88:                                               ; preds = %.lr.ph71
  %89 = getelementptr inbounds [400010 x %"class.std::vector"], ptr @F, i64 0, i64 %.04969
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %90 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %89) #7
  store ptr %90, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %91 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %89) #7
  store ptr %91, ptr %7, align 8
  %92 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %92, label %.lr.ph67, label %._crit_edge68

.lr.ph67:                                         ; preds = %88
  %93 = sdiv i64 %.04969, 2
  br label %94

._crit_edge68:                                    ; preds = %105, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %.pre = load i64, ptr %5, align 8, !tbaa !8
  br label %108

94:                                               ; preds = %.lr.ph67, %105
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = load i64, ptr %5, align 8, !tbaa !8
  %98 = add nsw i64 %97, %96
  %99 = icmp sgt i64 %98, %93
  br i1 %99, label %100, label %105

100:                                              ; preds = %94
  %101 = call noundef i64 @_ZSt3lcmIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef %97, i64 noundef %96) #7
  %102 = call noundef i64 @_ZSt3lcmIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef %93, i64 noundef %101) #7
  %103 = icmp eq i64 %102, %.04969
  br i1 %103, label %104, label %105

104:                                              ; preds = %100
  call void @_ZN12segment_tree3updExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %93, i64 noundef 1, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  br label %105

105:                                              ; preds = %104, %100, %94
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %107 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %107, label %94, label %._crit_edge68

108:                                              ; preds = %.lr.ph71, %._crit_edge68
  %109 = phi i64 [ %85, %.lr.ph71 ], [ %.pre, %._crit_edge68 ]
  %110 = add nsw i64 %109, %.04969
  %111 = icmp slt i64 %110, 400010
  br i1 %111, label %.lr.ph71, label %._crit_edge72, !llvm.loop !16

._crit_edge75:                                    ; preds = %.lr.ph74, %._crit_edge72
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %112 = load i64, ptr %5, align 8, !tbaa !8
  %113 = add nsw i64 %112, -1
  store i64 %113, ptr %5, align 8, !tbaa !8
  %114 = icmp sgt i64 %112, 1
  br i1 %114, label %77, label %74, !llvm.loop !17

.lr.ph74:                                         ; preds = %._crit_edge72, %.lr.ph74
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %119 = call noundef i64 @_ZN12segment_tree3qryExxxxx(ptr noundef nonnull align 8 dereferenceable(12800320) @S, i64 noundef %118, i64 noundef 0, i64 noundef 0, i64 noundef 400009, i64 noundef 1)
  %120 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %116
  %121 = load i64, ptr %120, align 8, !tbaa !8
  %122 = sub nsw i64 %121, %119
  store i64 %122, ptr %120, align 8, !tbaa !8
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %124 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %124, label %.lr.ph74, label %._crit_edge75

._crit_edge80:                                    ; preds = %.lr.ph79, %74
  ret i32 0

.lr.ph79:                                         ; preds = %74, %.lr.ph79
  %.077 = phi i64 [ %129, %.lr.ph79 ], [ 0, %74 ]
  %125 = getelementptr inbounds [100000 x i64], ptr @ans, i64 0, i64 %.077
  %126 = load i64, ptr %125, align 8, !tbaa !8
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %126)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %127, i8 noundef signext 10)
  %129 = add nuw nsw i64 %.077, 1
  %130 = load i64, ptr @T, align 8, !tbaa !8
  %131 = icmp slt i64 %129, %130
  br i1 %131, label %.lr.ph79, label %._crit_edge80, !llvm.loop !18
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3lcmIxxENSt11common_typeIJT_T0_EE4typeES1_S2_(i64 noundef, i64 noundef) local_unnamed_addr #1

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

; 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

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

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

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


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