; LLVM IR from jrouwe/JoltPhysics :: Jolt/Physics (LargeIslandSplitter)

; 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.JPH::LargeIslandSplitter" = type <{ i32, [4 x i8], ptr, ptr, ptr, i32, %"struct.std::atomic.0", i32, [4 x i8], ptr, %"struct.std::atomic.0", [4 x i8] }>
%"struct.std::atomic.0" = type { %"struct.std::__atomic_base.1" }
%"struct.std::__atomic_base.1" = type { i32 }
%"class.JPH::LargeIslandSplitter::Splits" = type <{ [32 x %"struct.JPH::LargeIslandSplitter::Split"], i32, i32, i32, i32, i32, [4 x i8], %"struct.std::atomic", %"struct.std::atomic.0", [4 x i8] }>
%"struct.JPH::LargeIslandSplitter::Split" = type { i32, i32, i32, i32 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i64 }

; 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: mustprogress uwtable
define dso_local void @_ZN3JPH19LargeIslandSplitter7PrepareERKNS_13IslandBuilderEjPNS_13TempAllocatorE(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef nonnull align 8 dereferenceable(112) %1, i32 noundef %2, ptr noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  %21 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 5
  store i32 0, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %67, %4
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %24)
  %26 = icmp ult i32 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  store i32 2, ptr %10, align 4
  br label %70

28:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = call noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %29, i32 noundef %30, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  %34 = ptrtoint ptr %32 to i64
  %35 = ptrtoint ptr %33 to i64
  %36 = sub i64 %34, %35
  %37 = sdiv exact i64 %36, 4
  %38 = trunc i64 %37 to i32
  store i32 %38, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = call noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %39, i32 noundef %40, ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = load ptr, ptr %14, align 8, !tbaa !5
  %44 = ptrtoint ptr %42 to i64
  %45 = ptrtoint ptr %43 to i64
  %46 = sub i64 %44, %45
  %47 = sdiv exact i64 %46, 4
  %48 = trunc i64 %47 to i32
  store i32 %48, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = load i32, ptr %16, align 4, !tbaa !9
  %51 = add i32 %49, %50
  store i32 %51, ptr %17, align 4, !tbaa !9
  %52 = load i32, ptr %17, align 4, !tbaa !9
  %53 = icmp uge i32 %52, 128
  br i1 %53, label %54, label %62

54:                                               ; preds = %28
  %55 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 7
  %56 = load i32, ptr %55, align 8, !tbaa !15
  %57 = add i32 %56, 1
  store i32 %57, ptr %55, align 8, !tbaa !15
  %58 = load i32, ptr %17, align 4, !tbaa !9
  %59 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 5
  %60 = load i32, ptr %59, align 8, !tbaa !11
  %61 = add i32 %60, %58
  store i32 %61, ptr %59, align 8, !tbaa !11
  br label %63

62:                                               ; preds = %28
  store i32 2, ptr %10, align 4
  br label %64

63:                                               ; preds = %54
  store i32 0, ptr %10, align 4
  br label %64

64:                                               ; preds = %63, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %65 = load i32, ptr %10, align 4
  switch i32 %65, label %70 [
    i32 0, label %66
  ]

66:                                               ; preds = %64
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = add i32 %68, 1
  store i32 %69, ptr %9, align 4, !tbaa !9
  br label %22, !llvm.loop !16

70:                                               ; preds = %64, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %71

71:                                               ; preds = %70
  %72 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 5
  %73 = load i32, ptr %72, align 8, !tbaa !11
  %74 = icmp ugt i32 %73, 0
  br i1 %74, label %75, label %135

75:                                               ; preds = %71
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 0
  store i32 %76, ptr %77, align 8, !tbaa !18
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !18
  %81 = zext i32 %80 to i64
  %82 = mul i64 %81, 4
  %83 = trunc i64 %82 to i32
  %84 = load ptr, ptr %78, align 8, !tbaa !19
  %85 = getelementptr inbounds ptr, ptr %84, i64 2
  %86 = load ptr, ptr %85, align 8
  %87 = call noundef ptr %86(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef %83)
  %88 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 2
  store ptr %87, ptr %88, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %89 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 5
  %90 = load i32, ptr %89, align 8, !tbaa !11
  %91 = zext i32 %90 to i64
  %92 = mul i64 %91, 4
  %93 = trunc i64 %92 to i32
  store i32 %93, ptr %18, align 4, !tbaa !9
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = load i32, ptr %18, align 4, !tbaa !9
  %96 = load ptr, ptr %94, align 8, !tbaa !19
  %97 = getelementptr inbounds ptr, ptr %96, i64 2
  %98 = load ptr, ptr %97, align 8
  %99 = call noundef ptr %98(ptr noundef nonnull align 8 dereferenceable(8) %94, i32 noundef %95)
  %100 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 3
  store ptr %99, ptr %100, align 8, !tbaa !22
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = load i32, ptr %18, align 4, !tbaa !9
  %103 = load ptr, ptr %101, align 8, !tbaa !19
  %104 = getelementptr inbounds ptr, ptr %103, i64 2
  %105 = load ptr, ptr %104, align 8
  %106 = call noundef ptr %105(ptr noundef nonnull align 8 dereferenceable(8) %101, i32 noundef %102)
  %107 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 4
  store ptr %106, ptr %107, align 8, !tbaa !23
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 7
  %110 = load i32, ptr %109, align 8, !tbaa !15
  %111 = zext i32 %110 to i64
  %112 = mul i64 %111, 552
  %113 = trunc i64 %112 to i32
  %114 = load ptr, ptr %108, align 8, !tbaa !19
  %115 = getelementptr inbounds ptr, ptr %114, i64 2
  %116 = load ptr, ptr %115, align 8
  %117 = call noundef ptr %116(ptr noundef nonnull align 8 dereferenceable(8) %108, i32 noundef %113)
  %118 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 9
  store ptr %117, ptr %118, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %131, %75
  %120 = load i32, ptr %19, align 4, !tbaa !9
  %121 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 7
  %122 = load i32, ptr %121, align 8, !tbaa !15
  %123 = icmp ult i32 %120, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %134

125:                                              ; preds = %119
  %126 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %20, i32 0, i32 9
  %127 = load ptr, ptr %126, align 8, !tbaa !24
  %128 = load i32, ptr %19, align 4, !tbaa !9
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %127, i64 %129
  call void @_ZN3JPH19LargeIslandSplitter6Splits11ResetStatusEv(ptr noundef nonnull align 8 dereferenceable(548) %130)
  br label %131

131:                                              ; preds = %125
  %132 = load i32, ptr %19, align 4, !tbaa !9
  %133 = add i32 %132, 1
  store i32 %133, ptr %19, align 4, !tbaa !9
  br label %119, !llvm.loop !25

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

135:                                              ; preds = %134, %71
  ret void
}

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

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH19LargeIslandSplitter6Splits11ResetStatusEv(ptr noundef nonnull align 8 dereferenceable(548)) #4 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 = { "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 = { 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 #5 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 32}
!12 = !{!"_ZTSN3JPH19LargeIslandSplitterE", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !13, i64 36, !10, i64 40, !6, i64 48, !13, i64 56}
!13 = !{!"_ZTSSt6atomicIjE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!15 = !{!12, !10, i64 40}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!12, !10, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"vtable pointer", !8, i64 0}
!21 = !{!12, !6, i64 8}
!22 = !{!12, !6, i64 16}
!23 = !{!12, !6, i64 24}
!24 = !{!12, !6, i64 48}
!25 = distinct !{!25, !17}


; 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.JPH::LargeIslandSplitter::Splits" = type <{ [32 x %"struct.JPH::LargeIslandSplitter::Split"], i32, i32, i32, i32, i32, [4 x i8], %"struct.std::atomic", %"struct.std::atomic.0", [4 x i8] }>
%"struct.JPH::LargeIslandSplitter::Split" = type { i32, i32, i32, i32 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i64 }
%"struct.std::atomic.0" = type { %"struct.std::__atomic_base.1" }
%"struct.std::__atomic_base.1" = type { i32 }

; 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: mustprogress uwtable
define dso_local void @_ZN3JPH19LargeIslandSplitter7PrepareERKNS_13IslandBuilderEjPNS_13TempAllocatorE(ptr nocapture noundef nonnull align 8 dereferenceable(60) %0, ptr noundef nonnull align 8 dereferenceable(112) %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 0, ptr %9, align 8, !tbaa !5
  %10 = tail call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %1)
  %.not29 = icmp eq i32 %10, 0
  br i1 %.not29, label %.loopexit25, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  br label %12

12:                                               ; preds = %.lr.ph, %31
  %.02226 = phi i32 [ 0, %.lr.ph ], [ %36, %31 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %13 = call noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %1, i32 noundef %.02226, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %14 = load ptr, ptr %6, align 8, !tbaa !13
  %15 = load ptr, ptr %5, align 8, !tbaa !13
  %16 = ptrtoint ptr %14 to i64
  %17 = ptrtoint ptr %15 to i64
  %18 = sub i64 %16, %17
  %19 = lshr exact i64 %18, 2
  %20 = trunc i64 %19 to i32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %21 = call noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112) %1, i32 noundef %.02226, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %22 = load ptr, ptr %8, align 8, !tbaa !13
  %23 = load ptr, ptr %7, align 8, !tbaa !13
  %24 = ptrtoint ptr %22 to i64
  %25 = ptrtoint ptr %23 to i64
  %26 = sub i64 %24, %25
  %27 = lshr exact i64 %26, 2
  %28 = trunc i64 %27 to i32
  %29 = add i32 %28, %20
  %30 = icmp ugt i32 %29, 127
  br i1 %30, label %31, label %.critedge

31:                                               ; preds = %12
  %32 = load i32, ptr %11, align 8, !tbaa !14
  %33 = add i32 %32, 1
  store i32 %33, ptr %11, align 8, !tbaa !14
  %34 = load i32, ptr %9, align 8, !tbaa !5
  %35 = add i32 %34, %29
  store i32 %35, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  %36 = add nuw i32 %.02226, 1
  %37 = call noundef i32 @_ZNK3JPH13IslandBuilder13GetNumIslandsEv(ptr noundef nonnull align 8 dereferenceable(112) %1)
  %38 = icmp ult i32 %36, %37
  br i1 %38, label %12, label %.loopexit25, !llvm.loop !15

.critedge:                                        ; preds = %12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %.loopexit25

.loopexit25:                                      ; preds = %31, %4, %.critedge
  %39 = load i32, ptr %9, align 8, !tbaa !5
  %.not = icmp eq i32 %39, 0
  br i1 %.not, label %.loopexit, label %40

40:                                               ; preds = %.loopexit25
  store i32 %2, ptr %0, align 8, !tbaa !17
  %41 = shl i32 %2, 2
  %42 = load ptr, ptr %3, align 8, !tbaa !18
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %44 = load ptr, ptr %43, align 8
  %45 = call noundef ptr %44(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %41)
  %46 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %45, ptr %46, align 8, !tbaa !20
  %47 = load i32, ptr %9, align 8, !tbaa !5
  %48 = shl i32 %47, 2
  %49 = load ptr, ptr %3, align 8, !tbaa !18
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %51 = load ptr, ptr %50, align 8
  %52 = call noundef ptr %51(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %48)
  %53 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %52, ptr %53, align 8, !tbaa !21
  %54 = load ptr, ptr %3, align 8, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  %56 = load ptr, ptr %55, align 8
  %57 = call noundef ptr %56(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %48)
  %58 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %57, ptr %58, align 8, !tbaa !22
  %59 = getelementptr inbounds i8, ptr %0, i64 40
  %60 = load i32, ptr %59, align 8, !tbaa !14
  %61 = mul i32 %60, 552
  %62 = load ptr, ptr %3, align 8, !tbaa !18
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %64 = load ptr, ptr %63, align 8
  %65 = call noundef ptr %64(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %61)
  %66 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %65, ptr %66, align 8, !tbaa !23
  %67 = load i32, ptr %59, align 8, !tbaa !14
  %.not30 = icmp eq i32 %67, 0
  br i1 %.not30, label %.loopexit, label %.lr.ph28

.lr.ph28:                                         ; preds = %40, %.lr.ph28
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph28 ], [ 0, %40 ]
  %68 = load ptr, ptr %66, align 8, !tbaa !23
  %69 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %68, i64 %indvars.iv
  call void @_ZN3JPH19LargeIslandSplitter6Splits11ResetStatusEv(ptr noundef nonnull align 8 dereferenceable(548) %69)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %70 = load i32, ptr %59, align 8, !tbaa !14
  %71 = zext i32 %70 to i64
  %72 = icmp ult i64 %indvars.iv.next, %71
  br i1 %72, label %.lr.ph28, label %.loopexit, !llvm.loop !24

.loopexit:                                        ; preds = %.lr.ph28, %40, %.loopexit25
  ret void
}

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

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder19GetContactsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

declare noundef zeroext i1 @_ZNK3JPH13IslandBuilder22GetConstraintsInIslandEjRPjS2_(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH19LargeIslandSplitter6Splits11ResetStatusEv(ptr noundef nonnull align 8 dereferenceable(548)) local_unnamed_addr #4 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 = { "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 = { 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 #5 = { 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 32}
!6 = !{!"_ZTSN3JPH19LargeIslandSplitterE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !11, i64 36, !7, i64 40, !10, i64 48, !11, i64 56}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSSt6atomicIjE", !12, i64 0}
!12 = !{!"_ZTSSt13__atomic_baseIjE", !7, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!6, !7, i64 40}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!6, !7, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"vtable pointer", !9, i64 0}
!20 = !{!6, !10, i64 8}
!21 = !{!6, !10, i64 16}
!22 = !{!6, !10, i64 24}
!23 = !{!6, !10, i64 48}
!24 = distinct !{!24, !16}


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