; LLVM IR from bqi343/cp-notebook :: Contests/USACO Training/Ch 4/4.2 job.ll (Z4posii)

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

@B = external dso_local global %"class.std::vector", align 8
@times = external dso_local global %"class.std::vector", align 8
@N = external dso_local global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z4posii(i32 noundef %0) #0 {
  %2 = alloca i1, align 1
  %3 = alloca i32, align 4
  %4 = alloca [1000 x i8], align 16
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1000, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %23, %1
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = load i32, ptr @N, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %26

19:                                               ; preds = %14
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1000 x i8], ptr %4, i64 0, i64 %21
  store i8 0, ptr %22, align 1, !tbaa !9
  br label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %5, align 4, !tbaa !5
  br label %14, !llvm.loop !11

26:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store ptr @B, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %27 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @B) #3
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %27, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %29 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @B) #3
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  br label %31

31:                                               ; preds = %82, %26
  %32 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  br i1 %32, label %34, label %33

33:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %84

34:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %36 = load i32, ptr %35, align 4, !tbaa !5
  store i32 %36, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = sub nsw i32 %37, %38
  store i32 %39, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %40 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @times) #3
  %41 = sub i64 %40, 1
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %11, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %74, %34
  %44 = load i32, ptr %11, align 4, !tbaa !5
  %45 = icmp sge i32 %44, 0
  br i1 %45, label %46, label %81

46:                                               ; preds = %43
  br label %47

47:                                               ; preds = %67, %46
  %48 = load i32, ptr %11, align 4, !tbaa !5
  %49 = icmp sge i32 %48, 0
  br i1 %49, label %50, label %65

50:                                               ; preds = %47
  %51 = load i32, ptr %11, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @times, i64 noundef %52) #3
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = icmp sgt i32 %54, %55
  br i1 %56, label %63, label %57

57:                                               ; preds = %50
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1000 x i8], ptr %4, i64 0, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !9, !range !15, !noundef !16
  %62 = trunc i8 %61 to i1
  br label %63

63:                                               ; preds = %57, %50
  %64 = phi i1 [ true, %50 ], [ %62, %57 ]
  br label %65

65:                                               ; preds = %63, %47
  %66 = phi i1 [ false, %47 ], [ %64, %63 ]
  br i1 %66, label %67, label %70

67:                                               ; preds = %65
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr %11, align 4, !tbaa !5
  br label %47, !llvm.loop !17

70:                                               ; preds = %65
  %71 = load i32, ptr %11, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  br label %81

74:                                               ; preds = %70
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1000 x i8], ptr %4, i64 0, i64 %76
  store i8 1, ptr %77, align 1, !tbaa !9
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = sub nsw i32 %79, %78
  store i32 %80, ptr %10, align 4, !tbaa !5
  br label %43, !llvm.loop !18

81:                                               ; preds = %73, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %82

82:                                               ; preds = %81
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  br label %31

84:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %100, %84
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = load i32, ptr @N, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 11, ptr %13, align 4
  br label %103

90:                                               ; preds = %85
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1000 x i8], ptr %4, i64 0, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !9, !range !15, !noundef !16
  %95 = trunc i8 %94 to i1
  %96 = zext i1 %95 to i32
  %97 = icmp eq i32 %96, 0
  br i1 %97, label %98, label %99

98:                                               ; preds = %90
  store i1 false, ptr %2, align 1
  store i32 1, ptr %13, align 4
  br label %103

99:                                               ; preds = %90
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %12, align 4, !tbaa !5
  br label %85, !llvm.loop !19

103:                                              ; preds = %98, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %104 = load i32, ptr %13, align 4
  switch i32 %104, label %106 [
    i32 11, label %105
  ]

105:                                              ; preds = %103
  store i1 true, ptr %2, align 1
  store i32 1, ptr %13, align 4
  br label %106

106:                                              ; preds = %105, %103
  call void @llvm.lifetime.end.p0(i64 1000, ptr %4) #3
  %107 = load i1, ptr %2, align 1
  ret i1 %107
}

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

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@B = external dso_local global %"class.std::vector", align 8
@times = external dso_local global %"class.std::vector", align 8
@N = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z4posii(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca [1000 x i8], align 16
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %2) #4
  %5 = load i32, ptr @N, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %1
  %7 = zext nneg i32 %5 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %2, i8 0, i64 %7, i1 false), !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %8 = tail call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @B) #4
  store ptr %8, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %9 = tail call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @B) #4
  store ptr %9, ptr %4, align 8
  %10 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %10, label %.lr.ph37, label %._crit_edge38

._crit_edge38:                                    ; preds = %.critedge.thread, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %11 = load i32, ptr @N, align 4, !tbaa !5
  %.not39 = icmp slt i32 %11, 1
  br i1 %.not39, label %.critedge28, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %._crit_edge38
  %12 = zext nneg i32 %11 to i64
  %wide.trip.count = zext nneg i32 %11 to i64
  %13 = load i8, ptr %2, align 16, !tbaa !9, !range !11, !noundef !12
  %14 = icmp eq i8 %13, 0
  br i1 %14, label %.critedge28, label %.lr.ph

.lr.ph37:                                         ; preds = %._crit_edge, %.critedge.thread
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @times) #4
  %18 = trunc i64 %17 to i32
  %19 = add i32 %18, -1
  %20 = icmp sgt i32 %19, -1
  br i1 %20, label %.preheader, label %.critedge.thread

.preheader:                                       ; preds = %.lr.ph37, %.critedge
  %.02335.pn = phi i32 [ %.02335, %.critedge ], [ %0, %.lr.ph37 ]
  %.02234 = phi i32 [ %32, %.critedge ], [ %19, %.lr.ph37 ]
  %.02335 = sub nsw i32 %.02335.pn, %16
  %21 = zext nneg i32 %.02234 to i64
  br label %22

22:                                               ; preds = %.preheader, %.critedge2
  %indvars.iv = phi i64 [ %21, %.preheader ], [ %indvars.iv.next, %.critedge2 ]
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @times, i64 noundef %indvars.iv) #4
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, %.02335
  br i1 %25, label %.critedge2, label %26

26:                                               ; preds = %22
  %27 = getelementptr inbounds [1000 x i8], ptr %2, i64 0, i64 %indvars.iv
  %28 = load i8, ptr %27, align 1, !tbaa !9, !range !11, !noundef !12
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %.critedge2, label %.critedge

.critedge2:                                       ; preds = %22, %26
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %30 = trunc nuw i64 %indvars.iv to i32
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %22, label %.critedge.thread, !llvm.loop !13

.critedge:                                        ; preds = %26
  %32 = trunc nuw i64 %indvars.iv to i32
  %33 = and i64 %indvars.iv, 4294967295
  %34 = getelementptr inbounds [1000 x i8], ptr %2, i64 0, i64 %33
  store i8 1, ptr %34, align 1, !tbaa !9
  %35 = icmp sgt i32 %32, -1
  br i1 %35, label %.preheader, label %.critedge.thread, !llvm.loop !15

.critedge.thread:                                 ; preds = %.critedge, %.critedge2, %.lr.ph37
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %37, label %.lr.ph37, label %._crit_edge38

.lr.ph:                                           ; preds = %.lr.ph43.preheader, %.lr.ph43
  %indvars.iv5056 = phi i64 [ %indvars.iv.next51, %.lr.ph43 ], [ 0, %.lr.ph43.preheader ]
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv5056, 1
  %exitcond = icmp eq i64 %indvars.iv.next51, %wide.trip.count
  br i1 %exitcond, label %.critedge28.loopexit, label %.lr.ph43, !llvm.loop !16

.lr.ph43:                                         ; preds = %.lr.ph
  %38 = getelementptr inbounds [1000 x i8], ptr %2, i64 0, i64 %indvars.iv.next51
  %39 = load i8, ptr %38, align 1, !tbaa !9, !range !11, !noundef !12
  %40 = icmp eq i8 %39, 0
  br i1 %40, label %.critedge28.loopexit, label %.lr.ph, !llvm.loop !16

.critedge28.loopexit:                             ; preds = %.lr.ph43, %.lr.ph
  %.not.le = icmp uge i64 %indvars.iv.next51, %12
  br label %.critedge28

.critedge28:                                      ; preds = %.critedge28.loopexit, %.lr.ph43.preheader, %._crit_edge38
  %.not.lcssa = phi i1 [ true, %._crit_edge38 ], [ false, %.lr.ph43.preheader ], [ %.not.le, %.critedge28.loopexit ]
  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %2) #4
  ret i1 %.not.lcssa
}

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"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 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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