; LLVM IR from weicao/cascadb :: src/serialize/layout.ll (ZN7cascadb6Layout8get_holeEmRm)

; 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.cascadb::ScopedMutex" = type { i8, ptr }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::_Deque_iterator.6" = type { ptr, ptr, ptr, ptr }
%"class.cascadb::Layout" = type { ptr, i64, %"class.cascadb::Options", %"class.cascadb::Mutex", i64, ptr, %"class.cascadb::Mutex", %"class.std::map", %"class.std::map", %"class.cascadb::Mutex", %"class.cascadb::Mutex", %"class.std::deque", %"class.std::deque", i64, i64 }
%"class.cascadb::Options" = type <{ ptr, ptr, i64, i64, i64, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, cascadb::BlockMeta *>, std::_Select1st<std::pair<const unsigned long, cascadb::BlockMeta *>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, cascadb::BlockMeta *>, std::_Select1st<std::pair<const unsigned long, cascadb::BlockMeta *>>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.cascadb::Mutex" = type { i8, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl" }
%"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl" = type { %"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl_data" }
%"struct.std::_Deque_base<cascadb::Layout::Hole, std::allocator<cascadb::Layout::Hole>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.cascadb::Layout::Hole" = type { i64, i64 }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb6Layout8get_holeEmRm(ptr noundef nonnull align 8 dereferenceable(600) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.cascadb::ScopedMutex", align 8
  %9 = alloca %"struct.std::_Deque_iterator", align 8
  %10 = alloca %"struct.std::_Deque_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::_Deque_iterator.6", align 8
  %13 = alloca %"struct.std::_Deque_iterator", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"struct.std::_Deque_iterator", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %18 = getelementptr inbounds %"class.cascadb::Layout", ptr %17, i32 0, i32 9
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #3
  %19 = getelementptr inbounds %"class.cascadb::Layout", ptr %17, i32 0, i32 11
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5beginEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(80) %19) #3
  br label %20

20:                                               ; preds = %63, %3
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #3
  %21 = getelementptr inbounds %"class.cascadb::Layout", ptr %17, i32 0, i32 11
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE3endEv(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(80) %21) #3
  %22 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_ES7_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %10) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #3
  br i1 %22, label %23, label %64

23:                                               ; preds = %20
  %24 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  %25 = getelementptr inbounds %"struct.cascadb::Layout::Hole", ptr %24, i32 0, i32 1
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = icmp ugt i64 %26, %27
  br i1 %28, label %29, label %44

29:                                               ; preds = %23
  %30 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  %31 = getelementptr inbounds %"struct.cascadb::Layout::Hole", ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !13
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %32, ptr %33, align 8, !tbaa !9
  %34 = load i64, ptr %6, align 8, !tbaa !9
  %35 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  %36 = getelementptr inbounds %"struct.cascadb::Layout::Hole", ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !13
  %38 = add i64 %37, %34
  store i64 %38, ptr %36, align 8, !tbaa !13
  %39 = load i64, ptr %6, align 8, !tbaa !9
  %40 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  %41 = getelementptr inbounds %"struct.cascadb::Layout::Hole", ptr %40, i32 0, i32 1
  %42 = load i64, ptr %41, align 8, !tbaa !11
  %43 = sub i64 %42, %39
  store i64 %43, ptr %41, align 8, !tbaa !11
  store i1 true, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %65

44:                                               ; preds = %23
  %45 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  %46 = getelementptr inbounds %"struct.cascadb::Layout::Hole", ptr %45, i32 0, i32 1
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = load i64, ptr %6, align 8, !tbaa !9
  %49 = icmp eq i64 %47, %48
  br i1 %49, label %50, label %61

50:                                               ; preds = %44
  %51 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  %52 = getelementptr inbounds %"struct.cascadb::Layout::Hole", ptr %51, i32 0, i32 0
  %53 = load i64, ptr %52, align 8, !tbaa !13
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %53, ptr %54, align 8, !tbaa !9
  %55 = getelementptr inbounds %"class.cascadb::Layout", ptr %17, i32 0, i32 11
  call void @_ZNSt15_Deque_iteratorIN7cascadb6Layout4HoleERKS2_PS3_EC2IS_IS2_RS2_PS2_EvEERKT_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %9) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #3
  invoke void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5eraseESt15_Deque_iteratorIS2_RKS2_PS6_E(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator") align 8 %13, ptr noundef nonnull align 8 dereferenceable(80) %55, ptr noundef %12)
          to label %56 unwind label %57

56:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #3
  store i1 true, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %65

57:                                               ; preds = %50
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %14, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  br label %67

61:                                               ; preds = %44
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #3
  call void @_ZNSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EppEi(ptr dead_on_unwind writable sret(%"struct.std::_Deque_iterator") align 8 %16, ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef 0) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #3
  br label %20, !llvm.loop !14

64:                                               ; preds = %20
  store i1 false, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %65

65:                                               ; preds = %64, %56, %29
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  %66 = load i1, ptr %4, align 1
  ret i1 %66

67:                                               ; preds = %57
  %68 = load ptr, ptr %14, align 8
  %69 = load i32, ptr %15, align 4
  %70 = insertvalue { ptr, i32 } poison, ptr %68, 0
  %71 = insertvalue { ptr, i32 } %70, i32 %69, 1
  resume { ptr, i32 } %71
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5eraseESt15_Deque_iteratorIS2_RKS2_PS6_E(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EppEi(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #2 align 2

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


; 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.cascadb::ScopedMutex" = type { i8, ptr }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::_Deque_iterator.6" = type { ptr, ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb6Layout8get_holeEmRm(ptr noundef nonnull align 8 dereferenceable(600) %0, i64 noundef %1, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.cascadb::ScopedMutex", align 8
  %5 = alloca %"struct.std::_Deque_iterator", align 8
  %6 = alloca %"struct.std::_Deque_iterator", align 8
  %7 = alloca %"struct.std::_Deque_iterator.6", align 8
  %8 = alloca %"struct.std::_Deque_iterator", align 8
  %9 = alloca %"struct.std::_Deque_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 328
  call void @_ZN7cascadb11ScopedMutexC2EPNS_5MutexE(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull %10)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #3
  %11 = getelementptr inbounds i8, ptr %0, i64 424
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5beginEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator") align 8 %5, ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #3
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %12 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_ES7_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #3
  br i1 %12, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %3, %37
  %13 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = icmp ugt i64 %15, %1
  %17 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  br i1 %16, label %18, label %27

18:                                               ; preds = %.lr.ph
  %19 = load i64, ptr %17, align 8, !tbaa !10
  store i64 %19, ptr %2, align 8, !tbaa !11
  %20 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  %21 = load i64, ptr %20, align 8, !tbaa !10
  %22 = add i64 %21, %1
  store i64 %22, ptr %20, align 8, !tbaa !10
  %23 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = sub i64 %25, %1
  store i64 %26, ptr %24, align 8, !tbaa !5
  br label %.loopexit

27:                                               ; preds = %.lr.ph
  %28 = getelementptr inbounds i8, ptr %17, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = icmp eq i64 %29, %1
  br i1 %30, label %31, label %37

31:                                               ; preds = %27
  %32 = call noundef ptr @_ZNKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EptEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  %33 = load i64, ptr %32, align 8, !tbaa !10
  store i64 %33, ptr %2, align 8, !tbaa !11
  call void @_ZNSt15_Deque_iteratorIN7cascadb6Layout4HoleERKS2_PS3_EC2IS_IS2_RS2_PS2_EvEERKT_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %5) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #3
  invoke void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5eraseESt15_Deque_iteratorIS2_RKS2_PS6_E(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull %7)
          to label %34 unwind label %35

34:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #3
  br label %.loopexit

35:                                               ; preds = %31
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  resume { ptr, i32 } %36

37:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #3
  call void @_ZNSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EppEi(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef 0) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #3
  call void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.std::_Deque_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(80) %11) #3
  %38 = call noundef zeroext i1 @_ZStneRKSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_ES7_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #3
  br i1 %38, label %.lr.ph, label %.loopexit, !llvm.loop !12

.loopexit:                                        ; preds = %37, %3, %34, %18
  %39 = phi i1 [ true, %34 ], [ true, %18 ], [ false, %3 ], [ false, %37 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #3
  call void @_ZN7cascadb11ScopedMutexD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #3
  ret i1 %39
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5beginEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIN7cascadb6Layout4HoleESaIS2_EE5eraseESt15_Deque_iteratorIS2_RKS2_PS6_E(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15_Deque_iteratorIN7cascadb6Layout4HoleERS2_PS2_EppEi(ptr dead_on_unwind noalias writable sret(%"struct.std::_Deque_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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, !7, i64 8}
!6 = !{!"_ZTSN7cascadb6Layout4HoleE", !7, i64 0, !7, i64 8}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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