; LLVM IR from ravireddy07/cpp-book :: src/Coding-Blocks/FriendsAtCodingBlocks.ll (Z9Sieve_setv)

; 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 long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.4" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@primes = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9Sieve_setv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector.0", align 8
  %4 = alloca i8, align 1
  %5 = alloca %"class.std::allocator.4", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::_Bit_reference", align 8
  %11 = alloca i64, align 8
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  store i64 1, ptr %1, align 8, !tbaa !5
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  store i64 2, ptr %2, align 8, !tbaa !5
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  store i8 1, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 50, ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %15 unwind label %22

15:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store i64 3, ptr %8, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %67, %15
  %17 = load i64, ptr %8, align 8, !tbaa !5
  %18 = load i64, ptr %8, align 8, !tbaa !5
  %19 = mul nsw i64 %17, %18
  %20 = icmp sle i64 %19, 50
  br i1 %20, label %26, label %21

21:                                               ; preds = %16
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %71

22:                                               ; preds = %0
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %6, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  br label %102

26:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #3
  %27 = load i64, ptr %8, align 8, !tbaa !5
  %28 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %27)
          to label %29 unwind label %43

29:                                               ; preds = %26
  %30 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %31 = extractvalue { ptr, i64 } %28, 0
  store ptr %31, ptr %30, align 8
  %32 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %33 = extractvalue { ptr, i64 } %28, 1
  store i64 %33, ptr %32, align 8
  %34 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  br i1 %34, label %35, label %66

35:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %36 = load i64, ptr %8, align 8, !tbaa !5
  %37 = load i64, ptr %8, align 8, !tbaa !5
  %38 = mul nsw i64 %36, %37
  store i64 %38, ptr %11, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %56, %35
  %40 = load i64, ptr %11, align 8, !tbaa !5
  %41 = icmp sle i64 %40, 50
  br i1 %41, label %47, label %42

42:                                               ; preds = %39
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %65

43:                                               ; preds = %26
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %6, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  br label %70

47:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #3
  %48 = load i64, ptr %11, align 8, !tbaa !5
  %49 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %48)
          to label %50 unwind label %61

50:                                               ; preds = %47
  %51 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 0
  %52 = extractvalue { ptr, i64 } %49, 0
  store ptr %52, ptr %51, align 8
  %53 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 1
  %54 = extractvalue { ptr, i64 } %49, 1
  store i64 %54, ptr %53, align 8
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %12, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #3
  br label %56

56:                                               ; preds = %50
  %57 = load i64, ptr %8, align 8, !tbaa !5
  %58 = mul nsw i64 2, %57
  %59 = load i64, ptr %11, align 8, !tbaa !5
  %60 = add nsw i64 %59, %58
  store i64 %60, ptr %11, align 8, !tbaa !5
  br label %39, !llvm.loop !11

61:                                               ; preds = %47
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %70

65:                                               ; preds = %42
  br label %66

66:                                               ; preds = %65, %29
  br label %67

67:                                               ; preds = %66
  %68 = load i64, ptr %8, align 8, !tbaa !5
  %69 = add nsw i64 %68, 2
  store i64 %69, ptr %8, align 8, !tbaa !5
  br label %16, !llvm.loop !13

70:                                               ; preds = %61, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %101

71:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i64 3, ptr %13, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %96, %71
  %73 = load i64, ptr %13, align 8, !tbaa !5
  %74 = icmp sle i64 %73, 50
  br i1 %74, label %76, label %75

75:                                               ; preds = %72
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %100

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #3
  %77 = load i64, ptr %13, align 8, !tbaa !5
  %78 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %77)
          to label %79 unwind label %87

79:                                               ; preds = %76
  %80 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %81 = extractvalue { ptr, i64 } %78, 0
  store ptr %81, ptr %80, align 8
  %82 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %83 = extractvalue { ptr, i64 } %78, 1
  store i64 %83, ptr %82, align 8
  %84 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %14) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  br i1 %84, label %85, label %95

85:                                               ; preds = %79
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %86 unwind label %91

86:                                               ; preds = %85
  br label %95

87:                                               ; preds = %76
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %6, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  br label %99

91:                                               ; preds = %85
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %6, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %7, align 4
  br label %99

95:                                               ; preds = %86, %79
  br label %96

96:                                               ; preds = %95
  %97 = load i64, ptr %13, align 8, !tbaa !5
  %98 = add nsw i64 %97, 2
  store i64 %98, ptr %13, align 8, !tbaa !5
  br label %72, !llvm.loop !14

99:                                               ; preds = %91, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %101

100:                                              ; preds = %75
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %3) #3
  ret void

101:                                              ; preds = %99, %70
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #3
  br label %102

102:                                              ; preds = %101, %22
  call void @llvm.lifetime.end.p0(i64 40, ptr %3) #3
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %6, align 8
  %105 = load i32, ptr %7, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

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

; 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 void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) 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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !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 long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.4" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@primes = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9Sieve_setv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector.0", align 8
  %4 = alloca i8, align 1
  %5 = alloca %"class.std::allocator.4", align 1
  %6 = alloca %"struct.std::_Bit_reference", align 8
  %7 = alloca %"struct.std::_Bit_reference", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  store i64 1, ptr %1, align 8, !tbaa !5
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 8 dereferenceable(8) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  store i64 2, ptr %2, align 8, !tbaa !5
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  store i8 1, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 50, ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %10 unwind label %14

10:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  %11 = getelementptr inbounds i8, ptr %6, i64 8
  %12 = getelementptr inbounds i8, ptr %7, i64 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %13 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 3)
          to label %16 unwind label %21

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  br label %103

16:                                               ; preds = %10
  %17 = extractvalue { ptr, i64 } %13, 0
  store ptr %17, ptr %6, align 8
  %18 = extractvalue { ptr, i64 } %13, 1
  store i64 %18, ptr %11, align 8
  %19 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br i1 %19, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %20 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 9)
          to label %23 unwind label %.loopexit27

21:                                               ; preds = %.loopexit.1, %.loopexit, %10
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %102

23:                                               ; preds = %.lr.ph
  %24 = extractvalue { ptr, i64 } %20, 0
  store ptr %24, ptr %7, align 8
  %25 = extractvalue { ptr, i64 } %20, 1
  store i64 %25, ptr %12, align 8
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %27 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 15)
          to label %28 unwind label %.loopexit27

28:                                               ; preds = %23
  %29 = extractvalue { ptr, i64 } %27, 0
  store ptr %29, ptr %7, align 8
  %30 = extractvalue { ptr, i64 } %27, 1
  store i64 %30, ptr %12, align 8
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %32 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 21)
          to label %33 unwind label %.loopexit27

33:                                               ; preds = %28
  %34 = extractvalue { ptr, i64 } %32, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i64 } %32, 1
  store i64 %35, ptr %12, align 8
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %37 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 27)
          to label %38 unwind label %.loopexit27

38:                                               ; preds = %33
  %39 = extractvalue { ptr, i64 } %37, 0
  store ptr %39, ptr %7, align 8
  %40 = extractvalue { ptr, i64 } %37, 1
  store i64 %40, ptr %12, align 8
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %42 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 33)
          to label %43 unwind label %.loopexit27

43:                                               ; preds = %38
  %44 = extractvalue { ptr, i64 } %42, 0
  store ptr %44, ptr %7, align 8
  %45 = extractvalue { ptr, i64 } %42, 1
  store i64 %45, ptr %12, align 8
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %47 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 39)
          to label %48 unwind label %.loopexit27

48:                                               ; preds = %43
  %49 = extractvalue { ptr, i64 } %47, 0
  store ptr %49, ptr %7, align 8
  %50 = extractvalue { ptr, i64 } %47, 1
  store i64 %50, ptr %12, align 8
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %52 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 45)
          to label %.loopexit.loopexit unwind label %.loopexit27

.loopexit.loopexit:                               ; preds = %48
  %53 = extractvalue { ptr, i64 } %52, 0
  store ptr %53, ptr %7, align 8
  %54 = extractvalue { ptr, i64 } %52, 1
  store i64 %54, ptr %12, align 8
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br label %.loopexit

.loopexit27:                                      ; preds = %48, %43, %38, %33, %28, %23, %.lr.ph
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %67, %62, %.lr.ph.1
  %lpad.loopexit28 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %.lr.ph.2
  %lpad.loopexit.split-lp29 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit27
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit27 ], [ %lpad.loopexit28, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp29, %.loopexit.split-lp.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br label %102

.loopexit:                                        ; preds = %.loopexit.loopexit, %16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %56 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 5)
          to label %57 unwind label %21

57:                                               ; preds = %.loopexit
  %58 = extractvalue { ptr, i64 } %56, 0
  store ptr %58, ptr %6, align 8
  %59 = extractvalue { ptr, i64 } %56, 1
  store i64 %59, ptr %11, align 8
  %60 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br i1 %60, label %.lr.ph.1, label %.loopexit.1

.lr.ph.1:                                         ; preds = %57
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %61 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 25)
          to label %62 unwind label %.loopexit.split-lp.loopexit

62:                                               ; preds = %.lr.ph.1
  %63 = extractvalue { ptr, i64 } %61, 0
  store ptr %63, ptr %7, align 8
  %64 = extractvalue { ptr, i64 } %61, 1
  store i64 %64, ptr %12, align 8
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %66 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 35)
          to label %67 unwind label %.loopexit.split-lp.loopexit

67:                                               ; preds = %62
  %68 = extractvalue { ptr, i64 } %66, 0
  store ptr %68, ptr %7, align 8
  %69 = extractvalue { ptr, i64 } %66, 1
  store i64 %69, ptr %12, align 8
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %71 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 45)
          to label %.loopexit.loopexit.1 unwind label %.loopexit.split-lp.loopexit

.loopexit.loopexit.1:                             ; preds = %67
  %72 = extractvalue { ptr, i64 } %71, 0
  store ptr %72, ptr %7, align 8
  %73 = extractvalue { ptr, i64 } %71, 1
  store i64 %73, ptr %12, align 8
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br label %.loopexit.1

.loopexit.1:                                      ; preds = %.loopexit.loopexit.1, %57
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %75 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 7)
          to label %76 unwind label %21

76:                                               ; preds = %.loopexit.1
  %77 = extractvalue { ptr, i64 } %75, 0
  store ptr %77, ptr %6, align 8
  %78 = extractvalue { ptr, i64 } %75, 1
  store i64 %78, ptr %11, align 8
  %79 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br i1 %79, label %.lr.ph.2, label %.loopexit.2

.lr.ph.2:                                         ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %80 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef 49)
          to label %.loopexit.loopexit.2 unwind label %.loopexit.split-lp.loopexit.split-lp

.loopexit.loopexit.2:                             ; preds = %.lr.ph.2
  %81 = extractvalue { ptr, i64 } %80, 0
  store ptr %81, ptr %7, align 8
  %82 = extractvalue { ptr, i64 } %80, 1
  store i64 %82, ptr %12, align 8
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %7, i1 noundef zeroext false) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br label %.loopexit.2

.loopexit.2:                                      ; preds = %.loopexit.loopexit.2, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  store i64 3, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %9, i64 8
  br label %86

85:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #3
  ret void

86:                                               ; preds = %.loopexit.2, %97
  %storemerge26 = phi i64 [ 3, %.loopexit.2 ], [ %99, %97 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #3
  %87 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %3, i64 noundef %storemerge26)
          to label %88 unwind label %93

88:                                               ; preds = %86
  %89 = extractvalue { ptr, i64 } %87, 0
  store ptr %89, ptr %9, align 8
  %90 = extractvalue { ptr, i64 } %87, 1
  store i64 %90, ptr %84, align 8
  %91 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #3
  br i1 %91, label %92, label %97

92:                                               ; preds = %88
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @primes, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %97 unwind label %95

93:                                               ; preds = %86
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #3
  br label %101

95:                                               ; preds = %92
  %96 = landingpad { ptr, i32 }
          cleanup
  br label %101

97:                                               ; preds = %88, %92
  %98 = load i64, ptr %8, align 8, !tbaa !5
  %99 = add nsw i64 %98, 2
  store i64 %99, ptr %8, align 8, !tbaa !5
  %100 = icmp slt i64 %98, 49
  br i1 %100, label %86, label %85, !llvm.loop !11

101:                                              ; preds = %95, %93
  %.pn = phi { ptr, i32 } [ %96, %95 ], [ %94, %93 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %102

102:                                              ; preds = %21, %.loopexit.split-lp, %101
  %.pn19.pn = phi { ptr, i32 } [ %.pn, %101 ], [ %lpad.phi, %.loopexit.split-lp ], [ %22, %21 ]
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %3) #3
  br label %103

103:                                              ; preds = %102, %14
  %.pn19.pn.pn = phi { ptr, i32 } [ %.pn19.pn, %102 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #3
  resume { ptr, i32 } %.pn19.pn.pn
}

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

; 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 void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) 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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass