; LLVM IR from kazunetakahashi/atcoder :: 2020/0203_ABC146 (F)

; 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::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%class.anon = type { i8 }
%class.anon.3 = type { i8 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%class.SegTree = type { i32, %"class.std::vector", i64, ptr, ptr }
%"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 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@func = external hidden global %class.anon, align 1
@_update = external hidden global %class.anon.3, align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2Nov() #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %class.SegTree, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector.5", align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %24 unwind label %38

24:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 56, ptr %7) #7
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = call noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @func) #7
  %28 = call noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @_update) #7
  invoke void @_ZN7SegTreeIxEC2EixPFxxxES2_(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %26, i64 noundef 9223372036854775807, ptr noundef %27, ptr noundef %28)
          to label %29 unwind label %42

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !5
  invoke void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %30, i64 noundef 0)
          to label %31 unwind label %46

31:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 1
  store i32 %33, ptr %8, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %128, %31
  %35 = load i32, ptr %8, align 4, !tbaa !5
  %36 = icmp sge i32 %35, 0
  br i1 %36, label %50, label %37

37:                                               ; preds = %34
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %132

38:                                               ; preds = %0
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %5, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %6, align 4
  br label %230

42:                                               ; preds = %24
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %5, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %6, align 4
  br label %229

46:                                               ; preds = %138, %134, %132, %29
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  br label %228

50:                                               ; preds = %34
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %52)
          to label %54 unwind label %77

54:                                               ; preds = %50
  %55 = load i8, ptr %53, align 1, !tbaa !9
  %56 = sext i8 %55 to i32
  %57 = icmp eq i32 %56, 48
  br i1 %57, label %58, label %127

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %12, align 4, !tbaa !5
  %67 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %68 unwind label %81

68:                                               ; preds = %58
  %69 = load i32, ptr %67, align 4, !tbaa !5
  %70 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %60, i32 noundef %69)
          to label %71 unwind label %81

71:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  store i64 %70, ptr %10, align 8, !tbaa !10
  %72 = load i64, ptr %10, align 8, !tbaa !10
  %73 = invoke noundef i64 @_Z5InftyIxET_v()
          to label %74 unwind label %85

74:                                               ; preds = %71
  %75 = icmp eq i64 %72, %73
  br i1 %75, label %76, label %89

76:                                               ; preds = %74
  store i32 4, ptr %9, align 4
  br label %119

77:                                               ; preds = %50
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %5, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %6, align 4
  br label %131

81:                                               ; preds = %68, %58
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %5, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %126

85:                                               ; preds = %98, %95, %93, %89, %71
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %5, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %6, align 4
  br label %126

89:                                               ; preds = %74
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = load i64, ptr %10, align 8, !tbaa !10
  %92 = add nsw i64 %91, 1
  invoke void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %90, i64 noundef %92)
          to label %93 unwind label %85

93:                                               ; preds = %89
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.2)
          to label %95 unwind label %85

95:                                               ; preds = %93
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %94, i32 noundef %96)
          to label %98 unwind label %85

98:                                               ; preds = %95
  %99 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef @.str.3)
          to label %100 unwind label %85

100:                                              ; preds = %98
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %103 = load i32, ptr %2, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %105, %106
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %14, align 4, !tbaa !5
  %109 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %110 unwind label %122

110:                                              ; preds = %100
  %111 = load i32, ptr %109, align 4, !tbaa !5
  %112 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %102, i32 noundef %111)
          to label %113 unwind label %122

113:                                              ; preds = %110
  %114 = add nsw i64 %112, 1
  %115 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %99, i64 noundef %114)
          to label %116 unwind label %122

116:                                              ; preds = %113
  %117 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %118 unwind label %122

118:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  store i32 0, ptr %9, align 4
  br label %119

119:                                              ; preds = %118, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %120 = load i32, ptr %9, align 4
  switch i32 %120, label %236 [
    i32 0, label %121
    i32 4, label %128
  ]

121:                                              ; preds = %119
  br label %127

122:                                              ; preds = %116, %113, %110, %100
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %5, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %126

126:                                              ; preds = %122, %85, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %131

127:                                              ; preds = %121, %54
  br label %128

128:                                              ; preds = %127, %119
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %8, align 4, !tbaa !5
  br label %34, !llvm.loop !12

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

132:                                              ; preds = %37
  %133 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef 0, i32 noundef 1)
          to label %134 unwind label %46

134:                                              ; preds = %132
  %135 = invoke noundef i64 @_Z5InftyIxET_v()
          to label %136 unwind label %46

136:                                              ; preds = %134
  %137 = icmp eq i64 %133, %135
  br i1 %137, label %138, label %140

138:                                              ; preds = %136
  invoke void @_Z2Nov()
          to label %139 unwind label %46

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139, %136
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %193, %140
  %142 = load i32, ptr %16, align 4, !tbaa !5
  %143 = load i32, ptr %2, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %145, label %195

145:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %146 = load i32, ptr %16, align 4, !tbaa !5
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  %149 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %146, i32 noundef %148)
          to label %150 unwind label %160

150:                                              ; preds = %145
  store i64 %149, ptr %17, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %151 = load i32, ptr %16, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %18, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %188, %150
  %154 = load i32, ptr %18, align 4, !tbaa !5
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = load i32, ptr %2, align 4, !tbaa !5
  %157 = add nsw i32 %155, %156
  %158 = icmp sle i32 %154, %157
  br i1 %158, label %164, label %159

159:                                              ; preds = %153
  store i32 7, ptr %9, align 4
  br label %191

160:                                              ; preds = %145
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %5, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %6, align 4
  br label %194

164:                                              ; preds = %153
  %165 = load i32, ptr %18, align 4, !tbaa !5
  %166 = load i32, ptr %18, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  %168 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %7, i32 noundef %165, i32 noundef %167)
          to label %169 unwind label %179

169:                                              ; preds = %164
  %170 = load i64, ptr %17, align 8, !tbaa !10
  %171 = sub nsw i64 %170, 1
  %172 = icmp eq i64 %168, %171
  br i1 %172, label %173, label %187

173:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %174 = load i32, ptr %18, align 4, !tbaa !5
  %175 = load i32, ptr %16, align 4, !tbaa !5
  %176 = sub nsw i32 %174, %175
  store i32 %176, ptr %19, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 4 dereferenceable(4) %19)
          to label %177 unwind label %183

177:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  %178 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %178, ptr %16, align 4, !tbaa !5
  store i32 7, ptr %9, align 4
  br label %191

179:                                              ; preds = %164
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %5, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %6, align 4
  br label %192

183:                                              ; preds = %173
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %5, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %192

187:                                              ; preds = %169
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %18, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %18, align 4, !tbaa !5
  br label %153, !llvm.loop !14

191:                                              ; preds = %177, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %193

192:                                              ; preds = %183, %179
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %194

193:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %141, !llvm.loop !15

194:                                              ; preds = %192, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %227

195:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 0, ptr %20, align 8, !tbaa !16
  br label %196

196:                                              ; preds = %222, %195
  %197 = load i64, ptr %20, align 8, !tbaa !16
  %198 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %199 = icmp ult i64 %197, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %196
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %225

201:                                              ; preds = %196
  %202 = load i64, ptr %20, align 8, !tbaa !16
  %203 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %202) #7
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %204)
          to label %206 unwind label %214

206:                                              ; preds = %201
  %207 = load i64, ptr %20, align 8, !tbaa !16
  %208 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  %209 = sub i64 %208, 1
  %210 = icmp ult i64 %207, %209
  br i1 %210, label %211, label %218

211:                                              ; preds = %206
  %212 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %213 unwind label %214

213:                                              ; preds = %211
  br label %221

214:                                              ; preds = %218, %211, %201
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %5, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %227

218:                                              ; preds = %206
  %219 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %220 unwind label %214

220:                                              ; preds = %218
  br label %221

221:                                              ; preds = %220, %213
  br label %222

222:                                              ; preds = %221
  %223 = load i64, ptr %20, align 8, !tbaa !16
  %224 = add i64 %223, 1
  store i64 %224, ptr %20, align 8, !tbaa !16
  br label %196, !llvm.loop !18

225:                                              ; preds = %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %7) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %226 = load i32, ptr %1, align 4
  ret i32 %226

227:                                              ; preds = %214, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #7
  br label %228

228:                                              ; preds = %227, %131, %46
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %7) #7
  br label %229

229:                                              ; preds = %228, %42
  call void @llvm.lifetime.end.p0(i64 56, ptr %7) #7
  br label %230

230:                                              ; preds = %229, %38
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr %5, align 8
  %233 = load i32, ptr %6, align 4
  %234 = insertvalue { ptr, i32 } poison, ptr %232, 0
  %235 = insertvalue { ptr, i32 } %234, i32 %233, 1
  resume { ptr, i32 } %235

236:                                              ; preds = %119
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTreeIxEC2EixPFxxxES2_(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5InftyIxET_v() #5

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

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


; 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::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%class.anon = type { i8 }
%class.anon.3 = type { i8 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%class.SegTree = type { i32, %"class.std::vector", i64, ptr, ptr }
%"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 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@func = external hidden global %class.anon, align 1
@_update = external hidden global %class.anon.3, align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2Nov() local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %class.SegTree, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::vector.5", align 8
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  %13 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %14 unwind label %26

14:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #7
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  %17 = call noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @func) #7
  %18 = call noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @_update) #7
  invoke void @_ZN7SegTreeIxEC2EixPFxxxES2_(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %16, i64 noundef 9223372036854775807, ptr noundef %17, ptr noundef %18)
          to label %19 unwind label %28

19:                                               ; preds = %14
  %20 = load i32, ptr %1, align 4, !tbaa !5
  invoke void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %20, i64 noundef 0)
          to label %21 unwind label %30

21:                                               ; preds = %19
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %21
  %24 = zext nneg i32 %22 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %76, %21
  %25 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef 0, i32 noundef 1)
          to label %78 unwind label %30

26:                                               ; preds = %0
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %128

28:                                               ; preds = %14
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %127

30:                                               ; preds = %81, %._crit_edge, %19
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %126

.lr.ph:                                           ; preds = %.lr.ph.preheader, %76
  %indvars.iv = phi i64 [ %24, %.lr.ph.preheader ], [ %indvars.iv.next, %76 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv.next)
  %33 = load i8, ptr %32, align 1, !tbaa !9
  %34 = icmp eq i8 %33, 48
  br i1 %34, label %35, label %76

35:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = trunc nuw nsw i64 %indvars.iv to i32
  %40 = add i32 %38, %39
  store i32 %40, ptr %6, align 4, !tbaa !5
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %39, i32 noundef %42)
          to label %44 unwind label %47

44:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %45 = call noundef i64 @_Z5InftyIxET_v()
  %46 = icmp eq i64 %43, %45
  br i1 %46, label %76, label %51

47:                                               ; preds = %35
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %126

49:                                               ; preds = %58, %56, %54, %51
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %126

51:                                               ; preds = %44
  %52 = add nsw i64 %43, 1
  %53 = trunc nuw nsw i64 %indvars.iv.next to i32
  invoke void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %53, i64 noundef %52)
          to label %54 unwind label %49

54:                                               ; preds = %51
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.2)
          to label %56 unwind label %49

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %55, i32 noundef %53)
          to label %58 unwind label %49

58:                                               ; preds = %56
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str.3)
          to label %60 unwind label %49

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = add i32 %63, %39
  store i32 %64, ptr %8, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %39, i32 noundef %66)
          to label %68 unwind label %74

68:                                               ; preds = %60
  %69 = add nsw i64 %67, 1
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %59, i64 noundef %69)
          to label %71 unwind label %74

71:                                               ; preds = %68
  %72 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %73 unwind label %74

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

74:                                               ; preds = %71, %68, %60
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  br label %126

76:                                               ; preds = %73, %44, %.lr.ph
  %77 = icmp ugt i64 %indvars.iv, 1
  br i1 %77, label %.lr.ph, label %._crit_edge, !llvm.loop !10

78:                                               ; preds = %._crit_edge
  %79 = call noundef i64 @_Z5InftyIxET_v()
  %80 = icmp eq i64 %25, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  invoke void @_Z2Nov()
          to label %82 unwind label %30

82:                                               ; preds = %81, %78
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %83 = load i32, ptr %1, align 4, !tbaa !5
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %.lr.ph59, label %.preheader

.preheader:                                       ; preds = %.loopexit, %82
  %85 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %.not63 = icmp eq i64 %85, 0
  br i1 %.not63, label %._crit_edge62, label %.lr.ph61

.lr.ph59:                                         ; preds = %82, %.loopexit
  %.03257 = phi i32 [ %.133, %.loopexit ], [ 0, %82 ]
  %86 = add nsw i32 %.03257, 1
  %87 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %.03257, i32 noundef %86)
          to label %.preheader51 unwind label %92

.preheader51:                                     ; preds = %.lr.ph59
  %88 = add nsw i64 %87, -1
  br label %89

89:                                               ; preds = %.preheader51, %97
  %.030 = phi i32 [ %95, %97 ], [ %86, %.preheader51 ]
  %90 = load i32, ptr %1, align 4, !tbaa !5
  %91 = add nsw i32 %90, %.03257
  %.not = icmp sgt i32 %.030, %91
  br i1 %.not, label %.loopexit, label %94

92:                                               ; preds = %.lr.ph59
  %93 = landingpad { ptr, i32 }
          cleanup
  br label %125

94:                                               ; preds = %89
  %95 = add nsw i32 %.030, 1
  %96 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %4, i32 noundef %.030, i32 noundef %95)
          to label %97 unwind label %102

97:                                               ; preds = %94
  %98 = icmp eq i64 %96, %88
  br i1 %98, label %99, label %89, !llvm.loop !12

99:                                               ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  %100 = sub nsw i32 %.030, %.03257
  store i32 %100, ptr %10, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %101 unwind label %104

101:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %.loopexit

102:                                              ; preds = %94
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %125

104:                                              ; preds = %99
  %105 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  br label %125

.loopexit:                                        ; preds = %89, %101
  %106 = phi i32 [ %.pre, %101 ], [ %90, %89 ]
  %.133 = phi i32 [ %.030, %101 ], [ %.03257, %89 ]
  %107 = icmp slt i32 %.133, %106
  br i1 %107, label %.lr.ph59, label %.preheader, !llvm.loop !13

._crit_edge62:                                    ; preds = %121, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph61:                                         ; preds = %.preheader, %121
  %.060 = phi i64 [ %122, %121 ], [ 0, %.preheader ]
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.060) #7
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %109)
          to label %111 unwind label %117

111:                                              ; preds = %.lr.ph61
  %112 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %113 = add i64 %112, -1
  %114 = icmp ult i64 %.060, %113
  br i1 %114, label %115, label %119

115:                                              ; preds = %111
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
          to label %121 unwind label %117

117:                                              ; preds = %119, %115, %.lr.ph61
  %118 = landingpad { ptr, i32 }
          cleanup
  br label %125

119:                                              ; preds = %111
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %121 unwind label %117

121:                                              ; preds = %115, %119
  %122 = add nuw i64 %.060, 1
  %123 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %124 = icmp ult i64 %122, %123
  br i1 %124, label %.lr.ph61, label %._crit_edge62, !llvm.loop !14

125:                                              ; preds = %92, %104, %102, %117
  %.pn.pn.pn = phi { ptr, i32 } [ %118, %117 ], [ %93, %92 ], [ %105, %104 ], [ %103, %102 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  br label %126

126:                                              ; preds = %47, %49, %74, %125, %30
  %.pn46.pn = phi { ptr, i32 } [ %.pn.pn.pn, %125 ], [ %31, %30 ], [ %75, %74 ], [ %50, %49 ], [ %48, %47 ]
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #7
  br label %127

127:                                              ; preds = %126, %28
  %.pn46.pn.pn = phi { ptr, i32 } [ %.pn46.pn, %126 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #7
  br label %128

128:                                              ; preds = %127, %26
  %.pn46.pn.pn.pn = phi { ptr, i32 } [ %.pn46.pn.pn, %127 ], [ %27, %26 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn46.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTreeIxEC2EixPFxxxES2_(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i64 noundef, ptr noundef, ptr noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z5InftyIxET_v() local_unnamed_addr #5

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}


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