; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1343E)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sta = external dso_local global [3 x i32], align 4
@dis = external dso_local global [3 x [200001 x i32]], align 16
@e = external dso_local global [200001 x %"class.std::vector"], align 16
@p = external dso_local global [200001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3que = external hidden global [200001 x i32], align 16
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::vector", align 8
  store i32 0, ptr %1, align 4
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %26

26:                                               ; preds = %232, %0
  %27 = load i32, ptr @t, align 4, !tbaa !5
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr @t, align 4, !tbaa !5
  %29 = icmp ne i32 %27, 0
  br i1 %29, label %30, label %233

30:                                               ; preds = %26
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %41, %30
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 3
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %44

36:                                               ; preds = %32
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr @sta, i64 %38
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %39)
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %32, !llvm.loop !9

44:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %55, %44
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr @m, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i64, ptr @p, i64 %52
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %53)
  br label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %3, align 4, !tbaa !5
  br label %45, !llvm.loop !11

58:                                               ; preds = %49
  %59 = load i32, ptr @m, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i64, ptr @p, i64 %60
  %62 = getelementptr inbounds i64, ptr %61, i64 1
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef getelementptr inbounds (i64, ptr @p, i64 1), ptr noundef %62)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %86, %58
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %89

68:                                               ; preds = %63
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !12
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !12
  %78 = add nsw i64 %77, %72
  store i64 %78, ptr %76, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %5, ptr noundef %6)
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %81
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %82, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %84
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %85, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %86

86:                                               ; preds = %68
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %4, align 4, !tbaa !5
  br label %63, !llvm.loop !14

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

90:                                               ; preds = %172, %89
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = icmp slt i32 %91, 3
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  store i32 13, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %175

94:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [3 x [200001 x i32]], ptr @dis, i64 0, i64 %96
  %98 = getelementptr inbounds [200001 x i32], ptr %97, i64 0, i64 0
  store ptr %98, ptr %9, align 8, !tbaa !15
  %99 = load ptr, ptr %9, align 8, !tbaa !15
  %100 = getelementptr inbounds i32, ptr %99, i64 1
  %101 = load i32, ptr @n, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = mul i64 %102, 4
  call void @llvm.memset.p0.i64(ptr align 4 %100, i8 -1, i64 %103, i1 false)
  %104 = load ptr, ptr %9, align 8, !tbaa !15
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [3 x i32], ptr @sta, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %104, i64 %109
  store i32 0, ptr %110, align 4, !tbaa !5
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [3 x i32], ptr @sta, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  store i32 %114, ptr @_ZZ4mainE3que, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %168, %94
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %171

120:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  store i32 %124, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %126
  store ptr %127, ptr %13, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %128 = load ptr, ptr %13, align 8, !tbaa !15
  %129 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %128) #8
  %130 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %129, ptr %130, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %131 = load ptr, ptr %13, align 8, !tbaa !15
  %132 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %131) #8
  %133 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %132, ptr %133, align 8
  br label %134

134:                                              ; preds = %165, %120
  %135 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #8
  br i1 %135, label %137, label %136

136:                                              ; preds = %134
  store i32 19, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %167

137:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %138 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  store ptr %138, ptr %16, align 8, !tbaa !15
  %139 = load ptr, ptr %9, align 8, !tbaa !15
  %140 = load ptr, ptr %16, align 8, !tbaa !15
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %139, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = icmp eq i32 %144, -1
  br i1 %145, label %146, label %164

146:                                              ; preds = %137
  %147 = load ptr, ptr %9, align 8, !tbaa !15
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %147, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  %153 = load ptr, ptr %9, align 8, !tbaa !15
  %154 = load ptr, ptr %16, align 8, !tbaa !15
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i32, ptr %153, i64 %156
  store i32 %152, ptr %157, align 4, !tbaa !5
  %158 = load ptr, ptr %16, align 8, !tbaa !15
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = load i32, ptr %11, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !5
  %162 = sext i32 %160 to i64
  %163 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %162
  store i32 %159, ptr %163, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %146, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %165

165:                                              ; preds = %164
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  br label %134

167:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %10, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %10, align 4, !tbaa !5
  br label %115, !llvm.loop !17

171:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %7, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %7, align 4, !tbaa !5
  br label %90, !llvm.loop !18

175:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store i64 9223372036854775807, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %214, %175
  %177 = load i32, ptr %18, align 4, !tbaa !5
  %178 = load i32, ptr @n, align 4, !tbaa !5
  %179 = icmp sle i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 21, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %217

181:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %182 = load i32, ptr %18, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [200001 x i32], ptr getelementptr inbounds ([3 x [200001 x i32]], ptr @dis, i64 0, i64 1), i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  store i32 %185, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %186 = load i32, ptr %19, align 4, !tbaa !5
  %187 = load i32, ptr %18, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [200001 x i32], ptr @dis, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = add nsw i32 %186, %190
  %192 = load i32, ptr %18, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [200001 x i32], ptr getelementptr inbounds ([3 x [200001 x i32]], ptr @dis, i64 0, i64 2), i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = add nsw i32 %191, %195
  store i32 %196, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %197 = load i64, ptr %17, align 8, !tbaa !12
  store i64 %197, ptr %21, align 8, !tbaa !12
  %198 = load i32, ptr %20, align 4, !tbaa !5
  %199 = load i32, ptr @m, align 4, !tbaa !5
  %200 = icmp sle i32 %198, %199
  br i1 %200, label %201, label %213

201:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %202 = load i32, ptr %19, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %203
  %205 = load i64, ptr %204, align 8, !tbaa !12
  %206 = load i32, ptr %20, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %207
  %209 = load i64, ptr %208, align 8, !tbaa !12
  %210 = add nsw i64 %205, %209
  store i64 %210, ptr %22, align 8, !tbaa !12
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %212 = load i64, ptr %211, align 8, !tbaa !12
  store i64 %212, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %213

213:                                              ; preds = %201, %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %18, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %18, align 4, !tbaa !5
  br label %176, !llvm.loop !19

217:                                              ; preds = %180
  %218 = load i64, ptr %17, align 8, !tbaa !12
  %219 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %218)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %220

220:                                              ; preds = %229, %217
  %221 = load i32, ptr %23, align 4, !tbaa !5
  %222 = load i32, ptr @n, align 4, !tbaa !5
  %223 = icmp sle i32 %221, %222
  br i1 %223, label %225, label %224

224:                                              ; preds = %220
  store i32 24, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %232

225:                                              ; preds = %220
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  call void @llvm.memset.p0.i64(ptr align 8 %24, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  %226 = load i32, ptr %23, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %227
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 8 dereferenceable(24) %228) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  br label %229

229:                                              ; preds = %225
  %230 = load i32, ptr %23, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %23, align 4, !tbaa !5
  br label %220, !llvm.loop !20

232:                                              ; preds = %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %26, !llvm.loop !21

233:                                              ; preds = %26
  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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #7

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

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

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

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

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

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

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

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@sta = external dso_local global [3 x i32], align 4
@dis = external dso_local local_unnamed_addr global [3 x [200001 x i32]], align 16
@e = external dso_local global [200001 x %"class.std::vector"], align 16
@p = external dso_local global [200001 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3que = external hidden local_unnamed_addr global [200001 x i32], align 16
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; 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 %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::vector", align 8
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %9 = load i32, ptr @t, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @t, align 4, !tbaa !5
  %.not81 = icmp eq i32 %9, 0
  br i1 %.not81, label %._crit_edge84, label %.lr.ph83

.lr.ph83:                                         ; preds = %0, %._crit_edge80
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @sta)
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @sta, i64 4))
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @sta, i64 8))
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %.not5258 = icmp slt i32 %15, 1
  br i1 %.not5258, label %.lr.ph83.._crit_edge_crit_edge, label %.lr.ph

.lr.ph83.._crit_edge_crit_edge:                   ; preds = %.lr.ph83
  %.pre105 = sext i32 %15 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph83.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre105, %.lr.ph83.._crit_edge_crit_edge ], [ %21, %.lr.ph ]
  %gep = getelementptr i64, ptr getelementptr inbounds (i8, ptr @p, i64 8), i64 %.pre-phi
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @p, i64 8), ptr noundef nonnull %gep)
  %16 = load i32, ptr @m, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph62, label %.preheader

.lr.ph:                                           ; preds = %.lr.ph83, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph83 ]
  %18 = getelementptr inbounds i64, ptr @p, i64 %indvars.iv
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %.not52.not = icmp slt i64 %indvars.iv, %21
  br i1 %.not52.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %.lr.ph62, %._crit_edge
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = shl nsw i64 %23, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @dis, i64 4), i8 -1, i64 %24, i1 false)
  %25 = load i32, ptr @sta, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr @dis, i64 %26
  store i32 0, ptr %27, align 4, !tbaa !5
  store i32 %25, ptr @_ZZ4mainE3que, align 16, !tbaa !5
  br label %115

.lr.ph62:                                         ; preds = %._crit_edge, %.lr.ph62
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph62 ], [ 0, %._crit_edge ]
  %28 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %indvars.iv88
  %29 = load i64, ptr %28, align 8, !tbaa !11
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %30 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %indvars.iv.next89
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = add nsw i64 %31, %29
  store i64 %32, ptr %30, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %35
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %38
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %40 = load i32, ptr @m, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next89, %41
  br i1 %42, label %.lr.ph62, label %.preheader, !llvm.loop !13

.lr.ph74.preheader:                               ; preds = %113
  %.pre103 = load i32, ptr @m, align 4, !tbaa !5
  br label %.lr.ph74

43:                                               ; preds = %._crit_edge66
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = shl nsw i64 %45, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @dis, i64 800008), i8 -1, i64 %46, i1 false)
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @sta, i64 4), align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @dis, i64 800004), i64 %48
  store i32 0, ptr %49, align 4, !tbaa !5
  store i32 %47, ptr @_ZZ4mainE3que, align 16, !tbaa !5
  br label %50

50:                                               ; preds = %._crit_edge66.1, %43
  %indvars.iv91.1 = phi i64 [ 0, %43 ], [ %indvars.iv.next92.1, %._crit_edge66.1 ]
  %.04968.1 = phi i32 [ 1, %43 ], [ %.1.lcssa.1, %._crit_edge66.1 ]
  %51 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %indvars.iv91.1
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %55 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #8
  store ptr %55, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %56 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #8
  store ptr %56, ptr %4, align 8
  %57 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %57, label %.lr.ph65.1, label %._crit_edge66.1

.lr.ph65.1:                                       ; preds = %50
  %58 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @dis, i64 800004), i64 %53
  br label %59

59:                                               ; preds = %73, %.lr.ph65.1
  %.163.1 = phi i32 [ %.04968.1, %.lr.ph65.1 ], [ %.2.1, %73 ]
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @dis, i64 800004), i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp eq i32 %64, -1
  br i1 %65, label %66, label %73

66:                                               ; preds = %59
  %67 = load i32, ptr %58, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %63, align 4, !tbaa !5
  %69 = load i32, ptr %60, align 4, !tbaa !5
  %70 = add nsw i32 %.163.1, 1
  %71 = sext i32 %.163.1 to i64
  %72 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %71
  store i32 %69, ptr %72, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %66, %59
  %.2.1 = phi i32 [ %70, %66 ], [ %.163.1, %59 ]
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %75 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %75, label %59, label %._crit_edge66.1

._crit_edge66.1:                                  ; preds = %73, %50
  %.1.lcssa.1 = phi i32 [ %.04968.1, %50 ], [ %.2.1, %73 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %indvars.iv.next92.1 = add nuw nsw i64 %indvars.iv91.1, 1
  %76 = sext i32 %.1.lcssa.1 to i64
  %77 = icmp slt i64 %indvars.iv.next92.1, %76
  br i1 %77, label %50, label %78, !llvm.loop !14

78:                                               ; preds = %._crit_edge66.1
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = shl nsw i64 %80, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @dis, i64 1600012), i8 -1, i64 %81, i1 false)
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @sta, i64 8), align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @dis, i64 1600008), i64 %83
  store i32 0, ptr %84, align 4, !tbaa !5
  store i32 %82, ptr @_ZZ4mainE3que, align 16, !tbaa !5
  br label %85

85:                                               ; preds = %._crit_edge66.2, %78
  %indvars.iv91.2 = phi i64 [ 0, %78 ], [ %indvars.iv.next92.2, %._crit_edge66.2 ]
  %.04968.2 = phi i32 [ 1, %78 ], [ %.1.lcssa.2, %._crit_edge66.2 ]
  %86 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %indvars.iv91.2
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %90 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %89) #8
  store ptr %90, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %91 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %89) #8
  store ptr %91, ptr %4, align 8
  %92 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %92, label %.lr.ph65.2, label %._crit_edge66.2

.lr.ph65.2:                                       ; preds = %85
  %93 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @dis, i64 1600008), i64 %88
  br label %94

94:                                               ; preds = %108, %.lr.ph65.2
  %.163.2 = phi i32 [ %.04968.2, %.lr.ph65.2 ], [ %.2.2, %108 ]
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @dis, i64 1600008), i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp eq i32 %99, -1
  br i1 %100, label %101, label %108

101:                                              ; preds = %94
  %102 = load i32, ptr %93, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %98, align 4, !tbaa !5
  %104 = load i32, ptr %95, align 4, !tbaa !5
  %105 = add nsw i32 %.163.2, 1
  %106 = sext i32 %.163.2 to i64
  %107 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %106
  store i32 %104, ptr %107, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %101, %94
  %.2.2 = phi i32 [ %105, %101 ], [ %.163.2, %94 ]
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %110 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %110, label %94, label %._crit_edge66.2

._crit_edge66.2:                                  ; preds = %108, %85
  %.1.lcssa.2 = phi i32 [ %.04968.2, %85 ], [ %.2.2, %108 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %indvars.iv.next92.2 = add nuw nsw i64 %indvars.iv91.2, 1
  %111 = sext i32 %.1.lcssa.2 to i64
  %112 = icmp slt i64 %indvars.iv.next92.2, %111
  br i1 %112, label %85, label %113, !llvm.loop !14

113:                                              ; preds = %._crit_edge66.2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  store i64 9223372036854775807, ptr %5, align 8, !tbaa !11
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %.not5371 = icmp slt i32 %114, 1
  br i1 %.not5371, label %._crit_edge75, label %.lr.ph74.preheader

115:                                              ; preds = %.preheader, %._crit_edge66
  %indvars.iv91 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next92, %._crit_edge66 ]
  %.04968 = phi i32 [ 1, %.preheader ], [ %.1.lcssa, %._crit_edge66 ]
  %116 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %indvars.iv91
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %118
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %120 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %119) #8
  store ptr %120, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %121 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %119) #8
  store ptr %121, ptr %4, align 8
  %122 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %122, label %.lr.ph65, label %._crit_edge66

.lr.ph65:                                         ; preds = %115
  %123 = getelementptr inbounds i32, ptr @dis, i64 %118
  br label %126

._crit_edge66:                                    ; preds = %140, %115
  %.1.lcssa = phi i32 [ %.04968, %115 ], [ %.2, %140 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %124 = sext i32 %.1.lcssa to i64
  %125 = icmp slt i64 %indvars.iv.next92, %124
  br i1 %125, label %115, label %43, !llvm.loop !14

126:                                              ; preds = %.lr.ph65, %140
  %.163 = phi i32 [ %.04968, %.lr.ph65 ], [ %.2, %140 ]
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr @dis, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = icmp eq i32 %131, -1
  br i1 %132, label %133, label %140

133:                                              ; preds = %126
  %134 = load i32, ptr %123, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %130, align 4, !tbaa !5
  %136 = load i32, ptr %127, align 4, !tbaa !5
  %137 = add nsw i32 %.163, 1
  %138 = sext i32 %.163 to i64
  %139 = getelementptr inbounds [200001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %138
  store i32 %136, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %133, %126
  %.2 = phi i32 [ %137, %133 ], [ %.163, %126 ]
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %142 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br i1 %142, label %126, label %._crit_edge66

._crit_edge75:                                    ; preds = %167, %113
  %143 = phi i64 [ 9223372036854775807, %113 ], [ %168, %167 ]
  %144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %143)
  %145 = load i32, ptr @n, align 4, !tbaa !5
  %.not5476 = icmp slt i32 %145, 1
  br i1 %.not5476, label %._crit_edge80, label %.lr.ph79

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %167
  %146 = phi i64 [ 9223372036854775807, %.lr.ph74.preheader ], [ %168, %167 ]
  %147 = phi i32 [ %114, %.lr.ph74.preheader ], [ %169, %167 ]
  %148 = phi i32 [ %.pre103, %.lr.ph74.preheader ], [ %170, %167 ]
  %indvars.iv97 = phi i64 [ 1, %.lr.ph74.preheader ], [ %indvars.iv.next98, %167 ]
  %149 = getelementptr inbounds [200001 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 800004), i64 0, i64 %indvars.iv97
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = getelementptr inbounds [200001 x i32], ptr @dis, i64 0, i64 %indvars.iv97
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = add nsw i32 %152, %150
  %154 = getelementptr inbounds [200001 x i32], ptr getelementptr inbounds (i8, ptr @dis, i64 1600008), i64 0, i64 %indvars.iv97
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = add nsw i32 %153, %155
  %.not55 = icmp sgt i32 %156, %148
  br i1 %.not55, label %167, label %157

157:                                              ; preds = %.lr.ph74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %158 = sext i32 %150 to i64
  %159 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !11
  %161 = sext i32 %156 to i64
  %162 = getelementptr inbounds [200001 x i64], ptr @p, i64 0, i64 %161
  %163 = load i64, ptr %162, align 8, !tbaa !11
  %164 = add nsw i64 %163, %160
  store i64 %164, ptr %6, align 8, !tbaa !11
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %166 = load i64, ptr %165, align 8, !tbaa !11
  store i64 %166, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  %.pre104 = load i32, ptr @n, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %157, %.lr.ph74
  %168 = phi i64 [ %166, %157 ], [ %146, %.lr.ph74 ]
  %169 = phi i32 [ %.pre104, %157 ], [ %147, %.lr.ph74 ]
  %170 = phi i32 [ %.pre, %157 ], [ %148, %.lr.ph74 ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %171 = sext i32 %169 to i64
  %.not53.not = icmp slt i64 %indvars.iv97, %171
  br i1 %.not53.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !15

._crit_edge80:                                    ; preds = %.lr.ph79, %._crit_edge75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %172 = load i32, ptr @t, align 4, !tbaa !5
  %173 = add nsw i32 %172, -1
  store i32 %173, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %172, 0
  br i1 %.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !16

.lr.ph79:                                         ; preds = %._crit_edge75, %.lr.ph79
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.lr.ph79 ], [ 1, %._crit_edge75 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  %174 = getelementptr inbounds [200001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv100
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %174) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %175 = load i32, ptr @n, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %.not54.not = icmp slt i64 %indvars.iv100, %176
  br i1 %.not54.not, label %.lr.ph79, label %._crit_edge80, !llvm.loop !17

._crit_edge84:                                    ; preds = %._crit_edge80, %0
  ret i32 0
}

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #7

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

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

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

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

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

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

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

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


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