; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2017/Codesprint 9/Problem F (usaxena)

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@take = external dso_local global [825 x i32], align 16
@C = external dso_local global [825 x i32], align 16
@A = external dso_local global [200005 x i32], align 16
@P = external dso_local global [200005 x %"struct.std::pair"], align 16
@lg = external dso_local global [200005 x i32], align 16
@sum = external dso_local global [200005 x i32], align 16
@tree = external dso_local global [822 x [45 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZZ4mainE1p = external hidden global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8process2i(i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5queryii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4readPii(ptr noundef, i32 noundef) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updatePiii(ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca [825 x %"struct.std::pair"], align 16
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca %"struct.std::pair", align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"struct.std::pair", align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %33 = 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %44, %0
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %41
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %42)
  br label %44

44:                                               ; preds = %39
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !5
  br label %34, !llvm.loop !9

47:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %48 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds ([200005 x %"struct.std::pair"], ptr @P, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %72, %47
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %49
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = add nsw i32 %59, %58
  store i32 %60, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = sub nsw i32 0, %61
  store i32 %62, ptr %10, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @P, i64 0, i64 %65
  %67 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %66, ptr noundef nonnull align 4 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200005 x i32], ptr @sum, i64 0, i64 %70
  store i32 %68, ptr %71, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %54
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %8, align 4, !tbaa !5
  br label %49, !llvm.loop !11

75:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %108, %75
  %77 = load i32, ptr %11, align 4, !tbaa !5
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  %80 = icmp sle i32 %77, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %111

82:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %83 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %83, ptr %13, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %102, %82
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = mul nsw i32 2, %86
  %88 = icmp slt i32 %85, %87
  br i1 %88, label %89, label %94

89:                                               ; preds = %84
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  %93 = icmp sle i32 %90, %92
  br label %94

94:                                               ; preds = %89, %84
  %95 = phi i1 [ false, %84 ], [ %93, %89 ]
  br i1 %95, label %97, label %96

96:                                               ; preds = %94
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %105

97:                                               ; preds = %94
  %98 = load i32, ptr @_ZZ4mainE1p, align 4, !tbaa !5
  %99 = load i32, ptr %13, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [200005 x i32], ptr @lg, i64 0, i64 %100
  store i32 %98, ptr %101, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %97
  %103 = load i32, ptr %13, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %13, align 4, !tbaa !5
  br label %84, !llvm.loop !12

105:                                              ; preds = %96
  %106 = load i32, ptr @_ZZ4mainE1p, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr @_ZZ4mainE1p, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %105
  %109 = load i32, ptr %11, align 4, !tbaa !5
  %110 = mul nsw i32 %109, 2
  store i32 %110, ptr %11, align 4, !tbaa !5
  br label %76, !llvm.loop !13

111:                                              ; preds = %81
  %112 = load i32, ptr %2, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  call void @_Z8process2i(i32 noundef %113)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 1, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 6600, ptr %20) #7
  %114 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i32 0, i32 0
  %115 = getelementptr inbounds %"struct.std::pair", ptr %114, i64 825
  br label %116

116:                                              ; preds = %116, %111
  %117 = phi ptr [ %114, %111 ], [ %118, %116 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %117)
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i64 1
  %119 = icmp eq ptr %118, %115
  br i1 %119, label %120, label %116

120:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %331, %120
  %122 = load i32, ptr %21, align 4, !tbaa !5
  %123 = load i32, ptr %2, align 4, !tbaa !5
  %124 = icmp sle i32 %122, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %121
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %334

126:                                              ; preds = %121
  %127 = load i32, ptr %21, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = icmp sgt i32 %130, 0
  br i1 %131, label %132, label %140

132:                                              ; preds = %126
  %133 = load i32, ptr %21, align 4, !tbaa !5
  %134 = load i32, ptr %21, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %138
  store i32 %133, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %132, %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 820, ptr %24, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %234, %140
  %142 = load i32, ptr %24, align 4, !tbaa !5
  %143 = icmp sge i32 %142, 1
  br i1 %143, label %145, label %144

144:                                              ; preds = %141
  store i32 17, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %237

145:                                              ; preds = %141
  %146 = load i32, ptr %21, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = icmp sgt i32 %149, 0
  br i1 %150, label %151, label %177

151:                                              ; preds = %145
  %152 = load i32, ptr %21, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = load i32, ptr %24, align 4, !tbaa !5
  %157 = icmp slt i32 %155, %156
  br i1 %157, label %158, label %177

158:                                              ; preds = %151
  %159 = load i32, ptr %24, align 4, !tbaa !5
  %160 = load i32, ptr %21, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = sub nsw i32 %159, %163
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [822 x [45 x i32]], ptr @tree, i64 0, i64 %165
  %167 = getelementptr inbounds [45 x i32], ptr %166, i64 0, i64 0
  %168 = load i32, ptr %21, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = sub nsw i32 %171, 1
  %173 = call noundef i32 @_Z4readPii(ptr noundef %167, i32 noundef %172)
  %174 = load i32, ptr %24, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %175
  store i32 %173, ptr %176, align 4, !tbaa !5
  br label %177

177:                                              ; preds = %158, %151, %145
  %178 = load i32, ptr %21, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = icmp sgt i32 %181, 0
  br i1 %182, label %183, label %196

183:                                              ; preds = %177
  %184 = load i32, ptr %24, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [822 x [45 x i32]], ptr @tree, i64 0, i64 %185
  %187 = getelementptr inbounds [45 x i32], ptr %186, i64 0, i64 0
  %188 = load i32, ptr %21, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %24, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  call void @_Z6updatePiii(ptr noundef %187, i32 noundef %191, i32 noundef %195)
  br label %196

196:                                              ; preds = %183, %177
  %197 = load i32, ptr %24, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %198
  %200 = load i32, ptr %24, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %201
  %203 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %199, ptr noundef nonnull align 4 dereferenceable(4) %202)
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = load i32, ptr %24, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %206
  store i32 %204, ptr %207, align 4, !tbaa !5
  %208 = load i32, ptr %24, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %209
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = icmp sgt i32 %211, 0
  br i1 %212, label %213, label %233

213:                                              ; preds = %196
  %214 = load i32, ptr %24, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = load i32, ptr %23, align 4, !tbaa !5
  %219 = icmp sgt i32 %217, %218
  br i1 %219, label %220, label %233

220:                                              ; preds = %213
  %221 = load i32, ptr %24, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  store i32 %224, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %225 = load i32, ptr %24, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %226
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %25, ptr noundef nonnull align 4 dereferenceable(4) %227, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %228 = load i32, ptr %22, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %22, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 %230
  %232 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %231, ptr noundef nonnull align 4 dereferenceable(8) %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %233

233:                                              ; preds = %220, %213, %196
  br label %234

234:                                              ; preds = %233
  %235 = load i32, ptr %24, align 4, !tbaa !5
  %236 = add nsw i32 %235, -1
  store i32 %236, ptr %24, align 4, !tbaa !5
  br label %141, !llvm.loop !14

237:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 1000000007, ptr %28, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %238 = load i32, ptr %22, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %22, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 %240
  %242 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %241, ptr noundef nonnull align 4 dereferenceable(8) %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %243 = load i32, ptr %21, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %244
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %29, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %245)
  %246 = load i32, ptr %22, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %22, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 %248
  %250 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %249, ptr noundef nonnull align 4 dereferenceable(8) %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  %251 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 0
  %252 = getelementptr inbounds %"struct.std::pair", ptr %251, i64 1
  %253 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 0
  %254 = load i32, ptr %22, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds %"struct.std::pair", ptr %253, i64 %255
  %257 = getelementptr inbounds %"struct.std::pair", ptr %256, i64 1
  call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef %252, ptr noundef %257)
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  store i32 -1000000007, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %258 = load i32, ptr %22, align 4, !tbaa !5
  %259 = sub nsw i32 %258, 1
  store i32 %259, ptr %31, align 4, !tbaa !5
  br label %260

260:                                              ; preds = %327, %237
  %261 = load i32, ptr %31, align 4, !tbaa !5
  %262 = icmp sge i32 %261, 1
  br i1 %262, label %264, label %263

263:                                              ; preds = %260
  store i32 20, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %330

264:                                              ; preds = %260
  %265 = load i32, ptr %31, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 %266
  %268 = getelementptr inbounds %"struct.std::pair", ptr %267, i32 0, i32 0
  %269 = load i32, ptr %268, align 8, !tbaa !15
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %14, align 4, !tbaa !5
  %271 = load i32, ptr %31, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 %273
  %275 = getelementptr inbounds %"struct.std::pair", ptr %274, i32 0, i32 0
  %276 = load i32, ptr %275, align 8, !tbaa !15
  store i32 %276, ptr %15, align 4, !tbaa !5
  %277 = load i32, ptr %31, align 4, !tbaa !5
  %278 = add nsw i32 %277, 1
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %20, i64 0, i64 %279
  %281 = getelementptr inbounds %"struct.std::pair", ptr %280, i32 0, i32 1
  %282 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %30, ptr noundef nonnull align 4 dereferenceable(4) %281)
  %283 = load i32, ptr %282, align 4, !tbaa !5
  store i32 %283, ptr %30, align 4, !tbaa !5
  %284 = load i32, ptr %14, align 4, !tbaa !5
  %285 = load i32, ptr %15, align 4, !tbaa !5
  %286 = icmp sgt i32 %284, %285
  br i1 %286, label %287, label %288

287:                                              ; preds = %264
  br label %327

288:                                              ; preds = %264
  %289 = load i32, ptr %14, align 4, !tbaa !5
  %290 = load i32, ptr %15, align 4, !tbaa !5
  %291 = call noundef i32 @_Z5queryii(i32 noundef %289, i32 noundef %290)
  store i32 %291, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %292 = load i32, ptr %21, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [200005 x i32], ptr @sum, i64 0, i64 %293
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = load i32, ptr %16, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [200005 x i32], ptr @sum, i64 0, i64 %297
  %299 = load i32, ptr %298, align 4, !tbaa !5
  %300 = sub nsw i32 %295, %299
  %301 = load i32, ptr %30, align 4, !tbaa !5
  %302 = sub nsw i32 %300, %301
  store i32 %302, ptr %32, align 4, !tbaa !5
  %303 = load i32, ptr %32, align 4, !tbaa !5
  %304 = load i32, ptr %17, align 4, !tbaa !5
  %305 = icmp sgt i32 %303, %304
  br i1 %305, label %306, label %311

306:                                              ; preds = %288
  %307 = load i32, ptr %32, align 4, !tbaa !5
  store i32 %307, ptr %17, align 4, !tbaa !5
  %308 = load i32, ptr %21, align 4, !tbaa !5
  %309 = load i32, ptr %16, align 4, !tbaa !5
  %310 = sub nsw i32 %308, %309
  store i32 %310, ptr %18, align 4, !tbaa !5
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %326

311:                                              ; preds = %288
  %312 = load i32, ptr %17, align 4, !tbaa !5
  %313 = load i32, ptr %32, align 4, !tbaa !5
  %314 = icmp eq i32 %312, %313
  br i1 %314, label %315, label %325

315:                                              ; preds = %311
  %316 = load i32, ptr %18, align 4, !tbaa !5
  %317 = load i32, ptr %21, align 4, !tbaa !5
  %318 = load i32, ptr %16, align 4, !tbaa !5
  %319 = sub nsw i32 %317, %318
  %320 = icmp eq i32 %316, %319
  br i1 %320, label %321, label %324

321:                                              ; preds = %315
  %322 = load i32, ptr %19, align 4, !tbaa !5
  %323 = add nsw i32 %322, 1
  store i32 %323, ptr %19, align 4, !tbaa !5
  br label %324

324:                                              ; preds = %321, %315
  br label %325

325:                                              ; preds = %324, %311
  br label %326

326:                                              ; preds = %325, %306
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %327

327:                                              ; preds = %326, %287
  %328 = load i32, ptr %31, align 4, !tbaa !5
  %329 = add nsw i32 %328, -1
  store i32 %329, ptr %31, align 4, !tbaa !5
  br label %260, !llvm.loop !17

330:                                              ; preds = %263
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %331

331:                                              ; preds = %330
  %332 = load i32, ptr %21, align 4, !tbaa !5
  %333 = add nsw i32 %332, 1
  store i32 %333, ptr %21, align 4, !tbaa !5
  br label %121, !llvm.loop !18

334:                                              ; preds = %125
  %335 = load i32, ptr %17, align 4, !tbaa !5
  %336 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %335)
  %337 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %336, i8 noundef signext 32)
  %338 = load i32, ptr %19, align 4, !tbaa !5
  %339 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %337, i32 noundef %338)
  call void @llvm.lifetime.end.p0(i64 6600, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %340 = load i32, ptr %1, align 4
  ret i32 %340
}

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 dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #5 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 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 = distinct !{!14, !10}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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"

%"struct.std::pair" = type { i32, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@take = external dso_local global [825 x i32], align 16
@C = external dso_local global [825 x i32], align 16
@A = external dso_local global [200005 x i32], align 16
@P = external dso_local global [200005 x %"struct.std::pair"], align 16
@lg = external dso_local local_unnamed_addr global [200005 x i32], align 16
@sum = external dso_local local_unnamed_addr global [200005 x i32], align 16
@tree = external dso_local global [822 x [45 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZZ4mainE1p = external hidden local_unnamed_addr global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4readPii(ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updatePiii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca i32, align 4
  %8 = alloca [825 x %"struct.std::pair"], align 16
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %17 = 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)
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %.not87 = icmp slt i32 %18, 1
  br i1 %.not87, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %19 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) getelementptr inbounds (i8, ptr @P, i64 8), ptr noundef nonnull align 4 dereferenceable(8) %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %20 = load i32, ptr %1, align 4
  %.not7389 = icmp slt i32 %20, 1
  br i1 %.not7389, label %.preheader84, label %.lr.ph92.preheader

.lr.ph92.preheader:                               ; preds = %._crit_edge
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %.lr.ph92

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %21 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %indvars.iv
  %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) %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %.not.not = icmp slt i64 %indvars.iv, %24
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader84:                                     ; preds = %.lr.ph92, %._crit_edge
  %.lcssa86 = phi i32 [ %20, %._crit_edge ], [ %38, %.lr.ph92 ]
  %25 = add nsw i32 %.lcssa86, 1
  %.not7497 = icmp slt i32 %.lcssa86, 0
  br i1 %.not7497, label %52, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader84
  %_ZZ4mainE1p.promoted = load i32, ptr @_ZZ4mainE1p, align 4, !tbaa !5
  %26 = zext nneg i32 %.lcssa86 to i64
  %27 = add nuw nsw i64 %26, 1
  br label %.preheader

.lr.ph92:                                         ; preds = %.lr.ph92.preheader, %.lr.ph92
  %28 = phi i32 [ %.pre, %.lr.ph92.preheader ], [ %36, %.lr.ph92 ]
  %indvars.iv126 = phi i64 [ 1, %.lr.ph92.preheader ], [ %indvars.iv.next127, %.lr.ph92 ]
  %29 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %indvars.iv126
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %28, %30
  store i32 %31, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  %32 = trunc i64 %indvars.iv126 to i32
  %33 = sub i32 0, %32
  store i32 %33, ptr %7, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %34 = getelementptr inbounds [200005 x %"struct.std::pair"], ptr @P, i64 0, i64 %indvars.iv.next127
  %35 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = getelementptr inbounds [200005 x i32], ptr @sum, i64 0, i64 %indvars.iv126
  store i32 %36, ptr %37, align 4, !tbaa !5
  %38 = load i32, ptr %1, align 4
  %39 = sext i32 %38 to i64
  %.not73.not = icmp slt i64 %indvars.iv126, %39
  br i1 %.not73.not, label %.lr.ph92, label %.preheader84, !llvm.loop !11

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge95
  %.06098 = phi i32 [ %41, %._crit_edge95 ], [ 1, %.preheader.preheader ]
  %40 = phi i32 [ %53, %._crit_edge95 ], [ %_ZZ4mainE1p.promoted, %.preheader.preheader ]
  %41 = shl nsw i32 %.06098, 1
  %42 = icmp slt i32 %.06098, %41
  br i1 %42, label %.lr.ph94.preheader, label %._crit_edge95

.lr.ph94.preheader:                               ; preds = %.preheader
  %43 = sext i32 %.06098 to i64
  %44 = sext i32 %41 to i64
  %45 = xor i64 %43, -1
  %46 = add nsw i64 %45, %44
  %smax = call i64 @llvm.smax.i64(i64 %27, i64 %43)
  %47 = sub i64 %smax, %43
  %umin = call i64 @llvm.umin.i64(i64 %46, i64 %47)
  %48 = add nsw i64 %umin, 1
  %min.iters.check = icmp ult i64 %48, 8
  br i1 %min.iters.check, label %.lr.ph94.preheader142, label %vector.ph

.lr.ph94.preheader142:                            ; preds = %middle.block, %.lr.ph94.preheader
  %indvars.iv129.ph = phi i64 [ %43, %.lr.ph94.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph94

vector.ph:                                        ; preds = %.lr.ph94.preheader
  %n.vec = and i64 %48, -8
  %ind.end = add i64 %n.vec, %43
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %40, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %43
  %49 = getelementptr inbounds [200005 x i32], ptr @lg, i64 0, i64 %offset.idx
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  store <4 x i32> %broadcast.splat, ptr %49, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %50, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %51 = icmp eq i64 %index.next, %n.vec
  br i1 %51, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %48, %n.vec
  br i1 %cmp.n, label %._crit_edge95, label %.lr.ph94.preheader142

._crit_edge99:                                    ; preds = %._crit_edge95
  store i32 %53, ptr @_ZZ4mainE1p, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %._crit_edge99, %.preheader84
  call void @_Z8process2i(i32 noundef %25)
  call void @llvm.lifetime.start.p0(i64 6600, ptr nonnull %8) #8
  br label %58

._crit_edge95:                                    ; preds = %.lr.ph94, %middle.block, %.preheader
  %53 = add nsw i32 %40, 1
  %.not74 = icmp sgt i32 %41, %25
  br i1 %.not74, label %._crit_edge99, label %.preheader, !llvm.loop !15

.lr.ph94:                                         ; preds = %.lr.ph94.preheader142, %.lr.ph94
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %.lr.ph94 ], [ %indvars.iv129.ph, %.lr.ph94.preheader142 ]
  %54 = getelementptr inbounds [200005 x i32], ptr @lg, i64 0, i64 %indvars.iv129
  store i32 %40, ptr %54, align 4, !tbaa !5
  %indvars.iv.next130 = add nsw i64 %indvars.iv129, 1
  %55 = icmp slt i64 %indvars.iv.next130, %44
  %56 = icmp sle i64 %indvars.iv129, %26
  %57 = and i1 %55, %56
  br i1 %57, label %.lr.ph94, label %._crit_edge95, !llvm.loop !16

58:                                               ; preds = %58, %52
  %.idx = phi i64 [ 0, %52 ], [ %.add, %58 ]
  %.ptr = getelementptr inbounds i8, ptr %8, i64 %.idx
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %.ptr)
  %.add = add nuw nsw i64 %.idx, 8
  %59 = icmp eq i64 %.add, 6600
  br i1 %59, label %60, label %58

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %invariant.gep = getelementptr inbounds i8, ptr %8, i64 8
  store i32 1, ptr %9, align 4, !tbaa !5
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %.not76114 = icmp slt i32 %61, 1
  br i1 %.not76114, label %._crit_edge121, label %.lr.ph120

._crit_edge121:                                   ; preds = %._crit_edge110, %60
  %.055.lcssa = phi i32 [ 0, %60 ], [ %.156.lcssa, %._crit_edge110 ]
  %.049.lcssa = phi i32 [ 0, %60 ], [ %.150.lcssa, %._crit_edge110 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.055.lcssa)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %62, i8 noundef signext 32)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %63, i32 noundef %.049.lcssa)
  call void @llvm.lifetime.end.p0(i64 6600, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

.lr.ph120:                                        ; preds = %60, %._crit_edge110
  %.049118 = phi i32 [ %.150.lcssa, %._crit_edge110 ], [ 0, %60 ]
  %.051117 = phi i32 [ %.152.lcssa, %._crit_edge110 ], [ 1, %60 ]
  %.055116 = phi i32 [ %.156.lcssa, %._crit_edge110 ], [ 0, %60 ]
  %storemerge115 = phi i32 [ %134, %._crit_edge110 ], [ 1, %60 ]
  %65 = sext i32 %storemerge115 to i64
  %66 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %69, label %72

69:                                               ; preds = %.lr.ph120
  %70 = zext nneg i32 %67 to i64
  %71 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %70
  store i32 %storemerge115, ptr %71, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %69, %.lr.ph120
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 820, ptr %10, align 4, !tbaa !5
  br label %87

73:                                               ; preds = %129
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  store i32 1000000007, ptr %14, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %74 = add nsw i32 %.148, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %8, i64 0, i64 %75
  %77 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %76, ptr noundef nonnull align 4 dereferenceable(8) %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %79
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %80)
  %81 = add nsw i32 %.148, 2
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %8, i64 0, i64 %82
  %84 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %83, ptr noundef nonnull align 4 dereferenceable(8) %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  %gep = getelementptr %"struct.std::pair", ptr %invariant.gep, i64 %82
  call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef nonnull %invariant.gep, ptr noundef nonnull %gep)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #8
  store i32 -1000000007, ptr %16, align 4, !tbaa !5
  %85 = icmp sgt i32 %.148, -1
  br i1 %85, label %.lr.ph109.preheader, label %._crit_edge110

.lr.ph109.preheader:                              ; preds = %73
  %86 = zext nneg i32 %74 to i64
  br label %.lr.ph109

87:                                               ; preds = %72, %129
  %.046103 = phi i32 [ 0, %72 ], [ %.1, %129 ]
  %.047102 = phi i32 [ 0, %72 ], [ %.148, %129 ]
  %storemerge77101 = phi i32 [ 820, %72 ], [ %131, %129 ]
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp sgt i32 %91, 0
  %93 = icmp slt i32 %91, %storemerge77101
  %or.cond = and i1 %92, %93
  br i1 %or.cond, label %94, label %103

94:                                               ; preds = %87
  %95 = sub nsw i32 %storemerge77101, %91
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [822 x [45 x i32]], ptr @tree, i64 0, i64 %96
  %98 = add nsw i32 %91, -1
  %99 = call noundef i32 @_Z4readPii(ptr noundef nonnull %97, i32 noundef %98)
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %101
  store i32 %99, ptr %102, align 4, !tbaa !5
  %.pre135 = load i32, ptr %9, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre135 to i64
  %.phi.trans.insert136 = getelementptr inbounds [200005 x i32], ptr @A, i64 0, i64 %.phi.trans.insert
  %.pre137 = load i32, ptr %.phi.trans.insert136, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %94, %87
  %104 = phi i32 [ %100, %94 ], [ %storemerge77101, %87 ]
  %105 = phi i32 [ %.pre137, %94 ], [ %91, %87 ]
  %106 = icmp sgt i32 %105, 0
  br i1 %106, label %107, label %112

107:                                              ; preds = %103
  %108 = sext i32 %104 to i64
  %109 = getelementptr inbounds [822 x [45 x i32]], ptr @tree, i64 0, i64 %108
  %110 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %108
  %111 = load i32, ptr %110, align 4, !tbaa !5
  call void @_Z6updatePiii(ptr noundef nonnull %109, i32 noundef %105, i32 noundef %111)
  %.pre138 = load i32, ptr %10, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %107, %103
  %113 = phi i32 [ %.pre138, %107 ], [ %104, %103 ]
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %114
  %116 = getelementptr inbounds [825 x i32], ptr @take, i64 0, i64 %114
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %115, ptr noundef nonnull align 4 dereferenceable(4) %116)
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [825 x i32], ptr @C, i64 0, i64 %120
  store i32 %118, ptr %121, align 4, !tbaa !5
  %122 = icmp sgt i32 %118, 0
  %123 = icmp sgt i32 %118, %.046103
  %or.cond79 = select i1 %122, i1 %123, i1 false
  br i1 %or.cond79, label %124, label %129

124:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(4) %121, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %125 = add nsw i32 %.047102, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %8, i64 0, i64 %126
  %128 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %127, ptr noundef nonnull align 4 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  %.pre139 = load i32, ptr %10, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %112, %124
  %130 = phi i32 [ %.pre139, %124 ], [ %119, %112 ]
  %.148 = phi i32 [ %125, %124 ], [ %.047102, %112 ]
  %.1 = phi i32 [ %118, %124 ], [ %.046103, %112 ]
  %131 = add nsw i32 %130, -1
  store i32 %131, ptr %10, align 4, !tbaa !5
  %132 = icmp sgt i32 %130, 1
  br i1 %132, label %87, label %73, !llvm.loop !17

._crit_edge110:                                   ; preds = %165, %73
  %.156.lcssa = phi i32 [ %.055116, %73 ], [ %.358, %165 ]
  %.152.lcssa = phi i32 [ %.051117, %73 ], [ %.354, %165 ]
  %.150.lcssa = phi i32 [ %.049118, %73 ], [ %.3, %165 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #8
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %9, align 4, !tbaa !5
  %135 = load i32, ptr %1, align 4, !tbaa !5
  %.not76.not = icmp slt i32 %133, %135
  br i1 %.not76.not, label %.lr.ph120, label %._crit_edge121, !llvm.loop !18

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %165
  %indvars.iv132 = phi i64 [ %86, %.lr.ph109.preheader ], [ %indvars.iv.next133, %165 ]
  %.150106 = phi i32 [ %.049118, %.lr.ph109.preheader ], [ %.3, %165 ]
  %.152105 = phi i32 [ %.051117, %.lr.ph109.preheader ], [ %.354, %165 ]
  %.156104 = phi i32 [ %.055116, %.lr.ph109.preheader ], [ %.358, %165 ]
  %136 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %8, i64 0, i64 %indvars.iv132
  %137 = load i32, ptr %136, align 8, !tbaa !19
  %138 = add nuw nsw i64 %indvars.iv132, 1
  %139 = getelementptr inbounds [825 x %"struct.std::pair"], ptr %8, i64 0, i64 %138
  %140 = load i32, ptr %139, align 8, !tbaa !19
  %141 = getelementptr inbounds i8, ptr %139, i64 4
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %141)
  %143 = load i32, ptr %142, align 4, !tbaa !5
  store i32 %143, ptr %16, align 4, !tbaa !5
  %.not78 = icmp slt i32 %137, %140
  br i1 %.not78, label %144, label %165

144:                                              ; preds = %.lr.ph109
  %145 = add nsw i32 %137, 1
  %146 = call noundef i32 @_Z5queryii(i32 noundef %145, i32 noundef %140)
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [200005 x i32], ptr @sum, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %146 to i64
  %152 = getelementptr inbounds [200005 x i32], ptr @sum, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = load i32, ptr %16, align 4, !tbaa !5
  %155 = add i32 %153, %154
  %156 = sub i32 %150, %155
  %157 = icmp sgt i32 %156, %.156104
  br i1 %157, label %158, label %160

158:                                              ; preds = %144
  %159 = sub nsw i32 %147, %146
  br label %165

160:                                              ; preds = %144
  %161 = icmp eq i32 %.156104, %156
  %162 = sub nsw i32 %147, %146
  %163 = icmp eq i32 %.152105, %162
  %or.cond81 = select i1 %161, i1 %163, i1 false
  %164 = zext i1 %or.cond81 to i32
  %spec.select = add nsw i32 %.150106, %164
  br label %165

165:                                              ; preds = %160, %158, %.lr.ph109
  %.358 = phi i32 [ %.156104, %.lr.ph109 ], [ %156, %158 ], [ %.156104, %160 ]
  %.354 = phi i32 [ %.152105, %.lr.ph109 ], [ %159, %158 ], [ %.152105, %160 ]
  %.3 = phi i32 [ %.150106, %.lr.ph109 ], [ 1, %158 ], [ %spec.select, %160 ]
  %indvars.iv.next133 = add nsw i64 %indvars.iv132, -1
  %166 = trunc nuw i64 %indvars.iv132 to i32
  %167 = icmp sgt i32 %166, 1
  br i1 %167, label %.lr.ph109, label %._crit_edge110, !llvm.loop !21
}

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 dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #5 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #7

attributes #0 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 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}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 0}
!20 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!21 = distinct !{!21, !10}


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