; LLVM IR from tangjz/acm-icpc :: 51nod (1302)

; 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 }

@n = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@que = external dso_local global [200001 x i32], align 16
@mx = external dso_local global i32, align 4
@bit = external dso_local global [200001 x i32], align 16
@a = external dso_local global [200001 x %"struct.std::pair"], align 16
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4findi(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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %61, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = shl i32 %17, 1
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %64

21:                                               ; preds = %15
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %23
  %25 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 0
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %27
  %29 = getelementptr inbounds %"struct.std::pair", ptr %28, i32 0, i32 1
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25, ptr noundef %29)
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %32
  %34 = getelementptr inbounds %"struct.std::pair", ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !9
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %37
  %39 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = icmp sgt i32 %35, %40
  br i1 %41, label %42, label %51

42:                                               ; preds = %21
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %44
  %46 = getelementptr inbounds %"struct.std::pair", ptr %45, i32 0, i32 0
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %48
  %50 = getelementptr inbounds %"struct.std::pair", ptr %49, i32 0, i32 1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %46, ptr noundef nonnull align 4 dereferenceable(4) %50) #6
  br label %51

51:                                               ; preds = %42, %21
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %53
  %55 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !11
  %57 = load i32, ptr @tot, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @tot, align 4, !tbaa !5
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %59
  store i32 %56, ptr %60, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %51
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !12

64:                                               ; preds = %20
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %66 = shl i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %"struct.std::pair", ptr @a, i64 %67
  call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef @a, ptr noundef %68)
  %69 = load i32, ptr @tot, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr @que, i64 %70
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %71)
  %72 = load i32, ptr @tot, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr @que, i64 %73
  %75 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %74)
  %76 = ptrtoint ptr %75 to i64
  %77 = sub i64 %76, ptrtoint (ptr @que to i64)
  %78 = sdiv exact i64 %77, 4
  %79 = trunc i64 %78 to i32
  store i32 %79, ptr @tot, align 4, !tbaa !5
  store i32 1, ptr @mx, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %85, %64
  %81 = load i32, ptr @mx, align 4, !tbaa !5
  %82 = load i32, ptr @tot, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %84, label %88

84:                                               ; preds = %80
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr @mx, align 4, !tbaa !5
  %87 = shl i32 %86, 1
  store i32 %87, ptr @mx, align 4, !tbaa !5
  br label %80, !llvm.loop !14

88:                                               ; preds = %80
  %89 = load i32, ptr @mx, align 4, !tbaa !5
  %90 = ashr i32 %89, 1
  store i32 %90, ptr @mx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %116, %88
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = load i32, ptr @n, align 4, !tbaa !5
  %94 = shl i32 %93, 1
  %95 = icmp slt i32 %92, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %119

97:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %98 = load i32, ptr @tot, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr @que, i64 %99
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %102
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 1
  %105 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %100, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = ptrtoint ptr %105 to i64
  %107 = sub i64 %106, ptrtoint (ptr @que to i64)
  %108 = sdiv exact i64 %107, 4
  %109 = add nsw i64 %108, 1
  %110 = trunc i64 %109 to i32
  store i32 %110, ptr %4, align 4, !tbaa !5
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %113, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %116

116:                                              ; preds = %97
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %3, align 4, !tbaa !5
  br label %91, !llvm.loop !15

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

120:                                              ; preds = %146, %119
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = load i32, ptr @tot, align 4, !tbaa !5
  %123 = icmp sle i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %149

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = sub nsw i32 0, %128
  %130 = and i32 %127, %129
  %131 = add nsw i32 %126, %130
  store i32 %131, ptr %6, align 4, !tbaa !5
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = load i32, ptr @tot, align 4, !tbaa !5
  %134 = icmp sle i32 %132, %133
  br i1 %134, label %135, label %145

135:                                              ; preds = %125
  %136 = load i32, ptr %5, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = add nsw i32 %143, %139
  store i32 %144, ptr %142, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %135, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %5, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %5, align 4, !tbaa !5
  br label %120, !llvm.loop !16

149:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %150 = load i32, ptr @a, align 16, !tbaa !9
  store i32 %150, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %151 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr @a, i32 0, i32 1), align 4, !tbaa !11
  store i32 %151, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %248, %149
  %153 = load i32, ptr %11, align 4, !tbaa !5
  %154 = load i32, ptr @n, align 4, !tbaa !5
  %155 = icmp sle i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %251

157:                                              ; preds = %152
  %158 = load i32, ptr @tot, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds i32, ptr @que, i64 %159
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %162
  %164 = getelementptr inbounds %"struct.std::pair", ptr %163, i32 0, i32 1
  %165 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %160, ptr noundef nonnull align 4 dereferenceable(4) %164)
  %166 = ptrtoint ptr %165 to i64
  %167 = sub i64 %166, ptrtoint (ptr @que to i64)
  %168 = sdiv exact i64 %167, 4
  %169 = add nsw i64 %168, 1
  %170 = trunc i64 %169 to i32
  call void @_Z3addii(i32 noundef %170, i32 noundef -1)
  %171 = call noundef i32 @_Z4findi(i32 noundef 1)
  %172 = sub nsw i32 %171, 1
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  store i32 %175, ptr %9, align 4, !tbaa !5
  %176 = load i32, ptr @n, align 4, !tbaa !5
  %177 = call noundef i32 @_Z4findi(i32 noundef %176)
  %178 = sub nsw i32 %177, 1
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  store i32 %181, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = mul nsw i64 %183, %186
  %188 = load i32, ptr %11, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %189
  %191 = getelementptr inbounds %"struct.std::pair", ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 8, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = load i32, ptr %11, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %195
  %197 = getelementptr inbounds %"struct.std::pair", ptr %196, i32 0, i32 1
  %198 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %197, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = mul nsw i64 %193, %200
  %202 = add nsw i64 %187, %201
  store i64 %202, ptr %12, align 8, !tbaa !17
  %203 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %204 = load i64, ptr %203, align 8, !tbaa !17
  store i64 %204, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %205 = load i32, ptr %11, align 4, !tbaa !5
  %206 = load i32, ptr @n, align 4, !tbaa !5
  %207 = icmp eq i32 %205, %206
  br i1 %207, label %208, label %209

208:                                              ; preds = %157
  store i32 2147483647, ptr %9, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %208, %157
  %210 = load i32, ptr @n, align 4, !tbaa !5
  %211 = load i32, ptr %11, align 4, !tbaa !5
  %212 = sub nsw i32 %210, %211
  %213 = add nsw i32 %212, 1
  %214 = call noundef i32 @_Z4findi(i32 noundef %213)
  %215 = sub nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  store i32 %218, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %219 = load i32, ptr %7, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = mul nsw i64 %220, %223
  %225 = load i32, ptr %11, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %226
  %228 = getelementptr inbounds %"struct.std::pair", ptr %227, i32 0, i32 0
  %229 = load i32, ptr %228, align 8, !tbaa !9
  %230 = sext i32 %229 to i64
  %231 = load i32, ptr %11, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %232
  %234 = getelementptr inbounds %"struct.std::pair", ptr %233, i32 0, i32 1
  %235 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %234, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = mul nsw i64 %230, %237
  %239 = add nsw i64 %224, %238
  store i64 %239, ptr %13, align 8, !tbaa !17
  %240 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %241 = load i64, ptr %240, align 8, !tbaa !17
  store i64 %241, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %242 = load i32, ptr %11, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %243
  %245 = getelementptr inbounds %"struct.std::pair", ptr %244, i32 0, i32 1
  %246 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %245)
  %247 = load i32, ptr %246, align 4, !tbaa !5
  store i32 %247, ptr %8, align 4, !tbaa !5
  br label %248

248:                                              ; preds = %209
  %249 = load i32, ptr %11, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %11, align 4, !tbaa !5
  br label %152, !llvm.loop !19

251:                                              ; preds = %156
  %252 = load i64, ptr @ans, align 8, !tbaa !17
  %253 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %252)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

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

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #3

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


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

%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [200001 x i32], align 16
@mx = external dso_local local_unnamed_addr global i32, align 4
@bit = external dso_local local_unnamed_addr global [200001 x i32], align 16
@a = external dso_local global [200001 x %"struct.std::pair"], align 16
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4findi(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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = shl i32 %7, 1
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre68 = sext i32 %8 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %29, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre68, %.._crit_edge_crit_edge ], [ %37, %29 ]
  %10 = getelementptr inbounds %"struct.std::pair", ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPSt4pairIiiEEvT_S3_(ptr noundef nonnull @a, ptr noundef nonnull %10)
  %11 = load i32, ptr @tot, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds i32, ptr @que, i64 %12
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %13)
  %14 = load i32, ptr @tot, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i32, ptr @que, i64 %15
  %17 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %16)
  %18 = ptrtoint ptr %17 to i64
  %19 = sub i64 %18, ptrtoint (ptr @que to i64)
  %20 = lshr exact i64 %19, 2
  %21 = trunc i64 %20 to i32
  store i32 %21, ptr @tot, align 4, !tbaa !5
  br label %39

.lr.ph:                                           ; preds = %0, %29
  %indvars.iv = phi i64 [ %indvars.iv.next, %29 ], [ 0, %0 ]
  %22 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv
  %23 = getelementptr inbounds i8, ptr %22, i64 4
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %22, ptr noundef nonnull %23)
  %25 = load i32, ptr %22, align 8, !tbaa !9
  %26 = load i32, ptr %23, align 4, !tbaa !11
  %27 = icmp sgt i32 %25, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %.lr.ph
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %23) #6
  %.pre = load i32, ptr %23, align 4, !tbaa !11
  br label %29

29:                                               ; preds = %28, %.lr.ph
  %30 = phi i32 [ %.pre, %28 ], [ %26, %.lr.ph ]
  %31 = load i32, ptr @tot, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr @tot, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %33
  store i32 %30, ptr %34, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = shl i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next, %37
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !12

39:                                               ; preds = %39, %._crit_edge
  %storemerge = phi i32 [ 1, %._crit_edge ], [ %41, %39 ]
  %40 = icmp slt i32 %storemerge, %21
  %41 = shl i32 %storemerge, 1
  br i1 %40, label %39, label %42, !llvm.loop !14

42:                                               ; preds = %39
  %43 = ashr i32 %storemerge, 1
  store i32 %43, ptr @mx, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = shl i32 %44, 1
  %46 = icmp sgt i32 %45, 1
  br i1 %46, label %.lr.ph46, label %.preheader

.preheader.loopexit:                              ; preds = %.lr.ph46
  %.pre67 = load i32, ptr @tot, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %42
  %47 = phi i32 [ %63, %.preheader.loopexit ], [ %44, %42 ]
  %48 = phi i32 [ %.pre67, %.preheader.loopexit ], [ %21, %42 ]
  %.not47 = icmp slt i32 %48, 1
  br i1 %.not47, label %._crit_edge50, label %.lr.ph49.preheader

.lr.ph49.preheader:                               ; preds = %.preheader
  %49 = zext nneg i32 %48 to i64
  %xtraiter = and i64 %49, 1
  %50 = icmp eq i32 %48, 1
  br i1 %50, label %._crit_edge50.loopexit.unr-lcssa, label %.lr.ph49.preheader.new

.lr.ph49.preheader.new:                           ; preds = %.lr.ph49.preheader
  %unroll_iter = and i64 %49, 2147483646
  br label %.lr.ph49

.lr.ph46:                                         ; preds = %42, %.lr.ph46
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.lr.ph46 ], [ 1, %42 ]
  %51 = load i32, ptr @tot, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr @que, i64 %52
  %54 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv58, i32 1
  %55 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %53, ptr noundef nonnull align 4 dereferenceable(4) %54)
  %56 = ptrtoint ptr %55 to i64
  %57 = sub i64 %56, ptrtoint (ptr @que to i64)
  %58 = shl i64 %57, 30
  %sext = add i64 %58, 4294967296
  %59 = ashr i64 %sext, 32
  %60 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !5
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = shl i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next59, %65
  br i1 %66, label %.lr.ph46, label %.preheader.loopexit, !llvm.loop !15

._crit_edge50.loopexit.unr-lcssa:                 ; preds = %100, %.lr.ph49.preheader
  %indvars.iv61.unr = phi i64 [ 1, %.lr.ph49.preheader ], [ %indvars.iv.next62.1, %100 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge50, label %.lr.ph49.epil

.lr.ph49.epil:                                    ; preds = %._crit_edge50.loopexit.unr-lcssa
  %indvars63.epil = trunc i64 %indvars.iv61.unr to i32
  %67 = sub nsw i32 0, %indvars63.epil
  %68 = and i32 %indvars63.epil, %67
  %69 = add nuw nsw i32 %68, %indvars63.epil
  %.not41.epil = icmp sgt i32 %69, %48
  br i1 %.not41.epil, label %._crit_edge50, label %70

70:                                               ; preds = %.lr.ph49.epil
  %71 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %indvars.iv61.unr
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = zext nneg i32 %69 to i64
  %74 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %75, %72
  store i32 %76, ptr %74, align 4, !tbaa !5
  br label %._crit_edge50

._crit_edge50:                                    ; preds = %._crit_edge50.loopexit.unr-lcssa, %70, %.lr.ph49.epil, %.preheader
  %77 = load i32, ptr @a, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !11
  store i32 %78, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %.not4051 = icmp slt i32 %47, 1
  br i1 %.not4051, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %._crit_edge50
  %79 = sext i32 %77 to i64
  br label %103

.lr.ph49:                                         ; preds = %100, %.lr.ph49.preheader.new
  %indvars.iv61 = phi i64 [ 1, %.lr.ph49.preheader.new ], [ %indvars.iv.next62.1, %100 ]
  %niter = phi i64 [ 0, %.lr.ph49.preheader.new ], [ %niter.next.1, %100 ]
  %indvars63 = trunc i64 %indvars.iv61 to i32
  %80 = sub nsw i32 0, %indvars63
  %81 = and i32 %indvars63, %80
  %82 = add nuw nsw i32 %81, %indvars63
  %.not41 = icmp sgt i32 %82, %48
  br i1 %.not41, label %.lr.ph49.1, label %83

83:                                               ; preds = %.lr.ph49
  %84 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %indvars.iv61
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = zext nneg i32 %82 to i64
  %87 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, %85
  store i32 %89, ptr %87, align 4, !tbaa !5
  br label %.lr.ph49.1

.lr.ph49.1:                                       ; preds = %83, %.lr.ph49
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %indvars63.1 = trunc i64 %indvars.iv.next62 to i32
  %90 = sub nsw i32 0, %indvars63.1
  %91 = and i32 %indvars63.1, %90
  %92 = add nuw nsw i32 %91, %indvars63.1
  %.not41.1 = icmp sgt i32 %92, %48
  br i1 %.not41.1, label %100, label %93

93:                                               ; preds = %.lr.ph49.1
  %94 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %indvars.iv.next62
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = zext nneg i32 %92 to i64
  %97 = getelementptr inbounds [200001 x i32], ptr @bit, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %98, %95
  store i32 %99, ptr %97, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %93, %.lr.ph49.1
  %indvars.iv.next62.1 = add nuw nsw i64 %indvars.iv61, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge50.loopexit.unr-lcssa, label %.lr.ph49, !llvm.loop !16

._crit_edge55:                                    ; preds = %143, %._crit_edge50
  %101 = load i64, ptr @ans, align 8, !tbaa !17
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %101)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

103:                                              ; preds = %.lr.ph54, %143
  %indvars.iv64 = phi i64 [ 1, %.lr.ph54 ], [ %indvars.iv.next65, %143 ]
  %104 = load i32, ptr @tot, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr @que, i64 %105
  %107 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv64
  %108 = getelementptr inbounds i8, ptr %107, i64 4
  %109 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %106, ptr noundef nonnull align 4 dereferenceable(4) %108)
  %110 = ptrtoint ptr %109 to i64
  %111 = sub i64 %110, ptrtoint (ptr @que to i64)
  %112 = lshr exact i64 %111, 2
  %113 = trunc i64 %112 to i32
  %114 = add i32 %113, 1
  call void @_Z3addii(i32 noundef %114, i32 noundef -1)
  %115 = call noundef i32 @_Z4findi(i32 noundef 1)
  %116 = add nsw i32 %115, -1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  store i32 %119, ptr %2, align 4, !tbaa !5
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = call noundef i32 @_Z4findi(i32 noundef %120)
  %122 = add nsw i32 %121, -1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  store i32 %125, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = mul nsw i64 %128, %79
  %130 = load i32, ptr %107, align 8, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %108, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = mul nsw i64 %134, %131
  %136 = add nsw i64 %135, %129
  store i64 %136, ptr %4, align 8, !tbaa !17
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %138 = load i64, ptr %137, align 8, !tbaa !17
  store i64 %138, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %139 = load i32, ptr @n, align 4, !tbaa !5
  %140 = zext i32 %139 to i64
  %141 = icmp eq i64 %indvars.iv64, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %103
  store i32 2147483647, ptr %2, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %142, %103
  %144 = trunc nuw nsw i64 %indvars.iv64 to i32
  %reass.sub = sub i32 %139, %144
  %145 = add i32 %reass.sub, 1
  %146 = call noundef i32 @_Z4findi(i32 noundef %145)
  %147 = add nsw i32 %146, -1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [200001 x i32], ptr @que, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  store i32 %150, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %151 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = mul nsw i64 %153, %79
  %155 = load i32, ptr %107, align 8, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %108, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = mul nsw i64 %159, %156
  %161 = add nsw i64 %160, %154
  store i64 %161, ptr %5, align 8, !tbaa !17
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %163 = load i64, ptr %162, align 8, !tbaa !17
  store i64 %163, ptr @ans, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %108)
  %165 = load i32, ptr %164, align 4, !tbaa !5
  store i32 %165, ptr %1, align 4, !tbaa !5
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %.not40.not = icmp slt i64 %indvars.iv64, %167
  br i1 %.not40.not, label %103, label %._crit_edge55, !llvm.loop !19
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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


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