; LLVM IR from tangjz/acm-icpc :: lydsy (2885)

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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@a = external dso_local global [100003 x i32], align 16
@b = external dso_local global [100003 x i32], align 16
@c = external dso_local global [100003 x i32], align 16
@s = external dso_local global [100003 x i32], align 16
@pL = external dso_local global [100003 x i32], align 16
@pR = external dso_local global [100003 x i32], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 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 %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @dt)
  store i32 1, ptr @pR, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %59, %0
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @a, i64 %27
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %28)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %35
  store i32 %33, ptr %36, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %38
  store i32 %33, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %41
  store i32 1, ptr %42, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sub nsw i32 %43, 1
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %46
  store i32 %44, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100003 x i32], ptr @pR, i64 0, i64 %51
  store i32 %49, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sub nsw i32 0, %56
  store i32 %57, ptr %4, align 4, !tbaa !5
  %58 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %58, ptr %3, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %59

59:                                               ; preds = %25
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !9

62:                                               ; preds = %24
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %66
  store i32 %63, ptr %67, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %70
  store i32 1061109567, ptr %71, align 4, !tbaa !5
  store i32 1061109567, ptr @b, align 16, !tbaa !5
  br label %72

72:                                               ; preds = %258, %256, %62
  %73 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %74 = xor i1 %73, true
  br i1 %74, label %75, label %259

75:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %76 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %77 = getelementptr inbounds %"struct.std::pair", ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !11
  store i32 %78, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  store i32 %82, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100003 x i32], ptr @pR, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  store i32 %86, ptr %7, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100003 x i32], ptr @pR, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = icmp ne i32 %90, %91
  br i1 %92, label %120, label %93

93:                                               ; preds = %75
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = icmp ne i32 %97, %98
  br i1 %99, label %120, label %100

100:                                              ; preds = %93
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp slt i32 %104, %108
  br i1 %109, label %120, label %110

110:                                              ; preds = %100
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp slt i32 %114, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %110, %100, %93, %75
  store i32 5, ptr %8, align 4
  br label %256, !llvm.loop !13

121:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1061109567, ptr %10, align 4, !tbaa !5
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = icmp slt i32 %125, 1061109567
  br i1 %126, label %127, label %135

127:                                              ; preds = %121
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %9, align 4, !tbaa !5
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %131
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %132)
  %134 = load i32, ptr %133, align 4, !tbaa !5
  store i32 %134, ptr %10, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %127, %121
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = icmp slt i32 %139, 1061109567
  br i1 %140, label %141, label %149

141:                                              ; preds = %135
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %9, align 4, !tbaa !5
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %145
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %146)
  %148 = load i32, ptr %147, align 4, !tbaa !5
  store i32 %148, ptr %10, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %141, %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = load i32, ptr @dt, align 4, !tbaa !5
  %152 = mul nsw i32 %150, %151
  %153 = load i32, ptr %5, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = mul nsw i32 %156, 2
  %158 = add nsw i32 %152, %157
  %159 = load i32, ptr %5, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sdiv i32 %158, %162
  %164 = add nsw i32 %163, 1
  %165 = sdiv i32 %164, 2
  store i32 %165, ptr %11, align 4, !tbaa !5
  %166 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %167 = load i32, ptr %166, align 4, !tbaa !5
  store i32 %167, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = load i32, ptr %5, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = icmp slt i32 %168, %172
  br i1 %173, label %174, label %175

174:                                              ; preds = %149
  store i32 5, ptr %8, align 4
  br label %255, !llvm.loop !13

175:                                              ; preds = %149
  %176 = load i32, ptr %10, align 4, !tbaa !5
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %178
  store i32 %176, ptr %179, align 4, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !5
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = load i32, ptr %5, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = icmp eq i32 %183, %187
  br i1 %188, label %189, label %212

189:                                              ; preds = %175
  %190 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z5erasei(i32 noundef %190)
  %191 = load i32, ptr %5, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = load i32, ptr %6, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !5
  %199 = add nsw i32 %198, %194
  store i32 %199, ptr %197, align 4, !tbaa !5
  %200 = load i32, ptr %5, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = load i32, ptr %6, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = add nsw i32 %207, %203
  store i32 %208, ptr %206, align 4, !tbaa !5
  %209 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %209, ptr %5, align 4, !tbaa !5
  %210 = load i32, ptr %9, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %9, align 4, !tbaa !5
  br label %212

212:                                              ; preds = %189, %175
  %213 = load i32, ptr %5, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = load i32, ptr %7, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = icmp eq i32 %216, %220
  br i1 %221, label %222, label %244

222:                                              ; preds = %212
  %223 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z5erasei(i32 noundef %223)
  %224 = load i32, ptr %7, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = load i32, ptr %5, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = add nsw i32 %231, %227
  store i32 %232, ptr %230, align 4, !tbaa !5
  %233 = load i32, ptr %7, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = load i32, ptr %5, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = add nsw i32 %240, %236
  store i32 %241, ptr %239, align 4, !tbaa !5
  %242 = load i32, ptr %9, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %9, align 4, !tbaa !5
  br label %244

244:                                              ; preds = %222, %212
  %245 = load i32, ptr %9, align 4, !tbaa !5
  %246 = icmp ne i32 %245, 0
  br i1 %246, label %247, label %254

247:                                              ; preds = %244
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %248 = load i32, ptr %5, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sub nsw i32 0, %251
  store i32 %252, ptr %13, align 4, !tbaa !5
  %253 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %253, ptr %12, align 4
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %254

254:                                              ; preds = %247, %244
  store i32 0, ptr %8, align 4
  br label %255

255:                                              ; preds = %254, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %256

256:                                              ; preds = %255, %120
  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 4, ptr %5) #7
  %257 = load i32, ptr %8, align 4
  switch i32 %257, label %346 [
    i32 0, label %258
    i32 5, label %72
  ]

258:                                              ; preds = %256
  br label %72, !llvm.loop !13

259:                                              ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %260

260:                                              ; preds = %287, %259
  %261 = load i32, ptr %14, align 4, !tbaa !5
  %262 = load i32, ptr @n, align 4, !tbaa !5
  %263 = icmp sle i32 %261, %262
  br i1 %263, label %265, label %264

264:                                              ; preds = %260
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %288

265:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %266 = load i32, ptr %14, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !5
  store i32 %269, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %270 = load i32, ptr %14, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  store i32 %273, ptr %16, align 4, !tbaa !5
  br label %274

274:                                              ; preds = %284, %265
  %275 = load i32, ptr %15, align 4, !tbaa !5
  %276 = icmp sgt i32 %275, 0
  br i1 %276, label %278, label %277

277:                                              ; preds = %274
  store i32 9, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %287

278:                                              ; preds = %274
  %279 = load i32, ptr %16, align 4, !tbaa !5
  %280 = load i32, ptr %14, align 4, !tbaa !5
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr %14, align 4, !tbaa !5
  %282 = sext i32 %280 to i64
  %283 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %282
  store i32 %279, ptr %283, align 4, !tbaa !5
  br label %284

284:                                              ; preds = %278
  %285 = load i32, ptr %15, align 4, !tbaa !5
  %286 = add nsw i32 %285, -1
  store i32 %286, ptr %15, align 4, !tbaa !5
  br label %274, !llvm.loop !14

287:                                              ; preds = %277
  br label %260, !llvm.loop !15

288:                                              ; preds = %264
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %289 = load i32, ptr getelementptr inbounds ([100003 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
  %290 = load i32, ptr getelementptr inbounds ([100003 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  %291 = sub nsw i32 %289, %290
  %292 = load i32, ptr getelementptr inbounds ([100003 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
  %293 = load i32, ptr getelementptr inbounds ([100003 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  %294 = sub nsw i32 %292, %293
  %295 = mul nsw i32 %291, %294
  %296 = sext i32 %295 to i64
  store i64 %296, ptr %17, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 2, ptr %18, align 4, !tbaa !5
  br label %297

297:                                              ; preds = %339, %288
  %298 = load i32, ptr %18, align 4, !tbaa !5
  %299 = load i32, ptr @n, align 4, !tbaa !5
  %300 = icmp sle i32 %298, %299
  br i1 %300, label %302, label %301

301:                                              ; preds = %297
  store i32 12, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %342

302:                                              ; preds = %297
  %303 = load i32, ptr @dt, align 4, !tbaa !5
  %304 = load i32, ptr %18, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %305
  %307 = load i32, ptr %306, align 4, !tbaa !5
  %308 = load i32, ptr %18, align 4, !tbaa !5
  %309 = sub nsw i32 %308, 1
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %310
  %312 = load i32, ptr %311, align 4, !tbaa !5
  %313 = sub nsw i32 %307, %312
  %314 = call i32 @llvm.abs.i32(i32 %313, i1 true)
  %315 = mul nsw i32 %303, %314
  %316 = load i32, ptr %18, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %317
  %319 = load i32, ptr %318, align 4, !tbaa !5
  %320 = load i32, ptr %18, align 4, !tbaa !5
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %321
  %323 = load i32, ptr %322, align 4, !tbaa !5
  %324 = sub nsw i32 %319, %323
  %325 = load i32, ptr %18, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %326
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = load i32, ptr %18, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %330
  %332 = load i32, ptr %331, align 4, !tbaa !5
  %333 = sub nsw i32 %328, %332
  %334 = mul nsw i32 %324, %333
  %335 = add nsw i32 %315, %334
  %336 = sext i32 %335 to i64
  %337 = load i64, ptr %17, align 8, !tbaa !16
  %338 = add nsw i64 %337, %336
  store i64 %338, ptr %17, align 8, !tbaa !16
  br label %339

339:                                              ; preds = %302
  %340 = load i32, ptr %18, align 4, !tbaa !5
  %341 = add nsw i32 %340, 1
  store i32 %341, ptr %18, align 4, !tbaa !5
  br label %297, !llvm.loop !18

342:                                              ; preds = %301
  %343 = load i64, ptr %17, align 8, !tbaa !16
  %344 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %343)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  %345 = load i32, ptr %1, align 4
  ret i32 %345

346:                                              ; preds = %256
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z5erasei(i32 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #6

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

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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@a = external dso_local global [100003 x i32], align 16
@b = external dso_local global [100003 x i32], align 16
@c = external dso_local local_unnamed_addr global [100003 x i32], align 16
@s = external dso_local local_unnamed_addr global [100003 x i32], align 16
@pL = external dso_local local_unnamed_addr global [100003 x i32], align 16
@pR = external dso_local local_unnamed_addr global [100003 x i32], align 16
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @dt)
  store i32 1, ptr @pR, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 1, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not58 = icmp slt i32 %10, 1
  br i1 %.not58, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa57 = phi i32 [ %10, %0 ], [ %34, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %11 = add nsw i32 %.lcssa57, 1
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %12
  store i32 %.lcssa57, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %12
  store i32 1061109567, ptr %14, align 4, !tbaa !5
  store i32 1061109567, ptr @b, align 16, !tbaa !5
  %15 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %15, label %.preheader, label %.lr.ph61

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge59 = phi i32 [ %33, %.lr.ph ], [ 1, %0 ]
  %16 = sext i32 %storemerge59 to i64
  %17 = getelementptr inbounds i32, ptr @a, i64 %16
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %17)
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %20
  store i32 %22, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %20
  store i32 %22, ptr %24, align 4, !tbaa !5
  %25 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %20
  store i32 1, ptr %25, align 4, !tbaa !5
  %26 = add nsw i32 %19, -1
  %27 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %20
  store i32 %26, ptr %27, align 4, !tbaa !5
  %28 = add nsw i32 %19, 1
  %29 = getelementptr inbounds [100003 x i32], ptr @pR, i64 0, i64 %20
  store i32 %28, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %30 = sub nsw i32 0, %22
  store i32 %30, ptr %3, align 4, !tbaa !5
  %31 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %1)
  store i64 %31, ptr %2, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %32 = load i32, ptr %1, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %1, align 4, !tbaa !5
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %32, %34
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %136, %._crit_edge
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %.not4967 = icmp slt i32 %35, 1
  br i1 %.not4967, label %._crit_edge70.thread, label %.lr.ph69

._crit_edge70.thread:                             ; preds = %.preheader
  %36 = load i32, ptr getelementptr inbounds (i8, ptr @b, i64 4), align 4, !tbaa !5
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  %38 = sub nsw i32 %36, %37
  %39 = mul nsw i32 %38, %38
  %40 = zext nneg i32 %39 to i64
  br label %._crit_edge77

.lr.ph61:                                         ; preds = %._crit_edge, %136
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  %43 = load i32, ptr %42, align 4, !tbaa !11
  store i32 %43, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = getelementptr inbounds [100003 x i32], ptr @pR, i64 0, i64 %44
  %48 = load i32, ptr %47, align 4, !tbaa !5
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %49 = sext i32 %46 to i64
  %50 = getelementptr inbounds [100003 x i32], ptr @pR, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %.not51 = icmp eq i32 %51, %52
  br i1 %.not51, label %53, label %136, !llvm.loop !13

53:                                               ; preds = %.lr.ph61
  %54 = sext i32 %48 to i64
  %55 = getelementptr inbounds [100003 x i32], ptr @pL, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %.not52 = icmp eq i32 %56, %51
  br i1 %.not52, label %57, label %136, !llvm.loop !13

57:                                               ; preds = %53
  %58 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %49
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %51 to i64
  %61 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp slt i32 %59, %62
  br i1 %63, label %136, label %64, !llvm.loop !13

64:                                               ; preds = %57
  %65 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %54
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp slt i32 %66, %62
  br i1 %67, label %136, label %68, !llvm.loop !13

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 1061109567, ptr %5, align 4, !tbaa !5
  %69 = icmp slt i32 %59, 1061109567
  br i1 %69, label %70, label %73

70:                                               ; preds = %68
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %58)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %72, ptr %5, align 4, !tbaa !5
  %.pre = load i32, ptr %65, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %70, %68
  %74 = phi i32 [ %.pre, %70 ], [ %66, %68 ]
  %.043 = phi i32 [ 1, %70 ], [ 0, %68 ]
  %75 = icmp slt i32 %74, 1061109567
  br i1 %75, label %76, label %80

76:                                               ; preds = %73
  %77 = add nuw nsw i32 %.043, 1
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %65)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  store i32 %79, ptr %5, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %76, %73
  %.144 = phi i32 [ %77, %76 ], [ %.043, %73 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %81 = load i32, ptr @dt, align 4, !tbaa !5
  %82 = mul nsw i32 %81, %.144
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = shl nsw i32 %86, 1
  %88 = add nsw i32 %87, %82
  %89 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %84
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sdiv i32 %88, %90
  %92 = add nsw i32 %91, 1
  %93 = sdiv i32 %92, 2
  store i32 %93, ptr %6, align 4, !tbaa !5
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp slt i32 %95, %99
  br i1 %100, label %.thread89, label %101, !llvm.loop !13

101:                                              ; preds = %80
  store i32 %95, ptr %98, align 4, !tbaa !5
  %102 = load i32, ptr %58, align 4, !tbaa !5
  %.not56 = icmp eq i32 %102, %95
  br i1 %.not56, label %103, label %.thread88

103:                                              ; preds = %101
  call void @_Z5erasei(i32 noundef %96)
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %49
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = add nsw i32 %109, %107
  store i32 %110, ptr %108, align 4, !tbaa !5
  %111 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %105
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %49
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, %112
  store i32 %115, ptr %113, align 4, !tbaa !5
  store i32 %46, ptr %4, align 4, !tbaa !5
  %.pre85 = load i32, ptr %58, align 4, !tbaa !5
  %116 = load i32, ptr %65, align 4, !tbaa !5
  %117 = icmp eq i32 %.pre85, %116
  br i1 %117, label %.thread, label %132

.thread88:                                        ; preds = %101
  %118 = load i32, ptr %65, align 4, !tbaa !5
  %119 = icmp eq i32 %95, %118
  br i1 %119, label %.thread, label %.thread89

.thread:                                          ; preds = %.thread88, %103
  call void @_Z5erasei(i32 noundef %48)
  %120 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %54
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %125, %121
  store i32 %126, ptr %124, align 4, !tbaa !5
  %127 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %54
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = getelementptr inbounds [100003 x i32], ptr @s, i64 0, i64 %123
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = add nsw i32 %130, %128
  store i32 %131, ptr %129, align 4, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %123
  %.pre87 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %103, %.thread
  %133 = phi i32 [ %.pre87, %.thread ], [ %.pre85, %103 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %134 = sub nsw i32 0, %133
  store i32 %134, ptr %8, align 4, !tbaa !5
  %135 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %135, ptr %7, align 8
  call void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %.thread89

.thread89:                                        ; preds = %.thread88, %132, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %136

136:                                              ; preds = %.lr.ph61, %53, %57, %64, %.thread89
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %137 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %137, label %.preheader, label %.lr.ph61

.loopexit.loopexit:                               ; preds = %.lr.ph65, %middle.block
  %indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %.lr.ph65 ]
  %138 = trunc nsw i64 %indvars.iv.next.lcssa to i32
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph69
  %.1.lcssa = phi i32 [ %.04268, %.lr.ph69 ], [ %138, %.loopexit.loopexit ]
  %.not49 = icmp sgt i32 %.1.lcssa, %35
  br i1 %.not49, label %._crit_edge70, label %.lr.ph69, !llvm.loop !14

._crit_edge70:                                    ; preds = %.loopexit
  %139 = load i32, ptr getelementptr inbounds (i8, ptr @b, i64 4), align 4, !tbaa !5
  %140 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  %141 = sub nsw i32 %139, %140
  %142 = mul nsw i32 %141, %141
  %143 = zext nneg i32 %142 to i64
  %.not5072 = icmp eq i32 %35, 1
  br i1 %.not5072, label %._crit_edge77, label %.lr.ph76

.lr.ph76:                                         ; preds = %._crit_edge70
  %144 = load i32, ptr @dt, align 4, !tbaa !5
  %145 = add nuw nsw i32 %35, 1
  %wide.trip.count = zext nneg i32 %145 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %146 = icmp eq i32 %145, 3
  br i1 %146, label %._crit_edge77.loopexit.unr-lcssa, label %.lr.ph76.new

.lr.ph76.new:                                     ; preds = %.lr.ph76
  %147 = and i64 %wide.trip.count, 2147483646
  %148 = add nsw i64 %147, -4
  br label %175

.lr.ph69:                                         ; preds = %.preheader, %.loopexit
  %.04268 = phi i32 [ %.1.lcssa, %.loopexit ], [ 1, %.preheader ]
  %149 = sext i32 %.04268 to i64
  %150 = getelementptr inbounds [100003 x i32], ptr @c, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %149
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = icmp sgt i32 %151, 0
  br i1 %154, label %.lr.ph65.preheader, label %.loopexit

.lr.ph65.preheader:                               ; preds = %.lr.ph69
  %155 = zext nneg i32 %151 to i64
  %min.iters.check = icmp ult i32 %151, 8
  br i1 %min.iters.check, label %.lr.ph65.preheader95, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph65.preheader
  %n.vec = and i64 %155, 2147483640
  %ind.end = add nsw i64 %n.vec, %149
  %.cast = trunc nuw nsw i64 %n.vec to i32
  %ind.end93 = sub nsw i32 %151, %.cast
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %153, 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, %149
  %156 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %offset.idx
  %157 = getelementptr inbounds i8, ptr %156, i64 16
  store <4 x i32> %broadcast.splat, ptr %156, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %157, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %158 = icmp eq i64 %index.next, %n.vec
  br i1 %158, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %155
  br i1 %cmp.n, label %.loopexit.loopexit, label %.lr.ph65.preheader95

.lr.ph65.preheader95:                             ; preds = %middle.block, %.lr.ph65.preheader
  %indvars.iv.ph = phi i64 [ %149, %.lr.ph65.preheader ], [ %ind.end, %middle.block ]
  %.04163.ph = phi i32 [ %151, %.lr.ph65.preheader ], [ %ind.end93, %middle.block ]
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph65.preheader95, %.lr.ph65
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph65 ], [ %indvars.iv.ph, %.lr.ph65.preheader95 ]
  %.04163 = phi i32 [ %160, %.lr.ph65 ], [ %.04163.ph, %.lr.ph65.preheader95 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %159 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %indvars.iv
  store i32 %153, ptr %159, align 4, !tbaa !5
  %160 = add nsw i32 %.04163, -1
  %161 = icmp ugt i32 %.04163, 1
  br i1 %161, label %.lr.ph65, label %.loopexit.loopexit, !llvm.loop !18

._crit_edge77.loopexit.unr-lcssa:                 ; preds = %175, %.lr.ph76
  %.lcssa.ph = phi i64 [ poison, %.lr.ph76 ], [ %200, %175 ]
  %.unr = phi i32 [ %139, %.lr.ph76 ], [ %190, %175 ]
  %indvars.iv82.unr = phi i64 [ 2, %.lr.ph76 ], [ %indvars.iv.next83.1, %175 ]
  %.04073.unr = phi i64 [ %143, %.lr.ph76 ], [ %200, %175 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge77, label %._crit_edge77.loopexit.epilog-lcssa

._crit_edge77.loopexit.epilog-lcssa:              ; preds = %._crit_edge77.loopexit.unr-lcssa
  %162 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %indvars.iv82.unr
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = sub nsw i32 %163, %.unr
  %165 = call i32 @llvm.abs.i32(i32 %164, i1 true)
  %166 = mul nsw i32 %165, %144
  %167 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %indvars.iv82.unr
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sub nsw i32 %163, %168
  %170 = mul nsw i32 %169, %169
  %171 = add nsw i32 %166, %170
  %172 = sext i32 %171 to i64
  %173 = add nsw i64 %.04073.unr, %172
  br label %._crit_edge77

._crit_edge77:                                    ; preds = %._crit_edge77.loopexit.epilog-lcssa, %._crit_edge77.loopexit.unr-lcssa, %._crit_edge70.thread, %._crit_edge70
  %.040.lcssa = phi i64 [ %143, %._crit_edge70 ], [ %40, %._crit_edge70.thread ], [ %.lcssa.ph, %._crit_edge77.loopexit.unr-lcssa ], [ %173, %._crit_edge77.loopexit.epilog-lcssa ]
  %174 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.040.lcssa)
  ret i32 0

175:                                              ; preds = %175, %.lr.ph76.new
  %176 = phi i32 [ %139, %.lr.ph76.new ], [ %190, %175 ]
  %indvars.iv82 = phi i64 [ 2, %.lr.ph76.new ], [ %indvars.iv.next83.1, %175 ]
  %.04073 = phi i64 [ %143, %.lr.ph76.new ], [ %200, %175 ]
  %niter = phi i64 [ 0, %.lr.ph76.new ], [ %niter.next.1, %175 ]
  %177 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %indvars.iv82
  %178 = load i32, ptr %177, align 8, !tbaa !5
  %179 = sub nsw i32 %178, %176
  %180 = call i32 @llvm.abs.i32(i32 %179, i1 true)
  %181 = mul nsw i32 %180, %144
  %182 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %indvars.iv82
  %183 = load i32, ptr %182, align 8, !tbaa !5
  %184 = sub nsw i32 %178, %183
  %185 = mul nsw i32 %184, %184
  %186 = add nsw i32 %181, %185
  %187 = sext i32 %186 to i64
  %188 = add nsw i64 %.04073, %187
  %indvars.iv.next83 = or disjoint i64 %indvars.iv82, 1
  %189 = getelementptr inbounds [100003 x i32], ptr @b, i64 0, i64 %indvars.iv.next83
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = sub nsw i32 %190, %178
  %192 = call i32 @llvm.abs.i32(i32 %191, i1 true)
  %193 = mul nsw i32 %192, %144
  %194 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %indvars.iv.next83
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = sub nsw i32 %190, %195
  %197 = mul nsw i32 %196, %196
  %198 = add nsw i32 %193, %197
  %199 = sext i32 %198 to i64
  %200 = add nsw i64 %188, %199
  %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %148
  br i1 %niter.ncmp.1, label %._crit_edge77.loopexit.unr-lcssa, label %175, !llvm.loop !19
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIiiESt6vectorIS1_SaIS1_EESt4lessIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z5erasei(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #6

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

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


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