; LLVM IR from imteekay/algorithms :: competitive-programming/uri (linear_parking_lot)

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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.car, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %13

13:                                               ; preds = %95, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = add nsw i32 %14, %15
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %97

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorI3carSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  store i8 1, ptr %6, align 1, !tbaa !9
  br label %19

19:                                               ; preds = %77, %18
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr %2, align 4, !tbaa !5
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %78

23:                                               ; preds = %19
  %24 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %25 unwind label %44

25:                                               ; preds = %23
  %26 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %27 unwind label %44

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = getelementptr inbounds %struct.car, ptr %10, i32 0, i32 0
  store i32 %28, ptr %29, align 4, !tbaa !11
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = getelementptr inbounds %struct.car, ptr %10, i32 0, i32 1
  store i32 %30, ptr %31, align 4, !tbaa !13
  br label %32

32:                                               ; preds = %43, %27
  %33 = call noundef i64 @_ZNKSt6vectorI3carSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %34 = icmp ugt i64 %33, 0
  br i1 %34, label %35, label %41

35:                                               ; preds = %32
  %36 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI3carSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %37 = getelementptr inbounds %struct.car, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !13
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br label %41

41:                                               ; preds = %35, %32
  %42 = phi i1 [ false, %32 ], [ %40, %35 ]
  br i1 %42, label %43, label %48

43:                                               ; preds = %41
  call void @_ZNSt6vectorI3carSaIS0_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  br label %32, !llvm.loop !14

44:                                               ; preds = %93, %91, %88, %86, %83, %81, %25, %23
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %8, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %9, align 4
  br label %96

48:                                               ; preds = %41
  %49 = call noundef i64 @_ZNKSt6vectorI3carSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = icmp uge i64 %49, %51
  br i1 %52, label %53, label %60

53:                                               ; preds = %48
  %54 = getelementptr inbounds %struct.car, ptr %10, i32 0, i32 0
  %55 = load i32, ptr %54, align 4, !tbaa !11
  %56 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI3carSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %57 = getelementptr inbounds %struct.car, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !13
  %59 = icmp slt i32 %55, %58
  br i1 %59, label %70, label %60

60:                                               ; preds = %53, %48
  %61 = call noundef i64 @_ZNKSt6vectorI3carSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %62 = icmp ugt i64 %61, 0
  br i1 %62, label %63, label %71

63:                                               ; preds = %60
  %64 = getelementptr inbounds %struct.car, ptr %10, i32 0, i32 1
  %65 = load i32, ptr %64, align 4, !tbaa !13
  %66 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI3carSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %67 = getelementptr inbounds %struct.car, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !13
  %69 = icmp sgt i32 %65, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %63, %53
  store i8 0, ptr %6, align 1, !tbaa !9
  br label %77

71:                                               ; preds = %63, %60
  invoke void @_ZNSt6vectorI3carSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %72 unwind label %73

72:                                               ; preds = %71
  br label %77

73:                                               ; preds = %71
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %8, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %96

77:                                               ; preds = %72, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %19, !llvm.loop !16

78:                                               ; preds = %19
  %79 = load i8, ptr %6, align 1, !tbaa !9, !range !17, !noundef !18
  %80 = trunc i8 %79 to i1
  br i1 %80, label %81, label %86

81:                                               ; preds = %78
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
          to label %83 unwind label %44

83:                                               ; preds = %81
  %84 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %85 unwind label %44

85:                                               ; preds = %83
  br label %91

86:                                               ; preds = %78
  %87 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
          to label %88 unwind label %44

88:                                               ; preds = %86
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %90 unwind label %44

90:                                               ; preds = %88
  br label %91

91:                                               ; preds = %90, %85
  %92 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %93 unwind label %44

93:                                               ; preds = %91
  %94 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %92, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %95 unwind label %44

95:                                               ; preds = %93
  call void @_ZNSt6vectorI3carSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  br label %13, !llvm.loop !19

96:                                               ; preds = %73, %44
  call void @_ZNSt6vectorI3carSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %98

97:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0

98:                                               ; preds = %96
  %99 = load ptr, ptr %8, align 8
  %100 = load i32, ptr %9, align 4
  %101 = insertvalue { ptr, i32 } poison, ptr %99, 0
  %102 = insertvalue { ptr, i32 } %101, i32 %100, 1
  resume { ptr, i32 } %102
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI3carSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #4 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: 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) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI3carSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %struct.car, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = sub i32 0, %10
  %.not17 = icmp eq i32 %9, %11
  br i1 %.not17, label %._crit_edge20, label %.lr.ph19

.lr.ph19:                                         ; preds = %0
  %12 = getelementptr inbounds i8, ptr %6, i64 4
  br label %13

13:                                               ; preds = %.lr.ph19, %59
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZNSt6vectorI3carSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %1, align 4, !tbaa !5
  %.not414 = icmp eq i32 %14, 0
  br i1 %.not414, label %.critedge21.invoke, label %.lr.ph16

.lr.ph16:                                         ; preds = %13, %49
  %.0315 = phi i1 [ %.1, %49 ], [ true, %13 ]
  %16 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %17 unwind label %.loopexit

17:                                               ; preds = %.lr.ph16
  %18 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %19 unwind label %.loopexit

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %20 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %20, ptr %6, align 4, !tbaa !9
  %21 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %21, ptr %12, align 4, !tbaa !11
  %22 = call noundef i64 @_ZNKSt6vectorI3carSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %.not512 = icmp eq i64 %22, 0
  br i1 %.not512, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %19, %27
  %23 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI3carSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = load i32, ptr %24, align 4, !tbaa !11
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %.not6 = icmp sgt i32 %25, %26
  br i1 %.not6, label %.critedge, label %27

27:                                               ; preds = %.lr.ph
  call void @_ZNSt6vectorI3carSaIS0_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %28 = call noundef i64 @_ZNKSt6vectorI3carSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %.not5 = icmp eq i64 %28, 0
  br i1 %.not5, label %.critedge, label %.lr.ph, !llvm.loop !12

.loopexit:                                        ; preds = %.lr.ph16, %17
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %63

.loopexit.split-lp:                               ; preds = %.critedge21.invoke, %.invoke, %55, %57
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %63

.critedge:                                        ; preds = %.lr.ph, %27, %19
  %29 = call noundef i64 @_ZNKSt6vectorI3carSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %.not7 = icmp ult i64 %29, %31
  br i1 %.not7, label %38, label %32

32:                                               ; preds = %.critedge
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI3carSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = icmp slt i32 %33, %36
  br i1 %37, label %49, label %38

38:                                               ; preds = %32, %.critedge
  %39 = call noundef i64 @_ZNKSt6vectorI3carSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %.not8 = icmp eq i64 %39, 0
  br i1 %.not8, label %46, label %40

40:                                               ; preds = %38
  %41 = load i32, ptr %12, align 4, !tbaa !11
  %42 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI3carSaIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = icmp sgt i32 %41, %44
  br i1 %45, label %49, label %46

46:                                               ; preds = %40, %38
  invoke void @_ZNSt6vectorI3carSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %49 unwind label %47

47:                                               ; preds = %46
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %63

49:                                               ; preds = %32, %40, %46
  %.1 = phi i1 [ %.0315, %46 ], [ false, %40 ], [ false, %32 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %1, align 4, !tbaa !5
  %.not4 = icmp eq i32 %50, 0
  br i1 %.not4, label %._crit_edge, label %.lr.ph16, !llvm.loop !14

._crit_edge:                                      ; preds = %49
  %spec.select = select i1 %.1, ptr @.str, ptr @.str.1
  br label %.critedge21.invoke

.critedge21.invoke:                               ; preds = %._crit_edge, %13
  %52 = phi ptr [ @.str, %13 ], [ %spec.select, %._crit_edge ]
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %52)
          to label %.invoke unwind label %.loopexit.split-lp

.invoke:                                          ; preds = %.critedge21.invoke
  %54 = 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 %55 unwind label %.loopexit.split-lp

55:                                               ; preds = %.invoke
  %56 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
          to label %57 unwind label %.loopexit.split-lp

57:                                               ; preds = %55
  %58 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %56, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %59 unwind label %.loopexit.split-lp

59:                                               ; preds = %57
  call void @_ZNSt6vectorI3carSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sub i32 0, %61
  %.not = icmp eq i32 %60, %62
  br i1 %.not, label %._crit_edge20, label %13, !llvm.loop !15

63:                                               ; preds = %.loopexit, %.loopexit.split-lp, %47
  %.pn = phi { ptr, i32 } [ %48, %47 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorI3carSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn

._crit_edge20:                                    ; preds = %59, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI3carSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 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: 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 #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI3carSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass