; LLVM IR from tangjz/acm-icpc :: codeforces (848B)

; 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
@w = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@vc = external dso_local global i32, align 4
@hc = external dso_local global i32, align 4
@vid = external dso_local global [100001 x i32], align 16
@hid = external dso_local global [100001 x i32], align 16
@ans = external dso_local global [100001 x i32], align 16
@tmp = external dso_local global [100001 x i32], align 16
@pos = external dso_local global [100001 x %"struct.std::pair"], align 16
@res = external dso_local global [100001 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

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

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

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

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %4, ptr noundef %5)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %32
  store i32 %30, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sub nsw i32 %34, %35
  store i32 %36, ptr %7, align 4, !tbaa !5
  %37 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i64 %37, ptr %6, align 4
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %39
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %40, ptr noundef nonnull align 4 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %56

44:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %45 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__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) @h)
  store i64 %45, ptr %8, align 4
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @res, i64 0, i64 %47
  %49 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %48, ptr noundef nonnull align 4 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = load i32, ptr @vc, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %52
  store i32 %50, ptr %53, align 4, !tbaa !5
  %54 = load i32, ptr @vc, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr @vc, align 4, !tbaa !5
  br label %68

56:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %57 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @w, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %57, ptr %9, align 4
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @res, i64 0, i64 %59
  %61 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %60, ptr noundef nonnull align 4 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = load i32, ptr @hc, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %64
  store i32 %62, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr @hc, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr @hc, align 4, !tbaa !5
  br label %68

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

69:                                               ; preds = %68
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %2, align 4, !tbaa !5
  br label %23, !llvm.loop !9

72:                                               ; preds = %27
  %73 = load i32, ptr @vc, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr @vid, i64 %74
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @vid, ptr noundef %75, ptr noundef @_Z3cmpRKiS0_)
  %76 = load i32, ptr @hc, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr @hid, i64 %77
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @hid, ptr noundef %78, ptr noundef @_Z3cmpRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %293, %72
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = load i32, ptr @vc, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %83, label %87

83:                                               ; preds = %79
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = load i32, ptr @hc, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br label %87

87:                                               ; preds = %83, %79
  %88 = phi i1 [ false, %79 ], [ %86, %83 ]
  br i1 %88, label %90, label %89

89:                                               ; preds = %87
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %300

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %95
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 0
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %102
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 0
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %97, ptr noundef nonnull align 4 dereferenceable(4) %104)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %106, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %141, %90
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = load i32, ptr %14, align 4, !tbaa !5
  %110 = add nsw i32 %108, %109
  %111 = load i32, ptr @vc, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %113, label %126

113:                                              ; preds = %107
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = load i32, ptr %14, align 4, !tbaa !5
  %116 = add nsw i32 %114, %115
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %120
  %122 = getelementptr inbounds %"struct.std::pair", ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !11
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = icmp eq i32 %123, %124
  br label %126

126:                                              ; preds = %113, %107
  %127 = phi i1 [ false, %107 ], [ %125, %113 ]
  br i1 %127, label %128, label %144

128:                                              ; preds = %126
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = add nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = load i32, ptr %14, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %139
  store i32 %137, ptr %140, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %128
  %142 = load i32, ptr %14, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %14, align 4, !tbaa !5
  br label %107, !llvm.loop !13

144:                                              ; preds = %126
  br label %145

145:                                              ; preds = %181, %144
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = load i32, ptr %15, align 4, !tbaa !5
  %148 = add nsw i32 %146, %147
  %149 = load i32, ptr @hc, align 4, !tbaa !5
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %151, label %164

151:                                              ; preds = %145
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = load i32, ptr %15, align 4, !tbaa !5
  %154 = add nsw i32 %152, %153
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %158
  %160 = getelementptr inbounds %"struct.std::pair", ptr %159, i32 0, i32 0
  %161 = load i32, ptr %160, align 8, !tbaa !11
  %162 = load i32, ptr %13, align 4, !tbaa !5
  %163 = icmp eq i32 %161, %162
  br label %164

164:                                              ; preds = %151, %145
  %165 = phi i1 [ false, %145 ], [ %163, %151 ]
  br i1 %165, label %166, label %184

166:                                              ; preds = %164
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = load i32, ptr %15, align 4, !tbaa !5
  %169 = add nsw i32 %167, %168
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = load i32, ptr %14, align 4, !tbaa !5
  %177 = load i32, ptr %15, align 4, !tbaa !5
  %178 = add nsw i32 %176, %177
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %179
  store i32 %175, ptr %180, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %166
  %182 = load i32, ptr %15, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %15, align 4, !tbaa !5
  br label %145, !llvm.loop !14

184:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %186 = load i32, ptr %185, align 4, !tbaa !5
  store i32 %186, ptr %16, align 4, !tbaa !5
  %187 = load i32, ptr %16, align 4, !tbaa !5
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %293

189:                                              ; preds = %184
  %190 = load i32, ptr %14, align 4, !tbaa !5
  %191 = load i32, ptr %16, align 4, !tbaa !5
  %192 = sub nsw i32 %190, %191
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i32, ptr @tmp, i64 %193
  %195 = load i32, ptr %14, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i32, ptr @tmp, i64 %196
  %198 = call noundef ptr @_ZNSt3_V26rotateIPiEET_S2_S2_S2_(ptr noundef @tmp, ptr noundef %194, ptr noundef %197)
  %199 = load i32, ptr %14, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds i32, ptr @tmp, i64 %200
  %202 = load i32, ptr %14, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds i32, ptr @tmp, i64 %203
  %205 = load i32, ptr %15, align 4, !tbaa !5
  %206 = load i32, ptr %16, align 4, !tbaa !5
  %207 = sub nsw i32 %205, %206
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds i32, ptr %204, i64 %208
  %210 = load i32, ptr %14, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds i32, ptr @tmp, i64 %211
  %213 = load i32, ptr %15, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds i32, ptr %212, i64 %214
  %216 = call noundef ptr @_ZNSt3_V26rotateIPiEET_S2_S2_S2_(ptr noundef %201, ptr noundef %209, ptr noundef %215)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %217

217:                                              ; preds = %231, %189
  %218 = load i32, ptr %17, align 4, !tbaa !5
  %219 = load i32, ptr %16, align 4, !tbaa !5
  %220 = icmp slt i32 %218, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %217
  store i32 13, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %234

222:                                              ; preds = %217
  %223 = load i32, ptr %17, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %224
  %226 = load i32, ptr %14, align 4, !tbaa !5
  %227 = load i32, ptr %17, align 4, !tbaa !5
  %228 = add nsw i32 %226, %227
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %229
  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) %225, ptr noundef nonnull align 4 dereferenceable(4) %230) #7
  br label %231

231:                                              ; preds = %222
  %232 = load i32, ptr %17, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %17, align 4, !tbaa !5
  br label %217, !llvm.loop !15

234:                                              ; preds = %221
  %235 = load i32, ptr %16, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds i32, ptr @tmp, i64 %236
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef @tmp, ptr noundef %237)
  %238 = load i32, ptr %14, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds i32, ptr @tmp, i64 %239
  %241 = load i32, ptr %14, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds i32, ptr @tmp, i64 %242
  %244 = load i32, ptr %16, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds i32, ptr %243, i64 %245
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef %240, ptr noundef %246)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %247

247:                                              ; preds = %265, %234
  %248 = load i32, ptr %18, align 4, !tbaa !5
  %249 = load i32, ptr %14, align 4, !tbaa !5
  %250 = icmp slt i32 %248, %249
  br i1 %250, label %252, label %251

251:                                              ; preds = %247
  store i32 16, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %268

252:                                              ; preds = %247
  %253 = load i32, ptr %18, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = load i32, ptr %10, align 4, !tbaa !5
  %258 = load i32, ptr %18, align 4, !tbaa !5
  %259 = add nsw i32 %257, %258
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %263
  store i32 %256, ptr %264, align 4, !tbaa !5
  br label %265

265:                                              ; preds = %252
  %266 = load i32, ptr %18, align 4, !tbaa !5
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %18, align 4, !tbaa !5
  br label %247, !llvm.loop !16

268:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %269

269:                                              ; preds = %289, %268
  %270 = load i32, ptr %19, align 4, !tbaa !5
  %271 = load i32, ptr %15, align 4, !tbaa !5
  %272 = icmp slt i32 %270, %271
  br i1 %272, label %274, label %273

273:                                              ; preds = %269
  store i32 19, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %292

274:                                              ; preds = %269
  %275 = load i32, ptr %14, align 4, !tbaa !5
  %276 = load i32, ptr %19, align 4, !tbaa !5
  %277 = add nsw i32 %275, %276
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %278
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = load i32, ptr %11, align 4, !tbaa !5
  %282 = load i32, ptr %19, align 4, !tbaa !5
  %283 = add nsw i32 %281, %282
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %287
  store i32 %280, ptr %288, align 4, !tbaa !5
  br label %289

289:                                              ; preds = %274
  %290 = load i32, ptr %19, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %19, align 4, !tbaa !5
  br label %269, !llvm.loop !17

292:                                              ; preds = %273
  br label %293

293:                                              ; preds = %292, %184
  %294 = load i32, ptr %14, align 4, !tbaa !5
  %295 = load i32, ptr %10, align 4, !tbaa !5
  %296 = add nsw i32 %295, %294
  store i32 %296, ptr %10, align 4, !tbaa !5
  %297 = load i32, ptr %15, align 4, !tbaa !5
  %298 = load i32, ptr %11, align 4, !tbaa !5
  %299 = add nsw i32 %298, %297
  store i32 %299, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %79, !llvm.loop !18

300:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %301

301:                                              ; preds = %314, %300
  %302 = load i32, ptr %20, align 4, !tbaa !5
  %303 = load i32, ptr @n, align 4, !tbaa !5
  %304 = icmp slt i32 %302, %303
  br i1 %304, label %306, label %305

305:                                              ; preds = %301
  store i32 22, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %317

306:                                              ; preds = %301
  %307 = load i32, ptr %20, align 4, !tbaa !5
  %308 = load i32, ptr %20, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !5
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %312
  store i32 %307, ptr %313, align 4, !tbaa !5
  br label %314

314:                                              ; preds = %306
  %315 = load i32, ptr %20, align 4, !tbaa !5
  %316 = add nsw i32 %315, 1
  store i32 %316, ptr %20, align 4, !tbaa !5
  br label %301, !llvm.loop !19

317:                                              ; preds = %305
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %318

318:                                              ; preds = %341, %317
  %319 = load i32, ptr %21, align 4, !tbaa !5
  %320 = load i32, ptr @n, align 4, !tbaa !5
  %321 = icmp slt i32 %319, %320
  br i1 %321, label %323, label %322

322:                                              ; preds = %318
  store i32 25, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %344

323:                                              ; preds = %318
  %324 = load i32, ptr %21, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %325
  %327 = load i32, ptr %326, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @res, i64 0, i64 %328
  %330 = getelementptr inbounds %"struct.std::pair", ptr %329, i32 0, i32 0
  %331 = load i32, ptr %330, align 8, !tbaa !11
  %332 = load i32, ptr %21, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %333
  %335 = load i32, ptr %334, align 4, !tbaa !5
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @res, i64 0, i64 %336
  %338 = getelementptr inbounds %"struct.std::pair", ptr %337, i32 0, i32 1
  %339 = load i32, ptr %338, align 4, !tbaa !20
  %340 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %331, i32 noundef %339)
  br label %341

341:                                              ; preds = %323
  %342 = load i32, ptr %21, align 4, !tbaa !5
  %343 = add nsw i32 %342, 1
  store i32 %343, ptr %21, align 4, !tbaa !5
  br label %318, !llvm.loop !21

344:                                              ; preds = %322
  ret i32 0
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

@n = external dso_local global i32, align 4
@w = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@vc = external dso_local local_unnamed_addr global i32, align 4
@hc = external dso_local local_unnamed_addr global i32, align 4
@vid = external dso_local global [100001 x i32], align 16
@hid = external dso_local global [100001 x i32], align 16
@ans = external dso_local local_unnamed_addr global [100001 x i32], align 16
@tmp = external dso_local global [100001 x i32], align 16
@pos = external dso_local global [100001 x %"struct.std::pair"], align 16
@res = external dso_local global [100001 x %"struct.std::pair"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @w, ptr noundef nonnull @h)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %42, %0
  %13 = load i32, ptr @vc, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds i32, ptr @vid, i64 %14
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @vid, ptr noundef nonnull %15, ptr noundef nonnull @_Z3cmpRKiS0_)
  %16 = load i32, ptr @hc, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr @hid, i64 %17
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @hid, ptr noundef nonnull %18, ptr noundef nonnull @_Z3cmpRKiS0_)
  %19 = load i32, ptr @vc, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  %21 = load i32, ptr @hc, align 4
  %22 = icmp sgt i32 %21, 0
  %23 = select i1 %20, i1 %22, i1 false
  br i1 %23, label %.lr.ph89, label %.preheader63

.lr.ph:                                           ; preds = %0, %42
  %indvars.iv = phi i64 [ %indvars.iv.next, %42 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %25 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %26, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sub nsw i32 %27, %28
  store i32 %29, ptr %5, align 4, !tbaa !5
  %30 = call i64 @_ZSt9make_pairIiRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %30, ptr %4, align 8
  %31 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %indvars.iv
  %32 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %31, ptr noundef nonnull align 4 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %34 = icmp eq i32 %33, 1
  %35 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @res, i64 0, i64 %indvars.iv
  br i1 %34, label %36, label %39

36:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %37 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @h)
  store i64 %37, ptr %6, align 8
  %38 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %35, ptr noundef nonnull align 4 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %42

39:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %40 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) @w, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %40, ptr %7, align 8
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %35, ptr noundef nonnull align 4 dereferenceable(8) %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %42

42:                                               ; preds = %39, %36
  %hc.sink130 = phi ptr [ @hc, %39 ], [ @vc, %36 ]
  %hid.sink = phi ptr [ @hid, %39 ], [ @vid, %36 ]
  %43 = load i32, ptr %hc.sink130, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100001 x i32], ptr %hid.sink, i64 0, i64 %44
  store i32 %26, ptr %45, align 4, !tbaa !5
  %46 = add nsw i32 %43, 1
  store i32 %46, ptr %hc.sink130, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader63:                                     ; preds = %.loopexit, %._crit_edge
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph91.preheader, label %._crit_edge94

.lr.ph91.preheader:                               ; preds = %.preheader63
  %wide.trip.count120 = zext nneg i32 %50 to i64
  %xtraiter138 = and i64 %wide.trip.count120, 3
  %52 = icmp ult i32 %50, 4
  br i1 %52, label %.preheader.unr-lcssa, label %.lr.ph91.preheader.new

.lr.ph91.preheader.new:                           ; preds = %.lr.ph91.preheader
  %unroll_iter141 = and i64 %wide.trip.count120, 2147483644
  br label %.lr.ph91

.lr.ph89:                                         ; preds = %._crit_edge, %.loopexit
  %.05886 = phi i32 [ %202, %.loopexit ], [ 0, %._crit_edge ]
  %.05984 = phi i32 [ %203, %.loopexit ], [ 0, %._crit_edge ]
  %53 = sext i32 %.05886 to i64
  %54 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %56
  %58 = sext i32 %.05984 to i64
  %59 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %61
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %57, ptr noundef nonnull align 4 dereferenceable(4) %62)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  %65 = load i32, ptr @vc, align 4, !tbaa !5
  %66 = icmp slt i32 %.05886, %65
  br i1 %66, label %.lr.ph68.preheader, label %.critedge

.lr.ph68.preheader:                               ; preds = %.lr.ph89
  %67 = sub i32 %65, %.05886
  %wide.trip.count = zext i32 %67 to i64
  br label %.lr.ph68

.lr.ph68:                                         ; preds = %.lr.ph68.preheader, %75
  %indvars.iv96 = phi i64 [ 0, %.lr.ph68.preheader ], [ %indvars.iv.next97, %75 ]
  %68 = add nsw i64 %indvars.iv96, %53
  %69 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %71
  %73 = load i32, ptr %72, align 8, !tbaa !11
  %74 = icmp eq i32 %73, %64
  br i1 %74, label %75, label %.critedge.loopexit.split.loop.exit126

75:                                               ; preds = %.lr.ph68
  %76 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %71
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv96
  store i32 %77, ptr %78, align 4, !tbaa !5
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %79 = trunc nsw i64 %indvars.iv.next97 to i32
  store i32 %79, ptr %8, align 4, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph68, !llvm.loop !13

.critedge.loopexit.split.loop.exit126:            ; preds = %.lr.ph68
  %80 = trunc nuw nsw i64 %indvars.iv96 to i32
  br label %.critedge

.critedge:                                        ; preds = %75, %.critedge.loopexit.split.loop.exit126, %.lr.ph89
  %.lcssa = phi i32 [ 0, %.lr.ph89 ], [ %80, %.critedge.loopexit.split.loop.exit126 ], [ %67, %75 ]
  %81 = load i32, ptr @hc, align 4, !tbaa !5
  %82 = icmp slt i32 %.05984, %81
  br i1 %82, label %.lr.ph72.preheader, label %.critedge2

.lr.ph72.preheader:                               ; preds = %.critedge
  %83 = sext i32 %.lcssa to i64
  %84 = sext i32 %81 to i64
  br label %.lr.ph72

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %93
  %indvars.iv99 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next100, %93 ]
  %85 = phi i32 [ %.05984, %.lr.ph72.preheader ], [ %101, %93 ]
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %89
  %91 = load i32, ptr %90, align 8, !tbaa !11
  %92 = icmp eq i32 %91, %64
  br i1 %92, label %93, label %.critedge2

93:                                               ; preds = %.lr.ph72
  %94 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %89
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i64 %indvars.iv99, %83
  %97 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %96
  store i32 %95, ptr %97, align 4, !tbaa !5
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %98 = trunc nsw i64 %indvars.iv.next100 to i32
  store i32 %98, ptr %9, align 4, !tbaa !5
  %99 = add nsw i64 %indvars.iv.next100, %58
  %100 = icmp slt i64 %99, %84
  %101 = trunc nsw i64 %99 to i32
  br i1 %100, label %.lr.ph72, label %.critedge2, !llvm.loop !14

.critedge2:                                       ; preds = %.lr.ph72, %93, %.critedge
  %102 = 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)
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %.not = icmp eq i32 %103, 0
  %.pre = load i32, ptr %8, align 4, !tbaa !5
  br i1 %.not, label %.critedge2..loopexit_crit_edge, label %104

.critedge2..loopexit_crit_edge:                   ; preds = %.critedge2
  %.pre125 = load i32, ptr %9, align 4, !tbaa !5
  br label %.loopexit

104:                                              ; preds = %.critedge2
  %105 = sub nsw i32 %.pre, %103
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr @tmp, i64 %106
  %108 = sext i32 %.pre to i64
  %109 = getelementptr inbounds i32, ptr @tmp, i64 %108
  %110 = call noundef ptr @_ZNSt3_V26rotateIPiEET_S2_S2_S2_(ptr noundef nonnull @tmp, ptr noundef nonnull %107, ptr noundef nonnull %109)
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr @tmp, i64 %112
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sub nsw i32 %114, %103
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i32, ptr %113, i64 %116
  %118 = sext i32 %114 to i64
  %119 = getelementptr inbounds i32, ptr %113, i64 %118
  %120 = call noundef ptr @_ZNSt3_V26rotateIPiEET_S2_S2_S2_(ptr noundef nonnull %113, ptr noundef nonnull %117, ptr noundef nonnull %119)
  %121 = icmp sgt i32 %103, 0
  br i1 %121, label %.lr.ph76.preheader, label %._crit_edge77

.lr.ph76.preheader:                               ; preds = %104
  %wide.trip.count105 = zext nneg i32 %103 to i64
  br label %.lr.ph76

._crit_edge77:                                    ; preds = %.lr.ph76, %104
  %122 = sext i32 %103 to i64
  %123 = getelementptr inbounds i32, ptr @tmp, i64 %122
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull @tmp, ptr noundef nonnull %123)
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds i32, ptr @tmp, i64 %125
  %127 = getelementptr inbounds i32, ptr %126, i64 %122
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull %126, ptr noundef nonnull %127)
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %.lr.ph80.preheader, label %.preheader64

.lr.ph80.preheader:                               ; preds = %._crit_edge77
  %wide.trip.count110 = zext nneg i32 %128 to i64
  %xtraiter = and i64 %wide.trip.count110, 3
  %130 = icmp ult i32 %128, 4
  br i1 %130, label %.preheader64.loopexit.unr-lcssa, label %.lr.ph80.preheader.new

.lr.ph80.preheader.new:                           ; preds = %.lr.ph80.preheader
  %unroll_iter = and i64 %wide.trip.count110, 2147483644
  br label %.lr.ph80

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %.lr.ph76
  %indvars.iv102 = phi i64 [ 0, %.lr.ph76.preheader ], [ %indvars.iv.next103, %.lr.ph76 ]
  %131 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv102
  %132 = load i32, ptr %8, align 4, !tbaa !5
  %133 = trunc nuw nsw i64 %indvars.iv102 to i32
  %134 = add nsw i32 %132, %133
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %135
  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) %131, ptr noundef nonnull align 4 dereferenceable(4) %136) #7
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105
  br i1 %exitcond106.not, label %._crit_edge77, label %.lr.ph76, !llvm.loop !15

.preheader64.loopexit.unr-lcssa:                  ; preds = %.lr.ph80, %.lr.ph80.preheader
  %indvars.iv107.unr = phi i64 [ 0, %.lr.ph80.preheader ], [ %indvars.iv.next108.3, %.lr.ph80 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader64, label %.lr.ph80.epil

.lr.ph80.epil:                                    ; preds = %.preheader64.loopexit.unr-lcssa, %.lr.ph80.epil
  %indvars.iv107.epil = phi i64 [ %indvars.iv.next108.epil, %.lr.ph80.epil ], [ %indvars.iv107.unr, %.preheader64.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph80.epil ], [ 0, %.preheader64.loopexit.unr-lcssa ]
  %137 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv107.epil
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = add nsw i64 %indvars.iv107.epil, %53
  %140 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %142
  store i32 %138, ptr %143, align 4, !tbaa !5
  %indvars.iv.next108.epil = add nuw nsw i64 %indvars.iv107.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader64, label %.lr.ph80.epil, !llvm.loop !16

.preheader64:                                     ; preds = %.preheader64.loopexit.unr-lcssa, %.lr.ph80.epil, %._crit_edge77
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = icmp sgt i32 %144, 0
  br i1 %145, label %.lr.ph83.preheader, label %.loopexit

.lr.ph83.preheader:                               ; preds = %.preheader64
  %146 = sext i32 %128 to i64
  %wide.trip.count115 = zext nneg i32 %144 to i64
  %xtraiter133 = and i64 %wide.trip.count115, 1
  %147 = icmp eq i32 %144, 1
  br i1 %147, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph83.preheader.new

.lr.ph83.preheader.new:                           ; preds = %.lr.ph83.preheader
  %unroll_iter136 = and i64 %wide.trip.count115, 2147483646
  br label %.lr.ph83

.lr.ph80:                                         ; preds = %.lr.ph80, %.lr.ph80.preheader.new
  %indvars.iv107 = phi i64 [ 0, %.lr.ph80.preheader.new ], [ %indvars.iv.next108.3, %.lr.ph80 ]
  %niter = phi i64 [ 0, %.lr.ph80.preheader.new ], [ %niter.next.3, %.lr.ph80 ]
  %148 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv107
  %149 = load i32, ptr %148, align 16, !tbaa !5
  %150 = add nsw i64 %indvars.iv107, %53
  %151 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %153
  store i32 %149, ptr %154, align 4, !tbaa !5
  %indvars.iv.next108 = or disjoint i64 %indvars.iv107, 1
  %155 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv.next108
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = add nsw i64 %indvars.iv.next108, %53
  %158 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %160
  store i32 %156, ptr %161, align 4, !tbaa !5
  %indvars.iv.next108.1 = or disjoint i64 %indvars.iv107, 2
  %162 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv.next108.1
  %163 = load i32, ptr %162, align 8, !tbaa !5
  %164 = add nsw i64 %indvars.iv.next108.1, %53
  %165 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %167
  store i32 %163, ptr %168, align 4, !tbaa !5
  %indvars.iv.next108.2 = or disjoint i64 %indvars.iv107, 3
  %169 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv.next108.2
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = add nsw i64 %indvars.iv.next108.2, %53
  %172 = getelementptr inbounds [100001 x i32], ptr @vid, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %174
  store i32 %170, ptr %175, align 4, !tbaa !5
  %indvars.iv.next108.3 = add nuw nsw i64 %indvars.iv107, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader64.loopexit.unr-lcssa, label %.lr.ph80, !llvm.loop !18

.lr.ph83:                                         ; preds = %.lr.ph83, %.lr.ph83.preheader.new
  %indvars.iv112 = phi i64 [ 0, %.lr.ph83.preheader.new ], [ %indvars.iv.next113.1, %.lr.ph83 ]
  %niter137 = phi i64 [ 0, %.lr.ph83.preheader.new ], [ %niter137.next.1, %.lr.ph83 ]
  %176 = add nsw i64 %indvars.iv112, %146
  %177 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = add nsw i64 %indvars.iv112, %58
  %180 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %182
  store i32 %178, ptr %183, align 4, !tbaa !5
  %indvars.iv.next113 = or disjoint i64 %indvars.iv112, 1
  %184 = add nsw i64 %indvars.iv.next113, %146
  %185 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = add nsw i64 %indvars.iv.next113, %58
  %188 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %190
  store i32 %186, ptr %191, align 4, !tbaa !5
  %indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 2
  %niter137.next.1 = add i64 %niter137, 2
  %niter137.ncmp.1 = icmp eq i64 %niter137.next.1, %unroll_iter136
  br i1 %niter137.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph83, !llvm.loop !19

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph83, %.lr.ph83.preheader
  %indvars.iv112.unr = phi i64 [ 0, %.lr.ph83.preheader ], [ %indvars.iv.next113.1, %.lr.ph83 ]
  %lcmp.mod135.not = icmp eq i64 %xtraiter133, 0
  br i1 %lcmp.mod135.not, label %.loopexit, label %.lr.ph83.epil

.lr.ph83.epil:                                    ; preds = %.loopexit.loopexit.unr-lcssa
  %192 = add nsw i64 %indvars.iv112.unr, %146
  %193 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = add nsw i64 %indvars.iv112.unr, %58
  %196 = getelementptr inbounds [100001 x i32], ptr @hid, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %198
  store i32 %194, ptr %199, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph83.epil, %.loopexit.loopexit.unr-lcssa, %.critedge2..loopexit_crit_edge, %.preheader64
  %200 = phi i32 [ %144, %.preheader64 ], [ %.pre125, %.critedge2..loopexit_crit_edge ], [ %144, %.loopexit.loopexit.unr-lcssa ], [ %144, %.lr.ph83.epil ]
  %201 = phi i32 [ %128, %.preheader64 ], [ %.pre, %.critedge2..loopexit_crit_edge ], [ %128, %.loopexit.loopexit.unr-lcssa ], [ %128, %.lr.ph83.epil ]
  %202 = add nsw i32 %201, %.05886
  %203 = add nsw i32 %200, %.05984
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  %204 = load i32, ptr @vc, align 4, !tbaa !5
  %205 = icmp slt i32 %202, %204
  %206 = load i32, ptr @hc, align 4
  %207 = icmp slt i32 %203, %206
  %208 = select i1 %205, i1 %207, i1 false
  br i1 %208, label %.lr.ph89, label %.preheader63, !llvm.loop !20

.preheader.unr-lcssa:                             ; preds = %.lr.ph91, %.lr.ph91.preheader
  %indvars.iv117.unr = phi i64 [ 0, %.lr.ph91.preheader ], [ %indvars.iv.next118.3, %.lr.ph91 ]
  %lcmp.mod140.not = icmp eq i64 %xtraiter138, 0
  br i1 %lcmp.mod140.not, label %.preheader, label %.lr.ph91.epil

.lr.ph91.epil:                                    ; preds = %.preheader.unr-lcssa, %.lr.ph91.epil
  %indvars.iv117.epil = phi i64 [ %indvars.iv.next118.epil, %.lr.ph91.epil ], [ %indvars.iv117.unr, %.preheader.unr-lcssa ]
  %epil.iter139 = phi i64 [ %epil.iter139.next, %.lr.ph91.epil ], [ 0, %.preheader.unr-lcssa ]
  %209 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv117.epil
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %211
  %213 = trunc nuw nsw i64 %indvars.iv117.epil to i32
  store i32 %213, ptr %212, align 4, !tbaa !5
  %indvars.iv.next118.epil = add nuw nsw i64 %indvars.iv117.epil, 1
  %epil.iter139.next = add i64 %epil.iter139, 1
  %epil.iter139.cmp.not = icmp eq i64 %epil.iter139.next, %xtraiter138
  br i1 %epil.iter139.cmp.not, label %.preheader, label %.lr.ph91.epil, !llvm.loop !21

.preheader:                                       ; preds = %.lr.ph91.epil, %.preheader.unr-lcssa
  br i1 %51, label %.lr.ph93, label %._crit_edge94

.lr.ph91:                                         ; preds = %.lr.ph91, %.lr.ph91.preheader.new
  %indvars.iv117 = phi i64 [ 0, %.lr.ph91.preheader.new ], [ %indvars.iv.next118.3, %.lr.ph91 ]
  %niter142 = phi i64 [ 0, %.lr.ph91.preheader.new ], [ %niter142.next.3, %.lr.ph91 ]
  %214 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv117
  %215 = load i32, ptr %214, align 16, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %216
  %218 = trunc nuw nsw i64 %indvars.iv117 to i32
  store i32 %218, ptr %217, align 4, !tbaa !5
  %indvars.iv.next118 = or disjoint i64 %indvars.iv117, 1
  %219 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv.next118
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %221
  %223 = trunc nuw nsw i64 %indvars.iv.next118 to i32
  store i32 %223, ptr %222, align 4, !tbaa !5
  %indvars.iv.next118.1 = or disjoint i64 %indvars.iv117, 2
  %224 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv.next118.1
  %225 = load i32, ptr %224, align 8, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %226
  %228 = trunc nuw nsw i64 %indvars.iv.next118.1 to i32
  store i32 %228, ptr %227, align 4, !tbaa !5
  %indvars.iv.next118.2 = or disjoint i64 %indvars.iv117, 3
  %229 = getelementptr inbounds [100001 x i32], ptr @ans, i64 0, i64 %indvars.iv.next118.2
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %231
  %233 = trunc nuw nsw i64 %indvars.iv.next118.2 to i32
  store i32 %233, ptr %232, align 4, !tbaa !5
  %indvars.iv.next118.3 = add nuw nsw i64 %indvars.iv117, 4
  %niter142.next.3 = add i64 %niter142, 4
  %niter142.ncmp.3 = icmp eq i64 %niter142.next.3, %unroll_iter141
  br i1 %niter142.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph91, !llvm.loop !22

._crit_edge94:                                    ; preds = %.lr.ph93, %.preheader63, %.preheader
  ret i32 0

.lr.ph93:                                         ; preds = %.preheader, %.lr.ph93
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %.lr.ph93 ], [ 0, %.preheader ]
  %234 = getelementptr inbounds [100001 x i32], ptr @tmp, i64 0, i64 %indvars.iv122
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @res, i64 0, i64 %236
  %238 = load i32, ptr %237, align 8, !tbaa !11
  %239 = getelementptr inbounds i8, ptr %237, i64 4
  %240 = load i32, ptr %239, align 4, !tbaa !23
  %241 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %238, i32 noundef %240)
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %242 = load i32, ptr @n, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = icmp slt i64 %indvars.iv.next123, %243
  br i1 %244, label %.lr.ph93, label %._crit_edge94, !llvm.loop !24
}

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

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

; Function Attrs: mustprogress 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 #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__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 #0

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

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

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

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

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

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

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

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

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


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