; LLVM IR from abeaumont/competitive-programming :: codeforces/1304 (e)

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

@INF = external dso_local global i64, align 8
@n = external dso_local global i64, align 8
@q = external dso_local global i64, align 8
@u = external dso_local global i64, align 8
@v = external dso_local global i64, align 8
@a = external dso_local global %"class.std::vector", align 8
@d = external dso_local global %"class.std::vector", align 8
@g = external dso_local global %"class.std::vector.0", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsxx(i64 noundef, i64 noundef) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9ancestorsv() #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4distxx(i64 noundef, i64 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector.0", align 8
  %3 = alloca %"class.std::allocator.2", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"class.std::initializer_list", align 8
  %25 = alloca [3 x i64], align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %29 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %30 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %31 = getelementptr i8, ptr %30, i64 -24
  %32 = load i64, ptr %31, align 8
  %33 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %32
  %34 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %33, ptr noundef null)
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #7
  %36 = load i64, ptr @n, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  call void @_ZNSaISt6vectorIxSaIxEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt6vectorIS_IxSaIxEESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %36, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %37 unwind label %51

37:                                               ; preds = %0
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(24) @g, ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  %39 = load i64, ptr @n, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %39, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %40 unwind label %55

40:                                               ; preds = %37
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @a, ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  %42 = load i64, ptr @n, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %42, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %43 unwind label %59

43:                                               ; preds = %40
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @d, ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %45

45:                                               ; preds = %74, %43
  %46 = load i64, ptr %10, align 8, !tbaa !8
  %47 = load i64, ptr @n, align 8, !tbaa !8
  %48 = sub nsw i64 %47, 1
  %49 = icmp slt i64 %46, %48
  br i1 %49, label %63, label %50

50:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %77

51:                                               ; preds = %0
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %4, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %5, align 4
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  br label %173

55:                                               ; preds = %37
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %4, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  br label %173

59:                                               ; preds = %40
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %4, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  br label %173

63:                                               ; preds = %45
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @u)
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 8 dereferenceable(8) @v)
  %66 = load i64, ptr @u, align 8, !tbaa !8
  %67 = add nsw i64 %66, -1
  store i64 %67, ptr @u, align 8, !tbaa !8
  %68 = load i64, ptr @v, align 8, !tbaa !8
  %69 = add nsw i64 %68, -1
  store i64 %69, ptr @v, align 8, !tbaa !8
  %70 = load i64, ptr @u, align 8, !tbaa !8
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %70) #7
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 8 dereferenceable(8) @v)
  %72 = load i64, ptr @v, align 8, !tbaa !8
  %73 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %72) #7
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %73, ptr noundef nonnull align 8 dereferenceable(8) @u)
  br label %74

74:                                               ; preds = %63
  %75 = load i64, ptr %10, align 8, !tbaa !8
  %76 = add nsw i64 %75, 1
  store i64 %76, ptr %10, align 8, !tbaa !8
  br label %45, !llvm.loop !11

77:                                               ; preds = %50
  call void @_Z3dfsxx(i64 noundef 0, i64 noundef -1)
  call void @_Z9ancestorsv()
  %78 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @q)
  br label %79

79:                                               ; preds = %170, %77
  %80 = load i64, ptr @q, align 8, !tbaa !8
  %81 = add nsw i64 %80, -1
  store i64 %81, ptr @q, align 8, !tbaa !8
  %82 = icmp ne i64 %80, 0
  br i1 %82, label %83, label %171

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %84, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %85, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %86, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %87, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %89 = load i64, ptr %11, align 8, !tbaa !8
  %90 = add nsw i64 %89, -1
  store i64 %90, ptr %11, align 8, !tbaa !8
  %91 = load i64, ptr %12, align 8, !tbaa !8
  %92 = add nsw i64 %91, -1
  store i64 %92, ptr %12, align 8, !tbaa !8
  %93 = load i64, ptr %13, align 8, !tbaa !8
  %94 = add nsw i64 %93, -1
  store i64 %94, ptr %13, align 8, !tbaa !8
  %95 = load i64, ptr %14, align 8, !tbaa !8
  %96 = add nsw i64 %95, -1
  store i64 %96, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %97 = load i64, ptr %13, align 8, !tbaa !8
  %98 = load i64, ptr %14, align 8, !tbaa !8
  %99 = call noundef i64 @_Z4distxx(i64 noundef %97, i64 noundef %98)
  store i64 %99, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %100 = load i64, ptr %13, align 8, !tbaa !8
  %101 = load i64, ptr %11, align 8, !tbaa !8
  %102 = call noundef i64 @_Z4distxx(i64 noundef %100, i64 noundef %101)
  store i64 %102, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %103 = load i64, ptr %13, align 8, !tbaa !8
  %104 = load i64, ptr %12, align 8, !tbaa !8
  %105 = call noundef i64 @_Z4distxx(i64 noundef %103, i64 noundef %104)
  store i64 %105, ptr %18, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %106 = load i64, ptr %14, align 8, !tbaa !8
  %107 = load i64, ptr %11, align 8, !tbaa !8
  %108 = call noundef i64 @_Z4distxx(i64 noundef %106, i64 noundef %107)
  store i64 %108, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %109 = load i64, ptr %14, align 8, !tbaa !8
  %110 = load i64, ptr %12, align 8, !tbaa !8
  %111 = call noundef i64 @_Z4distxx(i64 noundef %109, i64 noundef %110)
  store i64 %111, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %112 = load i64, ptr @INF, align 8, !tbaa !8
  store i64 %112, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %113 = load i64, ptr @INF, align 8, !tbaa !8
  store i64 %113, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #7
  %114 = load i64, ptr %16, align 8, !tbaa !8
  store i64 %114, ptr %25, align 8, !tbaa !8
  %115 = getelementptr inbounds i64, ptr %25, i64 1
  %116 = load i64, ptr %17, align 8, !tbaa !8
  %117 = add nsw i64 %116, 1
  %118 = load i64, ptr %20, align 8, !tbaa !8
  %119 = add nsw i64 %117, %118
  store i64 %119, ptr %115, align 8, !tbaa !8
  %120 = getelementptr inbounds i64, ptr %25, i64 2
  %121 = load i64, ptr %18, align 8, !tbaa !8
  %122 = add nsw i64 %121, 1
  %123 = load i64, ptr %19, align 8, !tbaa !8
  %124 = add nsw i64 %122, %123
  store i64 %124, ptr %120, align 8, !tbaa !8
  %125 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 0
  store ptr %25, ptr %125, align 8, !tbaa !13
  %126 = getelementptr inbounds %"class.std::initializer_list", ptr %24, i32 0, i32 1
  store i64 3, ptr %126, align 8, !tbaa !17
  store ptr %24, ptr %23, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %127 = load ptr, ptr %23, align 8, !tbaa !18
  %128 = call noundef ptr @_ZNKSt16initializer_listIxE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %127) #7
  store ptr %128, ptr %26, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %129 = load ptr, ptr %23, align 8, !tbaa !18
  %130 = call noundef ptr @_ZNKSt16initializer_listIxE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %129) #7
  store ptr %130, ptr %27, align 8, !tbaa !18
  br label %131

131:                                              ; preds = %149, %83
  %132 = load ptr, ptr %26, align 8, !tbaa !18
  %133 = load ptr, ptr %27, align 8, !tbaa !18
  %134 = icmp ne ptr %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %152

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %137 = load ptr, ptr %26, align 8, !tbaa !18
  %138 = load i64, ptr %137, align 8, !tbaa !8
  store i64 %138, ptr %28, align 8, !tbaa !8
  %139 = load i64, ptr %28, align 8, !tbaa !8
  %140 = srem i64 %139, 2
  %141 = icmp eq i64 %140, 0
  br i1 %141, label %142, label %145

142:                                              ; preds = %136
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %144 = load i64, ptr %143, align 8, !tbaa !8
  store i64 %144, ptr %21, align 8, !tbaa !8
  br label %148

145:                                              ; preds = %136
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %147 = load i64, ptr %146, align 8, !tbaa !8
  store i64 %147, ptr %22, align 8, !tbaa !8
  br label %148

148:                                              ; preds = %145, %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %26, align 8, !tbaa !18
  %151 = getelementptr inbounds i64, ptr %150, i32 1
  store ptr %151, ptr %26, align 8, !tbaa !18
  br label %131

152:                                              ; preds = %135
  %153 = load i64, ptr %15, align 8, !tbaa !8
  %154 = srem i64 %153, 2
  %155 = icmp eq i64 %154, 0
  br i1 %155, label %156, label %163

156:                                              ; preds = %152
  %157 = load i64, ptr %15, align 8, !tbaa !8
  %158 = load i64, ptr %21, align 8, !tbaa !8
  %159 = icmp sge i64 %157, %158
  %160 = zext i1 %159 to i64
  %161 = select i1 %159, ptr @.str, ptr @.str.5
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %161)
  br label %170

163:                                              ; preds = %152
  %164 = load i64, ptr %15, align 8, !tbaa !8
  %165 = load i64, ptr %22, align 8, !tbaa !8
  %166 = icmp sge i64 %164, %165
  %167 = zext i1 %166 to i64
  %168 = select i1 %166, ptr @.str, ptr @.str.5
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %168)
  br label %170

170:                                              ; preds = %163, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %79, !llvm.loop !19

171:                                              ; preds = %79
  %172 = load i32, ptr %1, align 4
  ret i32 %172

173:                                              ; preds = %59, %55, %51
  %174 = load ptr, ptr %4, align 8
  %175 = load i32, ptr %5, align 4
  %176 = insertvalue { ptr, i32 } poison, ptr %174, 0
  %177 = insertvalue { ptr, i32 } %176, i32 %175, 1
  resume { ptr, i32 } %177
}

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

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

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

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

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

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


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

%"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::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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::allocator.2" = type { i8 }
%"class.std::allocator" = type { i8 }
%"class.std::initializer_list" = type { ptr, i64 }

@INF = external dso_local local_unnamed_addr global i64, align 8
@n = external dso_local global i64, align 8
@q = external dso_local global i64, align 8
@u = external dso_local global i64, align 8
@v = external dso_local global i64, align 8
@a = external dso_local global %"class.std::vector", align 8
@d = external dso_local global %"class.std::vector", align 8
@g = external dso_local global %"class.std::vector.0", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsxx(i64 noundef, i64 noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9ancestorsv() local_unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4distxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector.0", align 8
  %2 = alloca %"class.std::allocator.2", align 1
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca i64, align 8
  %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 i64, align 8
  %14 = alloca %"class.std::initializer_list", align 8
  %15 = alloca [3 x i64], align 8
  %16 = alloca i64, align 8
  %17 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  %24 = load i64, ptr @n, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #7
  call void @_ZNSaISt6vectorIxSaIxEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  invoke void @_ZNSt6vectorIS_IxSaIxEESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %24, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %25 unwind label %41

25:                                               ; preds = %0
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(24) @g, ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %27 = load i64, ptr @n, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %27, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %28 unwind label %43

28:                                               ; preds = %25
  %29 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @a, ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  %30 = load i64, ptr @n, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSaIxEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt6vectorIxSaIxEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %30, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %31 unwind label %45

31:                                               ; preds = %28
  %32 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @d, ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  %33 = load i64, ptr @n, align 8, !tbaa !8
  %34 = icmp sgt i64 %33, 1
  br i1 %34, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %31
  call void @_Z3dfsxx(i64 noundef 0, i64 noundef -1)
  call void @_Z9ancestorsv()
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @q)
  %36 = load i64, ptr @q, align 8, !tbaa !8
  %37 = add nsw i64 %36, -1
  store i64 %37, ptr @q, align 8, !tbaa !8
  %.not28 = icmp eq i64 %36, 0
  br i1 %.not28, label %._crit_edge31, label %.lr.ph30

.lr.ph30:                                         ; preds = %._crit_edge
  %38 = getelementptr inbounds i8, ptr %15, i64 8
  %39 = getelementptr inbounds i8, ptr %15, i64 16
  %40 = getelementptr inbounds i8, ptr %14, i64 8
  br label %60

41:                                               ; preds = %0
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt6vectorIxSaIxEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  br label %114

43:                                               ; preds = %25
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %114

45:                                               ; preds = %28
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIxED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %114

.lr.ph:                                           ; preds = %31, %.lr.ph
  %.01722 = phi i64 [ %56, %.lr.ph ], [ 0, %31 ]
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @u)
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(8) @v)
  %49 = load i64, ptr @u, align 8, !tbaa !8
  %50 = add nsw i64 %49, -1
  store i64 %50, ptr @u, align 8, !tbaa !8
  %51 = load i64, ptr @v, align 8, !tbaa !8
  %52 = add nsw i64 %51, -1
  store i64 %52, ptr @v, align 8, !tbaa !8
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %50) #7
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %53, ptr noundef nonnull align 8 dereferenceable(8) @v)
  %54 = load i64, ptr @v, align 8, !tbaa !8
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @g, i64 noundef %54) #7
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 8 dereferenceable(8) @u)
  %56 = add nuw nsw i64 %.01722, 1
  %57 = load i64, ptr @n, align 8, !tbaa !8
  %58 = add nsw i64 %57, -1
  %59 = icmp slt i64 %56, %58
  br i1 %59, label %.lr.ph, label %._crit_edge, !llvm.loop !11

60:                                               ; preds = %.lr.ph30, %._crit_edge27
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %61, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %62, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %64, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %66 = load i64, ptr %7, align 8, !tbaa !8
  %67 = add nsw i64 %66, -1
  store i64 %67, ptr %7, align 8, !tbaa !8
  %68 = load i64, ptr %8, align 8, !tbaa !8
  %69 = add nsw i64 %68, -1
  store i64 %69, ptr %8, align 8, !tbaa !8
  %70 = load i64, ptr %9, align 8, !tbaa !8
  %71 = add nsw i64 %70, -1
  store i64 %71, ptr %9, align 8, !tbaa !8
  %72 = load i64, ptr %10, align 8, !tbaa !8
  %73 = add nsw i64 %72, -1
  store i64 %73, ptr %10, align 8, !tbaa !8
  %74 = call noundef i64 @_Z4distxx(i64 noundef %71, i64 noundef %73)
  %75 = load i64, ptr %9, align 8, !tbaa !8
  %76 = load i64, ptr %7, align 8, !tbaa !8
  %77 = call noundef i64 @_Z4distxx(i64 noundef %75, i64 noundef %76)
  %78 = load i64, ptr %9, align 8, !tbaa !8
  %79 = load i64, ptr %8, align 8, !tbaa !8
  %80 = call noundef i64 @_Z4distxx(i64 noundef %78, i64 noundef %79)
  %81 = load i64, ptr %10, align 8, !tbaa !8
  %82 = load i64, ptr %7, align 8, !tbaa !8
  %83 = call noundef i64 @_Z4distxx(i64 noundef %81, i64 noundef %82)
  %84 = load i64, ptr %10, align 8, !tbaa !8
  %85 = load i64, ptr %8, align 8, !tbaa !8
  %86 = call noundef i64 @_Z4distxx(i64 noundef %84, i64 noundef %85)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %87 = load i64, ptr @INF, align 8, !tbaa !8
  store i64 %87, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  store i64 %87, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #7
  store i64 %74, ptr %15, align 8, !tbaa !8
  %88 = add nsw i64 %77, 1
  %89 = add nsw i64 %88, %86
  store i64 %89, ptr %38, align 8, !tbaa !8
  %90 = add nsw i64 %80, 1
  %91 = add nsw i64 %90, %83
  store i64 %91, ptr %39, align 8, !tbaa !8
  store ptr %15, ptr %14, align 8, !tbaa !13
  store i64 3, ptr %40, align 8, !tbaa !17
  %92 = call noundef ptr @_ZNKSt16initializer_listIxE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  %93 = call noundef ptr @_ZNKSt16initializer_listIxE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  %.not1923 = icmp eq ptr %92, %93
  br i1 %.not1923, label %._crit_edge27, label %.lr.ph26

._crit_edge27:                                    ; preds = %112, %60
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  %94 = load i64, ptr %11, align 8, !tbaa !8
  %95 = and i64 %94, 1
  %96 = icmp eq i64 %95, 0
  %97 = load i64, ptr %13, align 8
  %98 = load i64, ptr %12, align 8
  %.sink = select i1 %96, i64 %98, i64 %97
  %.not20 = icmp slt i64 %94, %.sink
  %99 = select i1 %.not20, ptr @.str.5, ptr @.str
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %99)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %101 = load i64, ptr @q, align 8, !tbaa !8
  %102 = add nsw i64 %101, -1
  store i64 %102, ptr @q, align 8, !tbaa !8
  %.not = icmp eq i64 %101, 0
  br i1 %.not, label %._crit_edge31, label %60, !llvm.loop !18

.lr.ph26:                                         ; preds = %60, %112
  %.01524 = phi ptr [ %113, %112 ], [ %92, %60 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %103 = load i64, ptr %.01524, align 8, !tbaa !8
  store i64 %103, ptr %16, align 8, !tbaa !8
  %104 = and i64 %103, 1
  %105 = icmp eq i64 %104, 0
  br i1 %105, label %106, label %109

106:                                              ; preds = %.lr.ph26
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %108 = load i64, ptr %107, align 8, !tbaa !8
  store i64 %108, ptr %12, align 8, !tbaa !8
  br label %112

109:                                              ; preds = %.lr.ph26
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %111 = load i64, ptr %110, align 8, !tbaa !8
  store i64 %111, ptr %13, align 8, !tbaa !8
  br label %112

112:                                              ; preds = %109, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  %113 = getelementptr inbounds i8, ptr %.01524, i64 8
  %.not19 = icmp eq ptr %113, %93
  br i1 %.not19, label %._crit_edge27, label %.lr.ph26

._crit_edge31:                                    ; preds = %._crit_edge27, %._crit_edge
  ret i32 0

114:                                              ; preds = %45, %43, %41
  %.pn = phi { ptr, i32 } [ %46, %45 ], [ %44, %43 ], [ %42, %41 ]
  resume { ptr, i32 } %.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #4

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass