; LLVM IR from abeaumont/competitive-programming :: codeforces/1406 (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"

%"class.std::basic_istream" = type { ptr, i64, %"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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #6
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %23, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %24 unwind label %30

24:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %25

25:                                               ; preds = %40, %24
  %26 = load i32, ptr %9, align 4, !tbaa !8
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %34, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %47

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

34:                                               ; preds = %25
  %35 = load i32, ptr %9, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %36) #6
  %38 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %37)
          to label %39 unwind label %43

39:                                               ; preds = %34
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %9, align 4, !tbaa !8
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %9, align 4, !tbaa !8
  br label %25, !llvm.loop !13

43:                                               ; preds = %34
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %6, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %305

47:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %48 = load i32, ptr %2, align 4, !tbaa !8
  %49 = sub nsw i32 %48, 1
  store i32 %49, ptr %10, align 4, !tbaa !8
  br label %50

50:                                               ; preds = %78, %47
  %51 = load i32, ptr %10, align 4, !tbaa !8
  %52 = icmp sge i32 %51, 1
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %81

54:                                               ; preds = %50
  %55 = load i32, ptr %10, align 4, !tbaa !8
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %57) #6
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = load i32, ptr %10, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %61) #6
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = sub nsw i64 %63, %59
  store i64 %64, ptr %62, align 8, !tbaa !11
  %65 = load i32, ptr %10, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %66) #6
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %69 = icmp sgt i64 %68, 0
  br i1 %69, label %70, label %77

70:                                               ; preds = %54
  %71 = load i32, ptr %10, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %72) #6
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = load i64, ptr %8, align 8, !tbaa !11
  %76 = add nsw i64 %75, %74
  store i64 %76, ptr %8, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %70, %54
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %10, align 4, !tbaa !8
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr %10, align 4, !tbaa !8
  br label %50, !llvm.loop !15

81:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #6
  %83 = load i64, ptr %82, align 8, !tbaa !11
  %84 = load i64, ptr %8, align 8, !tbaa !11
  %85 = add nsw i64 %83, %84
  store i64 %85, ptr %11, align 8, !tbaa !11
  %86 = load i64, ptr %11, align 8, !tbaa !11
  %87 = icmp sge i64 %86, 0
  br i1 %87, label %88, label %91

88:                                               ; preds = %81
  %89 = load i64, ptr %11, align 8, !tbaa !11
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %11, align 8, !tbaa !11
  br label %91

91:                                               ; preds = %88, %81
  %92 = load i64, ptr %11, align 8, !tbaa !11
  %93 = sdiv i64 %92, 2
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %93)
          to label %95 unwind label %128

95:                                               ; preds = %91
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %94, i8 noundef signext 10)
          to label %97 unwind label %128

97:                                               ; preds = %95
  %98 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %99 unwind label %128

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %301, %99
  %101 = load i32, ptr %3, align 4, !tbaa !8
  %102 = add nsw i32 %101, -1
  store i32 %102, ptr %3, align 4, !tbaa !8
  %103 = icmp ne i32 %101, 0
  br i1 %103, label %104, label %302

104:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %105 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %106 unwind label %132

106:                                              ; preds = %104
  %107 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %105, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %108 unwind label %132

108:                                              ; preds = %106
  %109 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %107, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %110 unwind label %132

110:                                              ; preds = %108
  %111 = load i32, ptr %12, align 4, !tbaa !8
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %12, align 4, !tbaa !8
  %113 = load i32, ptr %12, align 4, !tbaa !8
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %195

115:                                              ; preds = %110
  %116 = load i32, ptr %12, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %117) #6
  %119 = load i64, ptr %118, align 8, !tbaa !11
  %120 = icmp sgt i64 %119, 0
  br i1 %120, label %121, label %136

121:                                              ; preds = %115
  %122 = load i64, ptr %14, align 8, !tbaa !11
  %123 = icmp sgt i64 %122, 0
  br i1 %123, label %124, label %136

124:                                              ; preds = %121
  %125 = load i64, ptr %14, align 8, !tbaa !11
  %126 = load i64, ptr %8, align 8, !tbaa !11
  %127 = add nsw i64 %126, %125
  store i64 %127, ptr %8, align 8, !tbaa !11
  br label %194

128:                                              ; preds = %97, %95, %91
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %6, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %7, align 4
  br label %304

132:                                              ; preds = %299, %295, %108, %106, %104
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %6, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %304

136:                                              ; preds = %121, %115
  %137 = load i32, ptr %12, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %138) #6
  %140 = load i64, ptr %139, align 8, !tbaa !11
  %141 = icmp sgt i64 %140, 0
  br i1 %141, label %142, label %165

142:                                              ; preds = %136
  %143 = load i64, ptr %14, align 8, !tbaa !11
  %144 = icmp sle i64 %143, 0
  br i1 %144, label %145, label %165

145:                                              ; preds = %142
  %146 = load i32, ptr %12, align 4, !tbaa !8
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %147) #6
  %149 = load i64, ptr %148, align 8, !tbaa !11
  %150 = load i64, ptr %14, align 8, !tbaa !11
  %151 = sub nsw i64 0, %150
  %152 = icmp sgt i64 %149, %151
  br i1 %152, label %153, label %157

153:                                              ; preds = %145
  %154 = load i64, ptr %14, align 8, !tbaa !11
  %155 = load i64, ptr %8, align 8, !tbaa !11
  %156 = add nsw i64 %155, %154
  store i64 %156, ptr %8, align 8, !tbaa !11
  br label %164

157:                                              ; preds = %145
  %158 = load i32, ptr %12, align 4, !tbaa !8
  %159 = sext i32 %158 to i64
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %159) #6
  %161 = load i64, ptr %160, align 8, !tbaa !11
  %162 = load i64, ptr %8, align 8, !tbaa !11
  %163 = sub nsw i64 %162, %161
  store i64 %163, ptr %8, align 8, !tbaa !11
  br label %164

164:                                              ; preds = %157, %153
  br label %193

165:                                              ; preds = %142, %136
  %166 = load i32, ptr %12, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %167) #6
  %169 = load i64, ptr %168, align 8, !tbaa !11
  %170 = icmp sle i64 %169, 0
  br i1 %170, label %171, label %192

171:                                              ; preds = %165
  %172 = load i64, ptr %14, align 8, !tbaa !11
  %173 = icmp sgt i64 %172, 0
  br i1 %173, label %174, label %192

174:                                              ; preds = %171
  %175 = load i32, ptr %12, align 4, !tbaa !8
  %176 = sext i32 %175 to i64
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %176) #6
  %178 = load i64, ptr %177, align 8, !tbaa !11
  %179 = sub nsw i64 0, %178
  %180 = load i64, ptr %14, align 8, !tbaa !11
  %181 = icmp sle i64 %179, %180
  br i1 %181, label %182, label %191

182:                                              ; preds = %174
  %183 = load i64, ptr %14, align 8, !tbaa !11
  %184 = load i32, ptr %12, align 4, !tbaa !8
  %185 = sext i32 %184 to i64
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %185) #6
  %187 = load i64, ptr %186, align 8, !tbaa !11
  %188 = add nsw i64 %183, %187
  %189 = load i64, ptr %8, align 8, !tbaa !11
  %190 = add nsw i64 %189, %188
  store i64 %190, ptr %8, align 8, !tbaa !11
  br label %191

191:                                              ; preds = %182, %174
  br label %192

192:                                              ; preds = %191, %171, %165
  br label %193

193:                                              ; preds = %192, %164
  br label %194

194:                                              ; preds = %193, %124
  br label %195

195:                                              ; preds = %194, %110
  %196 = load i64, ptr %14, align 8, !tbaa !11
  %197 = load i32, ptr %12, align 4, !tbaa !8
  %198 = sext i32 %197 to i64
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %198) #6
  %200 = load i64, ptr %199, align 8, !tbaa !11
  %201 = add nsw i64 %200, %196
  store i64 %201, ptr %199, align 8, !tbaa !11
  %202 = load i32, ptr %13, align 4, !tbaa !8
  %203 = load i32, ptr %2, align 4, !tbaa !8
  %204 = icmp slt i32 %202, %203
  br i1 %204, label %205, label %285

205:                                              ; preds = %195
  %206 = load i64, ptr %14, align 8, !tbaa !11
  %207 = sub nsw i64 0, %206
  store i64 %207, ptr %14, align 8, !tbaa !11
  %208 = load i32, ptr %13, align 4, !tbaa !8
  %209 = sext i32 %208 to i64
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %209) #6
  %211 = load i64, ptr %210, align 8, !tbaa !11
  %212 = icmp sgt i64 %211, 0
  br i1 %212, label %213, label %220

213:                                              ; preds = %205
  %214 = load i64, ptr %14, align 8, !tbaa !11
  %215 = icmp sgt i64 %214, 0
  br i1 %215, label %216, label %220

216:                                              ; preds = %213
  %217 = load i64, ptr %14, align 8, !tbaa !11
  %218 = load i64, ptr %8, align 8, !tbaa !11
  %219 = add nsw i64 %218, %217
  store i64 %219, ptr %8, align 8, !tbaa !11
  br label %278

220:                                              ; preds = %213, %205
  %221 = load i32, ptr %13, align 4, !tbaa !8
  %222 = sext i32 %221 to i64
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %222) #6
  %224 = load i64, ptr %223, align 8, !tbaa !11
  %225 = icmp sgt i64 %224, 0
  br i1 %225, label %226, label %249

226:                                              ; preds = %220
  %227 = load i64, ptr %14, align 8, !tbaa !11
  %228 = icmp sle i64 %227, 0
  br i1 %228, label %229, label %249

229:                                              ; preds = %226
  %230 = load i32, ptr %13, align 4, !tbaa !8
  %231 = sext i32 %230 to i64
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %231) #6
  %233 = load i64, ptr %232, align 8, !tbaa !11
  %234 = load i64, ptr %14, align 8, !tbaa !11
  %235 = sub nsw i64 0, %234
  %236 = icmp sgt i64 %233, %235
  br i1 %236, label %237, label %241

237:                                              ; preds = %229
  %238 = load i64, ptr %14, align 8, !tbaa !11
  %239 = load i64, ptr %8, align 8, !tbaa !11
  %240 = add nsw i64 %239, %238
  store i64 %240, ptr %8, align 8, !tbaa !11
  br label %248

241:                                              ; preds = %229
  %242 = load i32, ptr %13, align 4, !tbaa !8
  %243 = sext i32 %242 to i64
  %244 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %243) #6
  %245 = load i64, ptr %244, align 8, !tbaa !11
  %246 = load i64, ptr %8, align 8, !tbaa !11
  %247 = sub nsw i64 %246, %245
  store i64 %247, ptr %8, align 8, !tbaa !11
  br label %248

248:                                              ; preds = %241, %237
  br label %277

249:                                              ; preds = %226, %220
  %250 = load i32, ptr %13, align 4, !tbaa !8
  %251 = sext i32 %250 to i64
  %252 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %251) #6
  %253 = load i64, ptr %252, align 8, !tbaa !11
  %254 = icmp sle i64 %253, 0
  br i1 %254, label %255, label %276

255:                                              ; preds = %249
  %256 = load i64, ptr %14, align 8, !tbaa !11
  %257 = icmp sgt i64 %256, 0
  br i1 %257, label %258, label %276

258:                                              ; preds = %255
  %259 = load i32, ptr %13, align 4, !tbaa !8
  %260 = sext i32 %259 to i64
  %261 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %260) #6
  %262 = load i64, ptr %261, align 8, !tbaa !11
  %263 = sub nsw i64 0, %262
  %264 = load i64, ptr %14, align 8, !tbaa !11
  %265 = icmp slt i64 %263, %264
  br i1 %265, label %266, label %275

266:                                              ; preds = %258
  %267 = load i64, ptr %14, align 8, !tbaa !11
  %268 = load i32, ptr %13, align 4, !tbaa !8
  %269 = sext i32 %268 to i64
  %270 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %269) #6
  %271 = load i64, ptr %270, align 8, !tbaa !11
  %272 = add nsw i64 %267, %271
  %273 = load i64, ptr %8, align 8, !tbaa !11
  %274 = add nsw i64 %273, %272
  store i64 %274, ptr %8, align 8, !tbaa !11
  br label %275

275:                                              ; preds = %266, %258
  br label %276

276:                                              ; preds = %275, %255, %249
  br label %277

277:                                              ; preds = %276, %248
  br label %278

278:                                              ; preds = %277, %216
  %279 = load i64, ptr %14, align 8, !tbaa !11
  %280 = load i32, ptr %13, align 4, !tbaa !8
  %281 = sext i32 %280 to i64
  %282 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %281) #6
  %283 = load i64, ptr %282, align 8, !tbaa !11
  %284 = add nsw i64 %283, %279
  store i64 %284, ptr %282, align 8, !tbaa !11
  br label %285

285:                                              ; preds = %278, %195
  %286 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0) #6
  %287 = load i64, ptr %286, align 8, !tbaa !11
  %288 = load i64, ptr %8, align 8, !tbaa !11
  %289 = add nsw i64 %287, %288
  store i64 %289, ptr %11, align 8, !tbaa !11
  %290 = load i64, ptr %11, align 8, !tbaa !11
  %291 = icmp sge i64 %290, 0
  br i1 %291, label %292, label %295

292:                                              ; preds = %285
  %293 = load i64, ptr %11, align 8, !tbaa !11
  %294 = add nsw i64 %293, 1
  store i64 %294, ptr %11, align 8, !tbaa !11
  br label %295

295:                                              ; preds = %292, %285
  %296 = load i64, ptr %11, align 8, !tbaa !11
  %297 = sdiv i64 %296, 2
  %298 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %297)
          to label %299 unwind label %132

299:                                              ; preds = %295
  %300 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %298, i8 noundef signext 10)
          to label %301 unwind label %132

301:                                              ; preds = %299
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %100, !llvm.loop !16

302:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %303 = load i32, ptr %1, align 4
  ret i32 %303

304:                                              ; preds = %132, %128
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %305

305:                                              ; preds = %304, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %306

306:                                              ; preds = %305, %30
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %307

307:                                              ; preds = %306
  %308 = load ptr, ptr %6, align 8
  %309 = load i32, ptr %7, align 4
  %310 = insertvalue { ptr, i32 } poison, ptr %308, 0
  %311 = insertvalue { ptr, i32 } %310, i32 %309, 1
  resume { ptr, i32 } %311
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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) #3

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

; 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) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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::basic_istream" = type { ptr, i64, %"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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %15 = load i32, ptr %1, align 4, !tbaa !8
  %16 = sext i32 %15 to i64
  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 %16, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %17 unwind label %22

17:                                               ; preds = %0
  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
  %18 = load i32, ptr %1, align 4, !tbaa !8
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.preheader66:                                     ; preds = %26
  %20 = icmp sgt i32 %27, 1
  br i1 %20, label %.lr.ph73.preheader, label %._crit_edge

.lr.ph73.preheader:                               ; preds = %.preheader66
  %21 = zext nneg i32 %27 to i64
  br label %.lr.ph73

22:                                               ; preds = %0
  %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 %208

.lr.ph:                                           ; preds = %17, %26
  %indvars.iv = phi i64 [ %indvars.iv.next, %26 ], [ 0, %17 ]
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #6
  %25 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %26 unwind label %30

26:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr %1, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %.lr.ph, label %.preheader66, !llvm.loop !11

30:                                               ; preds = %.lr.ph
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %207

._crit_edge:                                      ; preds = %52, %17, %.preheader66
  %.041.lcssa = phi i64 [ 0, %.preheader66 ], [ 0, %17 ], [ %.142, %52 ]
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %33 = load i64, ptr %32, align 8, !tbaa !13
  %34 = add nsw i64 %33, %.041.lcssa
  %35 = icmp sgt i64 %34, -1
  %36 = zext i1 %35 to i64
  %spec.select = add nuw nsw i64 %34, %36
  %37 = sdiv i64 %spec.select, 2
  %38 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %37)
          to label %54 unwind label %77

.lr.ph73:                                         ; preds = %.lr.ph73.preheader, %52
  %indvars.iv81 = phi i64 [ %21, %.lr.ph73.preheader ], [ %indvars.iv.next82, %52 ]
  %.04170 = phi i64 [ 0, %.lr.ph73.preheader ], [ %.142, %52 ]
  %indvars.iv.next82 = add nsw i64 %indvars.iv81, -1
  %39 = add nsw i64 %indvars.iv81, -2
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %39) #6
  %41 = load i64, ptr %40, align 8, !tbaa !13
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv.next82) #6
  %43 = load i64, ptr %42, align 8, !tbaa !13
  %44 = sub nsw i64 %43, %41
  store i64 %44, ptr %42, align 8, !tbaa !13
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv.next82) #6
  %46 = load i64, ptr %45, align 8, !tbaa !13
  %47 = icmp sgt i64 %46, 0
  br i1 %47, label %48, label %52

48:                                               ; preds = %.lr.ph73
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv.next82) #6
  %50 = load i64, ptr %49, align 8, !tbaa !13
  %51 = add nsw i64 %50, %.04170
  br label %52

52:                                               ; preds = %.lr.ph73, %48
  %.142 = phi i64 [ %51, %48 ], [ %.04170, %.lr.ph73 ]
  %53 = icmp ugt i64 %indvars.iv81, 2
  br i1 %53, label %.lr.ph73, label %._crit_edge, !llvm.loop !15

54:                                               ; preds = %._crit_edge
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %38, i8 noundef signext 10)
          to label %56 unwind label %77

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %.preheader unwind label %77

.preheader:                                       ; preds = %56
  %58 = load i32, ptr %2, align 4, !tbaa !8
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %2, align 4, !tbaa !8
  %.not75 = icmp eq i32 %58, 0
  br i1 %.not75, label %._crit_edge78, label %.lr.ph77

.lr.ph77:                                         ; preds = %.preheader, %204
  %.276 = phi i64 [ %.5, %204 ], [ %.041.lcssa, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %60 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %61 unwind label %79

61:                                               ; preds = %.lr.ph77
  %62 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %63 unwind label %79

63:                                               ; preds = %61
  %64 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %62, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %65 unwind label %79

65:                                               ; preds = %63
  %66 = load i32, ptr %5, align 4, !tbaa !8
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %5, align 4, !tbaa !8
  %.not59 = icmp eq i32 %67, 0
  br i1 %.not59, label %123, label %68

68:                                               ; preds = %65
  %69 = sext i32 %67 to i64
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %69) #6
  %71 = load i64, ptr %70, align 8, !tbaa !13
  %72 = icmp sgt i64 %71, 0
  %73 = load i64, ptr %7, align 8
  %74 = icmp sgt i64 %73, 0
  %or.cond = select i1 %72, i1 %74, i1 false
  br i1 %or.cond, label %75, label %81

75:                                               ; preds = %68
  %76 = add nsw i64 %73, %.276
  br label %123

77:                                               ; preds = %56, %54, %._crit_edge
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %207

79:                                               ; preds = %202, %194, %63, %61, %.lr.ph77
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %207

81:                                               ; preds = %68
  %82 = load i32, ptr %5, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %83) #6
  %85 = load i64, ptr %84, align 8, !tbaa !13
  %86 = icmp sgt i64 %85, 0
  %87 = load i64, ptr %7, align 8
  %88 = icmp slt i64 %87, 1
  %or.cond3 = select i1 %86, i1 %88, i1 false
  %89 = load i32, ptr %5, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %90) #6
  %92 = load i64, ptr %91, align 8, !tbaa !13
  br i1 %or.cond3, label %93, label %105

93:                                               ; preds = %81
  %94 = load i64, ptr %7, align 8, !tbaa !13
  %95 = sub nsw i64 0, %94
  %96 = icmp sgt i64 %92, %95
  br i1 %96, label %97, label %99

97:                                               ; preds = %93
  %98 = add nsw i64 %94, %.276
  br label %123

99:                                               ; preds = %93
  %100 = load i32, ptr %5, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %101) #6
  %103 = load i64, ptr %102, align 8, !tbaa !13
  %104 = sub nsw i64 %.276, %103
  br label %123

105:                                              ; preds = %81
  %106 = icmp slt i64 %92, 1
  %107 = load i64, ptr %7, align 8
  %108 = icmp sgt i64 %107, 0
  %or.cond5 = select i1 %106, i1 %108, i1 false
  br i1 %or.cond5, label %109, label %123

109:                                              ; preds = %105
  %110 = load i32, ptr %5, align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %111) #6
  %113 = load i64, ptr %112, align 8, !tbaa !13
  %114 = sub nsw i64 0, %113
  %115 = load i64, ptr %7, align 8, !tbaa !13
  %.not60 = icmp slt i64 %115, %114
  br i1 %.not60, label %123, label %116

116:                                              ; preds = %109
  %117 = load i32, ptr %5, align 4, !tbaa !8
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %118) #6
  %120 = load i64, ptr %119, align 8, !tbaa !13
  %121 = add i64 %115, %.276
  %122 = add i64 %121, %120
  br label %123

123:                                              ; preds = %75, %105, %116, %109, %97, %99, %65
  %.3 = phi i64 [ %76, %75 ], [ %98, %97 ], [ %104, %99 ], [ %122, %116 ], [ %.276, %109 ], [ %.276, %105 ], [ %.276, %65 ]
  %124 = load i64, ptr %7, align 8, !tbaa !13
  %125 = load i32, ptr %5, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %126) #6
  %128 = load i64, ptr %127, align 8, !tbaa !13
  %129 = add nsw i64 %128, %124
  store i64 %129, ptr %127, align 8, !tbaa !13
  %130 = load i32, ptr %6, align 4, !tbaa !8
  %131 = load i32, ptr %1, align 4, !tbaa !8
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %194

133:                                              ; preds = %123
  %134 = load i64, ptr %7, align 8, !tbaa !13
  %135 = sub nsw i64 0, %134
  store i64 %135, ptr %7, align 8, !tbaa !13
  %136 = sext i32 %130 to i64
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %136) #6
  %138 = load i64, ptr %137, align 8, !tbaa !13
  %139 = icmp sgt i64 %138, 0
  %140 = load i64, ptr %7, align 8
  %141 = icmp sgt i64 %140, 0
  %or.cond7 = select i1 %139, i1 %141, i1 false
  br i1 %or.cond7, label %142, label %144

142:                                              ; preds = %133
  %143 = add nsw i64 %140, %.3
  br label %187

144:                                              ; preds = %133
  %145 = load i32, ptr %6, align 4, !tbaa !8
  %146 = sext i32 %145 to i64
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %146) #6
  %148 = load i64, ptr %147, align 8, !tbaa !13
  %149 = icmp sgt i64 %148, 0
  %150 = load i64, ptr %7, align 8
  %151 = icmp slt i64 %150, 1
  %or.cond9 = select i1 %149, i1 %151, i1 false
  %152 = load i32, ptr %6, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %153) #6
  %155 = load i64, ptr %154, align 8, !tbaa !13
  br i1 %or.cond9, label %156, label %168

156:                                              ; preds = %144
  %157 = load i64, ptr %7, align 8, !tbaa !13
  %158 = sub nsw i64 0, %157
  %159 = icmp sgt i64 %155, %158
  br i1 %159, label %160, label %162

160:                                              ; preds = %156
  %161 = add nsw i64 %157, %.3
  br label %187

162:                                              ; preds = %156
  %163 = load i32, ptr %6, align 4, !tbaa !8
  %164 = sext i32 %163 to i64
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %164) #6
  %166 = load i64, ptr %165, align 8, !tbaa !13
  %167 = sub nsw i64 %.3, %166
  br label %187

168:                                              ; preds = %144
  %169 = icmp slt i64 %155, 1
  %170 = load i64, ptr %7, align 8
  %171 = icmp sgt i64 %170, 0
  %or.cond11 = select i1 %169, i1 %171, i1 false
  br i1 %or.cond11, label %172, label %187

172:                                              ; preds = %168
  %173 = load i32, ptr %6, align 4, !tbaa !8
  %174 = sext i32 %173 to i64
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %174) #6
  %176 = load i64, ptr %175, align 8, !tbaa !13
  %177 = sub nsw i64 0, %176
  %178 = load i64, ptr %7, align 8, !tbaa !13
  %179 = icmp sgt i64 %178, %177
  br i1 %179, label %180, label %187

180:                                              ; preds = %172
  %181 = load i32, ptr %6, align 4, !tbaa !8
  %182 = sext i32 %181 to i64
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %182) #6
  %184 = load i64, ptr %183, align 8, !tbaa !13
  %185 = add i64 %178, %.3
  %186 = add i64 %185, %184
  br label %187

187:                                              ; preds = %162, %160, %172, %180, %168, %142
  %.4 = phi i64 [ %143, %142 ], [ %161, %160 ], [ %167, %162 ], [ %186, %180 ], [ %.3, %172 ], [ %.3, %168 ]
  %188 = load i64, ptr %7, align 8, !tbaa !13
  %189 = load i32, ptr %6, align 4, !tbaa !8
  %190 = sext i32 %189 to i64
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %190) #6
  %192 = load i64, ptr %191, align 8, !tbaa !13
  %193 = add nsw i64 %192, %188
  store i64 %193, ptr %191, align 8, !tbaa !13
  br label %194

194:                                              ; preds = %187, %123
  %.5 = phi i64 [ %.4, %187 ], [ %.3, %123 ]
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %196 = load i64, ptr %195, align 8, !tbaa !13
  %197 = add nsw i64 %196, %.5
  %198 = icmp sgt i64 %197, -1
  %199 = zext i1 %198 to i64
  %spec.select65 = add nuw nsw i64 %197, %199
  %200 = sdiv i64 %spec.select65, 2
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %200)
          to label %202 unwind label %79

202:                                              ; preds = %194
  %203 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %201, i8 noundef signext 10)
          to label %204 unwind label %79

204:                                              ; preds = %202
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %205 = load i32, ptr %2, align 4, !tbaa !8
  %206 = add nsw i32 %205, -1
  store i32 %206, ptr %2, align 4, !tbaa !8
  %.not = icmp eq i32 %205, 0
  br i1 %.not, label %._crit_edge78, label %.lr.ph77, !llvm.loop !16

._crit_edge78:                                    ; preds = %204, %.preheader
  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 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

207:                                              ; preds = %77, %79, %30
  %.pn62 = phi { ptr, i32 } [ %31, %30 ], [ %80, %79 ], [ %78, %77 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %208

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) 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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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) #3

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

; 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 #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; 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 #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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