; LLVM IR from kazunetakahashi/atcoder :: 2017/1111_ARC085 (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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.SegTree = type { i32, ptr }

@N = external dso_local global i32, align 4
@b = external dso_local global [200020 x i32], align 16
@Q = external dso_local global i32, align 4
@V = external dso_local global [200020 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5scorei(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.SegTree, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %33, %0
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = load i32, ptr @N, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

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

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %31)
  br label %33

33:                                               ; preds = %28
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !9

36:                                               ; preds = %27
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %53, %36
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = load i32, ptr @Q, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr %4, align 4, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %5, align 4, !tbaa !5
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200020 x %"class.std::vector"], ptr @V, i64 0, i64 %51
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %52, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %53

53:                                               ; preds = %43
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !5
  br label %38, !llvm.loop !11

56:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %77, %56
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = load i32, ptr @N, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200020 x %"class.std::vector"], ptr @V, i64 0, i64 %64
  %66 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %65) #7
  %67 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %66, ptr %67, align 8
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [200020 x %"class.std::vector"], ptr @V, i64 0, i64 %69
  %71 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #7
  %72 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %71, ptr %72, align 8
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %74, ptr %76)
  br label %77

77:                                               ; preds = %62
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %6, align 4, !tbaa !5
  br label %57, !llvm.loop !12

80:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %96, %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = load i32, ptr @N, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

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

86:                                               ; preds = %81
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %95

92:                                               ; preds = %86
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %9, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %92, %86
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %10, align 4, !tbaa !5
  br label %81, !llvm.loop !13

99:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %100 = load i32, ptr @N, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  call void @_ZN7SegTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %101)
  %102 = load i32, ptr %9, align 4, !tbaa !5
  invoke void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef 0, i32 noundef %102)
          to label %103 unwind label %109

103:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %164, %103
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = load i32, ptr @N, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %113, label %108

108:                                              ; preds = %104
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %177

109:                                              ; preds = %184, %182, %177, %99
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %12, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %13, align 4
  br label %188

113:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [200020 x %"class.std::vector"], ptr @V, i64 0, i64 %115
  store ptr %116, ptr %16, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %117 = load ptr, ptr %16, align 8, !tbaa !14
  %118 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %117) #7
  %119 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %118, ptr %119, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %120 = load ptr, ptr %16, align 8, !tbaa !14
  %121 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %120) #7
  %122 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %121, ptr %122, align 8
  br label %123

123:                                              ; preds = %137, %113
  %124 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %124, label %126, label %125

125:                                              ; preds = %123
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %143

126:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %128 = load i32, ptr %127, align 4, !tbaa !5
  store i32 %128, ptr %19, align 4, !tbaa !5
  %129 = load i32, ptr %19, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  %131 = load i32, ptr %14, align 4, !tbaa !5
  %132 = load i32, ptr %19, align 4, !tbaa !5
  %133 = add nsw i32 %132, 2
  %134 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %131, i32 noundef %133)
          to label %135 unwind label %139

135:                                              ; preds = %126
  invoke void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %130, i32 noundef %134)
          to label %136 unwind label %139

136:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %137

137:                                              ; preds = %136
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %123

139:                                              ; preds = %135, %126
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %12, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %176

143:                                              ; preds = %125
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %146 = load i32, ptr %14, align 4, !tbaa !5
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  %149 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %146, i32 noundef %148)
          to label %150 unwind label %167

150:                                              ; preds = %143
  %151 = load i32, ptr %14, align 4, !tbaa !5
  %152 = call noundef i32 @_Z5scorei(i32 noundef %151)
  %153 = add nsw i32 %149, %152
  store i32 %153, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %154 = load i32, ptr %14, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  %156 = load i32, ptr %14, align 4, !tbaa !5
  %157 = add nsw i32 %156, 2
  %158 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %155, i32 noundef %157)
          to label %159 unwind label %171

159:                                              ; preds = %150
  store i32 %158, ptr %21, align 4, !tbaa !5
  %160 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %161 unwind label %171

161:                                              ; preds = %159
  %162 = load i32, ptr %160, align 4, !tbaa !5
  invoke void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %145, i32 noundef %162)
          to label %163 unwind label %171

163:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %14, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %14, align 4, !tbaa !5
  br label %104, !llvm.loop !16

167:                                              ; preds = %143
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %12, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %13, align 4
  br label %175

171:                                              ; preds = %161, %159, %150
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %12, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %175

175:                                              ; preds = %171, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %176

176:                                              ; preds = %175, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %188

177:                                              ; preds = %108
  %178 = load i32, ptr @N, align 4, !tbaa !5
  %179 = load i32, ptr @N, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  %181 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %11, i32 noundef %178, i32 noundef %180)
          to label %182 unwind label %109

182:                                              ; preds = %177
  %183 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %181)
          to label %184 unwind label %109

184:                                              ; preds = %182
  %185 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %183, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %186 unwind label %109

186:                                              ; preds = %184
  call void @_ZN7SegTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %187 = load i32, ptr %1, align 4
  ret i32 %187

188:                                              ; preds = %176, %109
  call void @_ZN7SegTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %12, align 8
  %191 = load i32, ptr %13, align 4
  %192 = insertvalue { ptr, i32 } poison, ptr %190, 0
  %193 = insertvalue { ptr, i32 } %192, i32 %191, 1
  resume { ptr, i32 } %193
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(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 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7SegTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = distinct !{!16, !10}


; 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<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 }
%"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.SegTree = type { i32, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@b = external dso_local global [200020 x i32], align 16
@Q = external dso_local global i32, align 4
@V = external dso_local global [200020 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5scorei(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %class.SegTree, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %9 = load i32, ptr @N, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  %12 = load i32, ptr @Q, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph55, label %.preheader47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr @N, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader47:                                     ; preds = %.lr.ph55, %._crit_edge
  %19 = load i32, ptr @N, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph57, label %._crit_edge61

.lr.ph55:                                         ; preds = %._crit_edge, %.lr.ph55
  %.03153 = phi i32 [ %29, %.lr.ph55 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %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) %1)
  %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) %2)
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr %1, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %24 to i64
  %28 = getelementptr inbounds [200020 x %"class.std::vector"], ptr @V, i64 0, i64 %27
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %29 = add nuw nsw i32 %.03153, 1
  %30 = load i32, ptr @Q, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %.lr.ph55, label %.preheader47, !llvm.loop !11

.preheader46:                                     ; preds = %.lr.ph57
  %32 = icmp sgt i32 %46, 0
  br i1 %32, label %.lr.ph60.preheader, label %._crit_edge61

.lr.ph60.preheader:                               ; preds = %.preheader46
  %wide.trip.count = zext nneg i32 %46 to i64
  %min.iters.check = icmp ult i32 %46, 8
  br i1 %min.iters.check, label %.lr.ph60.preheader91, label %vector.ph

.lr.ph60.preheader91:                             ; preds = %middle.block, %.lr.ph60.preheader
  %indvars.iv76.ph = phi i64 [ 0, %.lr.ph60.preheader ], [ %n.vec, %middle.block ]
  %.03858.ph = phi i32 [ 0, %.lr.ph60.preheader ], [ %42, %middle.block ]
  br label %.lr.ph60

vector.ph:                                        ; preds = %.lr.ph60.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %39, %vector.body ]
  %vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ]
  %33 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %index
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %wide.load = load <4 x i32>, ptr %33, align 16, !tbaa !5
  %wide.load89 = load <4 x i32>, ptr %34, align 16, !tbaa !5
  %35 = icmp eq <4 x i32> %wide.load, zeroinitializer
  %36 = icmp eq <4 x i32> %wide.load89, zeroinitializer
  %37 = zext <4 x i1> %35 to <4 x i32>
  %38 = zext <4 x i1> %36 to <4 x i32>
  %39 = add <4 x i32> %vec.phi, %37
  %40 = add <4 x i32> %vec.phi88, %38
  %index.next = add nuw i64 %index, 8
  %41 = icmp eq i64 %index.next, %n.vec
  br i1 %41, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %40, %39
  %42 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge61, label %.lr.ph60.preheader91

.lr.ph57:                                         ; preds = %.preheader47, %.lr.ph57
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.lr.ph57 ], [ 0, %.preheader47 ]
  %43 = getelementptr inbounds [200020 x %"class.std::vector"], ptr @V, i64 0, i64 %indvars.iv73
  %44 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #8
  %45 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %44, ptr %45)
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %46 = load i32, ptr @N, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next74, %47
  br i1 %48, label %.lr.ph57, label %.preheader46, !llvm.loop !15

._crit_edge61:                                    ; preds = %.lr.ph60, %middle.block, %.preheader47, %.preheader46
  %.lcssa5183 = phi i32 [ %46, %.preheader46 ], [ %19, %.preheader47 ], [ %46, %middle.block ], [ %46, %.lr.ph60 ]
  %.038.lcssa = phi i32 [ 0, %.preheader46 ], [ 0, %.preheader47 ], [ %42, %middle.block ], [ %spec.select, %.lr.ph60 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  %49 = add nsw i32 %.lcssa5183, 1
  call void @_ZN7SegTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %49)
  invoke void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef 0, i32 noundef %.038.lcssa)
          to label %.preheader unwind label %58

.preheader:                                       ; preds = %._crit_edge61
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph67, label %._crit_edge68

.lr.ph60:                                         ; preds = %.lr.ph60.preheader91, %.lr.ph60
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.lr.ph60 ], [ %indvars.iv76.ph, %.lr.ph60.preheader91 ]
  %.03858 = phi i32 [ %spec.select, %.lr.ph60 ], [ %.03858.ph, %.lr.ph60.preheader91 ]
  %52 = getelementptr inbounds [200020 x i32], ptr @b, i64 0, i64 %indvars.iv76
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp eq i32 %53, 0
  %55 = zext i1 %54 to i32
  %spec.select = add nuw nsw i32 %.03858, %55
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !16

._crit_edge68:                                    ; preds = %84, %.preheader
  %.lcssa = phi i32 [ %50, %.preheader ], [ %85, %84 ]
  %56 = add nsw i32 %.lcssa, 1
  %57 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %.lcssa, i32 noundef %56)
          to label %93 unwind label %58

58:                                               ; preds = %95, %93, %._crit_edge68, %._crit_edge61
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %98

.lr.ph67:                                         ; preds = %.preheader, %84
  %indvars.iv79 = phi i64 [ %indvars.iv.next80, %84 ], [ 0, %.preheader ]
  %indvars81 = trunc i64 %indvars.iv79 to i32
  %60 = getelementptr inbounds [200020 x %"class.std::vector"], ptr @V, i64 0, i64 %indvars.iv79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %61 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #8
  store ptr %61, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %62 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #8
  store ptr %62, ptr %5, align 8
  %63 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br i1 %63, label %.lr.ph64, label %._crit_edge65

._crit_edge65:                                    ; preds = %71, %.lr.ph67
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %indvars = trunc i64 %indvars.iv.next80 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %64 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %indvars81, i32 noundef %indvars)
          to label %76 unwind label %88

.lr.ph64:                                         ; preds = %.lr.ph67, %71
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %66, 2
  %68 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %indvars81, i32 noundef %67)
          to label %69 unwind label %74

69:                                               ; preds = %.lr.ph64
  %70 = add nsw i32 %66, 1
  invoke void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %70, i32 noundef %68)
          to label %71 unwind label %74

71:                                               ; preds = %69
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  %73 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br i1 %73, label %.lr.ph64, label %._crit_edge65

74:                                               ; preds = %69, %.lr.ph64
  %75 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br label %98

76:                                               ; preds = %._crit_edge65
  %77 = call noundef i32 @_Z5scorei(i32 noundef %indvars81)
  %78 = add nsw i32 %77, %64
  store i32 %78, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  %79 = add nuw nsw i32 %indvars81, 2
  %80 = invoke noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %indvars, i32 noundef %79)
          to label %81 unwind label %90

81:                                               ; preds = %76
  store i32 %80, ptr %7, align 4, !tbaa !5
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %83 = load i32, ptr %82, align 4, !tbaa !5
  invoke void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %indvars, i32 noundef %83)
          to label %84 unwind label %90

84:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  %85 = load i32, ptr @N, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next80, %86
  br i1 %87, label %.lr.ph67, label %._crit_edge68, !llvm.loop !17

88:                                               ; preds = %._crit_edge65
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %92

90:                                               ; preds = %81, %76
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %92

92:                                               ; preds = %90, %88
  %.pn = phi { ptr, i32 } [ %91, %90 ], [ %89, %88 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  br label %98

93:                                               ; preds = %._crit_edge68
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %57)
          to label %95 unwind label %58

95:                                               ; preds = %93
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %97 unwind label %58

97:                                               ; preds = %95
  call void @_ZN7SegTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  ret i32 0

98:                                               ; preds = %74, %92, %58
  %.pn43.pn = phi { ptr, i32 } [ %59, %58 ], [ %75, %74 ], [ %.pn, %92 ]
  call void @_ZN7SegTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn43.pn
}

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

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

; 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 uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTreeC2Ei(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTree6updateEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(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 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7SegTree4findEii(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 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

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

; 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 #4 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)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7SegTreeD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #7

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

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

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


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