; LLVM IR from AnneLivia/Competitive-Programming :: Online Judges/URI/1973 (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 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 i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  call void @_ZNSt6vectorIySaIyEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  call void @_ZNSt6vectorIySaIyEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  %15 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERy(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %16 unwind label %38

16:                                               ; preds = %0
  %17 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIySaIyEE6assignEmRKy(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %17, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %18 unwind label %42

18:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %19 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIySaIyEE6assignEmRKy(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %19, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %20 unwind label %46

20:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %35, %20
  %22 = load i64, ptr %4, align 8, !tbaa !5
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = icmp ult i64 %22, %23
  br i1 %24, label %25, label %50

25:                                               ; preds = %21
  %26 = load i64, ptr %4, align 8, !tbaa !5
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %26) #5
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERy(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %27)
          to label %29 unwind label %38

29:                                               ; preds = %25
  %30 = load i64, ptr %4, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %30) #5
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = load i64, ptr %7, align 8, !tbaa !5
  %34 = add i64 %33, %32
  store i64 %34, ptr %7, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %29
  %36 = load i64, ptr %4, align 8, !tbaa !5
  %37 = add i64 %36, 1
  store i64 %37, ptr %4, align 8, !tbaa !5
  br label %21, !llvm.loop !9

38:                                               ; preds = %111, %106, %104, %101, %25, %0
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %10, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %11, align 4
  br label %115

42:                                               ; preds = %16
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %115

46:                                               ; preds = %18
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %115

50:                                               ; preds = %21
  store i64 0, ptr %5, align 8, !tbaa !5
  store i64 0, ptr %6, align 8, !tbaa !5
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %100, %50
  %52 = load i64, ptr %4, align 8, !tbaa !5
  %53 = icmp uge i64 %52, 0
  br i1 %53, label %54, label %58

54:                                               ; preds = %51
  %55 = load i64, ptr %4, align 8, !tbaa !5
  %56 = load i64, ptr %2, align 8, !tbaa !5
  %57 = icmp ult i64 %55, %56
  br label %58

58:                                               ; preds = %54, %51
  %59 = phi i1 [ false, %51 ], [ %57, %54 ]
  br i1 %59, label %60, label %101

60:                                               ; preds = %58
  %61 = load i64, ptr %4, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %61) #5
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %70, label %65

65:                                               ; preds = %60
  %66 = load i64, ptr %5, align 8, !tbaa !5
  %67 = add i64 %66, 1
  store i64 %67, ptr %5, align 8, !tbaa !5
  %68 = load i64, ptr %4, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %68) #5
  store i64 1, ptr %69, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %65, %60
  %71 = load i64, ptr %4, align 8, !tbaa !5
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %71) #5
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = icmp ne i64 %73, 0
  br i1 %74, label %75, label %97

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %76 = load i64, ptr %4, align 8, !tbaa !5
  %77 = trunc i64 %76 to i32
  store i32 %77, ptr %14, align 4, !tbaa !11
  %78 = load i64, ptr %4, align 8, !tbaa !5
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %78) #5
  %80 = load i64, ptr %79, align 8, !tbaa !5
  %81 = urem i64 %80, 2
  %82 = icmp eq i64 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %75
  %84 = load i64, ptr %4, align 8, !tbaa !5
  %85 = add i64 %84, -1
  store i64 %85, ptr %4, align 8, !tbaa !5
  br label %89

86:                                               ; preds = %75
  %87 = load i64, ptr %4, align 8, !tbaa !5
  %88 = add i64 %87, 1
  store i64 %88, ptr %4, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %86, %83
  %90 = load i64, ptr %6, align 8, !tbaa !5
  %91 = add i64 %90, 1
  store i64 %91, ptr %6, align 8, !tbaa !5
  %92 = load i32, ptr %14, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %93) #5
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = add i64 %95, -1
  store i64 %96, ptr %94, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %100

97:                                               ; preds = %70
  %98 = load i64, ptr %4, align 8, !tbaa !5
  %99 = add i64 %98, -1
  store i64 %99, ptr %4, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %97, %89
  br label %51, !llvm.loop !13

101:                                              ; preds = %58
  %102 = load i64, ptr %5, align 8, !tbaa !5
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEy(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %102)
          to label %104 unwind label %38

104:                                              ; preds = %101
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef @.str)
          to label %106 unwind label %38

106:                                              ; preds = %104
  %107 = load i64, ptr %7, align 8, !tbaa !5
  %108 = load i64, ptr %6, align 8, !tbaa !5
  %109 = sub i64 %107, %108
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEy(ptr noundef nonnull align 8 dereferenceable(8) %105, i64 noundef %109)
          to label %111 unwind label %38

111:                                              ; preds = %106
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %110, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %113 unwind label %38

113:                                              ; preds = %111
  store i32 0, ptr %1, align 4
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, 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
  %114 = load i32, ptr %1, align 4
  ret i32 %114

115:                                              ; preds = %46, %42, %38
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %10, align 8
  %118 = load i32, ptr %11, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; 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) #4

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long long, std::allocator<unsigned long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 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 %"class.std::vector", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @_ZNSt6vectorIySaIyEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIySaIyEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %6 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERy(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %7 unwind label %.loopexit.split-lp

7:                                                ; preds = %0
  %8 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIySaIyEE6assignEmRKy(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %8, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %9 unwind label %23

9:                                                ; preds = %7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %10 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIySaIyEE6assignEmRKy(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %10, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %11 unwind label %25

11:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %12 = load i64, ptr %1, align 8
  %.not41 = icmp eq i64 %12, 0
  br i1 %.not41, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %16
  %13 = icmp eq i64 %21, 0
  br i1 %13, label %._crit_edge, label %.lr.ph38

.lr.ph:                                           ; preds = %11, %16
  %.02434 = phi i64 [ %19, %16 ], [ 0, %11 ]
  %.02833 = phi i64 [ %20, %16 ], [ 0, %11 ]
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02833) #5
  %15 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERy(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %16 unwind label %.loopexit

16:                                               ; preds = %.lr.ph
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02833) #5
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = add i64 %18, %.02434
  %20 = add nuw i64 %.02833, 1
  %21 = load i64, ptr %1, align 8
  %22 = icmp ult i64 %20, %21
  br i1 %22, label %.lr.ph, label %.preheader, !llvm.loop !9

.loopexit:                                        ; preds = %.lr.ph
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %57

.loopexit.split-lp:                               ; preds = %0, %._crit_edge, %49, %51, %54
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %57

23:                                               ; preds = %7
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %57

25:                                               ; preds = %9
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %57

.lr.ph38:                                         ; preds = %.preheader, %45
  %.02537 = phi i64 [ %.1, %45 ], [ 0, %.preheader ]
  %.02636 = phi i64 [ %.127, %45 ], [ 0, %.preheader ]
  %.12935 = phi i64 [ %.3, %45 ], [ 0, %.preheader ]
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.12935) #5
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %.not = icmp eq i64 %28, 0
  br i1 %.not, label %29, label %32

29:                                               ; preds = %.lr.ph38
  %30 = add i64 %.02636, 1
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.12935) #5
  store i64 1, ptr %31, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %29, %.lr.ph38
  %.127 = phi i64 [ %.02636, %.lr.ph38 ], [ %30, %29 ]
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.12935) #5
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %.not30 = icmp eq i64 %34, 0
  br i1 %.not30, label %45, label %35

35:                                               ; preds = %32
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.12935) #5
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = and i64 %37, 1
  %39 = icmp eq i64 %38, 0
  %.2.v = select i1 %39, i64 -1, i64 1
  %40 = add i64 %.02537, 1
  %sext = shl i64 %.12935, 32
  %41 = ashr exact i64 %sext, 32
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %41) #5
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %44 = add i64 %43, -1
  store i64 %44, ptr %42, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %32, %35
  %.2.v.pn = phi i64 [ %.2.v, %35 ], [ -1, %32 ]
  %.1 = phi i64 [ %40, %35 ], [ %.02537, %32 ]
  %.3 = add i64 %.2.v.pn, %.12935
  %46 = load i64, ptr %1, align 8
  %47 = icmp ult i64 %.3, %46
  br i1 %47, label %.lr.ph38, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %45, %11, %.preheader
  %.024.lcssa45 = phi i64 [ %19, %.preheader ], [ 0, %11 ], [ %19, %45 ]
  %.026.lcssa = phi i64 [ 0, %.preheader ], [ 0, %11 ], [ %.127, %45 ]
  %.025.lcssa = phi i64 [ 0, %.preheader ], [ 0, %11 ], [ %.1, %45 ]
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEy(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.026.lcssa)
          to label %49 unwind label %.loopexit.split-lp

49:                                               ; preds = %._crit_edge
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @.str)
          to label %51 unwind label %.loopexit.split-lp

51:                                               ; preds = %49
  %52 = sub i64 %.024.lcssa45, %.025.lcssa
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEy(ptr noundef nonnull align 8 dereferenceable(8) %50, i64 noundef %52)
          to label %54 unwind label %.loopexit.split-lp

54:                                               ; preds = %51
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %56 unwind label %.loopexit.split-lp

56:                                               ; preds = %54
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

57:                                               ; preds = %.loopexit, %.loopexit.split-lp, %25, %23
  %.pn = phi { ptr, i32 } [ %26, %25 ], [ %24, %23 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; 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 @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIySaIyEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 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 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }

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

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


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