; LLVM IR from khushmmehta/Scorch-V :: src/ScorchVkEngine/Abstractions (VulkanMemoryAllocator)

; 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"

%"struct.VmaDefragmentationContext_T::MoveAllocationData" = type { i64, i64, i32, i32, %struct.VmaDefragmentationMove }
%struct.VmaDefragmentationMove = type { i32, ptr, ptr }
%struct.VmaDefragmentationContext_T = type { i64, i32, ptr, ptr, %struct.VmaStlAllocator.17, %class.VmaVector.18, i8, i32, i32, ptr, ptr, i64, %struct.VmaDefragmentationStats, %struct.VmaDefragmentationStats, ptr }
%struct.VmaStlAllocator.17 = type { ptr }
%class.VmaVector.18 = type { %struct.VmaStlAllocator.17, ptr, i64, i64 }
%struct.VmaDefragmentationStats = type { i64, i64, i32, i32 }
%class.VmaDeviceMemoryBlock = type { ptr, ptr, i32, i32, ptr, %class.VmaMutex, %class.VmaMappingHysteresis, i32, ptr }
%class.VmaMutex = type { %"class.std::mutex" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %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.VmaMappingHysteresis = type { i32, i32, i32 }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN27VmaDefragmentationContext_T27ComputeDefragmentation_FastER14VmaBlockVector = external hidden unnamed_addr constant [80 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK14VmaBlockVector8GetBlockEm(ptr noundef nonnull align 8 dereferenceable(181), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN27VmaDefragmentationContext_T27ComputeDefragmentation_FastER14VmaBlockVector(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(181) %1) #3 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.VmaDefragmentationContext_T::MoveAllocationData", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = call noundef i64 @_ZNK14VmaBlockVector13GetBlockCountEv(ptr noundef nonnull align 8 dereferenceable(181) %12)
  %14 = sub i64 %13, 1
  store i64 %14, ptr %6, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %76, %2
  %16 = load i64, ptr %6, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.VmaDefragmentationContext_T, ptr %11, i32 0, i32 11
  %18 = load i64, ptr %17, align 8, !tbaa !11
  %19 = icmp ugt i64 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  store i32 2, ptr %7, align 4
  br label %79

21:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load i64, ptr %6, align 8, !tbaa !9
  %24 = call noundef ptr @_ZNK14VmaBlockVector8GetBlockEm(ptr noundef nonnull align 8 dereferenceable(181) %22, i64 noundef %23)
  %25 = getelementptr inbounds %class.VmaDeviceMemoryBlock, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  store ptr %26, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !23
  %29 = getelementptr inbounds ptr, ptr %28, i64 11
  %30 = load ptr, ptr %29, align 8
  %31 = call noundef ptr %30(ptr noundef nonnull align 8 dereferenceable(33) %27)
  store ptr %31, ptr %9, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %63, %21
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  store i32 5, ptr %7, align 4
  br label %70

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 48, ptr %10) #4
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN27VmaDefragmentationContext_T11GetMoveDataEP16VmaAllocHandle_TP16VmaBlockMetadata(ptr dead_on_unwind writable sret(%"struct.VmaDefragmentationContext_T::MoveAllocationData") align 8 %10, ptr noundef %37, ptr noundef %38)
  %39 = getelementptr inbounds %"struct.VmaDefragmentationContext_T::MoveAllocationData", ptr %10, i32 0, i32 4
  %40 = getelementptr inbounds %struct.VmaDefragmentationMove, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !25
  %42 = call noundef ptr @_ZNK15VmaAllocation_T11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(84) %41)
  %43 = icmp eq ptr %42, %11
  br i1 %43, label %44, label %45

44:                                               ; preds = %36
  store i32 7, ptr %7, align 4
  br label %60

45:                                               ; preds = %36
  %46 = getelementptr inbounds %"struct.VmaDefragmentationContext_T::MoveAllocationData", ptr %10, i32 0, i32 4
  %47 = getelementptr inbounds %struct.VmaDefragmentationMove, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !25
  %49 = call noundef i64 @_ZNK15VmaAllocation_T7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(84) %48)
  %50 = call noundef i32 @_ZN27VmaDefragmentationContext_T13CheckCountersEm(ptr noundef nonnull align 8 dereferenceable(168) %11, i64 noundef %49)
  switch i32 %50, label %53 [
    i32 1, label %51
    i32 2, label %52
    i32 0, label %54
  ]

51:                                               ; preds = %45
  store i32 7, ptr %7, align 4
  br label %60

52:                                               ; preds = %45
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %60

53:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.57, ptr noundef @.str.2, i32 noundef 13583, ptr noundef @__PRETTY_FUNCTION__._ZN27VmaDefragmentationContext_T27ComputeDefragmentation_FastER14VmaBlockVector) #5
  unreachable

54:                                               ; preds = %45
  %55 = load i64, ptr %6, align 8, !tbaa !9
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = call noundef zeroext i1 @_ZN27VmaDefragmentationContext_T17AllocInOtherBlockEmmRNS_18MoveAllocationDataER14VmaBlockVector(ptr noundef nonnull align 8 dereferenceable(168) %11, i64 noundef 0, i64 noundef %55, ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(181) %56)
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  store i1 true, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %60

59:                                               ; preds = %54
  store i32 0, ptr %7, align 4
  br label %60

60:                                               ; preds = %59, %58, %52, %51, %44
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #4
  %61 = load i32, ptr %7, align 4
  switch i32 %61, label %70 [
    i32 0, label %62
    i32 7, label %63
  ]

62:                                               ; preds = %60
  br label %63

63:                                               ; preds = %62, %60
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = load ptr, ptr %64, align 8, !tbaa !23
  %67 = getelementptr inbounds ptr, ptr %66, i64 12
  %68 = load ptr, ptr %67, align 8
  %69 = call noundef ptr %68(ptr noundef nonnull align 8 dereferenceable(33) %64, ptr noundef %65)
  store ptr %69, ptr %9, align 8, !tbaa !5
  br label %32, !llvm.loop !30

70:                                               ; preds = %60, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %71 = load i32, ptr %7, align 4
  switch i32 %71, label %73 [
    i32 5, label %72
  ]

72:                                               ; preds = %70
  store i32 0, ptr %7, align 4
  br label %73

73:                                               ; preds = %72, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %74 = load i32, ptr %7, align 4
  switch i32 %74, label %79 [
    i32 0, label %75
  ]

75:                                               ; preds = %73
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %6, align 8, !tbaa !9
  %78 = add i64 %77, -1
  store i64 %78, ptr %6, align 8, !tbaa !9
  br label %15, !llvm.loop !32

79:                                               ; preds = %73, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %80 = load i32, ptr %7, align 4
  switch i32 %80, label %84 [
    i32 2, label %81
    i32 1, label %82
  ]

81:                                               ; preds = %79
  store i1 false, ptr %3, align 1
  br label %82

82:                                               ; preds = %81, %79
  %83 = load i1, ptr %3, align 1
  ret i1 %83

84:                                               ; preds = %79
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN27VmaDefragmentationContext_T11GetMoveDataEP16VmaAllocHandle_TP16VmaBlockMetadata(ptr dead_on_unwind noalias writable sret(%"struct.VmaDefragmentationContext_T::MoveAllocationData") align 8, ptr noundef, ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN27VmaDefragmentationContext_T13CheckCountersEm(ptr noundef nonnull align 8 dereferenceable(168), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN27VmaDefragmentationContext_T17AllocInOtherBlockEmmRNS_18MoveAllocationDataER14VmaBlockVector(ptr noundef nonnull align 8 dereferenceable(168), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(181)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { 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 #4 = { nounwind }
attributes #5 = { noreturn 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 104}
!12 = !{!"_ZTS27VmaDefragmentationContext_T", !10, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !15, i64 40, !7, i64 72, !13, i64 76, !13, i64 80, !6, i64 88, !6, i64 96, !10, i64 104, !16, i64 112, !16, i64 136, !6, i64 160}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS15VmaStlAllocatorI22VmaDefragmentationMoveE", !6, i64 0}
!15 = !{!"_ZTS9VmaVectorI22VmaDefragmentationMove15VmaStlAllocatorIS0_EE", !14, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!16 = !{!"_ZTS23VmaDefragmentationStats", !10, i64 0, !10, i64 8, !13, i64 16, !13, i64 20}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTS20VmaDeviceMemoryBlock", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !6, i64 24, !19, i64 32, !22, i64 72, !13, i64 84, !6, i64 88}
!19 = !{!"_ZTS8VmaMutex", !20, i64 0}
!20 = !{!"_ZTSSt5mutex", !21, i64 0}
!21 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!22 = !{!"_ZTS20VmaMappingHysteresis", !13, i64 0, !13, i64 4, !13, i64 8}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{!26, !6, i64 32}
!26 = !{!"_ZTSN27VmaDefragmentationContext_T18MoveAllocationDataE", !10, i64 0, !10, i64 8, !27, i64 16, !13, i64 20, !28, i64 24}
!27 = !{!"_ZTS20VmaSuballocationType", !7, i64 0}
!28 = !{!"_ZTS22VmaDefragmentationMove", !29, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTS31VmaDefragmentationMoveOperation", !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


; 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"

%"struct.VmaDefragmentationContext_T::MoveAllocationData" = type { i64, i64, i32, i32, %struct.VmaDefragmentationMove }
%struct.VmaDefragmentationMove = type { i32, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN27VmaDefragmentationContext_T27ComputeDefragmentation_FastER14VmaBlockVector = external hidden unnamed_addr constant [80 x i8], align 1

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK14VmaBlockVector8GetBlockEm(ptr noundef nonnull align 8 dereferenceable(181), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN27VmaDefragmentationContext_T27ComputeDefragmentation_FastER14VmaBlockVector(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(181) %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %"struct.VmaDefragmentationContext_T::MoveAllocationData", align 8
  %4 = tail call noundef i64 @_ZNK14VmaBlockVector13GetBlockCountEv(ptr noundef nonnull align 8 dereferenceable(181) %1)
  %5 = getelementptr inbounds i8, ptr %0, i64 104
  %.02338 = add i64 %4, -1
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %.not3139 = icmp ugt i64 %.02338, %6
  br i1 %.not3139, label %.lr.ph42, label %.loopexit32

.lr.ph42:                                         ; preds = %2
  %7 = getelementptr inbounds i8, ptr %3, i64 32
  br label %9

.loopexit:                                        ; preds = %26, %9
  %.023 = add i64 %.02340, -1
  %8 = load i64, ptr %5, align 8, !tbaa !5
  %.not31 = icmp ugt i64 %.023, %8
  br i1 %.not31, label %9, label %.loopexit32, !llvm.loop !15

9:                                                ; preds = %.lr.ph42, %.loopexit
  %.02340 = phi i64 [ %.02338, %.lr.ph42 ], [ %.023, %.loopexit ]
  %10 = call noundef ptr @_ZNK14VmaBlockVector8GetBlockEm(ptr noundef nonnull align 8 dereferenceable(181) %1, i64 noundef %.02340)
  %11 = load ptr, ptr %10, align 8, !tbaa !17
  %12 = load ptr, ptr %11, align 8, !tbaa !23
  %13 = getelementptr inbounds i8, ptr %12, i64 88
  %14 = load ptr, ptr %13, align 8
  %15 = call noundef ptr %14(ptr noundef nonnull align 8 dereferenceable(33) %11)
  %.not36 = icmp eq ptr %15, null
  br i1 %.not36, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %9, %26
  %.037 = phi ptr [ %30, %26 ], [ %15, %9 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %3) #4
  call void @_ZN27VmaDefragmentationContext_T11GetMoveDataEP16VmaAllocHandle_TP16VmaBlockMetadata(ptr dead_on_unwind nonnull writable sret(%"struct.VmaDefragmentationContext_T::MoveAllocationData") align 8 %3, ptr noundef nonnull %.037, ptr noundef nonnull %11)
  %16 = load ptr, ptr %7, align 8, !tbaa !25
  %17 = call noundef ptr @_ZNK15VmaAllocation_T11GetUserDataEv(ptr noundef nonnull align 8 dereferenceable(84) %16)
  %18 = icmp eq ptr %17, %0
  br i1 %18, label %26, label %19

19:                                               ; preds = %.lr.ph
  %20 = load ptr, ptr %7, align 8, !tbaa !25
  %21 = call noundef i64 @_ZNK15VmaAllocation_T7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(84) %20)
  %22 = call noundef i32 @_ZN27VmaDefragmentationContext_T13CheckCountersEm(ptr noundef nonnull align 8 dereferenceable(168) %0, i64 noundef %21)
  switch i32 %22, label %23 [
    i32 1, label %26
    i32 2, label %.thread29
    i32 0, label %24
  ]

23:                                               ; preds = %19
  call void @__assert_fail(ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.2, i32 noundef 13583, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN27VmaDefragmentationContext_T27ComputeDefragmentation_FastER14VmaBlockVector) #5
  unreachable

24:                                               ; preds = %19
  %25 = call noundef zeroext i1 @_ZN27VmaDefragmentationContext_T17AllocInOtherBlockEmmRNS_18MoveAllocationDataER14VmaBlockVector(ptr noundef nonnull align 8 dereferenceable(168) %0, i64 noundef 0, i64 noundef %.02340, ptr noundef nonnull align 8 dereferenceable(48) %3, ptr noundef nonnull align 8 dereferenceable(181) %1)
  br i1 %25, label %.thread29, label %26

26:                                               ; preds = %.lr.ph, %19, %24
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  %27 = load ptr, ptr %11, align 8, !tbaa !23
  %28 = getelementptr inbounds i8, ptr %27, i64 96
  %29 = load ptr, ptr %28, align 8
  %30 = call noundef ptr %29(ptr noundef nonnull align 8 dereferenceable(33) %11, ptr noundef nonnull %.037)
  %.not = icmp eq ptr %30, null
  br i1 %.not, label %.loopexit, label %.lr.ph, !llvm.loop !30

.thread29:                                        ; preds = %19, %24
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %3) #4
  br label %.loopexit32

.loopexit32:                                      ; preds = %.loopexit, %2, %.thread29
  %.not3135 = phi i1 [ true, %.thread29 ], [ false, %2 ], [ false, %.loopexit ]
  ret i1 %.not3135
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN27VmaDefragmentationContext_T11GetMoveDataEP16VmaAllocHandle_TP16VmaBlockMetadata(ptr dead_on_unwind noalias writable sret(%"struct.VmaDefragmentationContext_T::MoveAllocationData") align 8, ptr noundef, ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN27VmaDefragmentationContext_T13CheckCountersEm(ptr noundef nonnull align 8 dereferenceable(168), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN27VmaDefragmentationContext_T17AllocInOtherBlockEmmRNS_18MoveAllocationDataER14VmaBlockVector(ptr noundef nonnull align 8 dereferenceable(168), i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(181)) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { 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 #4 = { nounwind }
attributes #5 = { noreturn 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 104}
!6 = !{!"_ZTS27VmaDefragmentationContext_T", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !13, i64 40, !8, i64 72, !10, i64 76, !10, i64 80, !11, i64 88, !11, i64 96, !7, i64 104, !14, i64 112, !14, i64 136, !11, i64 160}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTS15VmaStlAllocatorI22VmaDefragmentationMoveE", !11, i64 0}
!13 = !{!"_ZTS9VmaVectorI22VmaDefragmentationMove15VmaStlAllocatorIS0_EE", !12, i64 0, !11, i64 8, !7, i64 16, !7, i64 24}
!14 = !{!"_ZTS23VmaDefragmentationStats", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !11, i64 0}
!18 = !{!"_ZTS20VmaDeviceMemoryBlock", !11, i64 0, !11, i64 8, !10, i64 16, !10, i64 20, !11, i64 24, !19, i64 32, !22, i64 72, !10, i64 84, !11, i64 88}
!19 = !{!"_ZTS8VmaMutex", !20, i64 0}
!20 = !{!"_ZTSSt5mutex", !21, i64 0}
!21 = !{!"_ZTSSt12__mutex_base", !8, i64 0}
!22 = !{!"_ZTS20VmaMappingHysteresis", !10, i64 0, !10, i64 4, !10, i64 8}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !9, i64 0}
!25 = !{!26, !11, i64 32}
!26 = !{!"_ZTSN27VmaDefragmentationContext_T18MoveAllocationDataE", !7, i64 0, !7, i64 8, !27, i64 16, !10, i64 20, !28, i64 24}
!27 = !{!"_ZTS20VmaSuballocationType", !8, i64 0}
!28 = !{!"_ZTS22VmaDefragmentationMove", !29, i64 0, !11, i64 8, !11, i64 16}
!29 = !{!"_ZTS31VmaDefragmentationMoveOperation", !8, i64 0}
!30 = distinct !{!30, !16}


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