; 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::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 }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [44 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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt13__atomic_baseImE4loadESt12memory_order(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH19LargeIslandSplitter5Split11GetNumItemsEv(ptr noundef nonnull align 4 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH19LargeIslandSplitter6Splits18MarkBatchProcessedEjRbS2_(ptr noundef nonnull align 8 dereferenceable(548) %0, i32 noundef %1, ptr noundef nonnull align 1 dereferenceable(1) %2, ptr noundef nonnull align 1 dereferenceable(1) %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.JPH::AssertLastParam", align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"struct.JPH::AssertLastParam", align 1
  %16 = alloca i32, align 4
  %17 = alloca %"struct.JPH::AssertLastParam", align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %19 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 7
  %20 = call noundef i64 @_ZNKSt13__atomic_baseImE4loadESt12memory_order(ptr noundef nonnull align 8 dereferenceable(8) %19, i32 noundef 0) #5
  store i64 %20, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %21 = load i64, ptr %9, align 8, !tbaa !11
  %22 = call noundef i32 @_ZN3JPH19LargeIslandSplitter6Splits9sGetSplitEm(i64 noundef %21)
  store i32 %22, ptr %10, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %4
  %24 = load i32, ptr %10, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 2
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = icmp ult i32 %24, %26
  br i1 %27, label %34, label %28

28:                                               ; preds = %23
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = icmp eq i32 %29, 31
  br i1 %30, label %34, label %31

31:                                               ; preds = %28
  %32 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 128)
  br i1 %32, label %33, label %34

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

34:                                               ; preds = %33, %31, %28, %23
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %37 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 0
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds [32 x %"struct.JPH::LargeIslandSplitter::Split"], ptr %37, i64 0, i64 %39
  store ptr %40, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = call noundef i32 @_ZNK3JPH19LargeIslandSplitter5Split11GetNumItemsEv(ptr noundef nonnull align 4 dereferenceable(16) %41)
  store i32 %42, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %43 = load i64, ptr %9, align 8, !tbaa !11
  %44 = call noundef i32 @_ZN3JPH19LargeIslandSplitter6Splits13sGetIterationEm(i64 noundef %43)
  store i32 %44, ptr %14, align 4, !tbaa !9
  %45 = load i32, ptr %14, align 4, !tbaa !9
  %46 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 3
  %47 = load i32, ptr %46, align 8, !tbaa !20
  %48 = sub nsw i32 %47, 1
  %49 = icmp eq i32 %45, %48
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = zext i1 %49 to i8
  store i8 %51, ptr %50, align 1, !tbaa !21
  br label %52

52:                                               ; preds = %36
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = icmp ugt i32 %53, 0
  br i1 %54, label %58, label %55

55:                                               ; preds = %52
  %56 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 138)
  br i1 %56, label %57, label %58

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

58:                                               ; preds = %57, %55, %52
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %61 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 8
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %61, i32 noundef %62, i32 noundef 4) #5
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = add i32 %63, %64
  store i32 %65, ptr %16, align 4, !tbaa !9
  %66 = load i32, ptr %16, align 4, !tbaa !9
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = icmp uge i32 %66, %67
  br i1 %68, label %69, label %120

69:                                               ; preds = %60
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %16, align 4, !tbaa !9
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = icmp eq i32 %71, %72
  br i1 %73, label %77, label %74

74:                                               ; preds = %70
  %75 = call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 144)
  br i1 %75, label %76, label %77

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

77:                                               ; preds = %76, %74, %70
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  %80 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 8
  call void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %80, i32 noundef 0, i32 noundef 3) #5
  br label %81

81:                                               ; preds = %109, %79
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = icmp eq i32 %82, 31
  br i1 %83, label %84, label %87

84:                                               ; preds = %81
  store i32 0, ptr %10, align 4, !tbaa !9
  %85 = load i32, ptr %14, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %14, align 4, !tbaa !9
  br label %90

87:                                               ; preds = %81
  %88 = load i32, ptr %10, align 4, !tbaa !9
  %89 = add i32 %88, 1
  store i32 %89, ptr %10, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %87, %84
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 2
  %93 = load i32, ptr %92, align 4, !tbaa !13
  %94 = icmp uge i32 %91, %93
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  store i32 31, ptr %10, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %95, %90
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %14, align 4, !tbaa !9
  %99 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 3
  %100 = load i32, ptr %99, align 8, !tbaa !20
  %101 = icmp slt i32 %98, %100
  br i1 %101, label %102, label %109

102:                                              ; preds = %97
  %103 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 0
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = zext i32 %104 to i64
  %106 = getelementptr inbounds [32 x %"struct.JPH::LargeIslandSplitter::Split"], ptr %103, i64 0, i64 %105
  %107 = call noundef i32 @_ZNK3JPH19LargeIslandSplitter5Split11GetNumItemsEv(ptr noundef nonnull align 4 dereferenceable(16) %106)
  %108 = icmp eq i32 %107, 0
  br label %109

109:                                              ; preds = %102, %97
  %110 = phi i1 [ false, %97 ], [ %108, %102 ]
  br i1 %110, label %81, label %111, !llvm.loop !25

111:                                              ; preds = %109
  %112 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 7
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = shl i64 %114, 48
  %116 = load i32, ptr %10, align 4, !tbaa !9
  %117 = zext i32 %116 to i64
  %118 = shl i64 %117, 32
  %119 = or i64 %115, %118
  call void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8) %112, i64 noundef %119, i32 noundef 3) #5
  br label %120

120:                                              ; preds = %111, %60
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = getelementptr inbounds %"class.JPH::LargeIslandSplitter::Splits", ptr %18, i32 0, i32 3
  %123 = load i32, ptr %122, align 8, !tbaa !20
  %124 = icmp sge i32 %121, %123
  %125 = load ptr, ptr %8, align 8, !tbaa !5
  %126 = zext i1 %124 to i8
  store i8 %126, ptr %125, align 1, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, 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 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline 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 #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 = { 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 #4 = { 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 #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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 516}
!14 = !{!"_ZTSN3JPH19LargeIslandSplitter6SplitsE", !7, i64 0, !10, i64 512, !10, i64 516, !10, i64 520, !10, i64 524, !10, i64 528, !15, i64 536, !17, i64 544}
!15 = !{!"_ZTSSt6atomicImE", !16, i64 0}
!16 = !{!"_ZTSSt13__atomic_baseImE", !12, i64 0}
!17 = !{!"_ZTSSt6atomicIjE", !18, i64 0}
!18 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!19 = !{i64 2158942216}
!20 = !{!14, !10, i64 520}
!21 = !{!22, !22, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{i64 2158942549}
!24 = !{i64 2158942932}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.JPH::LargeIslandSplitter::Split" = type { i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [44 x i8], align 1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt13__atomic_baseImE4loadESt12memory_order(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH19LargeIslandSplitter6Splits13sGetIterationEm(i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3JPH19LargeIslandSplitter6Splits9sGetSplitEm(i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3JPH19LargeIslandSplitter6Splits18MarkBatchProcessedEjRbS2_(ptr noundef nonnull align 8 dereferenceable(548) %0, i32 noundef %1, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %2, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %3) local_unnamed_addr #3 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 536
  %6 = tail call noundef i64 @_ZNKSt13__atomic_baseImE4loadESt12memory_order(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef 0) #4
  %7 = tail call noundef i32 @_ZN3JPH19LargeIslandSplitter6Splits9sGetSplitEm(i64 noundef %6)
  %8 = getelementptr inbounds i8, ptr %0, i64 516
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = icmp ult i32 %7, %9
  %11 = icmp eq i32 %7, 31
  %or.cond = or i1 %11, %10
  br i1 %or.cond, label %15, label %12

12:                                               ; preds = %4
  %13 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 128)
  br i1 %13, label %14, label %15

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

15:                                               ; preds = %14, %12, %4
  %16 = zext i32 %7 to i64
  %17 = getelementptr inbounds [32 x %"struct.JPH::LargeIslandSplitter::Split"], ptr %0, i64 0, i64 %16
  %18 = tail call noundef i32 @_ZNK3JPH19LargeIslandSplitter5Split11GetNumItemsEv(ptr noundef nonnull align 4 dereferenceable(16) %17)
  %19 = tail call noundef i32 @_ZN3JPH19LargeIslandSplitter6Splits13sGetIterationEm(i64 noundef %6)
  %20 = getelementptr inbounds i8, ptr %0, i64 520
  %21 = load i32, ptr %20, align 8, !tbaa !16
  %22 = add nsw i32 %21, -1
  %23 = icmp eq i32 %19, %22
  %24 = zext i1 %23 to i8
  store i8 %24, ptr %2, align 1, !tbaa !17
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %25, label %28

25:                                               ; preds = %15
  %26 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 138)
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !19
  br label %28

28:                                               ; preds = %27, %25, %15
  %29 = getelementptr inbounds i8, ptr %0, i64 544
  %30 = tail call noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef %1, i32 noundef 4) #4
  %31 = add i32 %30, %1
  %.not30 = icmp ult i32 %31, %18
  br i1 %.not30, label %54, label %32

32:                                               ; preds = %28
  %33 = icmp eq i32 %31, %18
  br i1 %33, label %37, label %34

34:                                               ; preds = %32
  %35 = tail call noundef zeroext i1 @_ZN3JPH23AssertFailedParamHelperEPKcS1_jNS_15AssertLastParamE(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 144)
  br i1 %35, label %36, label %37

36:                                               ; preds = %34
  tail call void asm sideeffect "int $$0x3", "~{dirflag},~{fpsr},~{flags}"() #4, !srcloc !20
  br label %37

37:                                               ; preds = %36, %34, %32
  tail call void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef 0, i32 noundef 3) #4
  br label %38

38:                                               ; preds = %46, %37
  %.026 = phi i32 [ %19, %37 ], [ %.127, %46 ]
  %.0 = phi i32 [ %7, %37 ], [ %spec.store.select, %46 ]
  %39 = icmp eq i32 %.0, 31
  %40 = add i32 %.0, 1
  %41 = zext i1 %39 to i32
  %.127 = add nsw i32 %.026, %41
  %.1 = select i1 %39, i32 0, i32 %40
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %.not31 = icmp ult i32 %.1, %42
  %spec.store.select = select i1 %.not31, i32 %.1, i32 31
  %43 = load i32, ptr %20, align 8, !tbaa !16
  %44 = icmp slt i32 %.127, %43
  %45 = zext i32 %spec.store.select to i64
  br i1 %44, label %46, label %.critedge

46:                                               ; preds = %38
  %47 = getelementptr inbounds [32 x %"struct.JPH::LargeIslandSplitter::Split"], ptr %0, i64 0, i64 %45
  %48 = tail call noundef i32 @_ZNK3JPH19LargeIslandSplitter5Split11GetNumItemsEv(ptr noundef nonnull align 4 dereferenceable(16) %47)
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %38, label %.critedge, !llvm.loop !21

.critedge:                                        ; preds = %46, %38
  %50 = zext i32 %.127 to i64
  %51 = shl i64 %50, 48
  %52 = shl nuw i64 %45, 32
  %53 = or i64 %52, %51
  tail call void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %53, i32 noundef 3) #4
  br label %54

54:                                               ; preds = %.critedge, %28
  %.2 = phi i32 [ %.127, %.critedge ], [ %19, %28 ]
  %55 = load i32, ptr %20, align 8, !tbaa !16
  %56 = icmp sge i32 %.2, %55
  %57 = zext i1 %56 to i8
  store i8 %57, ptr %3, align 1, !tbaa !17
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt13__atomic_baseIjE9fetch_addEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseIjE5storeEjSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) local_unnamed_addr #0 align 2

attributes #0 = { alwaysinline 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 #1 = { 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 #2 = { 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 #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 }

!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, !9, i64 516}
!6 = !{!"_ZTSN3JPH19LargeIslandSplitter6SplitsE", !7, i64 0, !9, i64 512, !9, i64 516, !9, i64 520, !9, i64 524, !9, i64 528, !10, i64 536, !13, i64 544}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"_ZTSSt6atomicImE", !11, i64 0}
!11 = !{!"_ZTSSt13__atomic_baseImE", !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSSt6atomicIjE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIjE", !9, i64 0}
!15 = !{i64 2158942216}
!16 = !{!6, !9, i64 520}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i64 2158942549}
!20 = !{i64 2158942932}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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