; LLVM IR from eyangch/competitive-programming :: Codeforces/799 (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 { [800005 x i64], [800005 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.anon = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon.0 = type { i8 }
%class.anon.2 = type { i8 }
%class.anon.4 = type { i8 }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@C = external dso_local global [200000 x i64], align 16
@I = external dso_local global [200000 x i64], align 16
@rI = external dso_local global [200000 x i64], align 16
@AN = external dso_local global i64, align 8
@AX = external dso_local global [200000 x i64], align 16
@BN = external dso_local global i64, align 8
@BX = external dso_local global [200000 x i64], align 16
@val = external dso_local global [200000 x i64], align 16
@vX = external dso_local global %"class.std::vector", align 8
@vY = external dso_local global %"class.std::vector", align 8
@vZ = external dso_local global %"class.std::vector", align 8
@X = external dso_local global i64, align 8
@Y = external dso_local global i64, align 8
@Z = external dso_local global i64, align 8
@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 i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %class.anon, align 1
  %7 = alloca i64, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %class.anon.0, align 1
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %class.anon.2, align 1
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %class.anon.4, align 1
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = 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) @N)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %38

38:                                               ; preds = %47, %0
  %39 = load i64, ptr %2, align 8, !tbaa !8
  %40 = load i64, ptr @N, align 8, !tbaa !8
  %41 = icmp slt i64 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  %44 = load i64, ptr %2, align 8, !tbaa !8
  %45 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %45)
  br label %47

47:                                               ; preds = %43
  %48 = load i64, ptr %2, align 8, !tbaa !8
  %49 = add nsw i64 %48, 1
  store i64 %49, ptr %2, align 8, !tbaa !8
  br label %38, !llvm.loop !11

50:                                               ; preds = %42
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @AN)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %71, %50
  %53 = load i64, ptr %3, align 8, !tbaa !8
  %54 = load i64, ptr @AN, align 8, !tbaa !8
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %74

57:                                               ; preds = %52
  %58 = load i64, ptr %3, align 8, !tbaa !8
  %59 = getelementptr inbounds [200000 x i64], ptr @AX, i64 0, i64 %58
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %59)
  %61 = load i64, ptr %3, align 8, !tbaa !8
  %62 = getelementptr inbounds [200000 x i64], ptr @AX, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = add nsw i64 %63, -1
  store i64 %64, ptr %62, align 8, !tbaa !8
  %65 = load i64, ptr %3, align 8, !tbaa !8
  %66 = getelementptr inbounds [200000 x i64], ptr @AX, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !8
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr %68, align 8, !tbaa !8
  br label %71

71:                                               ; preds = %57
  %72 = load i64, ptr %3, align 8, !tbaa !8
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %3, align 8, !tbaa !8
  br label %52, !llvm.loop !13

74:                                               ; preds = %56
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @BN)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %76

76:                                               ; preds = %95, %74
  %77 = load i64, ptr %4, align 8, !tbaa !8
  %78 = load i64, ptr @BN, align 8, !tbaa !8
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %81, label %80

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

81:                                               ; preds = %76
  %82 = load i64, ptr %4, align 8, !tbaa !8
  %83 = getelementptr inbounds [200000 x i64], ptr @BX, i64 0, i64 %82
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %83)
  %85 = load i64, ptr %4, align 8, !tbaa !8
  %86 = getelementptr inbounds [200000 x i64], ptr @BX, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = add nsw i64 %87, -1
  store i64 %88, ptr %86, align 8, !tbaa !8
  %89 = load i64, ptr %4, align 8, !tbaa !8
  %90 = getelementptr inbounds [200000 x i64], ptr @BX, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !8
  %94 = add nsw i64 %93, 2
  store i64 %94, ptr %92, align 8, !tbaa !8
  br label %95

95:                                               ; preds = %81
  %96 = load i64, ptr %4, align 8, !tbaa !8
  %97 = add nsw i64 %96, 1
  store i64 %97, ptr %4, align 8, !tbaa !8
  br label %76, !llvm.loop !14

98:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %99

99:                                               ; preds = %123, %98
  %100 = load i64, ptr %5, align 8, !tbaa !8
  %101 = load i64, ptr @N, align 8, !tbaa !8
  %102 = icmp slt i64 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %126

104:                                              ; preds = %99
  %105 = load i64, ptr %5, align 8, !tbaa !8
  %106 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !8
  %108 = icmp eq i64 %107, 1
  br i1 %108, label %109, label %110

109:                                              ; preds = %104
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @vX, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %110

110:                                              ; preds = %109, %104
  %111 = load i64, ptr %5, align 8, !tbaa !8
  %112 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = icmp eq i64 %113, 2
  br i1 %114, label %115, label %116

115:                                              ; preds = %110
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @vY, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %116

116:                                              ; preds = %115, %110
  %117 = load i64, ptr %5, align 8, !tbaa !8
  %118 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = icmp eq i64 %119, 3
  br i1 %120, label %121, label %122

121:                                              ; preds = %116
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @vZ, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %122

122:                                              ; preds = %121, %116
  br label %123

123:                                              ; preds = %122
  %124 = load i64, ptr %5, align 8, !tbaa !8
  %125 = add nsw i64 %124, 1
  store i64 %125, ptr %5, align 8, !tbaa !8
  br label %99, !llvm.loop !15

126:                                              ; preds = %103
  %127 = load i64, ptr @N, align 8, !tbaa !8
  %128 = getelementptr inbounds i64, ptr @I, i64 %127
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef @I, ptr noundef %128, i32 noundef 0)
  %129 = load i64, ptr @N, align 8, !tbaa !8
  %130 = getelementptr inbounds i64, ptr @I, i64 %129
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef @I, ptr noundef %130)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %131

131:                                              ; preds = %142, %126
  %132 = load i64, ptr %7, align 8, !tbaa !8
  %133 = load i64, ptr @N, align 8, !tbaa !8
  %134 = icmp slt i64 %132, %133
  br i1 %134, label %136, label %135

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

136:                                              ; preds = %131
  %137 = load i64, ptr %7, align 8, !tbaa !8
  %138 = load i64, ptr %7, align 8, !tbaa !8
  %139 = getelementptr inbounds [200000 x i64], ptr @I, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !8
  %141 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %140
  store i64 %137, ptr %141, align 8, !tbaa !8
  br label %142

142:                                              ; preds = %136
  %143 = load i64, ptr %7, align 8, !tbaa !8
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %7, align 8, !tbaa !8
  br label %131, !llvm.loop !16

145:                                              ; preds = %135
  %146 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vX) #7
  store i64 %146, ptr @X, align 8, !tbaa !8
  %147 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vY) #7
  store i64 %147, ptr @Y, align 8, !tbaa !8
  %148 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vZ) #7
  store i64 %148, ptr @Z, align 8, !tbaa !8
  %149 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @vX) #7
  %150 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  %151 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @vX) #7
  %152 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  %153 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8
  %155 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_1EvT_S8_T0_"(ptr %154, ptr %156)
  %157 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @vY) #7
  %158 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %157, ptr %158, align 8
  %159 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @vY) #7
  %160 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %159, ptr %160, align 8
  %161 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8
  %163 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_2EvT_S8_T0_"(ptr %162, ptr %164)
  %165 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @vZ) #7
  %166 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %165, ptr %166, align 8
  %167 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @vZ) #7
  %168 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %167, ptr %168, align 8
  %169 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8
  %171 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_3EvT_S8_T0_"(ptr %170, ptr %172)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !8
  br label %173

173:                                              ; preds = %185, %145
  %174 = load i64, ptr %17, align 8, !tbaa !8
  %175 = load i64, ptr @N, align 8, !tbaa !8
  %176 = icmp slt i64 %174, %175
  br i1 %176, label %178, label %177

177:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %188

178:                                              ; preds = %173
  %179 = load i64, ptr %17, align 8, !tbaa !8
  %180 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %179
  %181 = load i64, ptr %180, align 8, !tbaa !8
  %182 = load i64, ptr %17, align 8, !tbaa !8
  %183 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %182
  %184 = load i64, ptr %183, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %181, i1 noundef zeroext true, i64 noundef %184, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  br label %185

185:                                              ; preds = %178
  %186 = load i64, ptr %17, align 8, !tbaa !8
  %187 = add nsw i64 %186, 1
  store i64 %187, ptr %17, align 8, !tbaa !8
  br label %173, !llvm.loop !17

188:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 0, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 0, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  store i64 0, ptr %21, align 8, !tbaa !8
  br label %189

189:                                              ; preds = %208, %188
  %190 = load i64, ptr %21, align 8, !tbaa !8
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @Z, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %192 = load i64, ptr %191, align 8, !tbaa !8
  %193 = icmp slt i64 %190, %192
  br i1 %193, label %195, label %194

194:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %211

195:                                              ; preds = %189
  %196 = load i64, ptr %21, align 8, !tbaa !8
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vZ, i64 noundef %196) #7
  %198 = load i64, ptr %197, align 8, !tbaa !8
  %199 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %198
  %200 = load i64, ptr %199, align 8, !tbaa !8
  %201 = load i64, ptr %20, align 8, !tbaa !8
  %202 = add nsw i64 %201, %200
  store i64 %202, ptr %20, align 8, !tbaa !8
  %203 = load i64, ptr %21, align 8, !tbaa !8
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vZ, i64 noundef %203) #7
  %205 = load i64, ptr %204, align 8, !tbaa !8
  %206 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %205
  %207 = load i64, ptr %206, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %207, i1 noundef zeroext false, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  br label %208

208:                                              ; preds = %195
  %209 = load i64, ptr %21, align 8, !tbaa !8
  %210 = add nsw i64 %209, 1
  store i64 %210, ptr %21, align 8, !tbaa !8
  br label %189, !llvm.loop !18

211:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 10000000000000000, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 0, ptr %23, align 8, !tbaa !8
  br label %212

212:                                              ; preds = %306, %211
  %213 = load i64, ptr %23, align 8, !tbaa !8
  %214 = load i64, ptr @K, align 8, !tbaa !8
  %215 = icmp sle i64 %213, %214
  br i1 %215, label %217, label %216

216:                                              ; preds = %212
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %309

217:                                              ; preds = %212
  %218 = load i64, ptr @K, align 8, !tbaa !8
  %219 = load i64, ptr %23, align 8, !tbaa !8
  %220 = sub nsw i64 %218, %219
  %221 = load i64, ptr @Z, align 8, !tbaa !8
  %222 = icmp sle i64 %220, %221
  br i1 %222, label %223, label %271

223:                                              ; preds = %217
  %224 = load i64, ptr %23, align 8, !tbaa !8
  %225 = load i64, ptr @X, align 8, !tbaa !8
  %226 = icmp sle i64 %224, %225
  br i1 %226, label %227, label %271

227:                                              ; preds = %223
  %228 = load i64, ptr %23, align 8, !tbaa !8
  %229 = load i64, ptr @Y, align 8, !tbaa !8
  %230 = icmp sle i64 %228, %229
  br i1 %230, label %231, label %271

231:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %232 = load i64, ptr @M, align 8, !tbaa !8
  %233 = load i64, ptr %23, align 8, !tbaa !8
  %234 = sub nsw i64 %232, %233
  %235 = load i64, ptr @K, align 8, !tbaa !8
  %236 = sub nsw i64 %234, %235
  store i64 %236, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %237 = load i64, ptr %24, align 8, !tbaa !8
  %238 = call noundef i64 @_ZN12segment_tree4walkExxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %237, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  store i64 %238, ptr %25, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %239 = load i64, ptr %25, align 8, !tbaa !8
  %240 = load i64, ptr %18, align 8, !tbaa !8
  %241 = add nsw i64 %239, %240
  %242 = load i64, ptr %19, align 8, !tbaa !8
  %243 = add nsw i64 %241, %242
  %244 = load i64, ptr %20, align 8, !tbaa !8
  %245 = add nsw i64 %243, %244
  store i64 %245, ptr %26, align 8, !tbaa !8
  %246 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %247 = load i64, ptr %246, align 8, !tbaa !8
  store i64 %247, ptr %22, align 8, !tbaa !8
  %248 = load i64, ptr %23, align 8, !tbaa !8
  %249 = load i64, ptr @K, align 8, !tbaa !8
  %250 = icmp slt i64 %248, %249
  br i1 %250, label %251, label %270

251:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %252 = load i64, ptr @K, align 8, !tbaa !8
  %253 = load i64, ptr %23, align 8, !tbaa !8
  %254 = sub nsw i64 %252, %253
  %255 = sub nsw i64 %254, 1
  store i64 %255, ptr %27, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %256 = load i64, ptr %27, align 8, !tbaa !8
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vZ, i64 noundef %256) #7
  %258 = load i64, ptr %257, align 8, !tbaa !8
  store i64 %258, ptr %28, align 8, !tbaa !8
  %259 = load i64, ptr %28, align 8, !tbaa !8
  %260 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %259
  %261 = load i64, ptr %260, align 8, !tbaa !8
  %262 = load i64, ptr %28, align 8, !tbaa !8
  %263 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %262
  %264 = load i64, ptr %263, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %261, i1 noundef zeroext true, i64 noundef %264, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %265 = load i64, ptr %28, align 8, !tbaa !8
  %266 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %265
  %267 = load i64, ptr %266, align 8, !tbaa !8
  %268 = load i64, ptr %20, align 8, !tbaa !8
  %269 = sub nsw i64 %268, %267
  store i64 %269, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %270

270:                                              ; preds = %251, %231
  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 %271

271:                                              ; preds = %270, %227, %223, %217
  %272 = load i64, ptr %23, align 8, !tbaa !8
  %273 = load i64, ptr @X, align 8, !tbaa !8
  %274 = icmp slt i64 %272, %273
  br i1 %274, label %275, label %288

275:                                              ; preds = %271
  %276 = load i64, ptr %23, align 8, !tbaa !8
  %277 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vX, i64 noundef %276) #7
  %278 = load i64, ptr %277, align 8, !tbaa !8
  %279 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %278
  %280 = load i64, ptr %279, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %280, i1 noundef zeroext false, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %281 = load i64, ptr %23, align 8, !tbaa !8
  %282 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vX, i64 noundef %281) #7
  %283 = load i64, ptr %282, align 8, !tbaa !8
  %284 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %283
  %285 = load i64, ptr %284, align 8, !tbaa !8
  %286 = load i64, ptr %18, align 8, !tbaa !8
  %287 = add nsw i64 %286, %285
  store i64 %287, ptr %18, align 8, !tbaa !8
  br label %288

288:                                              ; preds = %275, %271
  %289 = load i64, ptr %23, align 8, !tbaa !8
  %290 = load i64, ptr @Y, align 8, !tbaa !8
  %291 = icmp slt i64 %289, %290
  br i1 %291, label %292, label %305

292:                                              ; preds = %288
  %293 = load i64, ptr %23, align 8, !tbaa !8
  %294 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vY, i64 noundef %293) #7
  %295 = load i64, ptr %294, align 8, !tbaa !8
  %296 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %295
  %297 = load i64, ptr %296, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %297, i1 noundef zeroext false, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %298 = load i64, ptr %23, align 8, !tbaa !8
  %299 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vY, i64 noundef %298) #7
  %300 = load i64, ptr %299, align 8, !tbaa !8
  %301 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %300
  %302 = load i64, ptr %301, align 8, !tbaa !8
  %303 = load i64, ptr %19, align 8, !tbaa !8
  %304 = add nsw i64 %303, %302
  store i64 %304, ptr %19, align 8, !tbaa !8
  br label %305

305:                                              ; preds = %292, %288
  br label %306

306:                                              ; preds = %305
  %307 = load i64, ptr %23, align 8, !tbaa !8
  %308 = add nsw i64 %307, 1
  store i64 %308, ptr %23, align 8, !tbaa !8
  br label %212, !llvm.loop !19

309:                                              ; preds = %216
  %310 = load i64, ptr %22, align 8, !tbaa !8
  %311 = sitofp i64 %310 to double
  %312 = fcmp oge double %311, 9.000000e+15
  br i1 %312, label %313, label %314

313:                                              ; preds = %309
  br label %316

314:                                              ; preds = %309
  %315 = load i64, ptr %22, align 8, !tbaa !8
  br label %316

316:                                              ; preds = %314, %313
  %317 = phi i64 [ -1, %313 ], [ %315, %314 ]
  %318 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %317)
  %319 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %318, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %320 = load i32, ptr %1, align 4
  ret i32 %320
}

; 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: 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 @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_1EvT_S8_T0_"(ptr, ptr) #5

; 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 uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_2EvT_S8_T0_"(ptr, ptr) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_3EvT_S8_T0_"(ptr, ptr) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080), i64 noundef, i1 noundef zeroext, i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3 align 2

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

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

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

; 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

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 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 = { 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}
!19 = distinct !{!19, !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 { [800005 x i64], [800005 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" }

@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@C = external dso_local global [200000 x i64], align 16
@I = external dso_local global [200000 x i64], align 16
@rI = external dso_local local_unnamed_addr global [200000 x i64], align 16
@AN = external dso_local global i64, align 8
@AX = external dso_local global [200000 x i64], align 16
@BN = external dso_local global i64, align 8
@BX = external dso_local global [200000 x i64], align 16
@val = external dso_local local_unnamed_addr global [200000 x i64], align 16
@vX = external dso_local global %"class.std::vector", align 8
@vY = external dso_local global %"class.std::vector", align 8
@vZ = external dso_local global %"class.std::vector", align 8
@X = external dso_local local_unnamed_addr global i64, align 8
@Y = external dso_local local_unnamed_addr global i64, align 8
@Z = external dso_local global i64, align 8
@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 i64, align 8
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = 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) @N)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %13 = load i64, ptr @N, align 8, !tbaa !8
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %15 = 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) @AN)
  %16 = load i64, ptr @AN, align 8, !tbaa !8
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph80, label %._crit_edge81

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.077 = phi i64 [ %20, %.lr.ph ], [ 0, %0 ]
  %18 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.077
  %19 = 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) %18)
  %20 = add nuw nsw i64 %.077, 1
  %21 = load i64, ptr @N, align 8, !tbaa !8
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge81:                                    ; preds = %.lr.ph80, %._crit_edge
  %23 = 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) @BN)
  %24 = load i64, ptr @BN, align 8, !tbaa !8
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph84, label %._crit_edge85

.lr.ph80:                                         ; preds = %._crit_edge, %.lr.ph80
  %.05878 = phi i64 [ %33, %.lr.ph80 ], [ 0, %._crit_edge ]
  %26 = getelementptr inbounds [200000 x i64], ptr @AX, i64 0, i64 %.05878
  %27 = 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) %26)
  %28 = load i64, ptr %26, align 8, !tbaa !8
  %29 = add nsw i64 %28, -1
  store i64 %29, ptr %26, align 8, !tbaa !8
  %30 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !8
  %32 = add nsw i64 %31, 1
  store i64 %32, ptr %30, align 8, !tbaa !8
  %33 = add nuw nsw i64 %.05878, 1
  %34 = load i64, ptr @AN, align 8, !tbaa !8
  %35 = icmp slt i64 %33, %34
  br i1 %35, label %.lr.ph80, label %._crit_edge81, !llvm.loop !13

._crit_edge85:                                    ; preds = %.lr.ph84, %._crit_edge81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 0, ptr %1, align 8, !tbaa !8
  %36 = load i64, ptr @N, align 8, !tbaa !8
  %37 = icmp sgt i64 %36, 0
  br i1 %37, label %.lr.ph88, label %._crit_edge89

.lr.ph84:                                         ; preds = %._crit_edge81, %.lr.ph84
  %.05982 = phi i64 [ %45, %.lr.ph84 ], [ 0, %._crit_edge81 ]
  %38 = getelementptr inbounds [200000 x i64], ptr @BX, i64 0, i64 %.05982
  %39 = 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) %38)
  %40 = load i64, ptr %38, align 8, !tbaa !8
  %41 = add nsw i64 %40, -1
  store i64 %41, ptr %38, align 8, !tbaa !8
  %42 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = add nsw i64 %43, 2
  store i64 %44, ptr %42, align 8, !tbaa !8
  %45 = add nuw nsw i64 %.05982, 1
  %46 = load i64, ptr @BN, align 8, !tbaa !8
  %47 = icmp slt i64 %45, %46
  br i1 %47, label %.lr.ph84, label %._crit_edge85, !llvm.loop !14

._crit_edge89:                                    ; preds = %68, %._crit_edge85
  %.lcssa = phi i64 [ %36, %._crit_edge85 ], [ %71, %68 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %48 = getelementptr inbounds i64, ptr @I, i64 %.lcssa
  call void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef nonnull @I, ptr noundef nonnull %48, i32 noundef 0)
  %49 = load i64, ptr @N, align 8, !tbaa !8
  %50 = getelementptr inbounds i64, ptr @I, i64 %49
  call void @"_ZSt4sortIPxZ4mainE3$_0EvT_S2_T0_"(ptr noundef nonnull @I, ptr noundef nonnull %50)
  %51 = load i64, ptr @N, align 8, !tbaa !8
  %52 = icmp sgt i64 %51, 0
  br i1 %52, label %.lr.ph92.preheader, label %._crit_edge93

.lr.ph92.preheader:                               ; preds = %._crit_edge89
  %xtraiter = and i64 %51, 3
  %53 = icmp ult i64 %51, 4
  br i1 %53, label %._crit_edge93.loopexit.unr-lcssa, label %.lr.ph92.preheader.new

.lr.ph92.preheader.new:                           ; preds = %.lr.ph92.preheader
  %unroll_iter = and i64 %51, 9223372036854775804
  br label %.lr.ph92

.lr.ph88:                                         ; preds = %._crit_edge85, %68
  %storemerge86 = phi i64 [ %70, %68 ], [ 0, %._crit_edge85 ]
  %54 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %storemerge86
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = icmp eq i64 %55, 1
  br i1 %56, label %57, label %58

57:                                               ; preds = %.lr.ph88
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @vX, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.pre = load i64, ptr %1, align 8, !tbaa !8
  %.phi.trans.insert = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %.pre
  %.pre113 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %57, %.lr.ph88
  %59 = phi i64 [ %.pre113, %57 ], [ %55, %.lr.ph88 ]
  %60 = phi i64 [ %.pre, %57 ], [ %storemerge86, %.lr.ph88 ]
  %61 = icmp eq i64 %59, 2
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @vY, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.pre114 = load i64, ptr %1, align 8, !tbaa !8
  %.phi.trans.insert115 = getelementptr inbounds [200000 x i64], ptr @val, i64 0, i64 %.pre114
  %.pre116 = load i64, ptr %.phi.trans.insert115, align 8, !tbaa !8
  br label %63

63:                                               ; preds = %62, %58
  %64 = phi i64 [ %.pre116, %62 ], [ %59, %58 ]
  %65 = phi i64 [ %.pre114, %62 ], [ %60, %58 ]
  %66 = icmp eq i64 %64, 3
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @vZ, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.pre117 = load i64, ptr %1, align 8, !tbaa !8
  br label %68

68:                                               ; preds = %63, %67
  %69 = phi i64 [ %65, %63 ], [ %.pre117, %67 ]
  %70 = add nsw i64 %69, 1
  store i64 %70, ptr %1, align 8, !tbaa !8
  %71 = load i64, ptr @N, align 8, !tbaa !8
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %.lr.ph88, label %._crit_edge89, !llvm.loop !15

._crit_edge93.loopexit.unr-lcssa:                 ; preds = %.lr.ph92, %.lr.ph92.preheader
  %.06090.unr = phi i64 [ 0, %.lr.ph92.preheader ], [ %103, %.lr.ph92 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge93, label %.lr.ph92.epil

.lr.ph92.epil:                                    ; preds = %._crit_edge93.loopexit.unr-lcssa, %.lr.ph92.epil
  %.06090.epil = phi i64 [ %76, %.lr.ph92.epil ], [ %.06090.unr, %._crit_edge93.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph92.epil ], [ 0, %._crit_edge93.loopexit.unr-lcssa ]
  %73 = getelementptr inbounds [200000 x i64], ptr @I, i64 0, i64 %.06090.epil
  %74 = load i64, ptr %73, align 8, !tbaa !8
  %75 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %74
  store i64 %.06090.epil, ptr %75, align 8, !tbaa !8
  %76 = add nuw nsw i64 %.06090.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge93, label %.lr.ph92.epil, !llvm.loop !16

._crit_edge93:                                    ; preds = %._crit_edge93.loopexit.unr-lcssa, %.lr.ph92.epil, %._crit_edge89
  %77 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vX) #7
  store i64 %77, ptr @X, align 8, !tbaa !8
  %78 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vY) #7
  store i64 %78, ptr @Y, align 8, !tbaa !8
  %79 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vZ) #7
  store i64 %79, ptr @Z, align 8, !tbaa !8
  %80 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @vX) #7
  %81 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @vX) #7
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_1EvT_S8_T0_"(ptr %80, ptr %81)
  %82 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @vY) #7
  %83 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @vY) #7
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_2EvT_S8_T0_"(ptr %82, ptr %83)
  %84 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @vZ) #7
  %85 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @vZ) #7
  call void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_3EvT_S8_T0_"(ptr %84, ptr %85)
  %86 = load i64, ptr @N, align 8, !tbaa !8
  %87 = icmp sgt i64 %86, 0
  br i1 %87, label %.lr.ph96, label %.preheader

.lr.ph92:                                         ; preds = %.lr.ph92, %.lr.ph92.preheader.new
  %.06090 = phi i64 [ 0, %.lr.ph92.preheader.new ], [ %103, %.lr.ph92 ]
  %niter = phi i64 [ 0, %.lr.ph92.preheader.new ], [ %niter.next.3, %.lr.ph92 ]
  %88 = getelementptr inbounds [200000 x i64], ptr @I, i64 0, i64 %.06090
  %89 = load i64, ptr %88, align 16, !tbaa !8
  %90 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %89
  store i64 %.06090, ptr %90, align 8, !tbaa !8
  %91 = or disjoint i64 %.06090, 1
  %92 = getelementptr inbounds [200000 x i64], ptr @I, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !8
  %94 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %93
  store i64 %91, ptr %94, align 8, !tbaa !8
  %95 = or disjoint i64 %.06090, 2
  %96 = getelementptr inbounds [200000 x i64], ptr @I, i64 0, i64 %95
  %97 = load i64, ptr %96, align 16, !tbaa !8
  %98 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %97
  store i64 %95, ptr %98, align 8, !tbaa !8
  %99 = or disjoint i64 %.06090, 3
  %100 = getelementptr inbounds [200000 x i64], ptr @I, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !8
  %102 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %101
  store i64 %99, ptr %102, align 8, !tbaa !8
  %103 = add nuw nsw i64 %.06090, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge93.loopexit.unr-lcssa, label %.lr.ph92, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph96, %._crit_edge93
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @Z, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = icmp sgt i64 %105, 0
  br i1 %106, label %.lr.ph99, label %._crit_edge100

.lr.ph96:                                         ; preds = %._crit_edge93, %.lr.ph96
  %.06894 = phi i64 [ %111, %.lr.ph96 ], [ 0, %._crit_edge93 ]
  %107 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %.06894
  %108 = load i64, ptr %107, align 8, !tbaa !8
  %109 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %.06894
  %110 = load i64, ptr %109, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %108, i1 noundef zeroext true, i64 noundef %110, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %111 = add nuw nsw i64 %.06894, 1
  %112 = load i64, ptr @N, align 8, !tbaa !8
  %113 = icmp slt i64 %111, %112
  br i1 %113, label %.lr.ph96, label %.preheader, !llvm.loop !19

._crit_edge100:                                   ; preds = %.lr.ph99, %.preheader
  %.063.lcssa = phi i64 [ 0, %.preheader ], [ %119, %.lr.ph99 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store i64 10000000000000000, ptr %2, align 8, !tbaa !8
  %114 = load i64, ptr @K, align 8, !tbaa !8
  %.not102 = icmp slt i64 %114, 0
  br i1 %.not102, label %._crit_edge110.thread, label %.lr.ph109.preheader

.lr.ph109.preheader:                              ; preds = %._crit_edge100
  %.pre119 = load i64, ptr @Y, align 8
  br label %.lr.ph109

.lr.ph99:                                         ; preds = %.preheader, %.lr.ph99
  %.06298 = phi i64 [ %124, %.lr.ph99 ], [ 0, %.preheader ]
  %.06397 = phi i64 [ %119, %.lr.ph99 ], [ 0, %.preheader ]
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vZ, i64 noundef %.06298) #7
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %119 = add nsw i64 %118, %.06397
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vZ, i64 noundef %.06298) #7
  %121 = load i64, ptr %120, align 8, !tbaa !8
  %122 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %123, i1 noundef zeroext false, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %124 = add nuw nsw i64 %.06298, 1
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @Z, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %126 = load i64, ptr %125, align 8, !tbaa !8
  %127 = icmp slt i64 %124, %126
  br i1 %127, label %.lr.ph99, label %._crit_edge100, !llvm.loop !20

._crit_edge110:                                   ; preds = %188
  %.pre121 = load i64, ptr %2, align 8
  %.pre121.fr = freeze i64 %.pre121
  %128 = icmp sgt i64 %.pre121.fr, 8999999999999999
  br i1 %128, label %._crit_edge110.thread, label %129

._crit_edge110.thread:                            ; preds = %._crit_edge100, %._crit_edge110
  br label %129

129:                                              ; preds = %._crit_edge110, %._crit_edge110.thread
  %130 = phi i64 [ -1, %._crit_edge110.thread ], [ %.pre121.fr, %._crit_edge110 ]
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %130)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %131, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  ret i32 0

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %188
  %133 = phi i64 [ %189, %188 ], [ %.pre119, %.lr.ph109.preheader ]
  %134 = phi i64 [ %191, %188 ], [ %114, %.lr.ph109.preheader ]
  %.061106 = phi i64 [ %190, %188 ], [ 0, %.lr.ph109.preheader ]
  %.1105 = phi i64 [ %.3, %188 ], [ %.063.lcssa, %.lr.ph109.preheader ]
  %.064104 = phi i64 [ %.165, %188 ], [ 0, %.lr.ph109.preheader ]
  %.066103 = phi i64 [ %.167, %188 ], [ 0, %.lr.ph109.preheader ]
  %135 = sub nsw i64 %134, %.061106
  %136 = load i64, ptr @Z, align 8, !tbaa !8
  %.not72 = icmp sgt i64 %135, %136
  %137 = load i64, ptr @X, align 8
  %.not73 = icmp sgt i64 %.061106, %137
  %or.cond = select i1 %.not72, i1 true, i1 %.not73
  %.not74 = icmp sgt i64 %.061106, %133
  %or.cond75 = select i1 %or.cond, i1 true, i1 %.not74
  br i1 %or.cond75, label %162, label %138

138:                                              ; preds = %.lr.ph109
  %139 = load i64, ptr @M, align 8, !tbaa !8
  %140 = add i64 %134, %.061106
  %141 = sub i64 %139, %140
  %142 = call noundef i64 @_ZN12segment_tree4walkExxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %141, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %143 = add i64 %.064104, %.066103
  %144 = add i64 %143, %.1105
  %145 = add i64 %144, %142
  store i64 %145, ptr %3, align 8, !tbaa !8
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %147 = load i64, ptr %146, align 8, !tbaa !8
  store i64 %147, ptr %2, align 8, !tbaa !8
  %148 = load i64, ptr @K, align 8, !tbaa !8
  %149 = icmp slt i64 %.061106, %148
  br i1 %149, label %150, label %161

150:                                              ; preds = %138
  %151 = xor i64 %.061106, -1
  %152 = add i64 %148, %151
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vZ, i64 noundef %152) #7
  %154 = load i64, ptr %153, align 8, !tbaa !8
  %155 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !8
  %157 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %154
  %158 = load i64, ptr %157, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %156, i1 noundef zeroext true, i64 noundef %158, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %159 = load i64, ptr %157, align 8, !tbaa !8
  %160 = sub nsw i64 %.1105, %159
  br label %161

161:                                              ; preds = %150, %138
  %.2 = phi i64 [ %160, %150 ], [ %.1105, %138 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %.pre120 = load i64, ptr @X, align 8, !tbaa !8
  br label %162

162:                                              ; preds = %161, %.lr.ph109
  %163 = phi i64 [ %.pre120, %161 ], [ %137, %.lr.ph109 ]
  %.3 = phi i64 [ %.2, %161 ], [ %.1105, %.lr.ph109 ]
  %164 = icmp slt i64 %.061106, %163
  br i1 %164, label %165, label %175

165:                                              ; preds = %162
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vX, i64 noundef %.061106) #7
  %167 = load i64, ptr %166, align 8, !tbaa !8
  %168 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %169, i1 noundef zeroext false, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vX, i64 noundef %.061106) #7
  %171 = load i64, ptr %170, align 8, !tbaa !8
  %172 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %171
  %173 = load i64, ptr %172, align 8, !tbaa !8
  %174 = add nsw i64 %173, %.066103
  br label %175

175:                                              ; preds = %165, %162
  %.167 = phi i64 [ %174, %165 ], [ %.066103, %162 ]
  %176 = load i64, ptr @Y, align 8
  %177 = icmp slt i64 %.061106, %176
  br i1 %177, label %178, label %188

178:                                              ; preds = %175
  %179 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vY, i64 noundef %.061106) #7
  %180 = load i64, ptr %179, align 8, !tbaa !8
  %181 = getelementptr inbounds [200000 x i64], ptr @rI, i64 0, i64 %180
  %182 = load i64, ptr %181, align 8, !tbaa !8
  call void @_ZN12segment_tree3updExbxxxx(ptr noundef nonnull align 8 dereferenceable(12800080) @S, i64 noundef %182, i1 noundef zeroext false, i64 noundef 0, i64 noundef 0, i64 noundef 199999, i64 noundef 1)
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vY, i64 noundef %.061106) #7
  %184 = load i64, ptr %183, align 8, !tbaa !8
  %185 = getelementptr inbounds [200000 x i64], ptr @C, i64 0, i64 %184
  %186 = load i64, ptr %185, align 8, !tbaa !8
  %187 = add nsw i64 %186, %.064104
  %.pre118 = load i64, ptr @Y, align 8
  br label %188

188:                                              ; preds = %175, %178
  %189 = phi i64 [ %.pre118, %178 ], [ %176, %175 ]
  %.165 = phi i64 [ %187, %178 ], [ %.064104, %175 ]
  %190 = add nuw nsw i64 %.061106, 1
  %191 = load i64, ptr @K, align 8, !tbaa !8
  %.not.not = icmp slt i64 %.061106, %191
  br i1 %.not.not, label %.lr.ph109, label %._crit_edge110, !llvm.loop !21
}

; 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 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 @_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 nounwind uwtable
declare dso_local void @_ZSt4iotaIPxiEvT_S1_T0_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

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

; 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 uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEZ4mainE3$_2EvT_S8_T0_"(ptr, ptr) local_unnamed_addr #5

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

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

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

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

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

; 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

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 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 = { 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, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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