; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/113 Division 2/Problem D (D)

; 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.node = type { i32, i32, i32 }
%"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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@shoes = external dso_local global [100100 x %struct.node], align 16
@f = external dso_local global [100100 x i32], align 16
@s = external dso_local global [100100 x i32], align 16
@v = external dso_local global [100100 x i32], align 16
@fid = external dso_local global [100100 x i32], align 16
@sid = external dso_local global [100100 x i32], align 16
@used = external dso_local global [100100 x i32], align 16
@g = external dso_local global [100100 x %"class.std::vector"], 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
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5comp3RK4nodeS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #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 %struct.node, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %21

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

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

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %28
  %30 = getelementptr inbounds %struct.node, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.node, ptr %33, i32 0, i32 1
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %30, ptr noundef %34)
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %38
  %40 = getelementptr inbounds %struct.node, ptr %39, i32 0, i32 2
  store i32 %36, ptr %40, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %26
  %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 %21, !llvm.loop !11

44:                                               ; preds = %25
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.node, ptr @shoes, i64 %46
  %48 = getelementptr inbounds %struct.node, ptr %47, i64 1
  call void @_ZSt4sortIP4nodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef getelementptr inbounds (%struct.node, ptr @shoes, i64 1), ptr noundef %48, ptr noundef @_Z5comp1RK4nodeS1_)
  %49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %180, %44
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = load i32, ptr @m, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %55, label %54

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

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #7
  %56 = getelementptr inbounds %struct.node, ptr %4, i32 0, i32 0
  %57 = getelementptr inbounds %struct.node, ptr %4, i32 0, i32 1
  %58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %56, ptr noundef %57)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %struct.node, ptr getelementptr inbounds (%struct.node, ptr @shoes, i64 1), i64 %60
  %62 = call noundef ptr @_ZSt11lower_boundIP4nodeS0_PFbRKS0_S3_EET_S6_S6_RKT0_T1_(ptr noundef getelementptr inbounds (%struct.node, ptr @shoes, i64 1), ptr noundef %61, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef @_Z5comp1RK4nodeS1_)
  %63 = ptrtoint ptr %62 to i64
  %64 = sub i64 %63, ptrtoint (ptr getelementptr inbounds (%struct.node, ptr @shoes, i64 1) to i64)
  %65 = sdiv exact i64 %64, 12
  %66 = trunc i64 %65 to i32
  store i32 %66, ptr %5, align 4, !tbaa !5
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %5, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %153, %55
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %73, label %94

73:                                               ; preds = %69
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.node, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !13
  %79 = getelementptr inbounds %struct.node, ptr %4, i32 0, i32 1
  %80 = load i32, ptr %79, align 4, !tbaa !13
  %81 = icmp eq i32 %78, %80
  br i1 %81, label %92, label %82

82:                                               ; preds = %73
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.node, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !13
  %88 = getelementptr inbounds %struct.node, ptr %4, i32 0, i32 1
  %89 = load i32, ptr %88, align 4, !tbaa !13
  %90 = add nsw i32 %89, 1
  %91 = icmp eq i32 %87, %90
  br label %92

92:                                               ; preds = %82, %73
  %93 = phi i1 [ true, %73 ], [ %91, %82 ]
  br label %94

94:                                               ; preds = %92, %69
  %95 = phi i1 [ false, %69 ], [ %93, %92 ]
  br i1 %95, label %96, label %156

96:                                               ; preds = %94
  %97 = getelementptr inbounds %struct.node, ptr %4, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !14
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %100
  %102 = getelementptr inbounds %struct.node, ptr %101, i32 0, i32 0
  %103 = load i32, ptr %102, align 4, !tbaa !14
  %104 = icmp sge i32 %98, %103
  br i1 %104, label %105, label %153

105:                                              ; preds = %96
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %107
  %109 = getelementptr inbounds %struct.node, ptr %108, i32 0, i32 2
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %111
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %112, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %135

118:                                              ; preds = %105
  %119 = load i32, ptr %5, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %120
  %122 = getelementptr inbounds %struct.node, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 4, !tbaa !14
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %125
  store i32 %123, ptr %126, align 4, !tbaa !5
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %128
  %130 = getelementptr inbounds %struct.node, ptr %129, i32 0, i32 2
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100100 x i32], ptr @fid, i64 0, i64 %133
  store i32 %131, ptr %134, align 4, !tbaa !5
  br label %152

135:                                              ; preds = %105
  %136 = load i32, ptr %5, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.node, ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 4, !tbaa !14
  %141 = load i32, ptr %3, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %142
  store i32 %140, ptr %143, align 4, !tbaa !5
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.node, ptr %146, i32 0, i32 2
  %148 = load i32, ptr %147, align 4, !tbaa !9
  %149 = load i32, ptr %3, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100100 x i32], ptr @sid, i64 0, i64 %150
  store i32 %148, ptr %151, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %135, %118
  br label %153

153:                                              ; preds = %152, %96
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %5, align 4, !tbaa !5
  br label %69, !llvm.loop !15

156:                                              ; preds = %94
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr %3, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = icmp slt i32 %160, %164
  br i1 %165, label %166, label %179

166:                                              ; preds = %156
  %167 = load i32, ptr %3, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %168
  %170 = load i32, ptr %3, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %171
  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) %169, ptr noundef nonnull align 4 dereferenceable(4) %172) #7
  %173 = load i32, ptr %3, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100100 x i32], ptr @fid, i64 0, i64 %174
  %176 = load i32, ptr %3, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [100100 x i32], ptr @sid, i64 0, i64 %177
  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) %175, ptr noundef nonnull align 4 dereferenceable(4) %178) #7
  br label %179

179:                                              ; preds = %166, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #7
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %3, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %3, align 4, !tbaa !5
  br label %50, !llvm.loop !16

183:                                              ; preds = %54
  %184 = load i32, ptr @n, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds %struct.node, ptr @shoes, i64 %185
  %187 = getelementptr inbounds %struct.node, ptr %186, i64 1
  call void @_ZSt4sortIP4nodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef getelementptr inbounds (%struct.node, ptr @shoes, i64 1), ptr noundef %187, ptr noundef @_Z5comp3RK4nodeS1_)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %411, %183
  %189 = load i32, ptr %8, align 4, !tbaa !5
  %190 = load i32, ptr @n, align 4, !tbaa !5
  %191 = icmp sle i32 %189, %190
  br i1 %191, label %193, label %192

192:                                              ; preds = %188
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %414

193:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  store i8 0, ptr %10, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %194 = load i32, ptr %8, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %195
  %197 = getelementptr inbounds %struct.node, ptr %196, i32 0, i32 2
  %198 = load i32, ptr %197, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %199
  %201 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %200) #7
  %202 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %201, ptr %202, align 8
  br label %203

203:                                              ; preds = %323, %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %204 = load i32, ptr %8, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %205
  %207 = getelementptr inbounds %struct.node, ptr %206, i32 0, i32 2
  %208 = load i32, ptr %207, align 4, !tbaa !9
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %209
  %211 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %210) #7
  %212 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %211, ptr %212, align 8
  %213 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br i1 %213, label %215, label %214

214:                                              ; preds = %203
  store i32 13, ptr %9, align 4
  br label %326

215:                                              ; preds = %203
  %216 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = icmp ne i32 %220, 0
  br i1 %221, label %322, label %222

222:                                              ; preds = %215
  %223 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = load i32, ptr %8, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %229
  %231 = getelementptr inbounds %struct.node, ptr %230, i32 0, i32 0
  %232 = load i32, ptr %231, align 4, !tbaa !14
  %233 = icmp sgt i32 %227, %232
  br i1 %233, label %234, label %261

234:                                              ; preds = %222
  %235 = load i32, ptr %8, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %236
  %238 = getelementptr inbounds %struct.node, ptr %237, i32 0, i32 2
  %239 = load i32, ptr %238, align 4, !tbaa !9
  %240 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %242
  store i32 %239, ptr %243, align 4, !tbaa !5
  %244 = load i32, ptr %7, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %7, align 4, !tbaa !5
  %246 = load i32, ptr %8, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %247
  %249 = getelementptr inbounds %struct.node, ptr %248, i32 0, i32 0
  %250 = load i32, ptr %249, align 4, !tbaa !14
  %251 = sext i32 %250 to i64
  %252 = load i64, ptr %6, align 8, !tbaa !17
  %253 = add nsw i64 %252, %251
  store i64 %253, ptr %6, align 8, !tbaa !17
  store i8 1, ptr %10, align 1, !tbaa !19
  %254 = load i32, ptr %8, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %255
  %257 = getelementptr inbounds %struct.node, ptr %256, i32 0, i32 2
  %258 = load i32, ptr %257, align 4, !tbaa !9
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %259
  store i32 1, ptr %260, align 4, !tbaa !5
  store i32 13, ptr %9, align 4
  br label %326

261:                                              ; preds = %222
  %262 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %263 = load i32, ptr %262, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !5
  %267 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %268 = load i32, ptr %267, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = icmp eq i32 %266, %271
  br i1 %272, label %273, label %320

273:                                              ; preds = %261
  %274 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [100100 x i32], ptr @fid, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %279
  %281 = load i32, ptr %280, align 4, !tbaa !5
  %282 = icmp ne i32 %281, 0
  br i1 %282, label %293, label %283

283:                                              ; preds = %273
  %284 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [100100 x i32], ptr @sid, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %289
  %291 = load i32, ptr %290, align 4, !tbaa !5
  %292 = icmp ne i32 %291, 0
  br i1 %292, label %293, label %320

293:                                              ; preds = %283, %273
  %294 = load i32, ptr %8, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %295
  %297 = getelementptr inbounds %struct.node, ptr %296, i32 0, i32 2
  %298 = load i32, ptr %297, align 4, !tbaa !9
  %299 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #7
  %300 = load i32, ptr %299, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %301
  store i32 %298, ptr %302, align 4, !tbaa !5
  %303 = load i32, ptr %7, align 4, !tbaa !5
  %304 = add nsw i32 %303, 1
  store i32 %304, ptr %7, align 4, !tbaa !5
  %305 = load i32, ptr %8, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %306
  %308 = getelementptr inbounds %struct.node, ptr %307, i32 0, i32 0
  %309 = load i32, ptr %308, align 4, !tbaa !14
  %310 = sext i32 %309 to i64
  %311 = load i64, ptr %6, align 8, !tbaa !17
  %312 = add nsw i64 %311, %310
  store i64 %312, ptr %6, align 8, !tbaa !17
  store i8 1, ptr %10, align 1, !tbaa !19
  %313 = load i32, ptr %8, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %314
  %316 = getelementptr inbounds %struct.node, ptr %315, i32 0, i32 2
  %317 = load i32, ptr %316, align 4, !tbaa !9
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %318
  store i32 1, ptr %319, align 4, !tbaa !5
  store i32 13, ptr %9, align 4
  br label %326

320:                                              ; preds = %283, %261
  br label %321

321:                                              ; preds = %320
  br label %322

322:                                              ; preds = %321, %215
  br label %323

323:                                              ; preds = %322
  %324 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #7
  %325 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %324, ptr %325, align 8
  br label %203, !llvm.loop !21

326:                                              ; preds = %293, %234, %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %327

327:                                              ; preds = %326
  %328 = load i8, ptr %10, align 1, !tbaa !19, !range !22, !noundef !23
  %329 = trunc i8 %328 to i1
  br i1 %329, label %410, label %330

330:                                              ; preds = %327
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 2000000000, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 -1, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %331 = load i32, ptr %8, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %332
  %334 = getelementptr inbounds %struct.node, ptr %333, i32 0, i32 2
  %335 = load i32, ptr %334, align 4, !tbaa !9
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %336
  %338 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %337) #7
  %339 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %338, ptr %339, align 8
  br label %340

340:                                              ; preds = %377, %330
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %341 = load i32, ptr %8, align 4, !tbaa !5
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %342
  %344 = getelementptr inbounds %struct.node, ptr %343, i32 0, i32 2
  %345 = load i32, ptr %344, align 4, !tbaa !9
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %346
  %348 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %347) #7
  %349 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %348, ptr %349, align 8
  %350 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br i1 %350, label %352, label %351

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

352:                                              ; preds = %340
  %353 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %354 = load i32, ptr %353, align 4, !tbaa !5
  %355 = sext i32 %354 to i64
  %356 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %355
  %357 = load i32, ptr %356, align 4, !tbaa !5
  %358 = icmp ne i32 %357, 0
  br i1 %358, label %376, label %359

359:                                              ; preds = %352
  %360 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %361 = load i32, ptr %360, align 4, !tbaa !5
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %362
  %364 = load i32, ptr %363, align 4, !tbaa !5
  %365 = load i32, ptr %14, align 4, !tbaa !5
  %366 = icmp slt i32 %364, %365
  br i1 %366, label %367, label %375

367:                                              ; preds = %359
  %368 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %369 = load i32, ptr %368, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %370
  %372 = load i32, ptr %371, align 4, !tbaa !5
  store i32 %372, ptr %14, align 4, !tbaa !5
  %373 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %374 = load i32, ptr %373, align 4, !tbaa !5
  store i32 %374, ptr %15, align 4, !tbaa !5
  br label %375

375:                                              ; preds = %367, %359
  br label %376

376:                                              ; preds = %375, %352
  br label %377

377:                                              ; preds = %376
  %378 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef 0) #7
  %379 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %378, ptr %379, align 8
  br label %340, !llvm.loop !24

380:                                              ; preds = %351
  %381 = load i32, ptr %15, align 4, !tbaa !5
  %382 = icmp ne i32 %381, -1
  br i1 %382, label %383, label %409

383:                                              ; preds = %380
  %384 = load i32, ptr %8, align 4, !tbaa !5
  %385 = sext i32 %384 to i64
  %386 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %385
  %387 = getelementptr inbounds %struct.node, ptr %386, i32 0, i32 2
  %388 = load i32, ptr %387, align 4, !tbaa !9
  %389 = load i32, ptr %15, align 4, !tbaa !5
  %390 = sext i32 %389 to i64
  %391 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %390
  store i32 %388, ptr %391, align 4, !tbaa !5
  %392 = load i32, ptr %7, align 4, !tbaa !5
  %393 = add nsw i32 %392, 1
  store i32 %393, ptr %7, align 4, !tbaa !5
  %394 = load i32, ptr %8, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %395
  %397 = getelementptr inbounds %struct.node, ptr %396, i32 0, i32 0
  %398 = load i32, ptr %397, align 4, !tbaa !14
  %399 = sext i32 %398 to i64
  %400 = load i64, ptr %6, align 8, !tbaa !17
  %401 = add nsw i64 %400, %399
  store i64 %401, ptr %6, align 8, !tbaa !17
  %402 = load i32, ptr %8, align 4, !tbaa !5
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %403
  %405 = getelementptr inbounds %struct.node, ptr %404, i32 0, i32 2
  %406 = load i32, ptr %405, align 4, !tbaa !9
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %407
  store i32 1, ptr %408, align 4, !tbaa !5
  br label %409

409:                                              ; preds = %383, %380
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %410

410:                                              ; preds = %409, %327
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  br label %411

411:                                              ; preds = %410
  %412 = load i32, ptr %8, align 4, !tbaa !5
  %413 = add nsw i32 %412, 1
  store i32 %413, ptr %8, align 4, !tbaa !5
  br label %188, !llvm.loop !25

414:                                              ; preds = %192
  %415 = load i64, ptr %6, align 8, !tbaa !17
  %416 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %415)
  %417 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %416, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %418 = load i32, ptr %7, align 4, !tbaa !5
  %419 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %417, i32 noundef %418)
  %420 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %419, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %421

421:                                              ; preds = %440, %414
  %422 = load i32, ptr %19, align 4, !tbaa !5
  %423 = load i32, ptr @m, align 4, !tbaa !5
  %424 = icmp sle i32 %422, %423
  br i1 %424, label %426, label %425

425:                                              ; preds = %421
  store i32 19, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %443

426:                                              ; preds = %421
  %427 = load i32, ptr %19, align 4, !tbaa !5
  %428 = sext i32 %427 to i64
  %429 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %428
  %430 = load i32, ptr %429, align 4, !tbaa !5
  %431 = icmp ne i32 %430, 0
  br i1 %431, label %432, label %439

432:                                              ; preds = %426
  %433 = load i32, ptr %19, align 4, !tbaa !5
  %434 = load i32, ptr %19, align 4, !tbaa !5
  %435 = sext i32 %434 to i64
  %436 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %435
  %437 = load i32, ptr %436, align 4, !tbaa !5
  %438 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %433, i32 noundef %437)
  br label %439

439:                                              ; preds = %432, %426
  br label %440

440:                                              ; preds = %439
  %441 = load i32, ptr %19, align 4, !tbaa !5
  %442 = add nsw i32 %441, 1
  store i32 %442, ptr %19, align 4, !tbaa !5
  br label %421, !llvm.loop !26

443:                                              ; preds = %425
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %444 = load i32, ptr %1, align 4
  ret i32 %444
}

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 @_ZSt4sortIP4nodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIP4nodeS0_PFbRKS0_S3_EET_S6_S6_RKT0_T1_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(12), 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: 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: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(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)) #6

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

; 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 ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

declare i32 @printf(ptr noundef, ...) #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 = { 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 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4node", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = !{!10, !6, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = distinct !{!21, !12}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}


; 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.node = type { i32, i32, i32 }
%"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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@shoes = external dso_local global [100100 x %struct.node], align 16
@f = external dso_local global [100100 x i32], align 16
@s = external dso_local global [100100 x i32], align 16
@v = external dso_local local_unnamed_addr global [100100 x i32], align 16
@fid = external dso_local global [100100 x i32], align 16
@sid = external dso_local global [100100 x i32], align 16
@used = external dso_local local_unnamed_addr global [100100 x i32], align 16
@g = external dso_local global [100100 x %"class.std::vector"], 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
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.node, align 4
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not85 = icmp slt i32 %8, 1
  br i1 %.not85, label %.._crit_edge_crit_edge, label %.lr.ph

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

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre132, %.._crit_edge_crit_edge ], [ %20, %.lr.ph ]
  %9 = getelementptr inbounds %struct.node, ptr @shoes, i64 %.pre-phi
  %10 = getelementptr inbounds i8, ptr %9, i64 12
  tail call void @_ZSt4sortIP4nodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @shoes, i64 12), ptr noundef nonnull %10, ptr noundef nonnull @_Z5comp1RK4nodeS1_)
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 1, ptr %1, align 4, !tbaa !5
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %.not7193 = icmp slt i32 %12, 1
  br i1 %.not7193, label %._crit_edge96, label %.lr.ph95

.lr.ph95:                                         ; preds = %._crit_edge
  %13 = getelementptr inbounds i8, ptr %2, i64 4
  br label %26

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %14 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %indvars.iv
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %14, ptr noundef nonnull %15)
  %17 = getelementptr inbounds i8, ptr %14, i64 8
  %18 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %18, ptr %17, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %.not.not = icmp slt i64 %indvars.iv, %20
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge96:                                    ; preds = %75, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds %struct.node, ptr @shoes, i64 %22
  %24 = getelementptr inbounds i8, ptr %23, i64 12
  call void @_ZSt4sortIP4nodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @shoes, i64 12), ptr noundef nonnull %24, ptr noundef nonnull @_Z5comp3RK4nodeS1_)
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %.not72106 = icmp slt i32 %25, 1
  br i1 %.not72106, label %._crit_edge112, label %.lr.ph111

26:                                               ; preds = %.lr.ph95, %75
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #8
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2, ptr noundef nonnull %13)
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %struct.node, ptr getelementptr inbounds (i8, ptr @shoes, i64 12), i64 %29
  %31 = call noundef ptr @_ZSt11lower_boundIP4nodeS0_PFbRKS0_S3_EET_S6_S6_RKT0_T1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @shoes, i64 12), ptr noundef nonnull %30, ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull @_Z5comp1RK4nodeS1_)
  %32 = ptrtoint ptr %31 to i64
  %33 = sub i64 %32, ptrtoint (ptr getelementptr inbounds (i8, ptr @shoes, i64 12) to i64)
  %34 = sdiv exact i64 %33, 12
  %35 = trunc i64 %34 to i32
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %.not80.not88 = icmp sgt i32 %36, %35
  br i1 %.not80.not88, label %.lr.ph91.preheader, label %.critedge

.lr.ph91.preheader:                               ; preds = %26
  %sext = shl i64 %34, 32
  %37 = ashr exact i64 %sext, 32
  br label %.lr.ph91

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %60
  %indvars.iv122 = phi i64 [ %37, %.lr.ph91.preheader ], [ %indvars.iv.next123, %60 ]
  %indvars.iv.next123 = add nsw i64 %indvars.iv122, 1
  %38 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %indvars.iv.next123
  %39 = getelementptr inbounds i8, ptr %38, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !13
  %41 = load i32, ptr %13, align 4, !tbaa !13
  %42 = icmp eq i32 %40, %41
  %43 = add nsw i32 %41, 1
  %44 = icmp eq i32 %40, %43
  %or.cond = select i1 %42, i1 true, i1 %44
  br i1 %or.cond, label %.critedge2, label %.critedge

.critedge2:                                       ; preds = %.lr.ph91
  %45 = load i32, ptr %2, align 4, !tbaa !14
  %46 = load i32, ptr %38, align 4, !tbaa !14
  %.not81 = icmp slt i32 %45, %46
  br i1 %.not81, label %60, label %.sink.split

.sink.split:                                      ; preds = %.critedge2
  %47 = getelementptr inbounds i8, ptr %38, i64 8
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %49
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp eq i32 %54, 0
  %56 = load i32, ptr %38, align 4, !tbaa !14
  %57 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %52
  %.sink = select i1 %55, ptr %53, ptr %57
  %fid.sink = select i1 %55, ptr @fid, ptr @sid
  store i32 %56, ptr %.sink, align 4, !tbaa !5
  %58 = load i32, ptr %47, align 4, !tbaa !9
  %59 = getelementptr inbounds [100100 x i32], ptr %fid.sink, i64 0, i64 %52
  store i32 %58, ptr %59, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %.sink.split, %.critedge2
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %.not80.not = icmp slt i64 %indvars.iv.next123, %62
  br i1 %.not80.not, label %.lr.ph91, label %.critedge, !llvm.loop !15

.critedge:                                        ; preds = %60, %.lr.ph91, %26
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %64
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp slt i32 %66, %68
  br i1 %69, label %70, label %75

70:                                               ; preds = %.critedge
  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) %65, ptr noundef nonnull align 4 dereferenceable(4) %67) #8
  %71 = load i32, ptr %1, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100100 x i32], ptr @fid, i64 0, i64 %72
  %74 = getelementptr inbounds [100100 x i32], ptr @sid, i64 0, i64 %72
  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) %73, ptr noundef nonnull align 4 dereferenceable(4) %74) #8
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %70, %.critedge
  %76 = phi i32 [ %.pre, %70 ], [ %63, %.critedge ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #8
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %1, align 4, !tbaa !5
  %78 = load i32, ptr @m, align 4, !tbaa !5
  %.not71.not = icmp slt i32 %76, %78
  br i1 %.not71.not, label %26, label %._crit_edge96, !llvm.loop !16

._crit_edge112:                                   ; preds = %200, %._crit_edge96
  %.062.lcssa = phi i64 [ 0, %._crit_edge96 ], [ %.365, %200 ]
  %.060.lcssa = phi i32 [ 0, %._crit_edge96 ], [ %.3, %200 ]
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.062.lcssa)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %80, i32 noundef %.060.lcssa)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %83 = load i32, ptr @m, align 4, !tbaa !5
  %.not73115 = icmp slt i32 %83, 1
  br i1 %.not73115, label %._crit_edge119, label %.lr.ph118

.lr.ph111:                                        ; preds = %._crit_edge96, %200
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %200 ], [ 1, %._crit_edge96 ]
  %.060108 = phi i32 [ %.3, %200 ], [ 0, %._crit_edge96 ]
  %.062107 = phi i64 [ %.365, %200 ], [ 0, %._crit_edge96 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %84 = getelementptr inbounds [100100 x %struct.node], ptr @shoes, i64 0, i64 %indvars.iv125
  %85 = getelementptr inbounds i8, ptr %84, i64 8
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %87
  %89 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #8
  store ptr %89, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %90 = load i32, ptr %85, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %91
  %93 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #8
  store ptr %93, ptr %4, align 8
  %94 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br i1 %94, label %.lr.ph98, label %._crit_edge99

.lr.ph98:                                         ; preds = %.lr.ph111, %138
  %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 [100100 x i32], ptr @v, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %.not75 = icmp eq i32 %99, 0
  br i1 %.not75, label %100, label %138

100:                                              ; preds = %.lr.ph98
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %84, align 4, !tbaa !14
  %107 = icmp sgt i32 %105, %106
  br i1 %107, label %.thread, label %108

108:                                              ; preds = %100
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100100 x i32], ptr @f, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = icmp eq i32 %113, %118
  br i1 %119, label %120, label %138

120:                                              ; preds = %108
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100100 x i32], ptr @fid, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %.not76 = icmp eq i32 %128, 0
  br i1 %.not76, label %129, label %.thread

129:                                              ; preds = %120
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100100 x i32], ptr @sid, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %.not77 = icmp eq i32 %137, 0
  br i1 %.not77, label %138, label %.thread

138:                                              ; preds = %.lr.ph98, %108, %129
  %139 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %140 = load i32, ptr %85, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %141
  %143 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %142) #8
  store ptr %143, ptr %4, align 8
  %144 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br i1 %144, label %.lr.ph98, label %._crit_edge99, !llvm.loop !17

.thread:                                          ; preds = %120, %129, %100
  %145 = load i32, ptr %85, align 4, !tbaa !9
  %146 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %148
  store i32 %145, ptr %149, align 4, !tbaa !5
  %150 = load i32, ptr %84, align 4, !tbaa !14
  %151 = load i32, ptr %85, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %152
  store i32 1, ptr %153, align 4, !tbaa !5
  %.161.ph = add nsw i32 %.060108, 1
  %.pn = sext i32 %150 to i64
  %.163.ph = add nsw i64 %.062107, %.pn
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %200

._crit_edge99:                                    ; preds = %138, %.lr.ph111
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %154 = load i32, ptr %85, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %155
  %157 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #8
  store ptr %157, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %158 = load i32, ptr %85, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %159
  %161 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %160) #8
  store ptr %161, ptr %6, align 8
  %162 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br i1 %162, label %.lr.ph103, label %._crit_edge104.thread

._crit_edge104.thread:                            ; preds = %._crit_edge99
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %200

._crit_edge104:                                   ; preds = %183
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %.not78 = icmp eq i32 %.1, -1
  br i1 %.not78, label %200, label %190

.lr.ph103:                                        ; preds = %._crit_edge99, %183
  %.054101 = phi i32 [ %.1, %183 ], [ -1, %._crit_edge99 ]
  %.055100 = phi i32 [ %.156, %183 ], [ 2000000000, %._crit_edge99 ]
  %163 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %.not79 = icmp eq i32 %167, 0
  br i1 %.not79, label %168, label %183

168:                                              ; preds = %.lr.ph103
  %169 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = icmp slt i32 %173, %.055100
  br i1 %174, label %175, label %183

175:                                              ; preds = %168
  %176 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100100 x i32], ptr @s, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %182 = load i32, ptr %181, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %.lr.ph103, %175, %168
  %.156 = phi i32 [ %.055100, %.lr.ph103 ], [ %180, %175 ], [ %.055100, %168 ]
  %.1 = phi i32 [ %.054101, %.lr.ph103 ], [ %182, %175 ], [ %.054101, %168 ]
  %184 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %185 = load i32, ptr %85, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %186
  %188 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %187) #8
  store ptr %188, ptr %6, align 8
  %189 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br i1 %189, label %.lr.ph103, label %._crit_edge104, !llvm.loop !18

190:                                              ; preds = %._crit_edge104
  %191 = load i32, ptr %85, align 4, !tbaa !9
  %192 = sext i32 %.1 to i64
  %193 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %192
  store i32 %191, ptr %193, align 4, !tbaa !5
  %194 = add nsw i32 %.060108, 1
  %195 = load i32, ptr %84, align 4, !tbaa !14
  %196 = sext i32 %195 to i64
  %197 = add nsw i64 %.062107, %196
  %198 = sext i32 %191 to i64
  %199 = getelementptr inbounds [100100 x i32], ptr @used, i64 0, i64 %198
  store i32 1, ptr %199, align 4, !tbaa !5
  br label %200

200:                                              ; preds = %._crit_edge104.thread, %.thread, %._crit_edge104, %190
  %.365 = phi i64 [ %197, %190 ], [ %.062107, %._crit_edge104 ], [ %.163.ph, %.thread ], [ %.062107, %._crit_edge104.thread ]
  %.3 = phi i32 [ %194, %190 ], [ %.060108, %._crit_edge104 ], [ %.161.ph, %.thread ], [ %.060108, %._crit_edge104.thread ]
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %201 = load i32, ptr @n, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %.not72.not = icmp slt i64 %indvars.iv125, %202
  br i1 %.not72.not, label %.lr.ph111, label %._crit_edge112, !llvm.loop !19

._crit_edge119:                                   ; preds = %209, %._crit_edge112
  ret i32 0

.lr.ph118:                                        ; preds = %._crit_edge112, %209
  %203 = phi i32 [ %210, %209 ], [ %83, %._crit_edge112 ]
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %209 ], [ 1, %._crit_edge112 ]
  %204 = getelementptr inbounds [100100 x i32], ptr @v, i64 0, i64 %indvars.iv128
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %.not74 = icmp eq i32 %205, 0
  br i1 %.not74, label %209, label %206

206:                                              ; preds = %.lr.ph118
  %207 = trunc nuw nsw i64 %indvars.iv128 to i32
  %208 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %207, i32 noundef %205)
  %.pre131 = load i32, ptr @m, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %.lr.ph118, %206
  %210 = phi i32 [ %203, %.lr.ph118 ], [ %.pre131, %206 ]
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %211 = sext i32 %210 to i64
  %.not73.not = icmp slt i64 %indvars.iv128, %211
  br i1 %.not73.not, label %.lr.ph118, label %._crit_edge119, !llvm.loop !20
}

; 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 @_ZSt4sortIP4nodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIP4nodeS0_PFbRKS0_S3_EET_S6_S6_RKT0_T1_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(12), 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: 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: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(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 #6

; 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: 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 ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 = { "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 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4node", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = !{!10, !6, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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