; LLVM IR from DionysiosB/CodeForces :: 0700-0799/732D-Exams.ll (Z5checkRKSt6vectorIlSaIlEES1_ll)

; 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 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checkRKSt6vectorIlSaIlEES1_ll(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca %"class.std::queue", align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  %23 = load i64, ptr %8, align 8, !tbaa !9
  %24 = add nsw i64 %23, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 -1, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #4
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %24, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %25 unwind label %31

25:                                               ; preds = %4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %26 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %26, ptr %16, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %58, %25
  %28 = load i64, ptr %16, align 8, !tbaa !9
  %29 = icmp sge i64 %28, 0
  br i1 %29, label %35, label %30

30:                                               ; preds = %27
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %61

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

35:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load i64, ptr %16, align 8, !tbaa !9
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %37) #4
  %39 = load i64, ptr %38, align 8, !tbaa !9
  store i64 %39, ptr %18, align 8, !tbaa !9
  %40 = load i64, ptr %18, align 8, !tbaa !9
  %41 = icmp sle i64 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %35
  store i32 4, ptr %17, align 4
  br label %55

43:                                               ; preds = %35
  %44 = load i64, ptr %18, align 8, !tbaa !9
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %44) #4
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = icmp sle i64 %46, 0
  br i1 %47, label %48, label %54

48:                                               ; preds = %43
  %49 = load i64, ptr %15, align 8, !tbaa !9
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %15, align 8, !tbaa !9
  %51 = load i64, ptr %16, align 8, !tbaa !9
  %52 = load i64, ptr %18, align 8, !tbaa !9
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %52) #4
  store i64 %51, ptr %53, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %48, %43
  store i32 0, ptr %17, align 4
  br label %55

55:                                               ; preds = %54, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %56 = load i32, ptr %17, align 4
  switch i32 %56, label %139 [
    i32 0, label %57
    i32 4, label %58
  ]

57:                                               ; preds = %55
  br label %58

58:                                               ; preds = %57, %55
  %59 = load i64, ptr %16, align 8, !tbaa !9
  %60 = add nsw i64 %59, -1
  store i64 %60, ptr %16, align 8, !tbaa !9
  br label %27, !llvm.loop !11

61:                                               ; preds = %30
  %62 = load i64, ptr %15, align 8, !tbaa !9
  %63 = load i64, ptr %8, align 8, !tbaa !9
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %65, label %66

65:                                               ; preds = %61
  store i1 false, ptr %5, align 1
  store i32 1, ptr %17, align 4
  br label %131

66:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 80, ptr %19) #4
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %19)
          to label %67 unwind label %73

67:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %68 = load i64, ptr %9, align 8, !tbaa !9
  store i64 %68, ptr %20, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %118, %67
  %70 = load i64, ptr %20, align 8, !tbaa !9
  %71 = icmp sge i64 %70, 0
  br i1 %71, label %77, label %72

72:                                               ; preds = %69
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %122

73:                                               ; preds = %66
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %13, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %14, align 4
  br label %130

77:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = load i64, ptr %20, align 8, !tbaa !9
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %79) #4
  %81 = load i64, ptr %80, align 8, !tbaa !9
  store i64 %81, ptr %21, align 8, !tbaa !9
  %82 = load i64, ptr %21, align 8, !tbaa !9
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %82) #4
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = load i64, ptr %20, align 8, !tbaa !9
  %86 = icmp eq i64 %84, %85
  br i1 %86, label %87, label %93

87:                                               ; preds = %77
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %19, ptr noundef nonnull align 8 dereferenceable(8) %21)
          to label %88 unwind label %89

88:                                               ; preds = %87
  br label %117

89:                                               ; preds = %93, %87
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %13, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %14, align 4
  br label %121

93:                                               ; preds = %77
  %94 = invoke noundef i64 @_ZNKSt5queueIlSt5dequeIlSaIlEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %19)
          to label %95 unwind label %89

95:                                               ; preds = %93
  %96 = icmp ugt i64 %94, 0
  br i1 %96, label %97, label %116

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIlSt5dequeIlSaIlEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %19)
          to label %99 unwind label %111

99:                                               ; preds = %97
  %100 = load i64, ptr %98, align 8, !tbaa !9
  store i64 %100, ptr %22, align 8, !tbaa !9
  %101 = load i64, ptr %22, align 8, !tbaa !9
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %101) #4
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = add nsw i64 %103, -1
  store i64 %104, ptr %102, align 8, !tbaa !9
  %105 = load i64, ptr %22, align 8, !tbaa !9
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %105) #4
  %107 = load i64, ptr %106, align 8, !tbaa !9
  %108 = icmp sle i64 %107, 0
  br i1 %108, label %109, label %115

109:                                              ; preds = %99
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %19)
          to label %110 unwind label %111

110:                                              ; preds = %109
  br label %115

111:                                              ; preds = %109, %97
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %13, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %121

115:                                              ; preds = %110, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %116

116:                                              ; preds = %115, %95
  br label %117

117:                                              ; preds = %116, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %118

118:                                              ; preds = %117
  %119 = load i64, ptr %20, align 8, !tbaa !9
  %120 = add nsw i64 %119, -1
  store i64 %120, ptr %20, align 8, !tbaa !9
  br label %69, !llvm.loop !13

121:                                              ; preds = %111, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %129

122:                                              ; preds = %72
  %123 = invoke noundef zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %19)
          to label %124 unwind label %125

124:                                              ; preds = %122
  store i1 %123, ptr %5, align 1
  store i32 1, ptr %17, align 4
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %19) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %19) #4
  br label %131

125:                                              ; preds = %122
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %13, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %14, align 4
  br label %129

129:                                              ; preds = %125, %121
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %19) #4
  br label %130

130:                                              ; preds = %129, %73
  call void @llvm.lifetime.end.p0(i64 80, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  br label %133

131:                                              ; preds = %124, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  %132 = load i1, ptr %5, align 1
  ret i1 %132

133:                                              ; preds = %130, %31
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %13, align 8
  %136 = load i32, ptr %14, align 4
  %137 = insertvalue { ptr, i32 } poison, ptr %135, 0
  %138 = insertvalue { ptr, i32 } %137, i32 %136, 1
  resume { ptr, i32 } %138

139:                                              ; preds = %55
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

attributes #0 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, 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 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checkRKSt6vectorIlSaIlEES1_ll(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #4
  %10 = add nsw i64 %2, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store i64 -1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #4
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %10, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %11 unwind label %14

11:                                               ; preds = %4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %12 = icmp sgt i64 %3, -1
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %26, %11
  %.026.lcssa = phi i64 [ 0, %11 ], [ %.2, %26 ]
  %13 = icmp slt i64 %.026.lcssa, %2
  br i1 %13, label %57, label %29

14:                                               ; preds = %4
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %58

.lr.ph:                                           ; preds = %11, %26
  %.02534 = phi i64 [ %27, %26 ], [ %3, %11 ]
  %.02633 = phi i64 [ %.2, %26 ], [ 0, %11 ]
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.02534) #4
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = icmp slt i64 %17, 1
  br i1 %18, label %26, label %19

19:                                               ; preds = %.lr.ph
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %17) #4
  %21 = load i64, ptr %20, align 8, !tbaa !5
  %22 = icmp slt i64 %21, 1
  br i1 %22, label %23, label %26

23:                                               ; preds = %19
  %24 = add nsw i64 %.02633, 1
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %17) #4
  store i64 %.02534, ptr %25, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %19, %23, %.lr.ph
  %.2 = phi i64 [ %.02633, %.lr.ph ], [ %24, %23 ], [ %.02633, %19 ]
  %27 = add nsw i64 %.02534, -1
  %28 = icmp sgt i64 %.02534, 0
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !9

29:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #4
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %.preheader unwind label %31

.preheader:                                       ; preds = %29
  br i1 %12, label %.lr.ph36, label %._crit_edge37

._crit_edge37:                                    ; preds = %53, %.preheader
  %30 = call noundef zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #4
  br label %57

31:                                               ; preds = %29
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %56

.lr.ph36:                                         ; preds = %.preheader, %53
  %.02335 = phi i64 [ %54, %53 ], [ %3, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.02335) #4
  %34 = load i64, ptr %33, align 8, !tbaa !5
  store i64 %34, ptr %9, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %34) #4
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = icmp eq i64 %36, %.02335
  br i1 %37, label %38, label %41

38:                                               ; preds = %.lr.ph36
  invoke void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %53 unwind label %39

39:                                               ; preds = %38
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #4
  br label %56

41:                                               ; preds = %.lr.ph36
  %42 = call noundef i64 @_ZNKSt5queueIlSt5dequeIlSaIlEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %.not = icmp eq i64 %42, 0
  br i1 %.not, label %53, label %43

43:                                               ; preds = %41
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIlSt5dequeIlSaIlEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %45 = load i64, ptr %44, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %45) #4
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = add nsw i64 %47, -1
  store i64 %48, ptr %46, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %45) #4
  %50 = load i64, ptr %49, align 8, !tbaa !5
  %51 = icmp slt i64 %50, 1
  br i1 %51, label %52, label %53

52:                                               ; preds = %43
  call void @_ZNSt5queueIlSt5dequeIlSaIlEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br label %53

53:                                               ; preds = %43, %52, %41, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  %54 = add nsw i64 %.02335, -1
  %55 = icmp sgt i64 %.02335, 0
  br i1 %55, label %.lr.ph36, label %._crit_edge37, !llvm.loop !11

56:                                               ; preds = %39, %31
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #4
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  br label %58

57:                                               ; preds = %._crit_edge, %._crit_edge37
  %.0 = phi i1 [ %30, %._crit_edge37 ], [ false, %._crit_edge ]
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  ret i1 %.0

58:                                               ; preds = %56, %14
  %.pn.pn = phi { ptr, i32 } [ %.pn, %56 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn.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 @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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 #0 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 @_ZNKSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

attributes #0 = { 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 #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}


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