; LLVM IR from opset/openset :: lib/sba/sba.ll (ZN7PoolMem6getPtrEl)

; 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.csLock = type { ptr }
%class.PoolMem = type { %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<PoolMem::memory_s, std::allocator<PoolMem::memory_s>>::_Vector_impl" }
%"struct.std::_Vector_base<PoolMem::memory_s, std::allocator<PoolMem::memory_s>>::_Vector_impl" = type { %"struct.std::_Vector_base<PoolMem::memory_s, std::allocator<PoolMem::memory_s>>::_Vector_impl_data" }
%"struct.std::_Vector_base<PoolMem::memory_s, std::allocator<PoolMem::memory_s>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = 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 }
%"struct.PoolMem::memory_s" = type { %class.CriticalSection, i32, i64, %"class.std::vector.5" }
%class.CriticalSection = type { %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i8 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<PoolMem::alloc_s *, std::allocator<PoolMem::alloc_s *>>::_Vector_impl" }
%"struct.std::_Vector_base<PoolMem::alloc_s *, std::allocator<PoolMem::alloc_s *>>::_Vector_impl" = type { %"struct.std::_Vector_base<PoolMem::alloc_s *, std::allocator<PoolMem::alloc_s *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<PoolMem::alloc_s *, std::allocator<PoolMem::alloc_s *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.PoolMem::alloc_s" = type <{ i32, [1 x i8] }>

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

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) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7PoolMem6getPtrEl(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %class.csLock, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %16 = load i64, ptr %5, align 8, !tbaa !9
  %17 = call noundef double @_ZSt4sqrtIlEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %16)
  %18 = fptosi double %17 to i64
  store i64 %18, ptr %6, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %38, %2
  %20 = load i64, ptr %6, align 8, !tbaa !9
  %21 = getelementptr inbounds %class.PoolMem, ptr %15, i32 0, i32 1
  %22 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  %23 = icmp ult i64 %20, %22
  br i1 %23, label %24, label %36

24:                                               ; preds = %19
  %25 = load i64, ptr %5, align 8, !tbaa !9
  %26 = getelementptr inbounds %class.PoolMem, ptr %15, i32 0, i32 0
  %27 = getelementptr inbounds %class.PoolMem, ptr %15, i32 0, i32 1
  %28 = load i64, ptr %6, align 8, !tbaa !9
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %28) #5
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7PoolMem8memory_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %31) #5
  %33 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %32, i32 0, i32 2
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = icmp sgt i64 %25, %34
  br label %36

36:                                               ; preds = %24, %19
  %37 = phi i1 [ false, %19 ], [ %35, %24 ]
  br i1 %37, label %38, label %41

38:                                               ; preds = %36
  %39 = load i64, ptr %6, align 8, !tbaa !9
  %40 = add nsw i64 %39, 1
  store i64 %40, ptr %6, align 8, !tbaa !9
  br label %19, !llvm.loop !23

41:                                               ; preds = %36
  %42 = load i64, ptr %6, align 8, !tbaa !9
  %43 = getelementptr inbounds %class.PoolMem, ptr %15, i32 0, i32 1
  %44 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #5
  %45 = icmp uge i64 %42, %44
  br i1 %45, label %46, label %55

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %47 = load i64, ptr %5, align 8, !tbaa !9
  %48 = add nsw i64 %47, 4
  %49 = call noalias noundef nonnull ptr @_Znam(i64 noundef %48) #6
  store ptr %49, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %"struct.PoolMem::alloc_s", ptr %50, i32 0, i32 0
  store i32 -1, ptr %51, align 1, !tbaa !25
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.PoolMem::alloc_s", ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds [1 x i8], ptr %53, i64 0, i64 0
  store ptr %54, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %103

55:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %56 = getelementptr inbounds %class.PoolMem, ptr %15, i32 0, i32 0
  %57 = getelementptr inbounds %class.PoolMem, ptr %15, i32 0, i32 1
  %58 = load i64, ptr %6, align 8, !tbaa !9
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %58) #5
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7PoolMem8memory_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %61) #5
  store ptr %62, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %63, i32 0, i32 0
  call void @_ZN6csLockC2ER15CriticalSection(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 1 dereferenceable(1) %64)
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %65, i32 0, i32 3
  %67 = call noundef zeroext i1 @_ZNKSt6vectorIPN7PoolMem7alloc_sESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #5
  br i1 %67, label %83, label %68

68:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %69, i32 0, i32 3
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7PoolMem7alloc_sESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #5
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  store ptr %72, ptr %11, align 8, !tbaa !5
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %73, i32 0, i32 3
  call void @_ZNSt6vectorIPN7PoolMem7alloc_sESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #5
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !27
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.PoolMem::alloc_s", ptr %78, i32 0, i32 0
  store i32 %77, ptr %79, align 1, !tbaa !25
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.PoolMem::alloc_s", ptr %80, i32 0, i32 1
  %82 = getelementptr inbounds [1 x i8], ptr %81, i64 0, i64 0
  store ptr %82, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %102

83:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %84, i32 0, i32 2
  %86 = load i64, ptr %85, align 8, !tbaa !13
  %87 = add nsw i64 %86, 4
  %88 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %87) #6
          to label %89 unwind label %98

89:                                               ; preds = %83
  store ptr %88, ptr %12, align 8, !tbaa !5
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = getelementptr inbounds %"struct.PoolMem::memory_s", ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !27
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.PoolMem::alloc_s", ptr %93, i32 0, i32 0
  store i32 %92, ptr %94, align 1, !tbaa !25
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.PoolMem::alloc_s", ptr %95, i32 0, i32 1
  %97 = getelementptr inbounds [1 x i8], ptr %96, i64 0, i64 0
  store ptr %97, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %102

98:                                               ; preds = %83
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %13, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZN6csLockD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %105

102:                                              ; preds = %89, %68
  call void @_ZN6csLockD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %103

103:                                              ; preds = %102, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %104 = load ptr, ptr %3, align 8
  ret ptr %104

105:                                              ; preds = %98
  %106 = load ptr, ptr %13, align 8
  %107 = load i32, ptr %14, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIlEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7PoolMem8memory_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 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) #3 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

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

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

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

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

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

!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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTSN7PoolMem8memory_sE", !15, i64 0, !12, i64 4, !10, i64 8, !19, i64 16}
!15 = !{!"_ZTS15CriticalSection", !16, i64 0}
!16 = !{!"_ZTSSt6atomicIbE", !17, i64 0}
!17 = !{!"_ZTSSt13__atomic_baseIbE", !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTSSt6vectorIPN7PoolMem7alloc_sESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIPN7PoolMem7alloc_sESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIPN7PoolMem7alloc_sESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPN7PoolMem7alloc_sESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !12, i64 0}
!26 = !{!"_ZTSN7PoolMem7alloc_sE", !12, i64 0, !7, i64 4}
!27 = !{!14, !12, i64 4}


; 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.csLock = type { ptr }

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

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) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull ptr @_ZN7PoolMem6getPtrEl(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.csLock, align 8
  %4 = tail call noundef double @_ZSt4sqrtIlEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %1)
  %5 = fptosi double %4 to i64
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %8 = icmp ugt i64 %7, %5
  br i1 %8, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %2, %16
  %.02426 = phi i64 [ %17, %16 ], [ %5, %2 ]
  %9 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.02426) #5
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7PoolMem8memory_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %11) #5
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !9
  %15 = icmp slt i64 %14, %1
  br i1 %15, label %16, label %.critedge

16:                                               ; preds = %.lr.ph
  %17 = add nuw nsw i64 %.02426, 1
  %18 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %19 = icmp ult i64 %17, %18
  br i1 %19, label %.lr.ph, label %.critedge, !llvm.loop !21

.critedge:                                        ; preds = %.lr.ph, %16, %2
  %.024.lcssa = phi i64 [ %5, %2 ], [ %17, %16 ], [ %.02426, %.lr.ph ]
  %20 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %.not = icmp ult i64 %.024.lcssa, %20
  br i1 %.not, label %24, label %21

21:                                               ; preds = %.critedge
  %22 = add nsw i64 %1, 4
  %23 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %22) #6
  store i32 -1, ptr %23, align 1, !tbaa !23
  br label %44

24:                                               ; preds = %.critedge
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.024.lcssa) #5
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7PoolMem8memory_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %27) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @_ZN6csLockC2ER15CriticalSection(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(1) %28)
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %30 = call noundef zeroext i1 @_ZNKSt6vectorIPN7PoolMem7alloc_sESaIS2_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  br i1 %30, label %34, label %31

31:                                               ; preds = %24
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7PoolMem7alloc_sESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  %33 = load ptr, ptr %32, align 8, !tbaa !25
  call void @_ZNSt6vectorIPN7PoolMem7alloc_sESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  br label %41

34:                                               ; preds = %24
  %35 = getelementptr inbounds i8, ptr %28, i64 8
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = add nsw i64 %36, 4
  %38 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %37) #6
          to label %41 unwind label %39

39:                                               ; preds = %34
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6csLockD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %40

41:                                               ; preds = %34, %31
  %.sink31 = phi ptr [ %33, %31 ], [ %38, %34 ]
  %42 = getelementptr inbounds i8, ptr %28, i64 4
  %43 = load i32, ptr %42, align 4, !tbaa !26
  store i32 %43, ptr %.sink31, align 1, !tbaa !23
  call void @_ZN6csLockD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %44

44:                                               ; preds = %41, %21
  %.pn25 = phi ptr [ %23, %21 ], [ %.sink31, %41 ]
  %.1 = getelementptr inbounds i8, ptr %.pn25, i64 4
  ret ptr %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIlEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN7PoolMem8memory_sESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 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 #3 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

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

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

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

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

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

!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, !15, i64 8}
!10 = !{!"_ZTSN7PoolMem8memory_sE", !11, i64 0, !6, i64 4, !15, i64 8, !16, i64 16}
!11 = !{!"_ZTS15CriticalSection", !12, i64 0}
!12 = !{!"_ZTSSt6atomicIbE", !13, i64 0}
!13 = !{!"_ZTSSt13__atomic_baseIbE", !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIPN7PoolMem7alloc_sESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIPN7PoolMem7alloc_sESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN7PoolMem7alloc_sESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPN7PoolMem7alloc_sESaIS2_EE17_Vector_impl_dataE", !20, i64 0, !20, i64 8, !20, i64 16}
!20 = !{!"any pointer", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !6, i64 0}
!24 = !{!"_ZTSN7PoolMem7alloc_sE", !6, i64 0, !7, i64 4}
!25 = !{!20, !20, i64 0}
!26 = !{!10, !6, i64 4}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass