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

%"struct.JPH::AssertLastParam" = type { i8 }
%"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 }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE = external dso_local constant i32, align 4
@.str.10 = external hidden unnamed_addr constant [24 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3JPH19LargeIslandSplitter11AssignSplitEPKNS_4BodyES3_(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %1, ptr noundef %2) #3 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.JPH::AssertLastParam", align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.JPH::AssertLastParam", align 1
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.JPH::AssertLastParam", align 1
  %20 = alloca %"struct.JPH::AssertLastParam", align 1
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef i32 @_ZNK3JPH4Body30GetIndexInActiveBodiesInternalEv(ptr noundef nonnull align 16 dereferenceable(122) %27)
  store i32 %28, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = call noundef i32 @_ZNK3JPH4Body30GetIndexInActiveBodiesInternalEv(ptr noundef nonnull align 16 dereferenceable(122) %29)
  store i32 %30, ptr %9, align 4, !tbaa !9
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = icmp eq i32 %31, -1
  br i1 %32, label %36, label %33

33:                                               ; preds = %3
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call noundef zeroext i1 @_ZNK3JPH4Body9IsDynamicEv(ptr noundef nonnull align 16 dereferenceable(122) %34)
  br i1 %35, label %65, label %36

36:                                               ; preds = %33, %3
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !11
  %41 = icmp ult i32 %38, %40
  br i1 %41, label %45, label %42

42:                                               ; preds = %37
  %43 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 244)
  br i1 %43, label %44, label %45

44:                                               ; preds = %42
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !15
  br label %45

45:                                               ; preds = %44, %42, %37
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %48 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  store ptr %52, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = xor i32 %54, -1
  %56 = call noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef %55)
  store i32 %56, ptr %13, align 4, !tbaa !9
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE)
  %58 = load i32, ptr %57, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  store i32 %58, ptr %12, align 4, !tbaa !9
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = shl i32 1, %59
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = or i32 %62, %60
  store i32 %63, ptr %61, align 4, !tbaa !9
  %64 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %64, ptr %4, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %154

65:                                               ; preds = %33
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = icmp eq i32 %66, -1
  br i1 %67, label %71, label %68

68:                                               ; preds = %65
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = call noundef zeroext i1 @_ZNK3JPH4Body9IsDynamicEv(ptr noundef nonnull align 16 dereferenceable(122) %69)
  br i1 %70, label %100, label %71

71:                                               ; preds = %68, %65
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 0
  %75 = load i32, ptr %74, align 8, !tbaa !11
  %76 = icmp ult i32 %73, %75
  br i1 %76, label %80, label %77

77:                                               ; preds = %72
  %78 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 253)
  br i1 %78, label %79, label %80

79:                                               ; preds = %77
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !17
  br label %80

80:                                               ; preds = %79, %77, %72
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %83 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 2
  %84 = load ptr, ptr %83, align 8, !tbaa !16
  %85 = load i32, ptr %8, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds i32, ptr %84, i64 %86
  store ptr %87, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %88 = load ptr, ptr %16, align 8, !tbaa !5
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %90 = xor i32 %89, -1
  %91 = call noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef %90)
  store i32 %91, ptr %18, align 4, !tbaa !9
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE)
  %93 = load i32, ptr %92, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  store i32 %93, ptr %17, align 4, !tbaa !9
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = shl i32 1, %94
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = or i32 %97, %95
  store i32 %98, ptr %96, align 4, !tbaa !9
  %99 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %99, ptr %4, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %154

100:                                              ; preds = %68
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !11
  %105 = icmp ult i32 %102, %104
  br i1 %105, label %109, label %106

106:                                              ; preds = %101
  %107 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 262)
  br i1 %107, label %108, label %109

108:                                              ; preds = %106
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !18
  br label %109

109:                                              ; preds = %108, %106, %101
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !11
  %116 = icmp ult i32 %113, %115
  br i1 %116, label %120, label %117

117:                                              ; preds = %112
  %118 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 263)
  br i1 %118, label %119, label %120

119:                                              ; preds = %117
  call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !19
  br label %120

120:                                              ; preds = %119, %117, %112
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %123 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 2
  %124 = load ptr, ptr %123, align 8, !tbaa !16
  %125 = load i32, ptr %8, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %124, i64 %126
  store ptr %127, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %128 = getelementptr inbounds %"class.JPH::LargeIslandSplitter", ptr %26, i32 0, i32 2
  %129 = load ptr, ptr %128, align 8, !tbaa !16
  %130 = load i32, ptr %9, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  %132 = getelementptr inbounds i32, ptr %129, i64 %131
  store ptr %132, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %133 = load ptr, ptr %21, align 8, !tbaa !5
  %134 = load i32, ptr %133, align 4, !tbaa !9
  %135 = xor i32 %134, -1
  %136 = load ptr, ptr %22, align 8, !tbaa !5
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = xor i32 %137, -1
  %139 = and i32 %135, %138
  %140 = call noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef %139)
  store i32 %140, ptr %24, align 4, !tbaa !9
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE)
  %142 = load i32, ptr %141, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  store i32 %142, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %143 = load i32, ptr %23, align 4, !tbaa !9
  %144 = shl i32 1, %143
  store i32 %144, ptr %25, align 4, !tbaa !9
  %145 = load i32, ptr %25, align 4, !tbaa !9
  %146 = load ptr, ptr %21, align 8, !tbaa !5
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = or i32 %147, %145
  store i32 %148, ptr %146, align 4, !tbaa !9
  %149 = load i32, ptr %25, align 4, !tbaa !9
  %150 = load ptr, ptr %22, align 8, !tbaa !5
  %151 = load i32, ptr %150, align 4, !tbaa !9
  %152 = or i32 %151, %149
  store i32 %152, ptr %150, align 4, !tbaa !9
  %153 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %153, ptr %4, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %154

154:                                              ; preds = %122, %82, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %155 = load i32, ptr %4, align 4
  ret i32 %155
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH4Body30GetIndexInActiveBodiesInternalEv(ptr noundef nonnull align 16 dereferenceable(122)) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 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 = { 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 0}
!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 = !{i64 2158944715}
!16 = !{!12, !6, i64 8}
!17 = !{i64 2158945058}
!18 = !{i64 2158945401}
!19 = !{i64 2158945744}


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

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE = external dso_local constant i32, align 4
@.str.10 = external hidden unnamed_addr constant [24 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3JPH19LargeIslandSplitter11AssignSplitEPKNS_4BodyES3_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(60) %0, ptr noundef nonnull %1, ptr noundef %2) local_unnamed_addr #3 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call noundef i32 @_ZNK3JPH4Body30GetIndexInActiveBodiesInternalEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  %8 = tail call noundef i32 @_ZNK3JPH4Body30GetIndexInActiveBodiesInternalEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  %9 = icmp eq i32 %7, -1
  br i1 %9, label %12, label %10

10:                                               ; preds = %3
  %11 = tail call noundef zeroext i1 @_ZNK3JPH4Body9IsDynamicEv(ptr noundef nonnull align 16 dereferenceable(122) %1)
  br i1 %11, label %29, label %12

12:                                               ; preds = %3, %10
  %13 = load i32, ptr %0, align 8, !tbaa !5
  %14 = icmp ult i32 %8, %13
  br i1 %14, label %18, label %15

15:                                               ; preds = %12
  %16 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 244)
  br i1 %16, label %17, label %18

17:                                               ; preds = %15
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !13
  br label %18

18:                                               ; preds = %17, %15, %12
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = zext i32 %8 to i64
  %22 = getelementptr inbounds i32, ptr %20, i64 %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = xor i32 %23, -1
  %25 = tail call noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef %24)
  store i32 %25, ptr %4, align 4, !tbaa !15
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE)
  %27 = load i32, ptr %26, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %28 = shl nuw i32 1, %27
  br label %78

29:                                               ; preds = %10
  %30 = icmp eq i32 %8, -1
  br i1 %30, label %33, label %31

31:                                               ; preds = %29
  %32 = tail call noundef zeroext i1 @_ZNK3JPH4Body9IsDynamicEv(ptr noundef nonnull align 16 dereferenceable(122) %2)
  br i1 %32, label %50, label %33

33:                                               ; preds = %29, %31
  %34 = load i32, ptr %0, align 8, !tbaa !5
  %35 = icmp ult i32 %7, %34
  br i1 %35, label %39, label %36

36:                                               ; preds = %33
  %37 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 253)
  br i1 %37, label %38, label %39

38:                                               ; preds = %36
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !16
  br label %39

39:                                               ; preds = %38, %36, %33
  %40 = getelementptr inbounds i8, ptr %0, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = zext i32 %7 to i64
  %43 = getelementptr inbounds i32, ptr %41, i64 %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %44 = load i32, ptr %43, align 4, !tbaa !15
  %45 = xor i32 %44, -1
  %46 = tail call noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef %45)
  store i32 %46, ptr %5, align 4, !tbaa !15
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE)
  %48 = load i32, ptr %47, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  %49 = shl nuw i32 1, %48
  br label %78

50:                                               ; preds = %31
  %51 = load i32, ptr %0, align 8, !tbaa !5
  %52 = icmp ult i32 %7, %51
  br i1 %52, label %56, label %53

53:                                               ; preds = %50
  %54 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 262)
  br i1 %54, label %55, label %56

55:                                               ; preds = %53
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !17
  br label %56

56:                                               ; preds = %50, %53, %55
  %57 = load i32, ptr %0, align 8, !tbaa !5
  %58 = icmp ult i32 %8, %57
  br i1 %58, label %62, label %59

59:                                               ; preds = %56
  %60 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 263)
  br i1 %60, label %61, label %62

61:                                               ; preds = %59
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !18
  br label %62

62:                                               ; preds = %61, %59, %56
  %63 = getelementptr inbounds i8, ptr %0, i64 8
  %64 = load ptr, ptr %63, align 8, !tbaa !14
  %65 = zext i32 %7 to i64
  %66 = getelementptr inbounds i32, ptr %64, i64 %65
  %67 = zext i32 %8 to i64
  %68 = getelementptr inbounds i32, ptr %64, i64 %67
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %69 = load i32, ptr %66, align 4, !tbaa !15
  %70 = load i32, ptr %68, align 4, !tbaa !15
  %.demorgan = or i32 %70, %69
  %71 = xor i32 %.demorgan, -1
  %72 = tail call noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef %71)
  store i32 %72, ptr %6, align 4, !tbaa !15
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIjERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) @_ZN3JPH19LargeIslandSplitter20cNonParallelSplitIdxE)
  %74 = load i32, ptr %73, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %75 = shl nuw i32 1, %74
  %76 = load i32, ptr %66, align 4, !tbaa !15
  %77 = or i32 %76, %75
  store i32 %77, ptr %66, align 4, !tbaa !15
  br label %78

78:                                               ; preds = %62, %39, %18
  %.sink = phi ptr [ %68, %62 ], [ %43, %39 ], [ %22, %18 ]
  %.sink35 = phi i32 [ %75, %62 ], [ %49, %39 ], [ %28, %18 ]
  %.0 = phi i32 [ %74, %62 ], [ %48, %39 ], [ %27, %18 ]
  %79 = load i32, ptr %.sink, align 4, !tbaa !15
  %80 = or i32 %79, %.sink35
  store i32 %80, ptr %.sink, align 4, !tbaa !15
  ret i32 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3JPH4Body30GetIndexInActiveBodiesInternalEv(ptr noundef nonnull align 16 dereferenceable(122)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH18CountTrailingZerosEj(i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 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 = { 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 0}
!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 = !{i64 2158944715}
!14 = !{!6, !10, i64 8}
!15 = !{!7, !7, i64 0}
!16 = !{i64 2158945058}
!17 = !{i64 2158945401}
!18 = !{i64 2158945744}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass