; LLVM IR from DionysiosB/CodeForces :: 1706C-QpwoeirutAndTheCity (main)

; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.std::allocator", align 1
  %16 = alloca %"class.std::vector", align 8
  %17 = alloca i64, align 8
  %18 = alloca %"class.std::allocator", align 1
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %29

29:                                               ; preds = %281, %0
  %30 = load i64, ptr %2, align 8, !tbaa !5
  %31 = add nsw i64 %30, -1
  store i64 %31, ptr %2, align 8, !tbaa !5
  %32 = icmp ne i64 %30, 0
  br i1 %32, label %33, label %289

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  %35 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %35, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %36 unwind label %42

36:                                               ; preds = %33
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %51, %36
  %38 = load i64, ptr %8, align 8, !tbaa !5
  %39 = load i64, ptr %3, align 8, !tbaa !5
  %40 = icmp slt i64 %38, %39
  br i1 %40, label %46, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %58

42:                                               ; preds = %33
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %6, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  br label %288

46:                                               ; preds = %37
  %47 = load i64, ptr %8, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %47) #5
  %49 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %48)
          to label %50 unwind label %54

50:                                               ; preds = %46
  br label %51

51:                                               ; preds = %50
  %52 = load i64, ptr %8, align 8, !tbaa !5
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %8, align 8, !tbaa !5
  br label %37, !llvm.loop !9

54:                                               ; preds = %46
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %6, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %287

58:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  %59 = load i64, ptr %3, align 8, !tbaa !5
  %60 = srem i64 %59, 2
  %61 = icmp ne i64 %60, 0
  br i1 %61, label %62, label %107

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 1, ptr %10, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %103, %62
  %64 = load i64, ptr %10, align 8, !tbaa !5
  %65 = load i64, ptr %3, align 8, !tbaa !5
  %66 = icmp slt i64 %64, %65
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %69 = load i64, ptr %10, align 8, !tbaa !5
  %70 = sub nsw i64 %69, 1
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %70) #5
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = load i64, ptr %10, align 8, !tbaa !5
  %74 = add nsw i64 %73, 1
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %74) #5
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = icmp sgt i64 %72, %76
  br i1 %77, label %78, label %83

78:                                               ; preds = %68
  %79 = load i64, ptr %10, align 8, !tbaa !5
  %80 = sub nsw i64 %79, 1
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %80) #5
  %82 = load i64, ptr %81, align 8, !tbaa !5
  br label %88

83:                                               ; preds = %68
  %84 = load i64, ptr %10, align 8, !tbaa !5
  %85 = add nsw i64 %84, 1
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %85) #5
  %87 = load i64, ptr %86, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %83, %78
  %89 = phi i64 [ %82, %78 ], [ %87, %83 ]
  %90 = add nsw i64 1, %89
  store i64 %90, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %91 = load i64, ptr %11, align 8, !tbaa !5
  %92 = load i64, ptr %10, align 8, !tbaa !5
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %92) #5
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = sub nsw i64 %91, %94
  store i64 %95, ptr %12, align 8, !tbaa !5
  %96 = load i64, ptr %12, align 8, !tbaa !5
  %97 = icmp sgt i64 %96, 0
  %98 = zext i1 %97 to i64
  %99 = load i64, ptr %12, align 8, !tbaa !5
  %100 = mul nsw i64 %98, %99
  %101 = load i64, ptr %9, align 8, !tbaa !5
  %102 = add nsw i64 %101, %100
  store i64 %102, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %103

103:                                              ; preds = %88
  %104 = load i64, ptr %10, align 8, !tbaa !5
  %105 = add nsw i64 %104, 2
  store i64 %105, ptr %10, align 8, !tbaa !5
  br label %63, !llvm.loop !11

106:                                              ; preds = %67
  br label %278

107:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %108 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %108, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %109 unwind label %118

109:                                              ; preds = %107
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  %110 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i64 0, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %110, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %111 unwind label %122

111:                                              ; preds = %109
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 1, ptr %19, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %170, %111
  %113 = load i64, ptr %19, align 8, !tbaa !5
  %114 = add nsw i64 %113, 1
  %115 = load i64, ptr %3, align 8, !tbaa !5
  %116 = icmp slt i64 %114, %115
  br i1 %116, label %126, label %117

117:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %173

118:                                              ; preds = %107
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %6, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %277

122:                                              ; preds = %109
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %6, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %277

126:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %127 = load i64, ptr %19, align 8, !tbaa !5
  %128 = sub nsw i64 %127, 1
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %128) #5
  %130 = load i64, ptr %129, align 8, !tbaa !5
  %131 = load i64, ptr %19, align 8, !tbaa !5
  %132 = add nsw i64 %131, 1
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %132) #5
  %134 = load i64, ptr %133, align 8, !tbaa !5
  %135 = icmp sgt i64 %130, %134
  br i1 %135, label %136, label %141

136:                                              ; preds = %126
  %137 = load i64, ptr %19, align 8, !tbaa !5
  %138 = sub nsw i64 %137, 1
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %138) #5
  %140 = load i64, ptr %139, align 8, !tbaa !5
  br label %146

141:                                              ; preds = %126
  %142 = load i64, ptr %19, align 8, !tbaa !5
  %143 = add nsw i64 %142, 1
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %143) #5
  %145 = load i64, ptr %144, align 8, !tbaa !5
  br label %146

146:                                              ; preds = %141, %136
  %147 = phi i64 [ %140, %136 ], [ %145, %141 ]
  %148 = add nsw i64 1, %147
  store i64 %148, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %149 = load i64, ptr %20, align 8, !tbaa !5
  %150 = load i64, ptr %19, align 8, !tbaa !5
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %150) #5
  %152 = load i64, ptr %151, align 8, !tbaa !5
  %153 = sub nsw i64 %149, %152
  store i64 %153, ptr %21, align 8, !tbaa !5
  %154 = load i64, ptr %19, align 8, !tbaa !5
  %155 = sub nsw i64 %154, 1
  %156 = load i64, ptr %19, align 8, !tbaa !5
  %157 = icmp sge i64 %156, 2
  %158 = zext i1 %157 to i64
  %159 = sub nsw i64 %155, %158
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %159) #5
  %161 = load i64, ptr %160, align 8, !tbaa !5
  %162 = load i64, ptr %21, align 8, !tbaa !5
  %163 = icmp sgt i64 %162, 0
  %164 = zext i1 %163 to i64
  %165 = load i64, ptr %21, align 8, !tbaa !5
  %166 = mul nsw i64 %164, %165
  %167 = add nsw i64 %161, %166
  %168 = load i64, ptr %19, align 8, !tbaa !5
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %168) #5
  store i64 %167, ptr %169, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %170

170:                                              ; preds = %146
  %171 = load i64, ptr %19, align 8, !tbaa !5
  %172 = add nsw i64 %171, 2
  store i64 %172, ptr %19, align 8, !tbaa !5
  br label %112, !llvm.loop !12

173:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %174 = load i64, ptr %3, align 8, !tbaa !5
  %175 = sub nsw i64 %174, 2
  store i64 %175, ptr %22, align 8, !tbaa !5
  br label %176

176:                                              ; preds = %226, %173
  %177 = load i64, ptr %22, align 8, !tbaa !5
  %178 = icmp sge i64 %177, 1
  br i1 %178, label %180, label %179

179:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %229

180:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %181 = load i64, ptr %22, align 8, !tbaa !5
  %182 = sub nsw i64 %181, 1
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %182) #5
  %184 = load i64, ptr %183, align 8, !tbaa !5
  %185 = load i64, ptr %22, align 8, !tbaa !5
  %186 = add nsw i64 %185, 1
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %186) #5
  %188 = load i64, ptr %187, align 8, !tbaa !5
  %189 = icmp sgt i64 %184, %188
  br i1 %189, label %190, label %195

190:                                              ; preds = %180
  %191 = load i64, ptr %22, align 8, !tbaa !5
  %192 = sub nsw i64 %191, 1
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %192) #5
  %194 = load i64, ptr %193, align 8, !tbaa !5
  br label %200

195:                                              ; preds = %180
  %196 = load i64, ptr %22, align 8, !tbaa !5
  %197 = add nsw i64 %196, 1
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %197) #5
  %199 = load i64, ptr %198, align 8, !tbaa !5
  br label %200

200:                                              ; preds = %195, %190
  %201 = phi i64 [ %194, %190 ], [ %199, %195 ]
  %202 = add nsw i64 1, %201
  store i64 %202, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %203 = load i64, ptr %23, align 8, !tbaa !5
  %204 = load i64, ptr %22, align 8, !tbaa !5
  %205 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %204) #5
  %206 = load i64, ptr %205, align 8, !tbaa !5
  %207 = sub nsw i64 %203, %206
  store i64 %207, ptr %24, align 8, !tbaa !5
  %208 = load i64, ptr %22, align 8, !tbaa !5
  %209 = add nsw i64 %208, 1
  %210 = load i64, ptr %22, align 8, !tbaa !5
  %211 = add nsw i64 %210, 2
  %212 = load i64, ptr %3, align 8, !tbaa !5
  %213 = icmp slt i64 %211, %212
  %214 = zext i1 %213 to i64
  %215 = add nsw i64 %209, %214
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %215) #5
  %217 = load i64, ptr %216, align 8, !tbaa !5
  %218 = load i64, ptr %24, align 8, !tbaa !5
  %219 = icmp sgt i64 %218, 0
  %220 = zext i1 %219 to i64
  %221 = load i64, ptr %24, align 8, !tbaa !5
  %222 = mul nsw i64 %220, %221
  %223 = add nsw i64 %217, %222
  %224 = load i64, ptr %22, align 8, !tbaa !5
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %224) #5
  store i64 %223, ptr %225, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %226

226:                                              ; preds = %200
  %227 = load i64, ptr %22, align 8, !tbaa !5
  %228 = sub nsw i64 %227, 2
  store i64 %228, ptr %22, align 8, !tbaa !5
  br label %176, !llvm.loop !13

229:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %230 = load i64, ptr %3, align 8, !tbaa !5
  %231 = sub nsw i64 %230, 3
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %231) #5
  %233 = load i64, ptr %232, align 8, !tbaa !5
  %234 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 2) #5
  %235 = load i64, ptr %234, align 8, !tbaa !5
  %236 = icmp slt i64 %233, %235
  br i1 %236, label %237, label %242

237:                                              ; preds = %229
  %238 = load i64, ptr %3, align 8, !tbaa !5
  %239 = sub nsw i64 %238, 3
  %240 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %239) #5
  %241 = load i64, ptr %240, align 8, !tbaa !5
  br label %245

242:                                              ; preds = %229
  %243 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 2) #5
  %244 = load i64, ptr %243, align 8, !tbaa !5
  br label %245

245:                                              ; preds = %242, %237
  %246 = phi i64 [ %241, %237 ], [ %244, %242 ]
  store i64 %246, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  store i64 2, ptr %26, align 8, !tbaa !5
  br label %247

247:                                              ; preds = %272, %245
  %248 = load i64, ptr %26, align 8, !tbaa !5
  %249 = add nsw i64 %248, 2
  %250 = load i64, ptr %3, align 8, !tbaa !5
  %251 = icmp slt i64 %249, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %247
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %275

253:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %254 = load i64, ptr %26, align 8, !tbaa !5
  %255 = sub nsw i64 %254, 1
  %256 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %255) #5
  %257 = load i64, ptr %256, align 8, !tbaa !5
  %258 = load i64, ptr %26, align 8, !tbaa !5
  %259 = add nsw i64 %258, 2
  %260 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %259) #5
  %261 = load i64, ptr %260, align 8, !tbaa !5
  %262 = add nsw i64 %257, %261
  store i64 %262, ptr %27, align 8, !tbaa !5
  %263 = load i64, ptr %25, align 8, !tbaa !5
  %264 = load i64, ptr %27, align 8, !tbaa !5
  %265 = icmp slt i64 %263, %264
  br i1 %265, label %266, label %268

266:                                              ; preds = %253
  %267 = load i64, ptr %25, align 8, !tbaa !5
  br label %270

268:                                              ; preds = %253
  %269 = load i64, ptr %27, align 8, !tbaa !5
  br label %270

270:                                              ; preds = %268, %266
  %271 = phi i64 [ %267, %266 ], [ %269, %268 ]
  store i64 %271, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %272

272:                                              ; preds = %270
  %273 = load i64, ptr %26, align 8, !tbaa !5
  %274 = add nsw i64 %273, 2
  store i64 %274, ptr %26, align 8, !tbaa !5
  br label %247, !llvm.loop !14

275:                                              ; preds = %252
  %276 = load i64, ptr %25, align 8, !tbaa !5
  store i64 %276, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %278

277:                                              ; preds = %122, %118
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %286

278:                                              ; preds = %275, %106
  %279 = load i64, ptr %9, align 8, !tbaa !5
  %280 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %279)
          to label %281 unwind label %282

281:                                              ; preds = %278
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %29, !llvm.loop !15

282:                                              ; preds = %278
  %283 = landingpad { ptr, i32 }
          cleanup
  %284 = extractvalue { ptr, i32 } %283, 0
  store ptr %284, ptr %6, align 8
  %285 = extractvalue { ptr, i32 } %283, 1
  store i32 %285, ptr %7, align 4
  br label %286

286:                                              ; preds = %282, %277
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %287

287:                                              ; preds = %286, %54
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %288

288:                                              ; preds = %287, %42
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %291

289:                                              ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %290 = load i32, ptr %1, align 4
  ret i32 %290

291:                                              ; preds = %288
  %292 = load ptr, ptr %6, align 8
  %293 = load i32, ptr %7, align 4
  %294 = insertvalue { ptr, i32 } poison, ptr %292, 0
  %295 = insertvalue { ptr, i32 } %294, i32 %293, 1
  resume { ptr, i32 } %295
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 = { 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 = !{!"long long", !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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %12 = load i64, ptr %1, align 8, !tbaa !5
  %13 = add nsw i64 %12, -1
  store i64 %13, ptr %1, align 8, !tbaa !5
  %.not97 = icmp eq i64 %12, 0
  br i1 %.not97, label %._crit_edge100, label %.lr.ph99

.lr.ph99:                                         ; preds = %0, %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %15 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %15, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %16 unwind label %22

16:                                               ; preds = %.lr.ph99
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %16
  %19 = phi i64 [ %17, %16 ], [ %27, %.lr.ph ]
  %20 = and i64 %19, 1
  %.not66 = icmp eq i64 %20, 0
  br i1 %.not66, label %47, label %.preheader75

.preheader75:                                     ; preds = %._crit_edge
  %21 = icmp sgt i64 %19, 1
  br i1 %21, label %.lr.ph80, label %.loopexit

22:                                               ; preds = %.lr.ph99
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %137

.lr.ph:                                           ; preds = %16, %.lr.ph
  %.05677 = phi i64 [ %26, %.lr.ph ], [ 0, %16 ]
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.05677) #6
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %24)
  %26 = add nuw nsw i64 %.05677, 1
  %27 = load i64, ptr %2, align 8, !tbaa !5
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph80:                                         ; preds = %.preheader75, %.lr.ph80
  %.05879 = phi i64 [ %43, %.lr.ph80 ], [ 0, %.preheader75 ]
  %.06078 = phi i64 [ %44, %.lr.ph80 ], [ 1, %.preheader75 ]
  %29 = add nsw i64 %.06078, -1
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %29) #6
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = add nuw nsw i64 %.06078, 1
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %32) #6
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = icmp sgt i64 %31, %34
  %. = select i1 %35, i64 %29, i64 %32
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.) #6
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = add nsw i64 %37, 1
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.06078) #6
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = sub i64 %38, %40
  %42 = call i64 @llvm.smax.i64(i64 %41, i64 0)
  %43 = add nuw nsw i64 %42, %.05879
  %44 = add nuw nsw i64 %.06078, 2
  %45 = load i64, ptr %2, align 8, !tbaa !5
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %.lr.ph80, label %.loopexit, !llvm.loop !11

47:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i64 0, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %19, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %48 unwind label %54

48:                                               ; preds = %47
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %49 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  store i64 0, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %49, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %50 unwind label %56

50:                                               ; preds = %48
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %51 = load i64, ptr %2, align 8, !tbaa !5
  %52 = icmp sgt i64 %51, 2
  br i1 %52, label %.lr.ph84, label %._crit_edge90

.preheader:                                       ; preds = %.lr.ph84
  %53 = icmp sgt i64 %80, 2
  br i1 %53, label %.lr.ph89, label %._crit_edge90

54:                                               ; preds = %47
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %133

56:                                               ; preds = %48
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %133

.lr.ph84:                                         ; preds = %50, %.lr.ph84
  %58 = phi i64 [ %79, %.lr.ph84 ], [ 2, %50 ]
  %.06182 = phi i64 [ %78, %.lr.ph84 ], [ 1, %50 ]
  %59 = add nsw i64 %.06182, -1
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %59) #6
  %61 = load i64, ptr %60, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %58) #6
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = icmp sgt i64 %61, %63
  %.111 = select i1 %64, i64 %59, i64 %58
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.111) #6
  %66 = load i64, ptr %65, align 8, !tbaa !5
  %67 = add nsw i64 %66, 1
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.06182) #6
  %69 = load i64, ptr %68, align 8, !tbaa !5
  %70 = sub i64 %67, %69
  %71 = icmp ugt i64 %.06182, 1
  %.neg = sext i1 %71 to i64
  %72 = add i64 %59, %.neg
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %72) #6
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = call i64 @llvm.smax.i64(i64 %70, i64 0)
  %76 = add nsw i64 %74, %75
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.06182) #6
  store i64 %76, ptr %77, align 8, !tbaa !5
  %78 = add nuw nsw i64 %.06182, 2
  %79 = add nuw nsw i64 %.06182, 3
  %80 = load i64, ptr %2, align 8, !tbaa !5
  %81 = icmp slt i64 %79, %80
  br i1 %81, label %.lr.ph84, label %.preheader, !llvm.loop !12

._crit_edge90.loopexit:                           ; preds = %.lr.ph89
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %._crit_edge90

._crit_edge90:                                    ; preds = %50, %._crit_edge90.loopexit, %.preheader
  %82 = phi i64 [ %.pre, %._crit_edge90.loopexit ], [ %80, %.preheader ], [ %51, %50 ]
  %83 = add nsw i64 %82, -3
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %83) #6
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 2) #6
  %87 = load i64, ptr %86, align 8, !tbaa !5
  %88 = icmp slt i64 %85, %87
  br i1 %88, label %112, label %116

.lr.ph89:                                         ; preds = %.preheader, %.lr.ph89
  %.057.in87 = phi i64 [ %.05788, %.lr.ph89 ], [ %80, %.preheader ]
  %.05788 = add nsw i64 %.057.in87, -2
  %89 = add nsw i64 %.057.in87, -3
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %89) #6
  %91 = load i64, ptr %90, align 8, !tbaa !5
  %92 = add nsw i64 %.057.in87, -1
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %92) #6
  %94 = load i64, ptr %93, align 8, !tbaa !5
  %95 = icmp sgt i64 %91, %94
  %.112 = select i1 %95, i64 %89, i64 %92
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.112) #6
  %97 = load i64, ptr %96, align 8, !tbaa !5
  %98 = add nsw i64 %97, 1
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.05788) #6
  %100 = load i64, ptr %99, align 8, !tbaa !5
  %101 = sub i64 %98, %100
  %102 = load i64, ptr %2, align 8, !tbaa !5
  %103 = icmp slt i64 %.057.in87, %102
  %104 = zext i1 %103 to i64
  %105 = add nuw nsw i64 %92, %104
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %105) #6
  %107 = load i64, ptr %106, align 8, !tbaa !5
  %108 = call i64 @llvm.smax.i64(i64 %101, i64 0)
  %109 = add nsw i64 %107, %108
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %.05788) #6
  store i64 %109, ptr %110, align 8, !tbaa !5
  %111 = icmp ugt i64 %.057.in87, 4
  br i1 %111, label %.lr.ph89, label %._crit_edge90.loopexit, !llvm.loop !13

112:                                              ; preds = %._crit_edge90
  %113 = load i64, ptr %2, align 8, !tbaa !5
  %114 = add nsw i64 %113, -3
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %114) #6
  br label %118

116:                                              ; preds = %._crit_edge90
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 2) #6
  br label %118

118:                                              ; preds = %116, %112
  %.in = phi ptr [ %115, %112 ], [ %117, %116 ]
  %119 = load i64, ptr %.in, align 8, !tbaa !5
  %120 = load i64, ptr %2, align 8, !tbaa !5
  %121 = icmp sgt i64 %120, 4
  br i1 %121, label %.lr.ph94, label %._crit_edge95

._crit_edge95:                                    ; preds = %.lr.ph94, %118
  %.053.lcssa = phi i64 [ %119, %118 ], [ %129, %.lr.ph94 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %.loopexit

.lr.ph94:                                         ; preds = %118, %.lr.ph94
  %122 = phi i64 [ %130, %.lr.ph94 ], [ 4, %118 ]
  %.05292 = phi i64 [ %122, %.lr.ph94 ], [ 2, %118 ]
  %.05391 = phi i64 [ %129, %.lr.ph94 ], [ %119, %118 ]
  %123 = add nsw i64 %.05292, -1
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %123) #6
  %125 = load i64, ptr %124, align 8, !tbaa !5
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %122) #6
  %127 = load i64, ptr %126, align 8, !tbaa !5
  %128 = add nsw i64 %127, %125
  %129 = call i64 @llvm.smin.i64(i64 %.05391, i64 %128)
  %130 = add nuw nsw i64 %122, 2
  %131 = load i64, ptr %2, align 8, !tbaa !5
  %132 = icmp slt i64 %130, %131
  br i1 %132, label %.lr.ph94, label %._crit_edge95, !llvm.loop !14

133:                                              ; preds = %56, %54
  %.pn = phi { ptr, i32 } [ %57, %56 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %137

.loopexit:                                        ; preds = %.lr.ph80, %.preheader75, %._crit_edge95
  %.159 = phi i64 [ %.053.lcssa, %._crit_edge95 ], [ 0, %.preheader75 ], [ %43, %.lr.ph80 ]
  %134 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.159)
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %135 = load i64, ptr %1, align 8, !tbaa !5
  %136 = add nsw i64 %135, -1
  store i64 %136, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %135, 0
  br i1 %.not, label %._crit_edge100, label %.lr.ph99, !llvm.loop !15

137:                                              ; preds = %133, %22
  %.pn.pn = phi { ptr, i32 } [ %.pn, %133 ], [ %23, %22 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn

._crit_edge100:                                   ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2EmRKxRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

; 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 @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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