; LLVM IR from DionysiosB/CodeForces :: 1400-1499 (1433C-DominantPiranha)

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

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

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

15:                                               ; preds = %151, %149, %0
  %16 = load i64, ptr %2, align 8, !tbaa !5
  %17 = add nsw i64 %16, -1
  store i64 %17, ptr %2, align 8, !tbaa !5
  %18 = icmp ne i64 %16, 0
  br i1 %18, label %19, label %154

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 2000000007, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  %21 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %21, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %22 unwind label %28

22:                                               ; preds = %19
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %63, %22
  %24 = load i64, ptr %10, align 8, !tbaa !5
  %25 = load i64, ptr %3, align 8, !tbaa !5
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %32, label %27

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

28:                                               ; preds = %19
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %8, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %9, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %153

32:                                               ; preds = %23
  %33 = load i64, ptr %10, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %33) #5
  %35 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %34)
          to label %36 unwind label %66

36:                                               ; preds = %32
  %37 = load i64, ptr %5, align 8, !tbaa !5
  %38 = load i64, ptr %10, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %38) #5
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = icmp slt i64 %37, %40
  br i1 %41, label %42, label %44

42:                                               ; preds = %36
  %43 = load i64, ptr %5, align 8, !tbaa !5
  br label %48

44:                                               ; preds = %36
  %45 = load i64, ptr %10, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %45) #5
  %47 = load i64, ptr %46, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %44, %42
  %49 = phi i64 [ %43, %42 ], [ %47, %44 ]
  store i64 %49, ptr %5, align 8, !tbaa !5
  %50 = load i64, ptr %4, align 8, !tbaa !5
  %51 = load i64, ptr %10, align 8, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %51) #5
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = icmp sgt i64 %50, %53
  br i1 %54, label %55, label %57

55:                                               ; preds = %48
  %56 = load i64, ptr %4, align 8, !tbaa !5
  br label %61

57:                                               ; preds = %48
  %58 = load i64, ptr %10, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %58) #5
  %60 = load i64, ptr %59, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %57, %55
  %62 = phi i64 [ %56, %55 ], [ %60, %57 ]
  store i64 %62, ptr %4, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %61
  %64 = load i64, ptr %10, align 8, !tbaa !5
  %65 = add nsw i64 %64, 1
  store i64 %65, ptr %10, align 8, !tbaa !5
  br label %23, !llvm.loop !9

66:                                               ; preds = %32
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %8, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %152

70:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 -1, ptr %11, align 8, !tbaa !5
  %71 = load i64, ptr %5, align 8, !tbaa !5
  %72 = load i64, ptr %4, align 8, !tbaa !5
  %73 = icmp eq i64 %71, %72
  br i1 %73, label %74, label %81

74:                                               ; preds = %70
  %75 = invoke i32 @puts(ptr noundef @.str.1)
          to label %76 unwind label %77

76:                                               ; preds = %74
  store i32 2, ptr %12, align 4
  br label %149, !llvm.loop !11

77:                                               ; preds = %145, %74
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %8, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %152

81:                                               ; preds = %70
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 0) #5
  %83 = load i64, ptr %82, align 8, !tbaa !5
  %84 = load i64, ptr %4, align 8, !tbaa !5
  %85 = icmp eq i64 %83, %84
  br i1 %85, label %86, label %92

86:                                               ; preds = %81
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 1) #5
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = load i64, ptr %4, align 8, !tbaa !5
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %86
  store i64 1, ptr %11, align 8, !tbaa !5
  br label %145

92:                                               ; preds = %86, %81
  %93 = load i64, ptr %3, align 8, !tbaa !5
  %94 = sub nsw i64 %93, 1
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %94) #5
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = load i64, ptr %4, align 8, !tbaa !5
  %98 = icmp eq i64 %96, %97
  br i1 %98, label %99, label %108

99:                                               ; preds = %92
  %100 = load i64, ptr %3, align 8, !tbaa !5
  %101 = sub nsw i64 %100, 2
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %101) #5
  %103 = load i64, ptr %102, align 8, !tbaa !5
  %104 = load i64, ptr %4, align 8, !tbaa !5
  %105 = icmp slt i64 %103, %104
  br i1 %105, label %106, label %108

106:                                              ; preds = %99
  %107 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %107, ptr %11, align 8, !tbaa !5
  br label %144

108:                                              ; preds = %99, %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 1, ptr %13, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %139, %108
  %110 = load i64, ptr %13, align 8, !tbaa !5
  %111 = add nsw i64 %110, 1
  %112 = load i64, ptr %3, align 8, !tbaa !5
  %113 = icmp slt i64 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %109
  store i32 7, ptr %12, align 4
  br label %142

115:                                              ; preds = %109
  %116 = load i64, ptr %13, align 8, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %116) #5
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %119 = load i64, ptr %4, align 8, !tbaa !5
  %120 = icmp eq i64 %118, %119
  br i1 %120, label %121, label %138

121:                                              ; preds = %115
  %122 = load i64, ptr %13, align 8, !tbaa !5
  %123 = sub nsw i64 %122, 1
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %123) #5
  %125 = load i64, ptr %124, align 8, !tbaa !5
  %126 = load i64, ptr %4, align 8, !tbaa !5
  %127 = icmp slt i64 %125, %126
  br i1 %127, label %135, label %128

128:                                              ; preds = %121
  %129 = load i64, ptr %13, align 8, !tbaa !5
  %130 = add nsw i64 %129, 1
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %130) #5
  %132 = load i64, ptr %131, align 8, !tbaa !5
  %133 = load i64, ptr %4, align 8, !tbaa !5
  %134 = icmp slt i64 %132, %133
  br i1 %134, label %135, label %138

135:                                              ; preds = %128, %121
  %136 = load i64, ptr %13, align 8, !tbaa !5
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %11, align 8, !tbaa !5
  store i32 7, ptr %12, align 4
  br label %142

138:                                              ; preds = %128, %115
  br label %139

139:                                              ; preds = %138
  %140 = load i64, ptr %13, align 8, !tbaa !5
  %141 = add nsw i64 %140, 1
  store i64 %141, ptr %13, align 8, !tbaa !5
  br label %109, !llvm.loop !12

142:                                              ; preds = %135, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143, %106
  br label %145

145:                                              ; preds = %144, %91
  %146 = load i64, ptr %11, align 8, !tbaa !5
  %147 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %146)
          to label %148 unwind label %77

148:                                              ; preds = %145
  store i32 0, ptr %12, align 4
  br label %149

149:                                              ; preds = %148, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  %150 = load i32, ptr %12, align 4
  switch i32 %150, label %161 [
    i32 0, label %151
    i32 2, label %15
  ]

151:                                              ; preds = %149
  br label %15, !llvm.loop !11

152:                                              ; preds = %77, %66
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %153

153:                                              ; preds = %152, %28
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %156

154:                                              ; preds = %15
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %155 = load i32, ptr %1, align 4
  ret i32 %155

156:                                              ; preds = %153
  %157 = load ptr, ptr %8, align 8
  %158 = load i32, ptr %9, align 4
  %159 = insertvalue { ptr, i32 } poison, ptr %157, 0
  %160 = insertvalue { ptr, i32 } %159, i32 %158, 1
  resume { ptr, i32 } %160

161:                                              ; preds = %149
  unreachable
}

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare i32 @puts(ptr noundef) #2

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

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

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

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

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

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


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

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

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

.lr.ph48:                                         ; preds = %0, %81
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %9 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %9, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %10 unwind label %14

10:                                               ; preds = %.lr.ph48
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %32
  %13 = icmp eq i64 %25, %33
  br i1 %13, label %37, label %._crit_edge.thread

14:                                               ; preds = %.lr.ph48
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %15

.lr.ph:                                           ; preds = %10, %32
  %.03036 = phi i64 [ %34, %32 ], [ 0, %10 ]
  %.03135 = phi i64 [ %33, %32 ], [ 0, %10 ]
  %.03234 = phi i64 [ %25, %32 ], [ 2000000007, %10 ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03036) #5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %16)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03036) #5
  %19 = load i64, ptr %18, align 8, !tbaa !5
  %20 = icmp slt i64 %.03234, %19
  br i1 %20, label %24, label %21

21:                                               ; preds = %.lr.ph
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03036) #5
  %23 = load i64, ptr %22, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %.lr.ph, %21
  %25 = phi i64 [ %23, %21 ], [ %.03234, %.lr.ph ]
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03036) #5
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = icmp sgt i64 %.03135, %27
  br i1 %28, label %32, label %29

29:                                               ; preds = %24
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03036) #5
  %31 = load i64, ptr %30, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %24, %29
  %33 = phi i64 [ %31, %29 ], [ %.03135, %24 ]
  %34 = add nuw nsw i64 %.03036, 1
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !9

37:                                               ; preds = %._crit_edge
  %38 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %81, !llvm.loop !11

._crit_edge.thread:                               ; preds = %10, %._crit_edge
  %.031.lcssa53 = phi i64 [ %33, %._crit_edge ], [ 0, %10 ]
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #5
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = icmp eq i64 %40, %.031.lcssa53
  br i1 %41, label %42, label %46

42:                                               ; preds = %._crit_edge.thread
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 1) #5
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = icmp slt i64 %44, %.031.lcssa53
  br i1 %45, label %.loopexit, label %46

46:                                               ; preds = %42, %._crit_edge.thread
  %47 = load i64, ptr %2, align 8, !tbaa !5
  %48 = add nsw i64 %47, -1
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %48) #5
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = icmp eq i64 %50, %.031.lcssa53
  br i1 %51, label %52, label %60

52:                                               ; preds = %46
  %53 = load i64, ptr %2, align 8, !tbaa !5
  %54 = add nsw i64 %53, -2
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %54) #5
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = icmp slt i64 %56, %.031.lcssa53
  br i1 %57, label %58, label %60

58:                                               ; preds = %52
  %59 = load i64, ptr %2, align 8, !tbaa !5
  br label %.loopexit

60:                                               ; preds = %52, %46
  %61 = load i64, ptr %2, align 8, !tbaa !5
  %62 = icmp sgt i64 %61, 2
  br i1 %62, label %.lr.ph40, label %.loopexit

.lr.ph40:                                         ; preds = %60, %76
  %63 = phi i64 [ %77, %76 ], [ 2, %60 ]
  %.038 = phi i64 [ %63, %76 ], [ 1, %60 ]
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.038) #5
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = icmp eq i64 %65, %.031.lcssa53
  br i1 %66, label %67, label %76

67:                                               ; preds = %.lr.ph40
  %68 = add nsw i64 %.038, -1
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %68) #5
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = icmp slt i64 %70, %.031.lcssa53
  br i1 %71, label %.loopexit, label %72

72:                                               ; preds = %67
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %63) #5
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = icmp slt i64 %74, %.031.lcssa53
  br i1 %75, label %.loopexit, label %76

76:                                               ; preds = %.lr.ph40, %72
  %77 = add nuw nsw i64 %63, 1
  %78 = load i64, ptr %2, align 8, !tbaa !5
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %.lr.ph40, label %.loopexit, !llvm.loop !12

.loopexit:                                        ; preds = %67, %72, %76, %60, %42, %58
  %.1 = phi i64 [ %59, %58 ], [ 1, %42 ], [ -1, %60 ], [ %63, %67 ], [ %63, %72 ], [ -1, %76 ]
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.1)
  br label %81

81:                                               ; preds = %.loopexit, %37
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %82 = load i64, ptr %1, align 8, !tbaa !5
  %83 = add nsw i64 %82, -1
  store i64 %83, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %82, 0
  br i1 %.not, label %._crit_edge49, label %.lr.ph48

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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


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