; LLVM IR from DionysiosB/CodeForces :: 1300-1399 (1399C-BoatsCompetition)

; 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 [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 %"class.std::vector", align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %17

17:                                               ; preds = %134, %0
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr %2, align 8, !tbaa !5
  %20 = icmp ne i64 %18, 0
  br i1 %20, label %21, label %141

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  %23 = load i64, ptr %3, align 8, !tbaa !5
  %24 = add nsw i64 %23, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %24, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %25 unwind label %31

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

26:                                               ; preds = %42, %25
  %27 = load i64, ptr %9, align 8, !tbaa !5
  %28 = load i64, ptr %3, align 8, !tbaa !5
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %35, label %30

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

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

35:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %36 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %10)
          to label %37 unwind label %45

37:                                               ; preds = %35
  %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) %4, i64 noundef %38) #5
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %42

42:                                               ; preds = %37
  %43 = load i64, ptr %9, align 8, !tbaa !5
  %44 = add nsw i64 %43, 1
  store i64 %44, ptr %9, align 8, !tbaa !5
  br label %26, !llvm.loop !9

45:                                               ; preds = %35
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %7, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %139

49:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %128, %49
  %51 = load i64, ptr %12, align 8, !tbaa !5
  %52 = load i64, ptr %3, align 8, !tbaa !5
  %53 = mul nsw i64 2, %52
  %54 = icmp sle i64 %51, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %50
  store i32 7, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %131

56:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 1, ptr %15, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %115, %56
  %58 = load i64, ptr %15, align 8, !tbaa !5
  %59 = load i64, ptr %3, align 8, !tbaa !5
  %60 = icmp sle i64 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 10, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %118

62:                                               ; preds = %57
  %63 = load i64, ptr %15, align 8, !tbaa !5
  %64 = load i64, ptr %12, align 8, !tbaa !5
  %65 = load i64, ptr %15, align 8, !tbaa !5
  %66 = sub nsw i64 %64, %65
  %67 = icmp sgt i64 %63, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %62
  br label %115

69:                                               ; preds = %62
  %70 = load i64, ptr %12, align 8, !tbaa !5
  %71 = load i64, ptr %15, align 8, !tbaa !5
  %72 = sub nsw i64 %70, %71
  %73 = load i64, ptr %3, align 8, !tbaa !5
  %74 = icmp sgt i64 %72, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %69
  br label %115

76:                                               ; preds = %69
  %77 = load i64, ptr %15, align 8, !tbaa !5
  %78 = mul nsw i64 2, %77
  %79 = load i64, ptr %12, align 8, !tbaa !5
  %80 = icmp eq i64 %78, %79
  br i1 %80, label %81, label %88

81:                                               ; preds = %76
  %82 = load i64, ptr %15, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %82) #5
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = sdiv i64 %84, 2
  %86 = load i64, ptr %14, align 8, !tbaa !5
  %87 = add nsw i64 %86, %85
  store i64 %87, ptr %14, align 8, !tbaa !5
  br label %112

88:                                               ; preds = %76
  %89 = load i64, ptr %15, align 8, !tbaa !5
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %89) #5
  %91 = load i64, ptr %90, align 8, !tbaa !5
  %92 = load i64, ptr %12, align 8, !tbaa !5
  %93 = load i64, ptr %15, align 8, !tbaa !5
  %94 = sub nsw i64 %92, %93
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %94) #5
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = icmp slt i64 %91, %96
  br i1 %97, label %98, label %102

98:                                               ; preds = %88
  %99 = load i64, ptr %15, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %99) #5
  %101 = load i64, ptr %100, align 8, !tbaa !5
  br label %108

102:                                              ; preds = %88
  %103 = load i64, ptr %12, align 8, !tbaa !5
  %104 = load i64, ptr %15, align 8, !tbaa !5
  %105 = sub nsw i64 %103, %104
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %105) #5
  %107 = load i64, ptr %106, align 8, !tbaa !5
  br label %108

108:                                              ; preds = %102, %98
  %109 = phi i64 [ %101, %98 ], [ %107, %102 ]
  %110 = load i64, ptr %14, align 8, !tbaa !5
  %111 = add nsw i64 %110, %109
  store i64 %111, ptr %14, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %108, %81
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114, %75, %68
  %116 = load i64, ptr %15, align 8, !tbaa !5
  %117 = add nsw i64 %116, 1
  store i64 %117, ptr %15, align 8, !tbaa !5
  br label %57, !llvm.loop !11

118:                                              ; preds = %61
  %119 = load i64, ptr %11, align 8, !tbaa !5
  %120 = load i64, ptr %14, align 8, !tbaa !5
  %121 = icmp sgt i64 %119, %120
  br i1 %121, label %122, label %124

122:                                              ; preds = %118
  %123 = load i64, ptr %11, align 8, !tbaa !5
  br label %126

124:                                              ; preds = %118
  %125 = load i64, ptr %14, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %124, %122
  %127 = phi i64 [ %123, %122 ], [ %125, %124 ]
  store i64 %127, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %128

128:                                              ; preds = %126
  %129 = load i64, ptr %12, align 8, !tbaa !5
  %130 = add nsw i64 %129, 1
  store i64 %130, ptr %12, align 8, !tbaa !5
  br label %50, !llvm.loop !12

131:                                              ; preds = %55
  %132 = load i64, ptr %11, align 8, !tbaa !5
  %133 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %132)
          to label %134 unwind label %135

134:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %17, !llvm.loop !13

135:                                              ; preds = %131
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %7, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %139

139:                                              ; preds = %135, %45
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %140

140:                                              ; preds = %139, %31
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %143

141:                                              ; preds = %17
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %142 = load i32, ptr %1, align 4
  ret i32 %142

143:                                              ; preds = %140
  %144 = load ptr, ptr %7, align 8
  %145 = load i32, ptr %8, align 4
  %146 = insertvalue { ptr, i32 } poison, ptr %144, 0
  %147 = insertvalue { ptr, i32 } %146, i32 %145, 1
  resume { ptr, i32 } %147
}

; 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 @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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 @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}
!13 = distinct !{!13, !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 [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 i64, align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %8 = load i64, ptr %1, align 8, !tbaa !5
  %9 = add nsw i64 %8, -1
  store i64 %9, ptr %1, align 8, !tbaa !5
  %.not49 = icmp eq i64 %8, 0
  br i1 %.not49, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %0, %._crit_edge47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = add nsw i64 %11, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %12, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %13 unwind label %17

13:                                               ; preds = %.lr.ph51
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %14 = load i64, ptr %2, align 8, !tbaa !5
  %15 = icmp sgt i64 %14, 0
  br i1 %15, label %.lr.ph, label %.preheader37

.preheader37:                                     ; preds = %.lr.ph, %13
  %16 = phi i64 [ %14, %13 ], [ %25, %.lr.ph ]
  %or.cond56 = icmp slt i64 %16, 1
  br i1 %or.cond56, label %._crit_edge47, label %.preheader

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

.lr.ph:                                           ; preds = %13, %.lr.ph
  %.03238 = phi i64 [ %24, %.lr.ph ], [ 0, %13 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %6)
  %20 = load i64, ptr %6, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %20) #6
  %22 = load i64, ptr %21, align 8, !tbaa !5
  %23 = add nsw i64 %22, 1
  store i64 %23, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %24 = add nuw nsw i64 %.03238, 1
  %25 = load i64, ptr %2, align 8, !tbaa !5
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %.lr.ph, label %.preheader37, !llvm.loop !9

.preheader:                                       ; preds = %.preheader37, %._crit_edge
  %27 = phi i64 [ %31, %._crit_edge ], [ %16, %.preheader37 ]
  %.03046 = phi i64 [ %33, %._crit_edge ], [ 0, %.preheader37 ]
  %.03145 = phi i64 [ %32, %._crit_edge ], [ 0, %.preheader37 ]
  %.not3639 = icmp slt i64 %27, 1
  br i1 %.not3639, label %._crit_edge, label %.lr.ph43

._crit_edge47:                                    ; preds = %._crit_edge, %.preheader37
  %.031.lcssa = phi i64 [ 0, %.preheader37 ], [ %32, %._crit_edge ]
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.031.lcssa)
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %29 = load i64, ptr %1, align 8, !tbaa !5
  %30 = add nsw i64 %29, -1
  store i64 %30, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %29, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !11

._crit_edge:                                      ; preds = %54, %.preheader
  %31 = phi i64 [ %27, %.preheader ], [ %56, %54 ]
  %.029.lcssa = phi i64 [ 0, %.preheader ], [ %.1, %54 ]
  %32 = call i64 @llvm.smax.i64(i64 %.03145, i64 %.029.lcssa)
  %33 = add nuw nsw i64 %.03046, 1
  %34 = shl nsw i64 %31, 1
  %.not35.not = icmp slt i64 %.03046, %34
  br i1 %.not35.not, label %.preheader, label %._crit_edge47, !llvm.loop !12

.lr.ph43:                                         ; preds = %.preheader, %54
  %35 = phi i64 [ %56, %54 ], [ %27, %.preheader ]
  %.041 = phi i64 [ %55, %54 ], [ 1, %.preheader ]
  %.02940 = phi i64 [ %.1, %54 ], [ 0, %.preheader ]
  %36 = sub nsw i64 %.03046, %.041
  %37 = icmp sgt i64 %.041, %36
  %38 = icmp sgt i64 %36, %35
  %or.cond = or i1 %37, %38
  br i1 %or.cond, label %54, label %39

39:                                               ; preds = %.lr.ph43
  %40 = shl nuw nsw i64 %.041, 1
  %41 = icmp eq i64 %40, %.03046
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.041) #6
  %43 = load i64, ptr %42, align 8, !tbaa !5
  br i1 %41, label %44, label %47

44:                                               ; preds = %39
  %45 = sdiv i64 %43, 2
  %46 = add nsw i64 %45, %.02940
  br label %54

47:                                               ; preds = %39
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %36) #6
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = icmp slt i64 %43, %49
  %.041. = select i1 %50, i64 %.041, i64 %36
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.041.) #6
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = add nsw i64 %52, %.02940
  br label %54

54:                                               ; preds = %44, %47, %.lr.ph43
  %.1 = phi i64 [ %.02940, %.lr.ph43 ], [ %46, %44 ], [ %53, %47 ]
  %55 = add nuw nsw i64 %.041, 1
  %56 = load i64, ptr %2, align 8, !tbaa !5
  %.not36.not = icmp slt i64 %.041, %56
  br i1 %.not36.not, label %.lr.ph43, label %._crit_edge, !llvm.loop !14

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

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

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

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

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

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 @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

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

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass